function $JssorPlayerClass$(){function i(n){function r(u){var f=$Jssor$.$EventSrc(u);t=f.pInstance;$Jssor$.$RemoveEvent(f,"dataavailable",r);$Jssor$.$Each(i,function(n){n!=t&&n.$Remove()});n.pTagName=t.tagName;i=null}function u(t){var u,f;return t.pInstance||(f=$Jssor$.$AttributeEx(t,"pHandler"),$JssorPlayer$[f]&&($Jssor$.$AddEvent(t,"dataavailable",r),u=new $JssorPlayer$[f](n,t),i.push(u),$JssorDebug$.$Execute(function(){$Jssor$.$Type(u.$Remove)!="function"&&$JssorDebug$.$Fail("'pRemove' interface not implemented for player handler '"+f+"'.")}))),u}var f=this,t,i=[];f.$InitPlayerController=function(){if(!n.pInstance&&!u(n)){var t=$Jssor$.$Children(n);$Jssor$.$Each(t,function(n){u(n)})}}}var t=this,n=[];t.$EVT_SWITCH=21;t.$FetchPlayers=function(t){t=t||document.body;var r=$Jssor$.$FindChildren(t,"player");$Jssor$.$Each(r,function(t){n[t.pId]||(t.pId=n.length,n.push(new i(t)));var r=n[t.pId];r.$InitPlayerController()})}}function $JssorCaptionSliderBase$(){$JssorAnimator$.call(this,0,0);this.$Revert=$Jssor$.$EmptyFunction}function PointerEventsPolyfill(n){if(this.options={selector:"*",mouseEvents:["click","dblclick","mousedown","mouseup"],usePolyfillIf:function(){var n,t;return navigator.appName=="Microsoft Internet Explorer"&&(n=navigator.userAgent,n.match(/MSIE ([0-9]{1,}[\.0-9]{0,})/)!=null&&(t=parseFloat(RegExp.$1),t<11))?!0:!1}},n){var t=this;$.each(n,function(n,i){t.options[n]=i})}this.options.usePolyfillIf()&&this.register_mouse_events()}function upclick(n){var a={element:null,action:"about:blank",action_params:{},maxsize:0,onstart:null,oncomplete:null,dataname:"Filedata",target:null,zindex:"auto",accept:"*",containerClass:"upclick-container"},o,f,r,t,i,h,u,c,s,e,v,l;for(o in a)n[o]=n[o]?n[o]:a[o];if(f=n.element,typeof f=="string"&&(f=document.getElementById(f)),r=f.ownerDocument,i=r.createElement("div"),$(i).addClass(n.containerClass),h="frame"+(new Date).getTime().toString().substr(8),i.innerHTML='<iframe name="'+h+'" src="about:blank" onload="this.onload_callback()"><\/iframe>',u=i.childNodes[0],u.onload_callback=function(){var f=r.createElement("form"),c,l,e,o,s;i.appendChild(f);f.method="post";f.enctype="multipart/form-data";f.encoding="multipart/form-data";n.target?(f.target=n.target,f.setAttribute("target",n.target)):(f.target=h,f.setAttribute("target",h));f.action=n.action;f.setAttribute("action",n.action);f.style.margin=0;f.style.padding=0;f.style.height="80px";f.style.width="40px";f.runat="server";c=n.action_params;for(l in c)e=r.createElement("input"),e.type="hidden",e.name=l,e.value=String(c[l]),f.appendChild(e);n.maxsize&&(o=r.createElement("input"),o.type="hidden",o.name="MAX_FILE_SIZE",o.value=String(n.maxsize),f.appendChild(o));t=r.createElement("input");t.name=n.dataname;t.type="file";t.size="1";t.accept=n.accept;t.runat="server";f.appendChild(t);t.style.position="absolute";t.style.display="block";t.style.top=0;t.style.left=0;t.style.height=f.style.height;t.style.width="80px";t.style.opacity=0;t.style.filter="alpha(opacity=0)";t.style.fontSize=8;t.style.zIndex=1;t.style.visiblity="hidden";t.style.marginLeft="-40px";n.multiple&&(t.multiple="multiple");s=function(){if(t.value){var i=n.onstart;i&&i(t.value);f.submit()}};t.addEventListener?t.addEventListener("change",s,!1):t.attachEvent?t.attachEvent("onpropertychange",function(n){n||(n=window.event);n.propertyName=="value"&&s()}):t.onpropertychange=s;u.onload_callback=function(){var t=null,r,i;u.contentWindow?t=u.contentWindow:u.contentDocument&&(t=u.contentDocument.defaultView);r=t.document.body.innerHTML;i=n.oncomplete;i&&i(r);f.reset()}},u.style.display="none",u.width=0,u.height=0,u.marginHeight=0,u.marginWidth=0,r.body.insertBefore(i,r.body.firstChild),i.style.position="absolute",i.style.overflow="hidden",i.style.padding=0,i.style.margin=0,i.style.visiblity="hidden",i.style.width="0px",i.style.height="0px",n.zindex=="auto"){for(c=0,e=f;e.tagName!="BODY";)v=e.currentStyle?e.currentStyle:getComputedStyle(e,null),s=parseInt(v.zIndex),s=isNaN(s)?0:s,c+=s+1,e=e.parentNode;i.style.zIndex=c}else i.style.zIndex=n.zindex;var p=n.element,b=function(){$("#"+p).css({"text-decoration":"none",color:"#ffffff","box-shadow":"0 3px 10px 0 rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.1)",opacity:"0.8"})},w=function(n){n||(n=window.event);$("#"+p).css({color:"#ffffff","box-shadow":"0 2px 3px 0 rgba(0,0,0,0.16), 0 0 0 1px rgba(0,0,0,0.08)",opacity:"1"});i.style.width="0px";i.style.height="0px";var t=r.elementFromPoint(n.clientX,n.clientY);t===f&&(i.style.width="40px",i.style.height="80px")};i.addEventListener?i.addEventListener("mousemove",w,!1):i.attachEvent&&i.attachEvent("onmousemove",w);l=function(n){n||(n=window.event);b();var t=y=0;n.pageX?t=n.pageX:n.clientX&&(t=n.clientX+(r.documentElement.scrollLeft?r.documentElement.scrollLeft:r.body.scrollLeft));n.pageY?y=n.pageY:n.clientY&&(y=n.clientY+(r.documentElement.scrollTop?r.documentElement.scrollTop:r.body.scrollTop));i.style.left=t-20+"px";i.style.top=y-40+"px";i.style.width="40px";i.style.height="80px"};f.addEventListener?f.addEventListener("mousemove",l,!1):f.attachEvent&&f.attachEvent("onmousemove",l)}function setWidthMenuComponent(n,t,i){for(var f=[],u,r=0;r<i.length;r++)$(i)[r].nodeName=="A"&&f.push(i[r]);for(u=0;u<f.length;u++)t?$(f[u]).css({overflow:"hidden","text-overflow":"ellipsis","text-aign":"center"}):$(f[u]).css({width:"",overflow:"","text-overflow":"","text-aign":""})}function addEventSimple(n,t,i){n.addEventListener?n.addEventListener(t,i,!1):n.attachEvent&&n.attachEvent("on"+t,i)}function removeEventSimple(n,t,i){n.removeEventListener?n.removeEventListener(t,i,!1):n.detachEvent&&n.detachEvent("on"+t,i)}function validateLink(){if($("#linkInput").val()!=""){var n=$("#linkInput").data().val,t=window[n],i=$("#linkInput").val(),r=i.search(t);r==-1?$("#linkInput").css("backgroundColor","red"):$("#linkInput").css("backgroundColor","white")}else $("#linkInput").css("backgroundColor","white")}function scallingItemList(n,t){var i=new Image;n.length<1||n.each(function(){var n=$(this).find("img");i.src=n.attr("src");t=="fill"?($(this).css("display","table-cell"),i.naturalWidth>i.naturalHeight?n.css({"max-height":"100%","max-width":"100%",height:"auto",width:"100%"}):n.css({"max-height":"100%","max-width":"100%",width:"auto",height:"100%"})):i.naturalWidth>i.naturalHeight?n.css({"max-height":"none","max-width":"none",width:"auto",height:"150px"}):n.css({"max-height":"none","max-width":"none",width:"150px",height:"auto"})})}function imageExists(n){var t=new XMLHttpRequest;return t.open("HEAD",n,!1),t.send(),t.status!=404}function hasActiveCKEditor(){for(name in CKEDITOR.instances){var n=$("#cke_"+name).css("display");if(n!="block")return!0}return!1}function enableSelection(n){typeof n.onselectstart!="undefined"?n.onselectstart=function(){return!0}:typeof n.style.MozUserSelect!="undefined"?n.style.MozUserSelect="text":(n.onmousedown=function(){return!0},n.style.cursor="default");$(n).each(function(){$(this).css("user-select","text !important");$(this).css("-moz-user-select","text !important");$(this).css("-webkit-user-select","text !important")})}function disableSelection(n){typeof n.onselectstart!="undefined"?n.onselectstart=null:typeof n.style.MozUserSelect!="undefined"?n.style.MozUserSelect="none":(n.onmousedown=function(){return!1},n.style.cursor="default");$(n).each(function(){$(this).css("user-select","none !important");$(this).css("-moz-user-select","none !important");$(this).css("-webkit-user-select","none !important")})}var defined=function(n){return typeof n!="undefined"&&n!==null},isDefinedAndNotEmpty=function(n){return defined(n)&&n!=null&&n!=""?!0:!1},Guid,Handlebars,$JssorSlider$,$JssorSlideshowFormations$,$JssorSlideshowRunner$,$JssorCaptionSlider$,SwitchManager,Grouping,InitHashChangeEvent,HashHelper,HandlebarHelper,ColorPickerHelper,SwitcherHelper,PopoverHelper,RangeSliderHelper,EditorEventsFactory,Indexer,Positioning,Resizer,_checkItem,MediaService,SiteSettings,Designer,Pager,Page,MenuHelper,eventsystem,TemplateFactory,ViewerFactory,ImageComponentViewer,HtmlContainerComponentViewer,GalleryComponentViewer,SlideshowComponentViewer,HousePhotoTourComponentViewer,ListComponentViewer,StretcherFactory,ContextFactory,ContactUsComponentViewerContext,EvaluateHomeComponentEditorContext,TransformFactory,TransformComponent,ProxyService,ActionFactory,BasicComponent,Component,Category,Order,handleGridRows,LocalStorageService,Binding,BindingController,Application,StretchingController,ClipboardViewModel,clipBoard,EventsComponents,YT,YTConfig,Froogaloop,LayeringConstraints,LayeringController,paletteCount,viewerPaletteController,AdvertisementService;String.isNullOrEmpty=function(n){return n==null?!0:n.length==0?!0:void 0};String.prototype.toBoolean=function(){return this.toLocaleLowerCase()==="true"||this=="1"};Boolean.prototype.toBoolean=function(){return this.valueOf()};Number.prototype.toBoolean=function(){var n=this.toInteger();return n>0?!0:!1};String.prototype.toNumber=function(){var n=_.parseInt(this.replace(/[A-Za-z$-]/g,""));return _.isNumber(n)&&!isNaN(n)?n:0};String.prototype.toInteger=function(){var n=_.parseInt(this);return _.isNumber(n)&&!isNaN(n)?n:0};String.prototype.toValidString=function(){return isDefinedAndNotEmpty(this)?this:""};Number.prototype.toInteger=function(){return isNaN(this)?0:this.valueOf()};Guid=function(){};Guid.new=function(){function n(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)}return function(){return n()+n()+"-"+n()+"-"+n()+"-"+n()+"-"+n()+n()+n()}}();Guid.empty=function(){return"00000000-0000-0000-0000-000000000000"};String.prototype.removeWhitespaces=function(){return this.replace(/ /g,"")};String.prototype.replaceAll=function(n,t,i){return this.replace(new RegExp(n.replace(/([\,\!\\\^\$\{\}\[\]\(\)\.\*\+\?\|\<\>\-\&])/g,function(n){return"\\"+n}),"g"+(i?"i":"")),t)};Date.prototype.getQuarter=function(){var n=this.getMonth()+1;return Math.ceil(n/3)};Date.isLeapYear=function(n){return n%4==0&&n%100!=0||n%400==0};Date.getDaysInMonth=function(n,t){return[31,Date.isLeapYear(n)?29:28,31,30,31,30,31,31,30,31,30,31][t]};Date.prototype.isLeapYear=function(){return Date.isLeapYear(this.getFullYear())};Date.prototype.getDaysInMonth=function(){return Date.getDaysInMonth(this.getFullYear(),this.getMonth())};Date.prototype.addMonths=function(n){var t=this.getDate();return this.setDate(1),this.setMonth(this.getMonth()+n),this.setDate(Math.min(t,this.getDaysInMonth())),this};var CALLBACKACTION_siteSettingsAccessibilityOnoff="",callbackActions={siteSettingsAccessibilityOnoff:function(n,t){defined(n)&&defined(t)&&(n.find("#site-accessibility-email").prop("disabled",!t.toBoolean()),n.find("#site-accessibility-key").prop("disabled",!t.toBoolean()))}},ANCHOR="anchor",WRAPPER="wrapper",COMPONENT_BAR="component-bar",EDITOR="editor",VIEWER="viewer",CONTEXT_EDITOR="contexteditor",CONTEXT_VIEWER="contextviewer",SELECT_WRAPPER="select-wrapper",SELECT_WRAPPER_MENU="resizer-actions-menu",SELECT_WRAPPER_FIXED="select-wrapper-fixed",HTML="html",DOCK_WRAPPER="dock-wrapper",VIEWER_CONTEXT=0,EDITOR_CONTEXT=1,SLAVE="_slave",VIEWER_TEMPLATE=0,EDITOR_TEMPLATE=1,MAIN="848cbb01-b945-4336-b149-03dcf135dae6",MAIN_COMPONENT="main",PAGE="f433edc4-3aae-4bfe-ab34-1c399ff86c30",PAGE_COMPONENT="page",ACTIVE_PALETTE="active-palette",DISPLAY_PAGE="page",SOUNDID="29f8ca10-8ec9-481d-b7ae-2d7a16e41a9f",BACKGROUND_COLOR="background-color",LOCATION="location",FIXED_LOCATION="fixed-location",BACKGROUND_COLOR_HOVER="background-color-hover",IMAGE_SETTINGS_BGCOLOR="image-section-bgcolor",IMAGE_SETTINGS_COLOR="image-section-color",IMAGE_SETTING_OPTIONALCOLOR="image-section-optionalcolor",IMAGE_SETTINGS_HEADERCOLOR="image-section-headercolor",OPTIONAL="optional",PLACEHOLDER="placeholder",TEXT_COLOR_HOVER="text-color-hover",BORDER_COLOR_HOVER="border-color-hover",IMAGE_STRETCHING="image-stretching",SET_IMAGE_LINK="set-image-link",COLUMNS="columns",ROWS="rows",COLOR="color",SECONDARY_COLOR="secondary-color",IMAGE_RATIO="image-ratio",TEXT_BOX_TYPE="text-box-type",GALLERY_ITEM_BOTTOM_MARGIN="gallery-item-bottom-margin",PANEL="div",IMAGE="img",IMAGE_PROPERTY="image",HOVER="hover",IMAGE_SWAP="image-swap",MORTGAGE_CALCULATOR="mortgage-calculator",EVALUATE_HOME="evaluate-home",BORDER_WIDTH="border-width",BORDER_RADIUS="border-radius",BORDER_COLOR="border-color",MARGINS_WIDTH="margins-width",STRETCH_TO_FULL_WIDTH="stretch-to-full-width",WIDTH="width",HEIGHT="height",TOP="top",LEFT="left",OFFSET_X="offset-x",OFFSET_Y="offset-y",TYPE="type",EXPAND="expand",ORDER="order",MODE_VALUE="mode-value",MODE="mode",PREDEFINED="predefined",NAME="name",TITLE="title",CHANGE="change",IS_PINED="is-pined",CLICK="click",TEXT_ALIGN="text-align",HOVER_STYLE="hover-style",OPEN_LINK_ON_BLANK="open-link-on-blank",FONT_SIZE="font-size",FONT_FAMILY="font-family",BUTTON="button",CONTACT_US="contact-us",PAUSE="pause",TEXT="text",INTERVAL="interval",LINE_HEIGHT="line-height",PARAGRAPH="paragraph",HEADERTEXT="headertext",HEADER="header",FOOTER="footer",BODY="body",PARAGRAPH_SEO="paragraph-seo",HEADERTEXT_SEO="headertext-seo",CONTENT="content",IMAGE_ON_HOVER="image-on-hover",IMAGE_ON_PRESSED="image-on-pressed",GALLERY="gallery",SLIDESHOW="slideshow",HOUSE_PHOTO_TOUR="house-photo-tour",HOUSE_PHOTO_TOUR_ITEM="house-photo-tour-item",HTML_CONTAINER="html-container",MENU="menu",VIDEO="video",SOUND="sound",AUTOPLAY="autoplay",HIDE="hide",PDF="pdf",PARAGRAPH_FORMAT="paragraph-format",META_TITLE="meta-title",META_DESCRIPTION="meta-description",META_KEYWORDS="meta-keywords",SRC="src",DESCRIPTION="description",PROVIDER="provider",LOOP="loop",REL="rel",ENABLEJSAPI="enablejsapi",API="api",NAV="nav",DOT="dot",CAPTION_POSITION="caption-position",SIGNIN="signin",SHOW_OPTIMIZED="show-optimized-image",SHOW_OPTIMIZED_HOVER="show-optimized-hover-image",SHOW_OPTIMIZED_PRESSED="show-optimized-pressed-image",SHOW_OPTIMIZED_PLACEHOLDER="show-optimized-placeholder",CLIENT_ID_SOUNDCLOUD_FOR_DEVELOPER="8e80248ca2cadb2f6e90453edcb21ad6",SOUNDCLOUD_RESOLVE_URL="http://api.soundcloud.com/resolve.json?url=",LIST="list",VERTICAL="vertical",GENERAL="general",LINES="lines",THUMBNAILS="thumbnails",SIMPLE="simple",BLANKIMAGE="data:text/plain;base64,R0lGODdh+gD6AOMAACdQfv///117nsnT3niRruTp7pOnvkJljq69zgAAAAAAAAAAAAAAAAAAAAAAAAAAACwAAAAA+gD6AAAE/hDISau9OOvNu/9gKI5kaZ5oqq5s675wLM90bd94ru987//AoHBILBqPyKRyyWw6n9CodEqtWq/YrHbL7Xq/4LB4TC6bz+i0es1uu9/wuHxOr9vv+Lx+z+/7/4CBgoOEhYaHiImKi4yNjo+QkZKTlJWWl5iZmpucnZ6foKGio6SlpqeoqaqrrK2ur7CxsrO0tba3uLm6u7y9vr/AwcLDxMXGx8jJysvMzc7P0NHS09TV1tfY2drb3N3e3+Dh4uPk5ebn6Onq6+zt7u/w8fLz9PX29/j5+vv8/f7/AAMKHEiwoLIACAVIQMgQBEOEQxgamFAAIiuGAxY+dLhRCEYJ/gcaajBg4AAohgQkELAIYmWAIi5VBijAAWHKTwxpAogZgieRhAAGBJi4weZJlDtZHhAaYIBJDD4ROhU6kUABpxSWziQ6QUDFAQJYChBagOsFqgAQPgUwduuEhyw3IaxIk+eBijnXVogKt+lHkHgRcg0JNyMAwgwRZFg5YKXOw3AVp4XrSbBgnghmHrg7FGpclAakhg3w9O7EzI9RH3B5U7VLvVkRZubqWq3Gm5UDECDLs6Jk1J5fvtWdVDjQCqGFA6hI1Ohy4pMVYiBLmiL0485zExjN9LZM5Xs/E+eZPbnIyTed94V+weXjyXDTs+9klKlF5z7DgzdKHrp5vMPJ/idffBkQZtZ6Ah6VEmLGQZcfBfnxdx90vhUXoHfofZBdhhZsyIlzmVlUIQDAtSdeSv0l6NOIzjGn4Xwudjjfh9AhJoFqnJkF4YkWclhhchPUBh2OAxiWwYZEGumhJpSRaBFneV3QJFIuZUTleiD1dRODmh3ZEWQPFfAUUwW8l0mThE2gVVOwDSfSlU3Bd5NVASDQnQRe1ZldW3W2SUGTeDKFwFprgpfNkgARJl1AAmwW4kDmCTbQASEWgJtBmGaq6aacdurpp6CGKuqopJZq6qmopqrqqqy26uqrsMYq66y01mrrrbjmquuuvPbq66/ABivssMQWa+yxyCar7LLMNDbr7LPQRivttNRWa+212Gar7bbcduvtt+CGK+645JZr7rnopqvuuuy26+678MYr77zdRAAAOw==",NO_IMAGE_YET="../Content/image/no-image-yet.png",Z_INDEX="z-index",TEMPLATE_MASTER_URL="/Template",REGULAR_INPUT_SIZE="^[-+]?[0-9]*.?[0-9]+(px|em|%|$){1}$",REGULAR_INPUT_Z_INDEX="^[-+]?[0-9]*.?[0-9]+$",REGULAR_INPUT_LINK="\\b(http|https)://[a-z0-9.-]+\\b",REGULAR_INPUT_LINK_VARIABLE="REGULAR_INPUT_LINK",MIN_WIDTH_UL_MENU="480px",MESSAGE_WAS_SENT="The message was sent!",MIN_ELEMENT_HEIGHT="20px",HEADER_PAGE_ID="0ebb514d-53f2-48c4-8073-98e9fb93e1fa",FOOTER_PAGE_ID="1992fecc-5276-4b6b-8bdd-46c8cff82f47",MENU_COMPONENT_ID="88cbc4c2-bb93-45e9-a318-57218c7c0171",MEESSAGE_EMAIL_THANK_YOU_NAME_EMAIL="Thank You! Your information has been sent to <CustomerEmail>  for review. You should hear back from them shortly. Make sure to add <RecipientEmail> to your contacts so responses are not swept into your spam folder",MEESSAGE_EMAIL_SUCCESS_NAME_EMAIL="Success!  Your information has been sent to <CustomerEmail> for review. You should hear back from them shortly. Make sure to add <RecipientEmail> to your contacts so responses are not swept into your spam folder",MEESSAGE_EMAIL_SUCCESS_DOMANIAN_NAME="Success! Your information has been sent to <DomainName> for review. You should hear back from them shortly. Make sure to add <RecipientEmail> to your contacts so responses are not swept into your spam folder",MESSAGE_WAS_NOT_SENT="The message was not sent",SECCESS_TITLE_PAGE="Success!",PHOTO_TOUR_TEXT_COLOR="photo-tour-text-color",SECCESS_BUTTON_TEXT="Ok",SECCESS_HEADER_COLOR="#616161",SECCESS_BUTTON_COLOR="#616161",SECCESS_CONTENT_COLOR="#ffffff",SECCESS_TEXT_COLOR="black",SECCESS_FONT_SIZE="27px",SECCESS_FONT_FAMILY="open sans",SUCCESS_LOGO_IMAGE="/Images/logo-successfully-new.png",SUCCESS_PAGE_MESSAGE="success-page-massage",SUCCESS_PAGE_TEXT_COLOR="success-page-text-color",SUCCESS_PAGE_IMAGE_LOGO="success-page-image-logo",SUCCESS_PAGE_CONTENT_COLOR="success-page-content-color",SUCCESS_PAGE_TEXT_COLOR="success-page-text-color",SUCCESS_PAGE_TEXT_FONT_SIZE="success-page-text-font-size",SUCCESS_PAGE_TEXT_FONT_FAMILY="success-page-text-font-family",SUCCESS_PAGE_LINK_REDIRECT_BUTTON="success-page-link-redirect-button",SUCCESS_PAGE_HEADER_COLOR="success-page-header-color",SUCCESS_PAGE_BUTTON_COLOR="success-page-button-color",SUCCESS_PAGE_HEADER_TEXT="success-page-header-text",SUCCESS_PAGE_BUTTON_TEXT="success-page-button-text",SUCCESS_PAGE_MASTER_LINK="success-page-master-link",DEFAULT_BG_COLOR_FORMS="rgba(0, 0, 0, 0)",GROUP_WRAPPER="group-wrapper",GROUP_WRAPPER_MENU="group-actions-menu",GROUP_WRAPPER_FIXED="group-wrapper-fixed",GROUP_WRAPPER_OUTER="outer",GROUPID="group-id",GROUP="group",COMPONENT="component",SELECT_WRAPPER="select-wrapper",DESERIALIZE_STRATEGY_STANDARD="Standard",DESERIALIZE_STRATEGY_COMPARE_CONTROLS="CompareControls",DESERIALIZE_STRATEGIES=[DESERIALIZE_STRATEGY_STANDARD,DESERIALIZE_STRATEGY_COMPARE_CONTROLS],ACTION_TYPE_CREATE_WEB_SITE=1,ACTION_TYPE_CREATE_TEMPLATE=4,ACTION_TYPE_EDIT_WEBSITE=2,ACTION_TYPE_EDIT_TEMPLATE=3,GROUPS_SHELL=[],DESIGN_POPOVER_CUSTOM="design-popover-custom",ADDING_CATEGORY_TO_PRODUCT_POPOVER_CUSTOM="adding-category-to-product-popover-custom",BATCH_OPERATIONS_POPOVER_CUSTOM="batch-operations-popover-custom",FORM="form",LABEL="_label",TEXTBOX="_textbox",TEXTAREA="_textarea",RADIOLIST="_radio-list",SELECTLIST="_select-list",CHECKBOX="_checkbox",SELECTEDLABEL="label-value",SELECTEDLABELTYPE="label-type",CAPTION_COMPONENTS_TO_LABEL="caption-components-to-label",CAPTION="caption",LABELTYPENAME="Name",SUBMIT="_submit",CAPTCHA="_captcha",FRAME="frame",UPCLICK_TYPE_PICTURE="Picture",UPCLICK_TYPE_CERTIFICATE="Certificate",UPCLICK_TYPE_SOUND="Sound",UPCLICK_TYPE_PDF="Pdf",JPLAYER_SUFFIX="_jplayer",JPLAYER_CONTAINER_SUFFIX="_jplayer_container",DUPLICATE="duplicate",COPY="copy",PASTE="paste",ADDITIONAL_COMPONENTS="additional-components",PDF_NOT_UPLOADED="PDF file is not uploaded yet",MAIN_MENU="main-menu",CKEDITOR_PAGE="ckeditorcmspage://",DEFAULT_PARAGRAPH_TEXT="This is a TEXT object frame. You can type directly over text, or copy and paste text into this frame. Highlight text and you will see the EDITING palette. There you can affect changes to text and create links to other pages. (*see User Guide for more detailed instructions on use).",DEFAULT_HEADER_TEXT="Heading",PREDEFINED_VIEW_SLIDESHOW='<div class="item active fitwidth"><a><img src="/Images/slideshow_predefined.png"><\/a><\/div>',DEVICE_TYPE="deviceType",SWITCHER_DESKTOP="desktop",SWITCHER_MOBILE="mobile",GOOGLE_ANALYTICS="googleanalytics",GOOGLE_ANALYTICS_SCRIPT="googleanalytics-script",RULER_GUIDES="ruler-guides",GOOGLE_VERIFICATION_CODE="google-verification-code",BING_VERIFICATION_CODE="bing-verification-code",SEARCHENGINE="searchengine",SITEMAPXML="sitemapxml",ISPROTECTED="isprotected",PROTECTEDWORD="protected-word",PROTECTEDEMAIL="protected-email",CALLBACK_ACTION="callbackaction",SITE_SETTINGS_ACCESSIBILITY="SiteSettingsAccessibility",PAGE_MANAGEMENT_SETTINGS="page-management-settings",SITE_SETTINGS_TEMPLATE="site-settings-template",SITE_AUTOSAVE_SETTINGS="site-auto-save-settings",SITE_SETTINGS_HEADER_CONTENT="header-content",PARENT_PAGE="parent-page",HOME="home",HIDE_FROM_MENU="hide-from-menu",SECURE="secure",HIDE_COMPONENT="hide-component",ALT="alt",ONLY_DESKTOP="only-desktop",DEVICE_DESKTOP_TYPE="desktop",DEVICE_MOBILE_TYPE="mobile",STD_COMPONENT_FIXED="std-component-fixed",DOC_READY_STATE_COMPLETE="complete",FORM_SUBJECT="form-subject",FORM_SPACE_AFTER_ITEM="form-space-after-item",STORE="store",STORE_CART="store-cart",STORE_CART_LINK="store-cart-link",STORE_CART_CHECKOUT="store-cart-checkout",STORE_THANK_YOU="store-thank-you",STORE_PRODUCT="store-product",STORE_GALLERY="store-gallery",MANAGE_STORE_PRODUCTS="manage-store-products",MANAGE_STORE_PRODUCTS_ADD_CATEGORY="#manage-store-products-category",MANAGE_STORE_PRODUCTS_ADDING_PRODUCTS_TO_CATEGORY="#manage-store-products-adding-products-to-category",MANAGE_STORE_PRODUCTS_ADDING_CATEGORIES_TO_PRODUCTS="#manage-store-products-adding-category-to-products",MANAGE_STORE_PRODUCTS_ADDING_DISCOUNT_TO_PRODUCTS="#manage-store-products-adding-discount-to-products",MANAGE_STORE_PRODUCTS_CHANGE_PRODUCTS_VISABILITY="#manage-store-products-change-products-visability",TEXT_ORDER_NUMBER="text-order-number",TEXT_TOTAL_COST="text-total-cost",TEXT_SHIPPING_TO="text-shipping-to",PAYPAL_EMAIL="paypal-email",ISSERVICE="isservice",DETAILS="details",SKU="sku",SOCIAL="social",PRICE="price",QUANTITY="quantity",ADD_TO_CART="add-to-cart",LAYOUT="layout",TITLE_COLOR="title-color",TITLE_FONT_FAMILY="title-font-family",TEXT_COLOR="text-color",TEXT_FONT_FAMILY="text-font-family",DIVIDER_COLOR="divider-color",DIVIDER_WIDTH="divider-width",DIVIDER="divider",SHARE_TO_FACEBOOK="share-to-facebook",SHARE_TO_TWITTER="share-to-twitter",SHARE_TO_GPLUS="share-to-gplus",STORE_PRODUCT_PRICE="store-product-price",STORE_PRODUCT_SKU="store-product-sku",STORE_PRODUCT_QUANTITY="store-product-quantity",STORE_PRODUCT_ADD_TO_CART="store-product-add-to-cart",STORE_PRODUCT_SOCIAL="store-product-social",STORE_PRODUCT_TITLE="store-product-title",STORE_PRODUCT_DESCRIPTION="store-product-description",STORE_PRODUCT_IMAGES="store-product-images",STORE_PRODUCT_OPTIONS="store-product-options",STORE_GALLERY_PRODUCT="store-gallery-product",STORE_GALLERY_PRODUCT_DESCRIPTION="store-gallery-product-description",STORE_GALLERY_PRODUCT_IMAGE="store-gallery-product-image",STORE_GALLERY_PRODUCT_LABEL="store-gallery-product-label",STORE_GALLERY_PRODUCT_PRICE="store-gallery-product-price",STORE_GALLERY_PRODUCT_TITLE="store-gallery-product-title",STORE_GALLERY_SHOW_MORE="store-gallery-show-more",STORE_CATEGORIES="store-categories",ACTION_ADD_TO_FORM="add-component-to-form",ACTION_REMOVE_FROM_FORM="remove-component-from-form",ACTION_SIGN_IN="sign-in",ACTION_SIGN_OUT="sign-out",ACTION_EDITOR_OPEN="editor-open",ACTION_EDITOR_CLOSED="editor-closed",PAGE_SECURE_PROPERTY="secure",RETURN_POLICY_URL="return-policy-url",SHIPPING_POLICY_URL="shipping-policy-url",CURRENCY="currency",WEIGHT_UNIT="weight-unit",SITE_COLORS="site-colors",CUSTOM_USER_FIELDS="custom-user-fields",STORE_PRODUCT_DEFAULT_IMAGE="//testwebsitecreator.blob.core.windows.net/ecommerce-image/RWSemptyproduct.svg",SIGNIN_USER_DEFAULT_IMAGE="//testwebsitecreator.blob.core.windows.net/ecommerce-image/bust1.png",STORE_SOCIAL_FACEBOOK_IMAGE="//testwebsitecreator.blob.core.windows.net/ecommerce-image/fb.png",STORE_SOCIAL_TWITTER_IMAGE="//testwebsitecreator.blob.core.windows.net/ecommerce-image/twitter.png",STORE_SOCIAL_GPLUS_IMAGE="//testwebsitecreator.blob.core.windows.net/ecommerce-image/g.png",ENABLE_LOGGING=!1,RECAPTCHA_SITE_KEY="6LfL3V8UAAAAABtWhgn1QoBaQCxmCJRSUKtSf9mk",USE_CAPTCHA="use-captcha",REQUIRED_FIELD="required-field",AUTO_SAVE_PERIOD="auto-save-period",REGEXP_CHECK_HTML_SCRIPT_AND_IFRAME_TAG="<s*(script|iframe)[^>]*>",INDEXEDDB_BASENAME="uwcBase",INDEXEDDB_STORE_TEMPLATE="templateValues",BLOGGING="blogging",META_DATE="meta-date",IS_IMAGE_PRIMARY="is-image-primary",BLOGGING_EMPTY_IMAGE_URL="../Content/image/no-image-yet.png",MAP="map",LATITUDE="latitude",LONGITUDE="longitude",SHOW_MAP_TYPE="show-map-type",SHOW_ZOOM="show-zoom",MAP_INTERACTIVE="map-interactive",SHOW_STREET_VIEW="show-street-view",MANAGE_MAILS_COMPONENT="#form-manage-mails",MANAGE_MAILS_CURRENT_COMPONENT="#form-manage-mails-current",MANAGE_MAILS_GRID_URL="/Account/ControlFormMailsListGrid",MAIL_HISTORY_PROPERTY="mail-history",LOGS_PROPERTY="logs",UndoManager=function(){"use strict";var t=[],n=-1,r=!1,i,u;return u=function(n,t){return!n||typeof n[t]!="function"?this:(r=!0,n[t](),r=!1,this)},{addSpecificActionToEnd:function(i,u){if(r)return this;var f=t[n];f[u]=i[u]},add:function(u){return r?this:(t.splice(n+1,t.length-n),t.push(u),n=t.length-1,i&&i(),this)},setCallback:function(n){i=n},undo:function(){var r=t[n];return r?(n==t.length-1&&t.length>0,u(r,"undo"),n-=1,i&&i(),this):this},redo:function(){var r=t[n+1];return r?(u(r,"redo"),n+=1,i&&i(),this):this},clear:function(){var r=t.length;t=[];n=-1;i&&r>0&&i()},hasUndo:function(){return n!==-1},hasRedo:function(){return n<t.length-1},getCommands:function(){return t},getLatestProperty:function(){return n!==-1&&defined(t[n].property)?t[n].property:null},getLatestComponentId:function(){return n!==-1&&defined(t[n].componentId)?t[n].componentId:null},getLatestCommand:function(){return n!==-1?t[n]:null}}};(function(n,t){typeof module=="object"&&typeof module.exports=="object"?module.exports=n.document?t(n,!0):function(n){if(!n.document)throw new Error("jQuery requires a window with a document");return t(n)}:t(n)})(typeof window!="undefined"?window:this,function(n,t){function ui(n){var t=n.length,r=i.type(n);return r==="function"||i.isWindow(n)?!1:n.nodeType===1&&t?!0:r==="array"||t===0||typeof t=="number"&&t>0&&t-1 in n}function fi(n,t,r){if(i.isFunction(t))return i.grep(n,function(n,i){return!!t.call(n,i,n)!==r});if(t.nodeType)return i.grep(n,function(n){return n===t!==r});if(typeof t=="string"){if(ef.test(t))return i.filter(t,n,r);t=i.filter(t,n)}return i.grep(n,function(n){return et.call(t,n)>=0!==r})}function ur(n,t){while((n=n[t])&&n.nodeType!==1);return n}function of(n){var t=ei[n]={};return i.each(n.match(c)||[],function(n,i){t[i]=!0}),t}function ct(){u.removeEventListener("DOMContentLoaded",ct,!1);n.removeEventListener("load",ct,!1);i.ready()}function p(){Object.defineProperty(this.cache={},0,{get:function(){return{}}});this.expando=i.expando+Math.random()}function fr(n,t,r){var u;if(r===undefined&&n.nodeType===1)if(u="data-"+t.replace(hf,"-$1").toLowerCase(),r=n.getAttribute(u),typeof r=="string"){try{r=r==="true"?!0:r==="false"?!1:r==="null"?null:+r+""===r?+r:sf.test(r)?i.parseJSON(r):r}catch(f){}e.set(n,t,r)}else r=undefined;return r}function at(){return!0}function g(){return!1}function hr(){try{return u.activeElement}catch(n){}}function vr(n,t){return i.nodeName(n,"table")&&i.nodeName(t.nodeType!==11?t:t.firstChild,"tr")?n.getElementsByTagName("tbody")[0]||n.appendChild(n.ownerDocument.createElement("tbody")):n}function bf(n){return n.type=(n.getAttribute("type")!==null)+"/"+n.type,n}function kf(n){var t=pf.exec(n.type);return t?n.type=t[1]:n.removeAttribute("type"),n}function oi(n,t){for(var i=0,u=n.length;i<u;i++)r.set(n[i],"globalEval",!t||r.get(t[i],"globalEval"))}function yr(n,t){var f,c,o,s,h,l,a,u;if(t.nodeType===1){if(r.hasData(n)&&(s=r.access(n),h=r.set(t,s),u=s.events,u)){delete h.handle;h.events={};for(o in u)for(f=0,c=u[o].length;f<c;f++)i.event.add(t,o,u[o][f])}e.hasData(n)&&(l=e.access(n),a=i.extend({},l),e.set(t,a))}}function o(n,t){var r=n.getElementsByTagName?n.getElementsByTagName(t||"*"):n.querySelectorAll?n.querySelectorAll(t||"*"):[];return t===undefined||t&&i.nodeName(n,t)?i.merge([n],r):r}function df(n,t){var i=t.nodeName.toLowerCase();i==="input"&&er.test(n.type)?t.checked=n.checked:(i==="input"||i==="textarea")&&(t.defaultValue=n.defaultValue)}function pr(t,r){var f,u=i(r.createElement(t)).appendTo(r.body),e=n.getDefaultComputedStyle&&(f=n.getDefaultComputedStyle(u[0]))?f.display:i.css(u[0],"display");return u.detach(),e}function hi(n){var r=u,t=si[n];return t||(t=pr(n,r),t!=="none"&&t||(vt=(vt||i("<iframe frameborder='0' width='0' height='0'/>")).appendTo(r.documentElement),r=vt[0].contentDocument,r.write(),r.close(),t=pr(n,r),vt.detach()),si[n]=t),t}function rt(n,t,r){var e,o,s,u,f=n.style;return r=r||yt(n),r&&(u=r.getPropertyValue(t)||r[t]),r&&(u!==""||i.contains(n.ownerDocument,n)||(u=i.style(n,t)),ci.test(u)&&wr.test(t)&&(e=f.width,o=f.minWidth,s=f.maxWidth,f.minWidth=f.maxWidth=f.width=u,u=r.width,f.width=e,f.minWidth=o,f.maxWidth=s)),u!==undefined?u+"":u}function br(n,t){return{get:function(){if(n()){delete this.get;return}return(this.get=t).apply(this,arguments)}}}function gr(n,t){if(t in n)return t;for(var r=t[0].toUpperCase()+t.slice(1),u=t,i=dr.length;i--;)if(t=dr[i]+r,t in n)return t;return u}function nu(n,t,i){var r=ne.exec(t);return r?Math.max(0,r[1]-(i||0))+(r[2]||"px"):t}function tu(n,t,r,u,f){for(var e=r===(u?"border":"content")?4:t==="width"?1:0,o=0;e<4;e+=2)r==="margin"&&(o+=i.css(n,r+w[e],!0,f)),u?(r==="content"&&(o-=i.css(n,"padding"+w[e],!0,f)),r!=="margin"&&(o-=i.css(n,"border"+w[e]+"Width",!0,f))):(o+=i.css(n,"padding"+w[e],!0,f),r!=="padding"&&(o+=i.css(n,"border"+w[e]+"Width",!0,f)));return o}function iu(n,t,r){var o=!0,u=t==="width"?n.offsetWidth:n.offsetHeight,e=yt(n),s=i.css(n,"boxSizing",!1,e)==="border-box";if(u<=0||u==null){if(u=rt(n,t,e),(u<0||u==null)&&(u=n.style[t]),ci.test(u))return u;o=s&&(f.boxSizingReliable()||u===n.style[t]);u=parseFloat(u)||0}return u+tu(n,t,r||(s?"border":"content"),o,e)+"px"}function ru(n,t){for(var e,u,s,o=[],f=0,h=n.length;f<h;f++)(u=n[f],u.style)&&(o[f]=r.get(u,"olddisplay"),e=u.style.display,t?(o[f]||e!=="none"||(u.style.display=""),u.style.display===""&&it(u)&&(o[f]=r.access(u,"olddisplay",hi(u.nodeName)))):(s=it(u),e==="none"&&s||r.set(u,"olddisplay",s?e:i.css(u,"display"))));for(f=0;f<h;f++)(u=n[f],u.style)&&(t&&u.style.display!=="none"&&u.style.display!==""||(u.style.display=t?o[f]||"":"none"));return n}function s(n,t,i,r,u){return new s.prototype.init(n,t,i,r,u)}function fu(){return setTimeout(function(){nt=undefined}),nt=i.now()}function bt(n,t){var r,u=0,i={height:n};for(t=t?1:0;u<4;u+=2-t)r=w[u],i["margin"+r]=i["padding"+r]=n;return t&&(i.opacity=i.width=n),i}function eu(n,t,i){for(var u,f=(ut[t]||[]).concat(ut["*"]),r=0,e=f.length;r<e;r++)if(u=f[r].call(i,t,n))return u}function fe(n,t,u){var f,a,p,v,o,w,h,b,l=this,y={},s=n.style,c=n.nodeType&&it(n),e=r.get(n,"fxshow");u.queue||(o=i._queueHooks(n,"fx"),o.unqueued==null&&(o.unqueued=0,w=o.empty.fire,o.empty.fire=function(){o.unqueued||w()}),o.unqueued++,l.always(function(){l.always(function(){o.unqueued--;i.queue(n,"fx").length||o.empty.fire()})}));n.nodeType===1&&("height"in t||"width"in t)&&(u.overflow=[s.overflow,s.overflowX,s.overflowY],h=i.css(n,"display"),b=h==="none"?r.get(n,"olddisplay")||hi(n.nodeName):h,b==="inline"&&i.css(n,"float")==="none"&&(s.display="inline-block"));u.overflow&&(s.overflow="hidden",l.always(function(){s.overflow=u.overflow[0];s.overflowX=u.overflow[1];s.overflowY=u.overflow[2]}));for(f in t)if(a=t[f],re.exec(a)){if(delete t[f],p=p||a==="toggle",a===(c?"hide":"show"))if(a==="show"&&e&&e[f]!==undefined)c=!0;else continue;y[f]=e&&e[f]||i.style(n,f)}else h=undefined;if(i.isEmptyObject(y))(h==="none"?hi(n.nodeName):h)==="inline"&&(s.display=h);else{e?"hidden"in e&&(c=e.hidden):e=r.access(n,"fxshow",{});p&&(e.hidden=!c);c?i(n).show():l.done(function(){i(n).hide()});l.done(function(){var t;r.remove(n,"fxshow");for(t in y)i.style(n,t,y[t])});for(f in y)v=eu(c?e[f]:0,f,l),f in e||(e[f]=v.start,c&&(v.end=v.start,v.start=f==="width"||f==="height"?1:0))}}function ee(n,t){var r,f,e,u,o;for(r in n)if(f=i.camelCase(r),e=t[f],u=n[r],i.isArray(u)&&(e=u[1],u=n[r]=u[0]),r!==f&&(n[f]=u,delete n[r]),o=i.cssHooks[f],o&&"expand"in o){u=o.expand(u);delete n[f];for(r in u)r in n||(n[r]=u[r],t[r]=e)}else t[f]=e}function ou(n,t,r){var e,o,s=0,l=wt.length,f=i.Deferred().always(function(){delete c.elem}),c=function(){if(o)return!1;for(var s=nt||fu(),t=Math.max(0,u.startTime+u.duration-s),h=t/u.duration||0,i=1-h,r=0,e=u.tweens.length;r<e;r++)u.tweens[r].run(i);return f.notifyWith(n,[u,i,t]),i<1&&e?t:(f.resolveWith(n,[u]),!1)},u=f.promise({elem:n,props:i.extend({},t),opts:i.extend(!0,{specialEasing:{}},r),originalProperties:t,originalOptions:r,startTime:nt||fu(),duration:r.duration,tweens:[],createTween:function(t,r){var f=i.Tween(n,u.opts,t,r,u.opts.specialEasing[t]||u.opts.easing);return u.tweens.push(f),f},stop:function(t){var i=0,r=t?u.tweens.length:0;if(o)return this;for(o=!0;i<r;i++)u.tweens[i].run(1);return t?f.resolveWith(n,[u,t]):f.rejectWith(n,[u,t]),this}}),h=u.props;for(ee(h,u.opts.specialEasing);s<l;s++)if(e=wt[s].call(u,n,h,u.opts),e)return e;return i.map(h,eu,u),i.isFunction(u.opts.start)&&u.opts.start.call(n,u),i.fx.timer(i.extend(c,{elem:n,anim:u,queue:u.opts.queue})),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always)}function pu(n){return function(t,r){typeof t!="string"&&(r=t,t="*");var u,f=0,e=t.toLowerCase().match(c)||[];if(i.isFunction(r))while(u=e[f++])u[0]==="+"?(u=u.slice(1)||"*",(n[u]=n[u]||[]).unshift(r)):(n[u]=n[u]||[]).push(r)}}function wu(n,t,r,u){function e(s){var h;return f[s]=!0,i.each(n[s]||[],function(n,i){var s=i(t,r,u);if(typeof s!="string"||o||f[s]){if(o)return!(h=s)}else return t.dataTypes.unshift(s),e(s),!1}),h}var f={},o=n===li;return e(t.dataTypes[0])||!f["*"]&&e("*")}function ai(n,t){var r,u,f=i.ajaxSettings.flatOptions||{};for(r in t)t[r]!==undefined&&((f[r]?n:u||(u={}))[r]=t[r]);return u&&i.extend(!0,n,u),n}function ae(n,t,i){for(var e,u,f,o,s=n.contents,r=n.dataTypes;r[0]==="*";)r.shift(),e===undefined&&(e=n.mimeType||t.getResponseHeader("Content-Type"));if(e)for(u in s)if(s[u]&&s[u].test(e)){r.unshift(u);break}if(r[0]in i)f=r[0];else{for(u in i){if(!r[0]||n.converters[u+" "+r[0]]){f=u;break}o||(o=u)}f=f||o}if(f)return f!==r[0]&&r.unshift(f),i[f]}function ve(n,t,i,r){var h,u,f,s,e,o={},c=n.dataTypes.slice();if(c[1])for(f in n.converters)o[f.toLowerCase()]=n.converters[f];for(u=c.shift();u;)if(n.responseFields[u]&&(i[n.responseFields[u]]=t),!e&&r&&n.dataFilter&&(t=n.dataFilter(t,n.dataType)),e=u,u=c.shift(),u)if(u==="*")u=e;else if(e!=="*"&&e!==u){if(f=o[e+" "+u]||o["* "+u],!f)for(h in o)if(s=h.split(" "),s[1]===u&&(f=o[e+" "+s[0]]||o["* "+s[0]],f)){f===!0?f=o[h]:o[h]!==!0&&(u=s[0],c.unshift(s[1]));break}if(f!==!0)if(f&&n.throws)t=f(t);else try{t=f(t)}catch(l){return{state:"parsererror",error:f?l:"No conversion from "+e+" to "+u}}}return{state:"success",data:t}}function vi(n,t,r,u){var f;if(i.isArray(t))i.each(t,function(t,i){r||pe.test(n)?u(n,i):vi(n+"["+(typeof i=="object"?t:"")+"]",i,r,u)});else if(r||i.type(t)!=="object")u(n,t);else for(f in t)vi(n+"["+f+"]",t[f],r,u)}function ku(n){return i.isWindow(n)?n:n.nodeType===9&&n.defaultView}var k=[],a=k.slice,bi=k.concat,ii=k.push,et=k.indexOf,ot={},nf=ot.toString,ri=ot.hasOwnProperty,f={},u=n.document,ki="2.1.1",i=function(n,t){return new i.fn.init(n,t)},tf=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,rf=/^-ms-/,uf=/-([\da-z])/gi,ff=function(n,t){return t.toUpperCase()},y,st,nr,tr,ir,rr,c,ei,ht,l,d,vt,si,oe,su,tt,hu,kt,cu,dt,gt,yi,ti,pi,wi,du,gu;i.fn=i.prototype={jquery:ki,constructor:i,selector:"",length:0,toArray:function(){return a.call(this)},get:function(n){return n!=null?n<0?this[n+this.length]:this[n]:a.call(this)},pushStack:function(n){var t=i.merge(this.constructor(),n);return t.prevObject=this,t.context=this.context,t},each:function(n,t){return i.each(this,n,t)},map:function(n){return this.pushStack(i.map(this,function(t,i){return n.call(t,i,t)}))},slice:function(){return this.pushStack(a.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(n){var i=this.length,t=+n+(n<0?i:0);return this.pushStack(t>=0&&t<i?[this[t]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:ii,sort:k.sort,splice:k.splice};i.extend=i.fn.extend=function(){var e,f,r,t,o,s,n=arguments[0]||{},u=1,c=arguments.length,h=!1;for(typeof n=="boolean"&&(h=n,n=arguments[u]||{},u++),typeof n=="object"||i.isFunction(n)||(n={}),u===c&&(n=this,u--);u<c;u++)if((e=arguments[u])!=null)for(f in e)(r=n[f],t=e[f],n!==t)&&(h&&t&&(i.isPlainObject(t)||(o=i.isArray(t)))?(o?(o=!1,s=r&&i.isArray(r)?r:[]):s=r&&i.isPlainObject(r)?r:{},n[f]=i.extend(h,s,t)):t!==undefined&&(n[f]=t));return n};i.extend({expando:"jQuery"+(ki+Math.random()).replace(/\D/g,""),isReady:!0,error:function(n){throw new Error(n);},noop:function(){},isFunction:function(n){return i.type(n)==="function"},isArray:Array.isArray,isWindow:function(n){return n!=null&&n===n.window},isNumeric:function(n){return!i.isArray(n)&&n-parseFloat(n)>=0},isPlainObject:function(n){return i.type(n)!=="object"||n.nodeType||i.isWindow(n)?!1:n.constructor&&!ri.call(n.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(n){var t;for(t in n)return!1;return!0},type:function(n){return n==null?n+"":typeof n=="object"||typeof n=="function"?ot[nf.call(n)]||"object":typeof n},globalEval:function(n){var t,r=eval;n=i.trim(n);n&&(n.indexOf("use strict")===1?(t=u.createElement("script"),t.text=n,u.head.appendChild(t).parentNode.removeChild(t)):r(n))},camelCase:function(n){return n.replace(rf,"ms-").replace(uf,ff)},nodeName:function(n,t){return n.nodeName&&n.nodeName.toLowerCase()===t.toLowerCase()},each:function(n,t,i){var u,r=0,f=n.length,e=ui(n);if(i){if(e){for(;r<f;r++)if(u=t.apply(n[r],i),u===!1)break}else for(r in n)if(u=t.apply(n[r],i),u===!1)break}else if(e){for(;r<f;r++)if(u=t.call(n[r],r,n[r]),u===!1)break}else for(r in n)if(u=t.call(n[r],r,n[r]),u===!1)break;return n},trim:function(n){return n==null?"":(n+"").replace(tf,"")},makeArray:function(n,t){var r=t||[];return n!=null&&(ui(Object(n))?i.merge(r,typeof n=="string"?[n]:n):ii.call(r,n)),r},inArray:function(n,t,i){return t==null?-1:et.call(t,n,i)},merge:function(n,t){for(var u=+t.length,i=0,r=n.length;i<u;i++)n[r++]=t[i];return n.length=r,n},grep:function(n,t,i){for(var u,f=[],r=0,e=n.length,o=!i;r<e;r++)u=!t(n[r],r),u!==o&&f.push(n[r]);return f},map:function(n,t,i){var u,r=0,e=n.length,o=ui(n),f=[];if(o)for(;r<e;r++)u=t(n[r],r,i),u!=null&&f.push(u);else for(r in n)u=t(n[r],r,i),u!=null&&f.push(u);return bi.apply([],f)},guid:1,proxy:function(n,t){var u,f,r;return(typeof t=="string"&&(u=n[t],t=n,n=u),!i.isFunction(n))?undefined:(f=a.call(arguments,2),r=function(){return n.apply(t||this,f.concat(a.call(arguments)))},r.guid=n.guid=n.guid||i.guid++,r)},now:Date.now,support:f});i.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(n,t){ot["[object "+t+"]"]=t.toLowerCase()});y=function(n){function r(n,t,i,r){var w,h,c,v,k,y,d,l,nt,g;if((t?t.ownerDocument||t:s)!==e&&p(t),t=t||e,i=i||[],!n||typeof n!="string")return i;if((v=t.nodeType)!==1&&v!==9)return[];if(a&&!r){if(w=sr.exec(n))if(c=w[1]){if(v===9)if(h=t.getElementById(c),h&&h.parentNode){if(h.id===c)return i.push(h),i}else return i;else if(t.ownerDocument&&(h=t.ownerDocument.getElementById(c))&&ot(t,h)&&h.id===c)return i.push(h),i}else{if(w[2])return b.apply(i,t.getElementsByTagName(n)),i;if((c=w[3])&&u.getElementsByClassName&&t.getElementsByClassName)return b.apply(i,t.getElementsByClassName(c)),i}if(u.qsa&&(!o||!o.test(n))){if(l=d=f,nt=t,g=v===9&&n,v===1&&t.nodeName.toLowerCase()!=="object"){for(y=et(n),(d=t.getAttribute("id"))?l=d.replace(hr,"\\$&"):t.setAttribute("id",l),l="[id='"+l+"'] ",k=y.length;k--;)y[k]=l+yt(y[k]);nt=gt.test(n)&&ii(t.parentNode)||t;g=y.join(",")}if(g)try{return b.apply(i,nt.querySelectorAll(g)),i}catch(tt){}finally{d||t.removeAttribute("id")}}}return si(n.replace(at,"$1"),t,i,r)}function ni(){function n(r,u){return i.push(r+" ")>t.cacheLength&&delete n[i.shift()],n[r+" "]=u}var i=[];return n}function h(n){return n[f]=!0,n}function c(n){var t=e.createElement("div");try{return!!n(t)}catch(i){return!1}finally{t.parentNode&&t.parentNode.removeChild(t);t=null}}function ti(n,i){for(var u=n.split("|"),r=n.length;r--;)t.attrHandle[u[r]]=i}function wi(n,t){var i=t&&n,r=i&&n.nodeType===1&&t.nodeType===1&&(~t.sourceIndex||ai)-(~n.sourceIndex||ai);if(r)return r;if(i)while(i=i.nextSibling)if(i===t)return-1;return n?1:-1}function cr(n){return function(t){var i=t.nodeName.toLowerCase();return i==="input"&&t.type===n}}function lr(n){return function(t){var i=t.nodeName.toLowerCase();return(i==="input"||i==="button")&&t.type===n}}function tt(n){return h(function(t){return t=+t,h(function(i,r){for(var u,f=n([],i.length,t),e=f.length;e--;)i[u=f[e]]&&(i[u]=!(r[u]=i[u]))})})}function ii(n){return n&&typeof n.getElementsByTagName!==ut&&n}function bi(){}function yt(n){for(var t=0,r=n.length,i="";t<r;t++)i+=n[t].value;return i}function ri(n,t,i){var r=t.dir,u=i&&r==="parentNode",e=ki++;return t.first?function(t,i,f){while(t=t[r])if(t.nodeType===1||u)return n(t,i,f)}:function(t,i,o){var s,h,c=[v,e];if(o){while(t=t[r])if((t.nodeType===1||u)&&n(t,i,o))return!0}else while(t=t[r])if(t.nodeType===1||u){if(h=t[f]||(t[f]={}),(s=h[r])&&s[0]===v&&s[1]===e)return c[2]=s[2];if(h[r]=c,c[2]=n(t,i,o))return!0}}}function ui(n){return n.length>1?function(t,i,r){for(var u=n.length;u--;)if(!n[u](t,i,r))return!1;return!0}:n[0]}function ar(n,t,i){for(var u=0,f=t.length;u<f;u++)r(n,t[u],i);return i}function pt(n,t,i,r,u){for(var e,o=[],f=0,s=n.length,h=t!=null;f<s;f++)(e=n[f])&&(!i||i(e,r,u))&&(o.push(e),h&&t.push(f));return o}function fi(n,t,i,r,u,e){return r&&!r[f]&&(r=fi(r)),u&&!u[f]&&(u=fi(u,e)),h(function(f,e,o,s){var l,c,a,p=[],y=[],w=e.length,k=f||ar(t||"*",o.nodeType?[o]:o,[]),v=n&&(f||!t)?pt(k,p,n,o,s):k,h=i?u||(f?n:w||r)?[]:e:v;if(i&&i(v,h,o,s),r)for(l=pt(h,y),r(l,[],o,s),c=l.length;c--;)(a=l[c])&&(h[y[c]]=!(v[y[c]]=a));if(f){if(u||n){if(u){for(l=[],c=h.length;c--;)(a=h[c])&&l.push(v[c]=a);u(null,h=[],l,s)}for(c=h.length;c--;)(a=h[c])&&(l=u?nt.call(f,a):p[c])>-1&&(f[l]=!(e[l]=a))}}else h=pt(h===e?h.splice(w,h.length):h),u?u(null,e,h,s):b.apply(e,h)})}function ei(n){for(var s,u,r,o=n.length,h=t.relative[n[0].type],c=h||t.relative[" "],i=h?1:0,l=ri(function(n){return n===s},c,!0),a=ri(function(n){return nt.call(s,n)>-1},c,!0),e=[function(n,t,i){return!h&&(i||t!==ct)||((s=t).nodeType?l(n,t,i):a(n,t,i))}];i<o;i++)if(u=t.relative[n[i].type])e=[ri(ui(e),u)];else{if(u=t.filter[n[i].type].apply(null,n[i].matches),u[f]){for(r=++i;r<o;r++)if(t.relative[n[r].type])break;return fi(i>1&&ui(e),i>1&&yt(n.slice(0,i-1).concat({value:n[i-2].type===" "?"*":""})).replace(at,"$1"),u,i<r&&ei(n.slice(i,r)),r<o&&ei(n=n.slice(r)),r<o&&yt(n))}e.push(u)}return ui(e)}function vr(n,i){var u=i.length>0,f=n.length>0,o=function(o,s,h,c,l){var y,d,w,k=0,a="0",g=o&&[],p=[],nt=ct,tt=o||f&&t.find.TAG("*",l),it=v+=nt==null?1:Math.random()||.1,rt=tt.length;for(l&&(ct=s!==e&&s);a!==rt&&(y=tt[a])!=null;a++){if(f&&y){for(d=0;w=n[d++];)if(w(y,s,h)){c.push(y);break}l&&(v=it)}u&&((y=!w&&y)&&k--,o&&g.push(y))}if(k+=a,u&&a!==k){for(d=0;w=i[d++];)w(g,p,s,h);if(o){if(k>0)while(a--)g[a]||p[a]||(p[a]=gi.call(c));p=pt(p)}b.apply(c,p);l&&!o&&p.length>0&&k+i.length>1&&r.uniqueSort(c)}return l&&(v=it,ct=nt),g};return u?h(o):o}var it,u,t,ht,oi,et,wt,si,ct,y,rt,p,e,l,a,o,g,lt,ot,f="sizzle"+-new Date,s=n.document,v=0,ki=0,hi=ni(),ci=ni(),li=ni(),bt=function(n,t){return n===t&&(rt=!0),0},ut=typeof undefined,ai=-2147483648,di={}.hasOwnProperty,w=[],gi=w.pop,nr=w.push,b=w.push,vi=w.slice,nt=w.indexOf||function(n){for(var t=0,i=this.length;t<i;t++)if(this[t]===n)return t;return-1},kt="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",i="[\\x20\\t\\r\\n\\f]",ft="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",yi=ft.replace("w","w#"),pi="\\["+i+"*("+ft+")(?:"+i+"*([*^$|!~]?=)"+i+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+yi+"))|)"+i+"*\\]",dt=":("+ft+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+pi+")*)|.*)\\)|)",at=new RegExp("^"+i+"+|((?:^|[^\\\\])(?:\\\\.)*)"+i+"+$","g"),tr=new RegExp("^"+i+"*,"+i+"*"),ir=new RegExp("^"+i+"*([>+~]|"+i+")"+i+"*"),rr=new RegExp("="+i+"*([^\\]'\"]*?)"+i+"*\\]","g"),ur=new RegExp(dt),fr=new RegExp("^"+yi+"$"),vt={ID:new RegExp("^#("+ft+")"),CLASS:new RegExp("^\\.("+ft+")"),TAG:new RegExp("^("+ft.replace("w","w*")+")"),ATTR:new RegExp("^"+pi),PSEUDO:new RegExp("^"+dt),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+i+"*(even|odd|(([+-]|)(\\d*)n|)"+i+"*(?:([+-]|)"+i+"*(\\d+)|))"+i+"*\\)|)","i"),bool:new RegExp("^(?:"+kt+")$","i"),needsContext:new RegExp("^"+i+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+i+"*((?:-\\d)?\\d*)"+i+"*\\)|)(?=[^-]|$)","i")},er=/^(?:input|select|textarea|button)$/i,or=/^h\d$/i,st=/^[^{]+\{\s*\[native \w/,sr=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,gt=/[+~]/,hr=/'|\\/g,k=new RegExp("\\\\([\\da-f]{1,6}"+i+"?|("+i+")|.)","ig"),d=function(n,t,i){var r="0x"+t-65536;return r!==r||i?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,r&1023|56320)};try{b.apply(w=vi.call(s.childNodes),s.childNodes);w[s.childNodes.length].nodeType}catch(yr){b={apply:w.length?function(n,t){nr.apply(n,vi.call(t))}:function(n,t){for(var i=n.length,r=0;n[i++]=t[r++];);n.length=i-1}}}u=r.support={};oi=r.isXML=function(n){var t=n&&(n.ownerDocument||n).documentElement;return t?t.nodeName!=="HTML":!1};p=r.setDocument=function(n){var v,r=n?n.ownerDocument||n:s,h=r.defaultView;return r===e||r.nodeType!==9||!r.documentElement?e:(e=r,l=r.documentElement,a=!oi(r),h&&h!==h.top&&(h.addEventListener?h.addEventListener("unload",function(){p()},!1):h.attachEvent&&h.attachEvent("onunload",function(){p()})),u.attributes=c(function(n){return n.className="i",!n.getAttribute("className")}),u.getElementsByTagName=c(function(n){return n.appendChild(r.createComment("")),!n.getElementsByTagName("*").length}),u.getElementsByClassName=st.test(r.getElementsByClassName)&&c(function(n){return n.innerHTML="<div class='a'><\/div><div class='a i'><\/div>",n.firstChild.className="i",n.getElementsByClassName("i").length===2}),u.getById=c(function(n){return l.appendChild(n).id=f,!r.getElementsByName||!r.getElementsByName(f).length}),u.getById?(t.find.ID=function(n,t){if(typeof t.getElementById!==ut&&a){var i=t.getElementById(n);return i&&i.parentNode?[i]:[]}},t.filter.ID=function(n){var t=n.replace(k,d);return function(n){return n.getAttribute("id")===t}}):(delete t.find.ID,t.filter.ID=function(n){var t=n.replace(k,d);return function(n){var i=typeof n.getAttributeNode!==ut&&n.getAttributeNode("id");return i&&i.value===t}}),t.find.TAG=u.getElementsByTagName?function(n,t){if(typeof t.getElementsByTagName!==ut)return t.getElementsByTagName(n)}:function(n,t){var i,r=[],f=0,u=t.getElementsByTagName(n);if(n==="*"){while(i=u[f++])i.nodeType===1&&r.push(i);return r}return u},t.find.CLASS=u.getElementsByClassName&&function(n,t){if(typeof t.getElementsByClassName!==ut&&a)return t.getElementsByClassName(n)},g=[],o=[],(u.qsa=st.test(r.querySelectorAll))&&(c(function(n){n.innerHTML="<select msallowclip=''><option selected=''><\/option><\/select>";n.querySelectorAll("[msallowclip^='']").length&&o.push("[*^$]="+i+"*(?:''|\"\")");n.querySelectorAll("[selected]").length||o.push("\\["+i+"*(?:value|"+kt+")");n.querySelectorAll(":checked").length||o.push(":checked")}),c(function(n){var t=r.createElement("input");t.setAttribute("type","hidden");n.appendChild(t).setAttribute("name","D");n.querySelectorAll("[name=d]").length&&o.push("name"+i+"*[*^$|!~]?=");n.querySelectorAll(":enabled").length||o.push(":enabled",":disabled");n.querySelectorAll("*,:x");o.push(",.*:")})),(u.matchesSelector=st.test(lt=l.matches||l.webkitMatchesSelector||l.mozMatchesSelector||l.oMatchesSelector||l.msMatchesSelector))&&c(function(n){u.disconnectedMatch=lt.call(n,"div");lt.call(n,"[s!='']:x");g.push("!=",dt)}),o=o.length&&new RegExp(o.join("|")),g=g.length&&new RegExp(g.join("|")),v=st.test(l.compareDocumentPosition),ot=v||st.test(l.contains)?function(n,t){var r=n.nodeType===9?n.documentElement:n,i=t&&t.parentNode;return n===i||!!(i&&i.nodeType===1&&(r.contains?r.contains(i):n.compareDocumentPosition&&n.compareDocumentPosition(i)&16))}:function(n,t){if(t)while(t=t.parentNode)if(t===n)return!0;return!1},bt=v?function(n,t){if(n===t)return rt=!0,0;var i=!n.compareDocumentPosition-!t.compareDocumentPosition;return i?i:(i=(n.ownerDocument||n)===(t.ownerDocument||t)?n.compareDocumentPosition(t):1,i&1||!u.sortDetached&&t.compareDocumentPosition(n)===i)?n===r||n.ownerDocument===s&&ot(s,n)?-1:t===r||t.ownerDocument===s&&ot(s,t)?1:y?nt.call(y,n)-nt.call(y,t):0:i&4?-1:1}:function(n,t){if(n===t)return rt=!0,0;var i,u=0,o=n.parentNode,h=t.parentNode,f=[n],e=[t];if(o&&h){if(o===h)return wi(n,t)}else return n===r?-1:t===r?1:o?-1:h?1:y?nt.call(y,n)-nt.call(y,t):0;for(i=n;i=i.parentNode;)f.unshift(i);for(i=t;i=i.parentNode;)e.unshift(i);while(f[u]===e[u])u++;return u?wi(f[u],e[u]):f[u]===s?-1:e[u]===s?1:0},r)};r.matches=function(n,t){return r(n,null,null,t)};r.matchesSelector=function(n,t){if((n.ownerDocument||n)!==e&&p(n),t=t.replace(rr,"='$1']"),u.matchesSelector&&a&&(!g||!g.test(t))&&(!o||!o.test(t)))try{var i=lt.call(n,t);if(i||u.disconnectedMatch||n.document&&n.document.nodeType!==11)return i}catch(f){}return r(t,e,null,[n]).length>0};r.contains=function(n,t){return(n.ownerDocument||n)!==e&&p(n),ot(n,t)};r.attr=function(n,i){(n.ownerDocument||n)!==e&&p(n);var f=t.attrHandle[i.toLowerCase()],r=f&&di.call(t.attrHandle,i.toLowerCase())?f(n,i,!a):undefined;return r!==undefined?r:u.attributes||!a?n.getAttribute(i):(r=n.getAttributeNode(i))&&r.specified?r.value:null};r.error=function(n){throw new Error("Syntax error, unrecognized expression: "+n);};r.uniqueSort=function(n){var r,f=[],t=0,i=0;if(rt=!u.detectDuplicates,y=!u.sortStable&&n.slice(0),n.sort(bt),rt){while(r=n[i++])r===n[i]&&(t=f.push(i));while(t--)n.splice(f[t],1)}return y=null,n};ht=r.getText=function(n){var r,i="",u=0,t=n.nodeType;if(t){if(t===1||t===9||t===11){if(typeof n.textContent=="string")return n.textContent;for(n=n.firstChild;n;n=n.nextSibling)i+=ht(n)}else if(t===3||t===4)return n.nodeValue}else while(r=n[u++])i+=ht(r);return i};t=r.selectors={cacheLength:50,createPseudo:h,match:vt,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(n){return n[1]=n[1].replace(k,d),n[3]=(n[3]||n[4]||n[5]||"").replace(k,d),n[2]==="~="&&(n[3]=" "+n[3]+" "),n.slice(0,4)},CHILD:function(n){return n[1]=n[1].toLowerCase(),n[1].slice(0,3)==="nth"?(n[3]||r.error(n[0]),n[4]=+(n[4]?n[5]+(n[6]||1):2*(n[3]==="even"||n[3]==="odd")),n[5]=+(n[7]+n[8]||n[3]==="odd")):n[3]&&r.error(n[0]),n},PSEUDO:function(n){var i,t=!n[6]&&n[2];return vt.CHILD.test(n[0])?null:(n[3]?n[2]=n[4]||n[5]||"":t&&ur.test(t)&&(i=et(t,!0))&&(i=t.indexOf(")",t.length-i)-t.length)&&(n[0]=n[0].slice(0,i),n[2]=t.slice(0,i)),n.slice(0,3))}},filter:{TAG:function(n){var t=n.replace(k,d).toLowerCase();return n==="*"?function(){return!0}:function(n){return n.nodeName&&n.nodeName.toLowerCase()===t}},CLASS:function(n){var t=hi[n+" "];return t||(t=new RegExp("(^|"+i+")"+n+"("+i+"|$)"))&&hi(n,function(n){return t.test(typeof n.className=="string"&&n.className||typeof n.getAttribute!==ut&&n.getAttribute("class")||"")})},ATTR:function(n,t,i){return function(u){var f=r.attr(u,n);return f==null?t==="!=":t?(f+="",t==="="?f===i:t==="!="?f!==i:t==="^="?i&&f.indexOf(i)===0:t==="*="?i&&f.indexOf(i)>-1:t==="$="?i&&f.slice(-i.length)===i:t==="~="?(" "+f+" ").indexOf(i)>-1:t==="|="?f===i||f.slice(0,i.length+1)===i+"-":!1):!0}},CHILD:function(n,t,i,r,u){var s=n.slice(0,3)!=="nth",o=n.slice(-4)!=="last",e=t==="of-type";return r===1&&u===0?function(n){return!!n.parentNode}:function(t,i,h){var a,k,c,l,y,w,b=s!==o?"nextSibling":"previousSibling",p=t.parentNode,g=e&&t.nodeName.toLowerCase(),d=!h&&!e;if(p){if(s){while(b){for(c=t;c=c[b];)if(e?c.nodeName.toLowerCase()===g:c.nodeType===1)return!1;w=b=n==="only"&&!w&&"nextSibling"}return!0}if(w=[o?p.firstChild:p.lastChild],o&&d){for(k=p[f]||(p[f]={}),a=k[n]||[],y=a[0]===v&&a[1],l=a[0]===v&&a[2],c=y&&p.childNodes[y];c=++y&&c&&c[b]||(l=y=0)||w.pop();)if(c.nodeType===1&&++l&&c===t){k[n]=[v,y,l];break}}else if(d&&(a=(t[f]||(t[f]={}))[n])&&a[0]===v)l=a[1];else while(c=++y&&c&&c[b]||(l=y=0)||w.pop())if((e?c.nodeName.toLowerCase()===g:c.nodeType===1)&&++l&&(d&&((c[f]||(c[f]={}))[n]=[v,l]),c===t))break;return l-=u,l===r||l%r==0&&l/r>=0}}},PSEUDO:function(n,i){var e,u=t.pseudos[n]||t.setFilters[n.toLowerCase()]||r.error("unsupported pseudo: "+n);return u[f]?u(i):u.length>1?(e=[n,n,"",i],t.setFilters.hasOwnProperty(n.toLowerCase())?h(function(n,t){for(var r,f=u(n,i),e=f.length;e--;)r=nt.call(n,f[e]),n[r]=!(t[r]=f[e])}):function(n){return u(n,0,e)}):u}},pseudos:{not:h(function(n){var i=[],r=[],t=wt(n.replace(at,"$1"));return t[f]?h(function(n,i,r,u){for(var e,o=t(n,null,u,[]),f=n.length;f--;)(e=o[f])&&(n[f]=!(i[f]=e))}):function(n,u,f){return i[0]=n,t(i,null,f,r),!r.pop()}}),has:h(function(n){return function(t){return r(n,t).length>0}}),contains:h(function(n){return function(t){return(t.textContent||t.innerText||ht(t)).indexOf(n)>-1}}),lang:h(function(n){return fr.test(n||"")||r.error("unsupported lang: "+n),n=n.replace(k,d).toLowerCase(),function(t){var i;do if(i=a?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return i=i.toLowerCase(),i===n||i.indexOf(n+"-")===0;while((t=t.parentNode)&&t.nodeType===1);return!1}}),target:function(t){var i=n.location&&n.location.hash;return i&&i.slice(1)===t.id},root:function(n){return n===l},focus:function(n){return n===e.activeElement&&(!e.hasFocus||e.hasFocus())&&!!(n.type||n.href||~n.tabIndex)},enabled:function(n){return n.disabled===!1},disabled:function(n){return n.disabled===!0},checked:function(n){var t=n.nodeName.toLowerCase();return t==="input"&&!!n.checked||t==="option"&&!!n.selected},selected:function(n){return n.parentNode&&n.parentNode.selectedIndex,n.selected===!0},empty:function(n){for(n=n.firstChild;n;n=n.nextSibling)if(n.nodeType<6)return!1;return!0},parent:function(n){return!t.pseudos.empty(n)},header:function(n){return or.test(n.nodeName)},input:function(n){return er.test(n.nodeName)},button:function(n){var t=n.nodeName.toLowerCase();return t==="input"&&n.type==="button"||t==="button"},text:function(n){var t;return n.nodeName.toLowerCase()==="input"&&n.type==="text"&&((t=n.getAttribute("type"))==null||t.toLowerCase()==="text")},first:tt(function(){return[0]}),last:tt(function(n,t){return[t-1]}),eq:tt(function(n,t,i){return[i<0?i+t:i]}),even:tt(function(n,t){for(var i=0;i<t;i+=2)n.push(i);return n}),odd:tt(function(n,t){for(var i=1;i<t;i+=2)n.push(i);return n}),lt:tt(function(n,t,i){for(var r=i<0?i+t:i;--r>=0;)n.push(r);return n}),gt:tt(function(n,t,i){for(var r=i<0?i+t:i;++r<t;)n.push(r);return n})}};t.pseudos.nth=t.pseudos.eq;for(it in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})t.pseudos[it]=cr(it);for(it in{submit:!0,reset:!0})t.pseudos[it]=lr(it);return bi.prototype=t.filters=t.pseudos,t.setFilters=new bi,et=r.tokenize=function(n,i){var e,f,s,o,u,h,c,l=ci[n+" "];if(l)return i?0:l.slice(0);for(u=n,h=[],c=t.preFilter;u;){(!e||(f=tr.exec(u)))&&(f&&(u=u.slice(f[0].length)||u),h.push(s=[]));e=!1;(f=ir.exec(u))&&(e=f.shift(),s.push({value:e,type:f[0].replace(at," ")}),u=u.slice(e.length));for(o in t.filter)(f=vt[o].exec(u))&&(!c[o]||(f=c[o](f)))&&(e=f.shift(),s.push({value:e,type:o,matches:f}),u=u.slice(e.length));if(!e)break}return i?u.length:u?r.error(n):ci(n,h).slice(0)},wt=r.compile=function(n,t){var r,u=[],e=[],i=li[n+" "];if(!i){for(t||(t=et(n)),r=t.length;r--;)i=ei(t[r]),i[f]?u.push(i):e.push(i);i=li(n,vr(e,u));i.selector=n}return i},si=r.select=function(n,i,r,f){var s,e,o,l,v,c=typeof n=="function"&&n,h=!f&&et(n=c.selector||n);if(r=r||[],h.length===1){if(e=h[0]=h[0].slice(0),e.length>2&&(o=e[0]).type==="ID"&&u.getById&&i.nodeType===9&&a&&t.relative[e[1].type]){if(i=(t.find.ID(o.matches[0].replace(k,d),i)||[])[0],i)c&&(i=i.parentNode);else return r;n=n.slice(e.shift().value.length)}for(s=vt.needsContext.test(n)?0:e.length;s--;){if(o=e[s],t.relative[l=o.type])break;if((v=t.find[l])&&(f=v(o.matches[0].replace(k,d),gt.test(e[0].type)&&ii(i.parentNode)||i))){if(e.splice(s,1),n=f.length&&yt(e),!n)return b.apply(r,f),r;break}}}return(c||wt(n,h))(f,i,!a,r,gt.test(n)&&ii(i.parentNode)||i),r},u.sortStable=f.split("").sort(bt).join("")===f,u.detectDuplicates=!!rt,p(),u.sortDetached=c(function(n){return n.compareDocumentPosition(e.createElement("div"))&1}),c(function(n){return n.innerHTML="<a href='#'><\/a>",n.firstChild.getAttribute("href")==="#"})||ti("type|href|height|width",function(n,t,i){if(!i)return n.getAttribute(t,t.toLowerCase()==="type"?1:2)}),u.attributes&&c(function(n){return n.innerHTML="<input/>",n.firstChild.setAttribute("value",""),n.firstChild.getAttribute("value")===""})||ti("value",function(n,t,i){if(!i&&n.nodeName.toLowerCase()==="input")return n.defaultValue}),c(function(n){return n.getAttribute("disabled")==null})||ti(kt,function(n,t,i){var r;if(!i)return n[t]===!0?t.toLowerCase():(r=n.getAttributeNode(t))&&r.specified?r.value:null}),r}(n);i.find=y;i.expr=y.selectors;i.expr[":"]=i.expr.pseudos;i.unique=y.uniqueSort;i.text=y.getText;i.isXMLDoc=y.isXML;i.contains=y.contains;var di=i.expr.match.needsContext,gi=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,ef=/^.[^:#\[\.,]*$/;i.filter=function(n,t,r){var u=t[0];return r&&(n=":not("+n+")"),t.length===1&&u.nodeType===1?i.find.matchesSelector(u,n)?[u]:[]:i.find.matches(n,i.grep(t,function(n){return n.nodeType===1}))};i.fn.extend({find:function(n){var t,u=this.length,r=[],f=this;if(typeof n!="string")return this.pushStack(i(n).filter(function(){for(t=0;t<u;t++)if(i.contains(f[t],this))return!0}));for(t=0;t<u;t++)i.find(n,f[t],r);return r=this.pushStack(u>1?i.unique(r):r),r.selector=this.selector?this.selector+" "+n:n,r},filter:function(n){return this.pushStack(fi(this,n||[],!1))},not:function(n){return this.pushStack(fi(this,n||[],!0))},is:function(n){return!!fi(this,typeof n=="string"&&di.test(n)?i(n):n||[],!1).length}});nr=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/;tr=i.fn.init=function(n,t){var r,f;if(!n)return this;if(typeof n=="string"){if(r=n[0]==="<"&&n[n.length-1]===">"&&n.length>=3?[null,n,null]:nr.exec(n),r&&(r[1]||!t)){if(r[1]){if(t=t instanceof i?t[0]:t,i.merge(this,i.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:u,!0)),gi.test(r[1])&&i.isPlainObject(t))for(r in t)i.isFunction(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return f=u.getElementById(r[2]),f&&f.parentNode&&(this.length=1,this[0]=f),this.context=u,this.selector=n,this}return!t||t.jquery?(t||st).find(n):this.constructor(t).find(n)}return n.nodeType?(this.context=this[0]=n,this.length=1,this):i.isFunction(n)?typeof st.ready!="undefined"?st.ready(n):n(i):(n.selector!==undefined&&(this.selector=n.selector,this.context=n.context),i.makeArray(n,this))};tr.prototype=i.fn;st=i(u);ir=/^(?:parents|prev(?:Until|All))/;rr={children:!0,contents:!0,next:!0,prev:!0};i.extend({dir:function(n,t,r){for(var u=[],f=r!==undefined;(n=n[t])&&n.nodeType!==9;)if(n.nodeType===1){if(f&&i(n).is(r))break;u.push(n)}return u},sibling:function(n,t){for(var i=[];n;n=n.nextSibling)n.nodeType===1&&n!==t&&i.push(n);return i}});i.fn.extend({has:function(n){var t=i(n,this),r=t.length;return this.filter(function(){for(var n=0;n<r;n++)if(i.contains(this,t[n]))return!0})},closest:function(n,t){for(var r,f=0,o=this.length,u=[],e=di.test(n)||typeof n!="string"?i(n,t||this.context):0;f<o;f++)for(r=this[f];r&&r!==t;r=r.parentNode)if(r.nodeType<11&&(e?e.index(r)>-1:r.nodeType===1&&i.find.matchesSelector(r,n))){u.push(r);break}return this.pushStack(u.length>1?i.unique(u):u)},index:function(n){return n?typeof n=="string"?et.call(i(n),this[0]):et.call(this,n.jquery?n[0]:n):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(n,t){return this.pushStack(i.unique(i.merge(this.get(),i(n,t))))},addBack:function(n){return this.add(n==null?this.prevObject:this.prevObject.filter(n))}});i.each({parent:function(n){var t=n.parentNode;return t&&t.nodeType!==11?t:null},parents:function(n){return i.dir(n,"parentNode")},parentsUntil:function(n,t,r){return i.dir(n,"parentNode",r)},next:function(n){return ur(n,"nextSibling")},prev:function(n){return ur(n,"previousSibling")},nextAll:function(n){return i.dir(n,"nextSibling")},prevAll:function(n){return i.dir(n,"previousSibling")},nextUntil:function(n,t,r){return i.dir(n,"nextSibling",r)},prevUntil:function(n,t,r){return i.dir(n,"previousSibling",r)},siblings:function(n){return i.sibling((n.parentNode||{}).firstChild,n)},children:function(n){return i.sibling(n.firstChild)},contents:function(n){return n.contentDocument||i.merge([],n.childNodes)}},function(n,t){i.fn[n]=function(r,u){var f=i.map(this,t,r);return n.slice(-5)!=="Until"&&(u=r),u&&typeof u=="string"&&(f=i.filter(u,f)),this.length>1&&(rr[n]||i.unique(f),ir.test(n)&&f.reverse()),this.pushStack(f)}});c=/\S+/g;ei={};i.Callbacks=function(n){n=typeof n=="string"?ei[n]||of(n):i.extend({},n);var u,h,o,c,f,e,t=[],r=!n.once&&[],l=function(i){for(u=n.memory&&i,h=!0,e=c||0,c=0,f=t.length,o=!0;t&&e<f;e++)if(t[e].apply(i[0],i[1])===!1&&n.stopOnFalse){u=!1;break}o=!1;t&&(r?r.length&&l(r.shift()):u?t=[]:s.disable())},s={add:function(){if(t){var r=t.length;(function e(r){i.each(r,function(r,u){var f=i.type(u);f==="function"?n.unique&&s.has(u)||t.push(u):u&&u.length&&f!=="string"&&e(u)})})(arguments);o?f=t.length:u&&(c=r,l(u))}return this},remove:function(){return t&&i.each(arguments,function(n,r){for(var u;(u=i.inArray(r,t,u))>-1;)t.splice(u,1),o&&(u<=f&&f--,u<=e&&e--)}),this},has:function(n){return n?i.inArray(n,t)>-1:!!(t&&t.length)},empty:function(){return t=[],f=0,this},disable:function(){return t=r=u=undefined,this},disabled:function(){return!t},lock:function(){return r=undefined,u||s.disable(),this},locked:function(){return!r},fireWith:function(n,i){return t&&(!h||r)&&(i=i||[],i=[n,i.slice?i.slice():i],o?r.push(i):l(i)),this},fire:function(){return s.fireWith(this,arguments),this},fired:function(){return!!h}};return s};i.extend({Deferred:function(n){var u=[["resolve","done",i.Callbacks("once memory"),"resolved"],["reject","fail",i.Callbacks("once memory"),"rejected"],["notify","progress",i.Callbacks("memory")]],f="pending",r={state:function(){return f},always:function(){return t.done(arguments).fail(arguments),this},then:function(){var n=arguments;return i.Deferred(function(f){i.each(u,function(u,e){var o=i.isFunction(n[u])&&n[u];t[e[1]](function(){var n=o&&o.apply(this,arguments);n&&i.isFunction(n.promise)?n.promise().done(f.resolve).fail(f.reject).progress(f.notify):f[e[0]+"With"](this===r?f.promise():this,o?[n]:arguments)})});n=null}).promise()},promise:function(n){return n!=null?i.extend(n,r):r}},t={};return r.pipe=r.then,i.each(u,function(n,i){var e=i[2],o=i[3];r[i[1]]=e.add;o&&e.add(function(){f=o},u[n^1][2].disable,u[2][2].lock);t[i[0]]=function(){return t[i[0]+"With"](this===t?r:this,arguments),this};t[i[0]+"With"]=e.fireWith}),r.promise(t),n&&n.call(t,t),t},when:function(n){var t=0,u=a.call(arguments),r=u.length,e=r!==1||n&&i.isFunction(n.promise)?r:0,f=e===1?n:i.Deferred(),h=function(n,t,i){return function(r){t[n]=this;i[n]=arguments.length>1?a.call(arguments):r;i===o?f.notifyWith(t,i):--e||f.resolveWith(t,i)}},o,c,s;if(r>1)for(o=new Array(r),c=new Array(r),s=new Array(r);t<r;t++)u[t]&&i.isFunction(u[t].promise)?u[t].promise().done(h(t,s,u)).fail(f.reject).progress(h(t,c,o)):--e;return e||f.resolveWith(s,u),f.promise()}});i.fn.ready=function(n){return i.ready.promise().done(n),this};i.extend({isReady:!1,readyWait:1,holdReady:function(n){n?i.readyWait++:i.ready(!0)},ready:function(n){(n===!0?--i.readyWait:i.isReady)||(i.isReady=!0,n!==!0&&--i.readyWait>0)||(ht.resolveWith(u,[i]),i.fn.triggerHandler&&(i(u).triggerHandler("ready"),i(u).off("ready")))}});i.ready.promise=function(t){return ht||(ht=i.Deferred(),u.readyState==="complete"?setTimeout(i.ready):(u.addEventListener("DOMContentLoaded",ct,!1),n.addEventListener("load",ct,!1))),ht.promise(t)};i.ready.promise();l=i.access=function(n,t,r,u,f,e,o){var s=0,c=n.length,h=r==null;if(i.type(r)==="object"){f=!0;for(s in r)i.access(n,t,s,r[s],!0,e,o)}else if(u!==undefined&&(f=!0,i.isFunction(u)||(o=!0),h&&(o?(t.call(n,u),t=null):(h=t,t=function(n,t,r){return h.call(i(n),r)})),t))for(;s<c;s++)t(n[s],r,o?u:u.call(n[s],s,t(n[s],r)));return f?n:h?t.call(n):c?t(n[0],r):e};i.acceptData=function(n){return n.nodeType===1||n.nodeType===9||!+n.nodeType};p.uid=1;p.accepts=i.acceptData;p.prototype={key:function(n){if(!p.accepts(n))return 0;var r={},t=n[this.expando];if(!t){t=p.uid++;try{r[this.expando]={value:t};Object.defineProperties(n,r)}catch(u){r[this.expando]=t;i.extend(n,r)}}return this.cache[t]||(this.cache[t]={}),t},set:function(n,t,r){var f,e=this.key(n),u=this.cache[e];if(typeof t=="string")u[t]=r;else if(i.isEmptyObject(u))i.extend(this.cache[e],t);else for(f in t)u[f]=t[f];return u},get:function(n,t){var i=this.cache[this.key(n)];return t===undefined?i:i[t]},access:function(n,t,r){var u;return t===undefined||t&&typeof t=="string"&&r===undefined?(u=this.get(n,t),u!==undefined?u:this.get(n,i.camelCase(t))):(this.set(n,t,r),r!==undefined?r:t)},remove:function(n,t){var u,r,f,o=this.key(n),e=this.cache[o];if(t===undefined)this.cache[o]={};else for(i.isArray(t)?r=t.concat(t.map(i.camelCase)):(f=i.camelCase(t),t in e?r=[t,f]:(r=f,r=r in e?[r]:r.match(c)||[])),u=r.length;u--;)delete e[r[u]]},hasData:function(n){return!i.isEmptyObject(this.cache[n[this.expando]]||{})},discard:function(n){n[this.expando]&&delete this.cache[n[this.expando]]}};var r=new p,e=new p,sf=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,hf=/([A-Z])/g;i.extend({hasData:function(n){return e.hasData(n)||r.hasData(n)},data:function(n,t,i){return e.access(n,t,i)},removeData:function(n,t){e.remove(n,t)},_data:function(n,t,i){return r.access(n,t,i)},_removeData:function(n,t){r.remove(n,t)}});i.fn.extend({data:function(n,t){var o,f,s,u=this[0],h=u&&u.attributes;if(n===undefined){if(this.length&&(s=e.get(u),u.nodeType===1&&!r.get(u,"hasDataAttrs"))){for(o=h.length;o--;)h[o]&&(f=h[o].name,f.indexOf("data-")===0&&(f=i.camelCase(f.slice(5)),fr(u,f,s[f])));r.set(u,"hasDataAttrs",!0)}return s}return typeof n=="object"?this.each(function(){e.set(this,n)}):l(this,function(t){var r,f=i.camelCase(n);if(u&&t===undefined)return(r=e.get(u,n),r!==undefined)?r:(r=e.get(u,f),r!==undefined)?r:(r=fr(u,f,undefined),r!==undefined)?r:void 0;this.each(function(){var i=e.get(this,f);e.set(this,f,t);n.indexOf("-")!==-1&&i!==undefined&&e.set(this,n,t)})},null,t,arguments.length>1,null,!0)},removeData:function(n){return this.each(function(){e.remove(this,n)})}});i.extend({queue:function(n,t,u){var f;if(n)return t=(t||"fx")+"queue",f=r.get(n,t),u&&(!f||i.isArray(u)?f=r.access(n,t,i.makeArray(u)):f.push(u)),f||[]},dequeue:function(n,t){t=t||"fx";var r=i.queue(n,t),e=r.length,u=r.shift(),f=i._queueHooks(n,t),o=function(){i.dequeue(n,t)};u==="inprogress"&&(u=r.shift(),e--);u&&(t==="fx"&&r.unshift("inprogress"),delete f.stop,u.call(n,o,f));!e&&f&&f.empty.fire()},_queueHooks:function(n,t){var u=t+"queueHooks";return r.get(n,u)||r.access(n,u,{empty:i.Callbacks("once memory").add(function(){r.remove(n,[t+"queue",u])})})}});i.fn.extend({queue:function(n,t){var r=2;return(typeof n!="string"&&(t=n,n="fx",r--),arguments.length<r)?i.queue(this[0],n):t===undefined?this:this.each(function(){var r=i.queue(this,n,t);i._queueHooks(this,n);n==="fx"&&r[0]!=="inprogress"&&i.dequeue(this,n)})},dequeue:function(n){return this.each(function(){i.dequeue(this,n)})},clearQueue:function(n){return this.queue(n||"fx",[])},promise:function(n,t){var u,e=1,o=i.Deferred(),f=this,s=this.length,h=function(){--e||o.resolveWith(f,[f])};for(typeof n!="string"&&(t=n,n=undefined),n=n||"fx";s--;)u=r.get(f[s],n+"queueHooks"),u&&u.empty&&(e++,u.empty.add(h));return h(),o.promise(t)}});var lt=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,w=["Top","Right","Bottom","Left"],it=function(n,t){return n=t||n,i.css(n,"display")==="none"||!i.contains(n.ownerDocument,n)},er=/^(?:checkbox|radio)$/i;(function(){var i=u.createDocumentFragment(),n=i.appendChild(u.createElement("div")),t=u.createElement("input");t.setAttribute("type","radio");t.setAttribute("checked","checked");t.setAttribute("name","t");n.appendChild(t);f.checkClone=n.cloneNode(!0).cloneNode(!0).lastChild.checked;n.innerHTML="<textarea>x<\/textarea>";f.noCloneChecked=!!n.cloneNode(!0).lastChild.defaultValue})();d=typeof undefined;f.focusinBubbles="onfocusin"in n;var cf=/^key/,lf=/^(?:mouse|pointer|contextmenu)|click/,or=/^(?:focusinfocus|focusoutblur)$/,sr=/^([^.]*)(?:\.(.+)|)$/;i.event={global:{},add:function(n,t,u,f,e){var v,y,w,p,b,h,s,l,o,k,g,a=r.get(n);if(a)for(u.handler&&(v=u,u=v.handler,e=v.selector),u.guid||(u.guid=i.guid++),(p=a.events)||(p=a.events={}),(y=a.handle)||(y=a.handle=function(t){return typeof i!==d&&i.event.triggered!==t.type?i.event.dispatch.apply(n,arguments):undefined}),t=(t||"").match(c)||[""],b=t.length;b--;)(w=sr.exec(t[b])||[],o=g=w[1],k=(w[2]||"").split(".").sort(),o)&&(s=i.event.special[o]||{},o=(e?s.delegateType:s.bindType)||o,s=i.event.special[o]||{},h=i.extend({type:o,origType:g,data:f,handler:u,guid:u.guid,selector:e,needsContext:e&&i.expr.match.needsContext.test(e),namespace:k.join(".")},v),(l=p[o])||(l=p[o]=[],l.delegateCount=0,s.setup&&s.setup.call(n,f,k,y)!==!1||n.addEventListener&&n.addEventListener(o,y,!1)),s.add&&(s.add.call(n,h),h.handler.guid||(h.handler.guid=u.guid)),e?l.splice(l.delegateCount++,0,h):l.push(h),i.event.global[o]=!0)},remove:function(n,t,u,f,e){var p,k,h,v,w,s,l,a,o,b,d,y=r.hasData(n)&&r.get(n);if(y&&(v=y.events)){for(t=(t||"").match(c)||[""],w=t.length;w--;){if(h=sr.exec(t[w])||[],o=d=h[1],b=(h[2]||"").split(".").sort(),!o){for(o in v)i.event.remove(n,o+t[w],u,f,!0);continue}for(l=i.event.special[o]||{},o=(f?l.delegateType:l.bindType)||o,a=v[o]||[],h=h[2]&&new RegExp("(^|\\.)"+b.join("\\.(?:.*\\.|)")+"(\\.|$)"),k=p=a.length;p--;)s=a[p],(e||d===s.origType)&&(!u||u.guid===s.guid)&&(!h||h.test(s.namespace))&&(!f||f===s.selector||f==="**"&&s.selector)&&(a.splice(p,1),s.selector&&a.delegateCount--,l.remove&&l.remove.call(n,s));k&&!a.length&&(l.teardown&&l.teardown.call(n,b,y.handle)!==!1||i.removeEvent(n,o,y.handle),delete v[o])}i.isEmptyObject(v)&&(delete y.handle,r.remove(n,"events"))}},trigger:function(t,f,e,o){var w,s,c,b,a,v,l,p=[e||u],h=ri.call(t,"type")?t.type:t,y=ri.call(t,"namespace")?t.namespace.split("."):[];if((s=c=e=e||u,e.nodeType!==3&&e.nodeType!==8)&&!or.test(h+i.event.triggered)&&(h.indexOf(".")>=0&&(y=h.split("."),h=y.shift(),y.sort()),a=h.indexOf(":")<0&&"on"+h,t=t[i.expando]?t:new i.Event(h,typeof t=="object"&&t),t.isTrigger=o?2:3,t.namespace=y.join("."),t.namespace_re=t.namespace?new RegExp("(^|\\.)"+y.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=undefined,t.target||(t.target=e),f=f==null?[t]:i.makeArray(f,[t]),l=i.event.special[h]||{},o||!l.trigger||l.trigger.apply(e,f)!==!1)){if(!o&&!l.noBubble&&!i.isWindow(e)){for(b=l.delegateType||h,or.test(b+h)||(s=s.parentNode);s;s=s.parentNode)p.push(s),c=s;c===(e.ownerDocument||u)&&p.push(c.defaultView||c.parentWindow||n)}for(w=0;(s=p[w++])&&!t.isPropagationStopped();)t.type=w>1?b:l.bindType||h,v=(r.get(s,"events")||{})[t.type]&&r.get(s,"handle"),v&&v.apply(s,f),v=a&&s[a],v&&v.apply&&i.acceptData(s)&&(t.result=v.apply(s,f),t.result===!1&&t.preventDefault());return t.type=h,o||t.isDefaultPrevented()||(!l._default||l._default.apply(p.pop(),f)===!1)&&i.acceptData(e)&&a&&i.isFunction(e[h])&&!i.isWindow(e)&&(c=e[a],c&&(e[a]=null),i.event.triggered=h,e[h](),i.event.triggered=undefined,c&&(e[a]=c)),t.result}},dispatch:function(n){n=i.event.fix(n);var o,s,e,u,t,h=[],c=a.call(arguments),l=(r.get(this,"events")||{})[n.type]||[],f=i.event.special[n.type]||{};if(c[0]=n,n.delegateTarget=this,!f.preDispatch||f.preDispatch.call(this,n)!==!1){for(h=i.event.handlers.call(this,n,l),o=0;(u=h[o++])&&!n.isPropagationStopped();)for(n.currentTarget=u.elem,s=0;(t=u.handlers[s++])&&!n.isImmediatePropagationStopped();)(!n.namespace_re||n.namespace_re.test(t.namespace))&&(n.handleObj=t,n.data=t.data,e=((i.event.special[t.origType]||{}).handle||t.handler).apply(u.elem,c),e!==undefined&&(n.result=e)===!1&&(n.preventDefault(),n.stopPropagation()));return f.postDispatch&&f.postDispatch.call(this,n),n.result}},handlers:function(n,t){var e,u,f,o,h=[],s=t.delegateCount,r=n.target;if(s&&r.nodeType&&(!n.button||n.type!=="click"))for(;r!==this;r=r.parentNode||this)if(r.disabled!==!0||n.type!=="click"){for(u=[],e=0;e<s;e++)o=t[e],f=o.selector+" ",u[f]===undefined&&(u[f]=o.needsContext?i(f,this).index(r)>=0:i.find(f,this,null,[r]).length),u[f]&&u.push(o);u.length&&h.push({elem:r,handlers:u})}return s<t.length&&h.push({elem:this,handlers:t.slice(s)}),h},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(n,t){return n.which==null&&(n.which=t.charCode!=null?t.charCode:t.keyCode),n}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(n,t){var e,i,r,f=t.button;return n.pageX==null&&t.clientX!=null&&(e=n.target.ownerDocument||u,i=e.documentElement,r=e.body,n.pageX=t.clientX+(i&&i.scrollLeft||r&&r.scrollLeft||0)-(i&&i.clientLeft||r&&r.clientLeft||0),n.pageY=t.clientY+(i&&i.scrollTop||r&&r.scrollTop||0)-(i&&i.clientTop||r&&r.clientTop||0)),n.which||f===undefined||(n.which=f&1?1:f&2?3:f&4?2:0),n}},fix:function(n){if(n[i.expando])return n;var f,e,o,r=n.type,s=n,t=this.fixHooks[r];for(t||(this.fixHooks[r]=t=lf.test(r)?this.mouseHooks:cf.test(r)?this.keyHooks:{}),o=t.props?this.props.concat(t.props):this.props,n=new i.Event(s),f=o.length;f--;)e=o[f],n[e]=s[e];return n.target||(n.target=u),n.target.nodeType===3&&(n.target=n.target.parentNode),t.filter?t.filter(n,s):n},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==hr()&&this.focus)return this.focus(),!1},delegateType:"focusin"},blur:{trigger:function(){if(this===hr()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if(this.type==="checkbox"&&this.click&&i.nodeName(this,"input"))return this.click(),!1},_default:function(n){return i.nodeName(n.target,"a")}},beforeunload:{postDispatch:function(n){n.result!==undefined&&n.originalEvent&&(n.originalEvent.returnValue=n.result)}}},simulate:function(n,t,r,u){var f=i.extend(new i.Event,r,{type:n,isSimulated:!0,originalEvent:{}});u?i.event.trigger(f,null,t):i.event.dispatch.call(t,f);f.isDefaultPrevented()&&r.preventDefault()}};i.removeEvent=function(n,t,i){n.removeEventListener&&n.removeEventListener(t,i,!1)};i.Event=function(n,t){if(!(this instanceof i.Event))return new i.Event(n,t);n&&n.type?(this.originalEvent=n,this.type=n.type,this.isDefaultPrevented=n.defaultPrevented||n.defaultPrevented===undefined&&n.returnValue===!1?at:g):this.type=n;t&&i.extend(this,t);this.timeStamp=n&&n.timeStamp||i.now();this[i.expando]=!0};i.Event.prototype={isDefaultPrevented:g,isPropagationStopped:g,isImmediatePropagationStopped:g,preventDefault:function(){var n=this.originalEvent;this.isDefaultPrevented=at;n&&n.preventDefault&&n.preventDefault()},stopPropagation:function(){var n=this.originalEvent;this.isPropagationStopped=at;n&&n.stopPropagation&&n.stopPropagation()},stopImmediatePropagation:function(){var n=this.originalEvent;this.isImmediatePropagationStopped=at;n&&n.stopImmediatePropagation&&n.stopImmediatePropagation();this.stopPropagation()}};i.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(n,t){i.event.special[n]={delegateType:t,bindType:t,handle:function(n){var u,f=this,r=n.relatedTarget,e=n.handleObj;return r&&(r===f||i.contains(f,r))||(n.type=e.origType,u=e.handler.apply(this,arguments),n.type=t),u}}});f.focusinBubbles||i.each({focus:"focusin",blur:"focusout"},function(n,t){var u=function(n){i.event.simulate(t,n.target,i.event.fix(n),!0)};i.event.special[t]={setup:function(){var i=this.ownerDocument||this,f=r.access(i,t);f||i.addEventListener(n,u,!0);r.access(i,t,(f||0)+1)},teardown:function(){var i=this.ownerDocument||this,f=r.access(i,t)-1;f?r.access(i,t,f):(i.removeEventListener(n,u,!0),r.remove(i,t))}}});i.fn.extend({on:function(n,t,r,u,f){var e,o;if(typeof n=="object"){typeof t!="string"&&(r=r||t,t=undefined);for(o in n)this.on(o,t,r,n[o],f);return this}if(r==null&&u==null?(u=t,r=t=undefined):u==null&&(typeof t=="string"?(u=r,r=undefined):(u=r,r=t,t=undefined)),u===!1)u=g;else if(!u)return this;return f===1&&(e=u,u=function(n){return i().off(n),e.apply(this,arguments)},u.guid=e.guid||(e.guid=i.guid++)),this.each(function(){i.event.add(this,n,u,r,t)})},one:function(n,t,i,r){return this.on(n,t,i,r,1)},off:function(n,t,r){var u,f;if(n&&n.preventDefault&&n.handleObj)return u=n.handleObj,i(n.delegateTarget).off(u.namespace?u.origType+"."+u.namespace:u.origType,u.selector,u.handler),this;if(typeof n=="object"){for(f in n)this.off(f,t,n[f]);return this}return(t===!1||typeof t=="function")&&(r=t,t=undefined),r===!1&&(r=g),this.each(function(){i.event.remove(this,n,r,t)})},trigger:function(n,t){return this.each(function(){i.event.trigger(n,t,this)})},triggerHandler:function(n,t){var r=this[0];if(r)return i.event.trigger(n,t,r,!0)}});var cr=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,lr=/<([\w:]+)/,af=/<|&#?\w+;/,vf=/<(?:script|style|link)/i,yf=/checked\s*(?:[^=]|=\s*.checked.)/i,ar=/^$|\/(?:java|ecma)script/i,pf=/^true\/(.*)/,wf=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,h={option:[1,"<select multiple='multiple'>","<\/select>"],thead:[1,"<table>","<\/table>"],col:[2,"<table><colgroup>","<\/colgroup><\/table>"],tr:[2,"<table><tbody>","<\/tbody><\/table>"],td:[3,"<table><tbody><tr>","<\/tr><\/tbody><\/table>"],_default:[0,"",""]};h.optgroup=h.option;h.tbody=h.tfoot=h.colgroup=h.caption=h.thead;h.th=h.td;i.extend({clone:function(n,t,r){var u,c,s,e,h=n.cloneNode(!0),l=i.contains(n.ownerDocument,n);if(!f.noCloneChecked&&(n.nodeType===1||n.nodeType===11)&&!i.isXMLDoc(n))for(e=o(h),s=o(n),u=0,c=s.length;u<c;u++)df(s[u],e[u]);if(t)if(r)for(s=s||o(n),e=e||o(h),u=0,c=s.length;u<c;u++)yr(s[u],e[u]);else yr(n,h);return e=o(h,"script"),e.length>0&&oi(e,!l&&o(n,"script")),h},buildFragment:function(n,t,r,u){for(var f,e,y,l,p,a,s=t.createDocumentFragment(),v=[],c=0,w=n.length;c<w;c++)if(f=n[c],f||f===0)if(i.type(f)==="object")i.merge(v,f.nodeType?[f]:f);else if(af.test(f)){for(e=e||s.appendChild(t.createElement("div")),y=(lr.exec(f)||["",""])[1].toLowerCase(),l=h[y]||h._default,e.innerHTML=l[1]+f.replace(cr,"<$1><\/$2>")+l[2],a=l[0];a--;)e=e.lastChild;i.merge(v,e.childNodes);e=s.firstChild;e.textContent=""}else v.push(t.createTextNode(f));for(s.textContent="",c=0;f=v[c++];)if((!u||i.inArray(f,u)===-1)&&(p=i.contains(f.ownerDocument,f),e=o(s.appendChild(f),"script"),p&&oi(e),r))for(a=0;f=e[a++];)ar.test(f.type||"")&&r.push(f);return s},cleanData:function(n){for(var f,t,o,u,h=i.event.special,s=0;(t=n[s])!==undefined;s++){if(i.acceptData(t)&&(u=t[r.expando],u&&(f=r.cache[u]))){if(f.events)for(o in f.events)h[o]?i.event.remove(t,o):i.removeEvent(t,o,f.handle);r.cache[u]&&delete r.cache[u]}delete e.cache[t[e.expando]]}}});i.fn.extend({text:function(n){return l(this,function(n){return n===undefined?i.text(this):this.empty().each(function(){(this.nodeType===1||this.nodeType===11||this.nodeType===9)&&(this.textContent=n)})},null,n,arguments.length)},append:function(){return this.domManip(arguments,function(n){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var t=vr(this,n);t.appendChild(n)}})},prepend:function(){return this.domManip(arguments,function(n){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var t=vr(this,n);t.insertBefore(n,t.firstChild)}})},before:function(){return this.domManip(arguments,function(n){this.parentNode&&this.parentNode.insertBefore(n,this)})},after:function(){return this.domManip(arguments,function(n){this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling)})},remove:function(n,t){for(var r,f=n?i.filter(n,this):this,u=0;(r=f[u])!=null;u++)t||r.nodeType!==1||i.cleanData(o(r)),r.parentNode&&(t&&i.contains(r.ownerDocument,r)&&oi(o(r,"script")),r.parentNode.removeChild(r));return this},empty:function(){for(var n,t=0;(n=this[t])!=null;t++)n.nodeType===1&&(i.cleanData(o(n,!1)),n.textContent="");return this},clone:function(n,t){return n=n==null?!1:n,t=t==null?n:t,this.map(function(){return i.clone(this,n,t)})},html:function(n){return l(this,function(n){var t=this[0]||{},r=0,u=this.length;if(n===undefined&&t.nodeType===1)return t.innerHTML;if(typeof n=="string"&&!vf.test(n)&&!h[(lr.exec(n)||["",""])[1].toLowerCase()]){n=n.replace(cr,"<$1><\/$2>");try{for(;r<u;r++)t=this[r]||{},t.nodeType===1&&(i.cleanData(o(t,!1)),t.innerHTML=n);t=0}catch(f){}}t&&this.empty().append(n)},null,n,arguments.length)},replaceWith:function(){var n=arguments[0];return this.domManip(arguments,function(t){n=this.parentNode;i.cleanData(o(this));n&&n.replaceChild(t,this)}),n&&(n.length||n.nodeType)?this:this.remove()},detach:function(n){return this.remove(n,!0)},domManip:function(n,t){n=bi.apply([],n);var h,v,s,c,u,y,e=0,l=this.length,w=this,b=l-1,a=n[0],p=i.isFunction(a);if(p||l>1&&typeof a=="string"&&!f.checkClone&&yf.test(a))return this.each(function(i){var r=w.eq(i);p&&(n[0]=a.call(this,i,r.html()));r.domManip(n,t)});if(l&&(h=i.buildFragment(n,this[0].ownerDocument,!1,this),v=h.firstChild,h.childNodes.length===1&&(h=v),v)){for(s=i.map(o(h,"script"),bf),c=s.length;e<l;e++)u=h,e!==b&&(u=i.clone(u,!0,!0),c&&i.merge(s,o(u,"script"))),t.call(this[e],u,e);if(c)for(y=s[s.length-1].ownerDocument,i.map(s,kf),e=0;e<c;e++)u=s[e],ar.test(u.type||"")&&!r.access(u,"globalEval")&&i.contains(y,u)&&(u.src?i._evalUrl&&i._evalUrl(u.src):i.globalEval(u.textContent.replace(wf,"")))}return this}});i.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(n,t){i.fn[n]=function(n){for(var u,f=[],e=i(n),o=e.length-1,r=0;r<=o;r++)u=r===o?this:this.clone(!0),i(e[r])[t](u),ii.apply(f,u.get());return this.pushStack(f)}});si={};var wr=/^margin/,ci=new RegExp("^("+lt+")(?!px)[a-z%]+$","i"),yt=function(n){return n.ownerDocument.defaultView.getComputedStyle(n,null)};(function(){function h(){t.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute";t.innerHTML="";e.appendChild(r);var i=n.getComputedStyle(t,null);s=i.top!=="1%";o=i.width==="4px";e.removeChild(r)}var s,o,e=u.documentElement,r=u.createElement("div"),t=u.createElement("div");t.style&&(t.style.backgroundClip="content-box",t.cloneNode(!0).style.backgroundClip="",f.clearCloneStyle=t.style.backgroundClip==="content-box",r.style.cssText="border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;position:absolute",r.appendChild(t),n.getComputedStyle&&i.extend(f,{pixelPosition:function(){return h(),s},boxSizingReliable:function(){return o==null&&h(),o},reliableMarginRight:function(){var f,i=t.appendChild(u.createElement("div"));return i.style.cssText=t.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",i.style.marginRight=i.style.width="0",t.style.width="1px",e.appendChild(r),f=!parseFloat(n.getComputedStyle(i,null).marginRight),e.removeChild(r),f}}))})();i.swap=function(n,t,i,r){var f,u,e={};for(u in t)e[u]=n.style[u],n.style[u]=t[u];f=i.apply(n,r||[]);for(u in t)n.style[u]=e[u];return f};var gf=/^(none|table(?!-c[ea]).+)/,ne=new RegExp("^("+lt+")(.*)$","i"),te=new RegExp("^([+-])=("+lt+")","i"),ie={position:"absolute",visibility:"hidden",display:"block"},kr={letterSpacing:"0",fontWeight:"400"},dr=["Webkit","O","Moz","ms"];i.extend({cssHooks:{opacity:{get:function(n,t){if(t){var i=rt(n,"opacity");return i===""?"1":i}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{float:"cssFloat"},style:function(n,t,r,u){if(n&&n.nodeType!==3&&n.nodeType!==8&&n.style){var o,h,e,s=i.camelCase(t),c=n.style;if(t=i.cssProps[s]||(i.cssProps[s]=gr(c,s)),e=i.cssHooks[t]||i.cssHooks[s],r!==undefined){if(h=typeof r,h==="string"&&(o=te.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(i.css(n,t)),h="number"),r==null||r!==r)return;h!=="number"||i.cssNumber[s]||(r+="px");f.clearCloneStyle||r!==""||t.indexOf("background")!==0||(c[t]="inherit");e&&"set"in e&&(r=e.set(n,r,u))===undefined||(c[t]=r)}else return e&&"get"in e&&(o=e.get(n,!1,u))!==undefined?o:c[t]}},css:function(n,t,r,u){var f,s,e,o=i.camelCase(t);return(t=i.cssProps[o]||(i.cssProps[o]=gr(n.style,o)),e=i.cssHooks[t]||i.cssHooks[o],e&&"get"in e&&(f=e.get(n,!0,r)),f===undefined&&(f=rt(n,t,u)),f==="normal"&&t in kr&&(f=kr[t]),r===""||r)?(s=parseFloat(f),r===!0||i.isNumeric(s)?s||0:f):f}});i.each(["height","width"],function(n,t){i.cssHooks[t]={get:function(n,r,u){if(r)return gf.test(i.css(n,"display"))&&n.offsetWidth===0?i.swap(n,ie,function(){return iu(n,t,u)}):iu(n,t,u)},set:function(n,r,u){var f=u&&yt(n);return nu(n,r,u?tu(n,t,u,i.css(n,"boxSizing",!1,f)==="border-box",f):0)}}});i.cssHooks.marginRight=br(f.reliableMarginRight,function(n,t){if(t)return i.swap(n,{display:"inline-block"},rt,[n,"marginRight"])});i.each({margin:"",padding:"",border:"Width"},function(n,t){i.cssHooks[n+t]={expand:function(i){for(var r=0,f={},u=typeof i=="string"?i.split(" "):[i];r<4;r++)f[n+w[r]+t]=u[r]||u[r-2]||u[0];return f}};wr.test(n)||(i.cssHooks[n+t].set=nu)});i.fn.extend({css:function(n,t){return l(this,function(n,t,r){var f,e,o={},u=0;if(i.isArray(t)){for(f=yt(n),e=t.length;u<e;u++)o[t[u]]=i.css(n,t[u],!1,f);return o}return r!==undefined?i.style(n,t,r):i.css(n,t)},n,t,arguments.length>1)},show:function(){return ru(this,!0)},hide:function(){return ru(this)},toggle:function(n){return typeof n=="boolean"?n?this.show():this.hide():this.each(function(){it(this)?i(this).show():i(this).hide()})}});i.Tween=s;s.prototype={constructor:s,init:function(n,t,r,u,f,e){this.elem=n;this.prop=r;this.easing=f||"swing";this.options=t;this.start=this.now=this.cur();this.end=u;this.unit=e||(i.cssNumber[r]?"":"px")},cur:function(){var n=s.propHooks[this.prop];return n&&n.get?n.get(this):s.propHooks._default.get(this)},run:function(n){var t,r=s.propHooks[this.prop];return this.pos=this.options.duration?t=i.easing[this.easing](n,this.options.duration*n,0,1,this.options.duration):t=n,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),r&&r.set?r.set(this):s.propHooks._default.set(this),this}};s.prototype.init.prototype=s.prototype;s.propHooks={_default:{get:function(n){var t;return n.elem[n.prop]!=null&&(!n.elem.style||n.elem.style[n.prop]==null)?n.elem[n.prop]:(t=i.css(n.elem,n.prop,""),!t||t==="auto"?0:t)},set:function(n){i.fx.step[n.prop]?i.fx.step[n.prop](n):n.elem.style&&(n.elem.style[i.cssProps[n.prop]]!=null||i.cssHooks[n.prop])?i.style(n.elem,n.prop,n.now+n.unit):n.elem[n.prop]=n.now}}};s.propHooks.scrollTop=s.propHooks.scrollLeft={set:function(n){n.elem.nodeType&&n.elem.parentNode&&(n.elem[n.prop]=n.now)}};i.easing={linear:function(n){return n},swing:function(n){return.5-Math.cos(n*Math.PI)/2}};i.fx=s.prototype.init;i.fx.step={};var nt,pt,re=/^(?:toggle|show|hide)$/,uu=new RegExp("^(?:([+-])=|)("+lt+")([a-z%]*)$","i"),ue=/queueHooks$/,wt=[fe],ut={"*":[function(n,t){var f=this.createTween(n,t),s=f.cur(),u=uu.exec(t),e=u&&u[3]||(i.cssNumber[n]?"":"px"),r=(i.cssNumber[n]||e!=="px"&&+s)&&uu.exec(i.css(f.elem,n)),o=1,h=20;if(r&&r[3]!==e){e=e||r[3];u=u||[];r=+s||1;do o=o||".5",r=r/o,i.style(f.elem,n,r+e);while(o!==(o=f.cur()/s)&&o!==1&&--h)}return u&&(r=f.start=+r||+s||0,f.unit=e,f.end=u[1]?r+(u[1]+1)*u[2]:+u[2]),f}]};i.Animation=i.extend(ou,{tweener:function(n,t){i.isFunction(n)?(t=n,n=["*"]):n=n.split(" ");for(var r,u=0,f=n.length;u<f;u++)r=n[u],ut[r]=ut[r]||[],ut[r].unshift(t)},prefilter:function(n,t){t?wt.unshift(n):wt.push(n)}});i.speed=function(n,t,r){var u=n&&typeof n=="object"?i.extend({},n):{complete:r||!r&&t||i.isFunction(n)&&n,duration:n,easing:r&&t||t&&!i.isFunction(t)&&t};return u.duration=i.fx.off?0:typeof u.duration=="number"?u.duration:u.duration in i.fx.speeds?i.fx.speeds[u.duration]:i.fx.speeds._default,(u.queue==null||u.queue===!0)&&(u.queue="fx"),u.old=u.complete,u.complete=function(){i.isFunction(u.old)&&u.old.call(this);u.queue&&i.dequeue(this,u.queue)},u};i.fn.extend({fadeTo:function(n,t,i,r){return this.filter(it).css("opacity",0).show().end().animate({opacity:t},n,i,r)},animate:function(n,t,u,f){var s=i.isEmptyObject(n),o=i.speed(t,u,f),e=function(){var t=ou(this,i.extend({},n),o);(s||r.get(this,"finish"))&&t.stop(!0)};return e.finish=e,s||o.queue===!1?this.each(e):this.queue(o.queue,e)},stop:function(n,t,u){var f=function(n){var t=n.stop;delete n.stop;t(u)};return typeof n!="string"&&(u=t,t=n,n=undefined),t&&n!==!1&&this.queue(n||"fx",[]),this.each(function(){var s=!0,t=n!=null&&n+"queueHooks",o=i.timers,e=r.get(this);if(t)e[t]&&e[t].stop&&f(e[t]);else for(t in e)e[t]&&e[t].stop&&ue.test(t)&&f(e[t]);for(t=o.length;t--;)o[t].elem===this&&(n==null||o[t].queue===n)&&(o[t].anim.stop(u),s=!1,o.splice(t,1));(s||!u)&&i.dequeue(this,n)})},finish:function(n){return n!==!1&&(n=n||"fx"),this.each(function(){var t,e=r.get(this),u=e[n+"queue"],o=e[n+"queueHooks"],f=i.timers,s=u?u.length:0;for(e.finish=!0,i.queue(this,n,[]),o&&o.stop&&o.stop.call(this,!0),t=f.length;t--;)f[t].elem===this&&f[t].queue===n&&(f[t].anim.stop(!0),f.splice(t,1));for(t=0;t<s;t++)u[t]&&u[t].finish&&u[t].finish.call(this);delete e.finish})}});i.each(["toggle","show","hide"],function(n,t){var r=i.fn[t];i.fn[t]=function(n,i,u){return n==null||typeof n=="boolean"?r.apply(this,arguments):this.animate(bt(t,!0),n,i,u)}});i.each({slideDown:bt("show"),slideUp:bt("hide"),slideToggle:bt("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(n,t){i.fn[n]=function(n,i,r){return this.animate(t,n,i,r)}});i.timers=[];i.fx.tick=function(){var r,n=0,t=i.timers;for(nt=i.now();n<t.length;n++)r=t[n],r()||t[n]!==r||t.splice(n--,1);t.length||i.fx.stop();nt=undefined};i.fx.timer=function(n){i.timers.push(n);n()?i.fx.start():i.timers.pop()};i.fx.interval=13;i.fx.start=function(){pt||(pt=setInterval(i.fx.tick,i.fx.interval))};i.fx.stop=function(){clearInterval(pt);pt=null};i.fx.speeds={slow:600,fast:200,_default:400};i.fn.delay=function(n,t){return n=i.fx?i.fx.speeds[n]||n:n,t=t||"fx",this.queue(t,function(t,i){var r=setTimeout(t,n);i.stop=function(){clearTimeout(r)}})},function(){var n=u.createElement("input"),t=u.createElement("select"),i=t.appendChild(u.createElement("option"));n.type="checkbox";f.checkOn=n.value!=="";f.optSelected=i.selected;t.disabled=!0;f.optDisabled=!i.disabled;n=u.createElement("input");n.value="t";n.type="radio";f.radioValue=n.value==="t"}();tt=i.expr.attrHandle;i.fn.extend({attr:function(n,t){return l(this,i.attr,n,t,arguments.length>1)},removeAttr:function(n){return this.each(function(){i.removeAttr(this,n)})}});i.extend({attr:function(n,t,r){var u,f,e=n.nodeType;if(n&&e!==3&&e!==8&&e!==2){if(typeof n.getAttribute===d)return i.prop(n,t,r);if(e===1&&i.isXMLDoc(n)||(t=t.toLowerCase(),u=i.attrHooks[t]||(i.expr.match.bool.test(t)?su:oe)),r!==undefined)if(r===null)i.removeAttr(n,t);else return u&&"set"in u&&(f=u.set(n,r,t))!==undefined?f:(n.setAttribute(t,r+""),r);else return u&&"get"in u&&(f=u.get(n,t))!==null?f:(f=i.find.attr(n,t),f==null?undefined:f)}},removeAttr:function(n,t){var r,u,e=0,f=t&&t.match(c);if(f&&n.nodeType===1)while(r=f[e++])u=i.propFix[r]||r,i.expr.match.bool.test(r)&&(n[u]=!1),n.removeAttribute(r)},attrHooks:{type:{set:function(n,t){if(!f.radioValue&&t==="radio"&&i.nodeName(n,"input")){var r=n.value;return n.setAttribute("type",t),r&&(n.value=r),t}}}}});su={set:function(n,t,r){return t===!1?i.removeAttr(n,r):n.setAttribute(r,r),r}};i.each(i.expr.match.bool.source.match(/\w+/g),function(n,t){var r=tt[t]||i.find.attr;tt[t]=function(n,t,i){var u,f;return i||(f=tt[t],tt[t]=u,u=r(n,t,i)!=null?t.toLowerCase():null,tt[t]=f),u}});hu=/^(?:input|select|textarea|button)$/i;i.fn.extend({prop:function(n,t){return l(this,i.prop,n,t,arguments.length>1)},removeProp:function(n){return this.each(function(){delete this[i.propFix[n]||n]})}});i.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(n,t,r){var f,u,o,e=n.nodeType;if(n&&e!==3&&e!==8&&e!==2)return o=e!==1||!i.isXMLDoc(n),o&&(t=i.propFix[t]||t,u=i.propHooks[t]),r!==undefined?u&&"set"in u&&(f=u.set(n,r,t))!==undefined?f:n[t]=r:u&&"get"in u&&(f=u.get(n,t))!==null?f:n[t]},propHooks:{tabIndex:{get:function(n){return n.hasAttribute("tabindex")||hu.test(n.nodeName)||n.href?n.tabIndex:-1}}}});f.optSelected||(i.propHooks.selected={get:function(n){var t=n.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null}});i.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){i.propFix[this.toLowerCase()]=this});kt=/[\t\r\n\f]/g;i.fn.extend({addClass:function(n){var o,t,r,u,s,f,h=typeof n=="string"&&n,e=0,l=this.length;if(i.isFunction(n))return this.each(function(t){i(this).addClass(n.call(this,t,this.className))});if(h)for(o=(n||"").match(c)||[];e<l;e++)if(t=this[e],r=t.nodeType===1&&(t.className?(" "+t.className+" ").replace(kt," "):" "),r){for(s=0;u=o[s++];)r.indexOf(" "+u+" ")<0&&(r+=u+" ");f=i.trim(r);t.className!==f&&(t.className=f)}return this},removeClass:function(n){var o,t,r,u,s,f,h=arguments.length===0||typeof n=="string"&&n,e=0,l=this.length;if(i.isFunction(n))return this.each(function(t){i(this).removeClass(n.call(this,t,this.className))});if(h)for(o=(n||"").match(c)||[];e<l;e++)if(t=this[e],r=t.nodeType===1&&(t.className?(" "+t.className+" ").replace(kt," "):""),r){for(s=0;u=o[s++];)while(r.indexOf(" "+u+" ")>=0)r=r.replace(" "+u+" "," ");f=n?i.trim(r):"";t.className!==f&&(t.className=f)}return this},toggleClass:function(n,t){var u=typeof n;return typeof t=="boolean"&&u==="string"?t?this.addClass(n):this.removeClass(n):i.isFunction(n)?this.each(function(r){i(this).toggleClass(n.call(this,r,this.className,t),t)}):this.each(function(){if(u==="string")for(var t,e=0,f=i(this),o=n.match(c)||[];t=o[e++];)f.hasClass(t)?f.removeClass(t):f.addClass(t);else(u===d||u==="boolean")&&(this.className&&r.set(this,"__className__",this.className),this.className=this.className||n===!1?"":r.get(this,"__className__")||"")})},hasClass:function(n){for(var i=" "+n+" ",t=0,r=this.length;t<r;t++)if(this[t].nodeType===1&&(" "+this[t].className+" ").replace(kt," ").indexOf(i)>=0)return!0;return!1}});cu=/\r/g;i.fn.extend({val:function(n){var t,r,f,u=this[0];return arguments.length?(f=i.isFunction(n),this.each(function(r){var u;this.nodeType===1&&(u=f?n.call(this,r,i(this).val()):n,u==null?u="":typeof u=="number"?u+="":i.isArray(u)&&(u=i.map(u,function(n){return n==null?"":n+""})),t=i.valHooks[this.type]||i.valHooks[this.nodeName.toLowerCase()],t&&"set"in t&&t.set(this,u,"value")!==undefined||(this.value=u))})):u?(t=i.valHooks[u.type]||i.valHooks[u.nodeName.toLowerCase()],t&&"get"in t&&(r=t.get(u,"value"))!==undefined)?r:(r=u.value,typeof r=="string"?r.replace(cu,""):r==null?"":r):void 0}});i.extend({valHooks:{option:{get:function(n){var t=i.find.attr(n,"value");return t!=null?t:i.trim(i.text(n))}},select:{get:function(n){for(var o,t,s=n.options,r=n.selectedIndex,u=n.type==="select-one"||r<0,h=u?null:[],c=u?r+1:s.length,e=r<0?c:u?r:0;e<c;e++)if(t=s[e],(t.selected||e===r)&&(f.optDisabled?!t.disabled:t.getAttribute("disabled")===null)&&(!t.parentNode.disabled||!i.nodeName(t.parentNode,"optgroup"))){if(o=i(t).val(),u)return o;h.push(o)}return h},set:function(n,t){for(var u,r,f=n.options,e=i.makeArray(t),o=f.length;o--;)r=f[o],(r.selected=i.inArray(r.value,e)>=0)&&(u=!0);return u||(n.selectedIndex=-1),e}}}});i.each(["radio","checkbox"],function(){i.valHooks[this]={set:function(n,t){if(i.isArray(t))return n.checked=i.inArray(i(n).val(),t)>=0}};f.checkOn||(i.valHooks[this].get=function(n){return n.getAttribute("value")===null?"on":n.value})});i.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(n,t){i.fn[t]=function(n,i){return arguments.length>0?this.on(t,null,n,i):this.trigger(t)}});i.fn.extend({hover:function(n,t){return this.mouseenter(n).mouseleave(t||n)},bind:function(n,t,i){return this.on(n,null,t,i)},unbind:function(n,t){return this.off(n,null,t)},delegate:function(n,t,i,r){return this.on(t,n,i,r)},undelegate:function(n,t,i){return arguments.length===1?this.off(n,"**"):this.off(t,n||"**",i)}});dt=i.now();gt=/\?/;i.parseJSON=function(n){return JSON.parse(n+"")};i.parseXML=function(n){var t,r;if(!n||typeof n!="string")return null;try{r=new DOMParser;t=r.parseFromString(n,"text/xml")}catch(u){t=undefined}return(!t||t.getElementsByTagName("parsererror").length)&&i.error("Invalid XML: "+n),t};var b,v,se=/#.*$/,lu=/([?&])_=[^&]*/,he=/^(.*?):[ \t]*([^\r\n]*)$/mg,ce=/^(?:GET|HEAD)$/,le=/^\/\//,au=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,vu={},li={},yu="*/".concat("*");try{v=location.href}catch(ge){v=u.createElement("a");v.href="";v=v.href}b=au.exec(v.toLowerCase())||[];i.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:v,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(b[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":yu,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":i.parseJSON,"text xml":i.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(n,t){return t?ai(ai(n,i.ajaxSettings),t):ai(i.ajaxSettings,n)},ajaxPrefilter:pu(vu),ajaxTransport:pu(li),ajax:function(n,t){function w(n,t,h,c){var v,it,b,y,w,l=t;e!==2&&(e=2,d&&clearTimeout(d),s=undefined,k=c||"",u.readyState=n>0?4:0,v=n>=200&&n<300||n===304,h&&(y=ae(r,u,h)),y=ve(r,y,u,v),v?(r.ifModified&&(w=u.getResponseHeader("Last-Modified"),w&&(i.lastModified[f]=w),w=u.getResponseHeader("etag"),w&&(i.etag[f]=w)),n===204||r.type==="HEAD"?l="nocontent":n===304?l="notmodified":(l=y.state,it=y.data,b=y.error,v=!b)):(b=l,(n||!l)&&(l="error",n<0&&(n=0))),u.status=n,u.statusText=(t||l)+"",v?nt.resolveWith(o,[it,l,u]):nt.rejectWith(o,[u,l,b]),u.statusCode(p),p=undefined,a&&g.trigger(v?"ajaxSuccess":"ajaxError",[u,r,v?it:b]),tt.fireWith(o,[u,l]),a&&(g.trigger("ajaxComplete",[u,r]),--i.active||i.event.trigger("ajaxStop")))}typeof n=="object"&&(t=n,n=undefined);t=t||{};var s,f,k,y,d,h,a,l,r=i.ajaxSetup({},t),o=r.context||r,g=r.context&&(o.nodeType||o.jquery)?i(o):i.event,nt=i.Deferred(),tt=i.Callbacks("once memory"),p=r.statusCode||{},it={},rt={},e=0,ut="canceled",u={readyState:0,getResponseHeader:function(n){var t;if(e===2){if(!y)for(y={};t=he.exec(k);)y[t[1].toLowerCase()]=t[2];t=y[n.toLowerCase()]}return t==null?null:t},getAllResponseHeaders:function(){return e===2?k:null},setRequestHeader:function(n,t){var i=n.toLowerCase();return e||(n=rt[i]=rt[i]||n,it[n]=t),this},overrideMimeType:function(n){return e||(r.mimeType=n),this},statusCode:function(n){var t;if(n)if(e<2)for(t in n)p[t]=[p[t],n[t]];else u.always(n[u.status]);return this},abort:function(n){var t=n||ut;return s&&s.abort(t),w(0,t),this}};if(nt.promise(u).complete=tt.add,u.success=u.done,u.error=u.fail,r.url=((n||r.url||v)+"").replace(se,"").replace(le,b[1]+"//"),r.type=t.method||t.type||r.method||r.type,r.dataTypes=i.trim(r.dataType||"*").toLowerCase().match(c)||[""],r.crossDomain==null&&(h=au.exec(r.url.toLowerCase()),r.crossDomain=!!(h&&(h[1]!==b[1]||h[2]!==b[2]||(h[3]||(h[1]==="http:"?"80":"443"))!==(b[3]||(b[1]==="http:"?"80":"443"))))),r.data&&r.processData&&typeof r.data!="string"&&(r.data=i.param(r.data,r.traditional)),wu(vu,r,t,u),e===2)return u;a=r.global;a&&i.active++==0&&i.event.trigger("ajaxStart");r.type=r.type.toUpperCase();r.hasContent=!ce.test(r.type);f=r.url;r.hasContent||(r.data&&(f=r.url+=(gt.test(f)?"&":"?")+r.data,delete r.data),r.cache===!1&&(r.url=lu.test(f)?f.replace(lu,"$1_="+dt++):f+(gt.test(f)?"&":"?")+"_="+dt++));r.ifModified&&(i.lastModified[f]&&u.setRequestHeader("If-Modified-Since",i.lastModified[f]),i.etag[f]&&u.setRequestHeader("If-None-Match",i.etag[f]));(r.data&&r.hasContent&&r.contentType!==!1||t.contentType)&&u.setRequestHeader("Content-Type",r.contentType);u.setRequestHeader("Accept",r.dataTypes[0]&&r.accepts[r.dataTypes[0]]?r.accepts[r.dataTypes[0]]+(r.dataTypes[0]!=="*"?", "+yu+"; q=0.01":""):r.accepts["*"]);for(l in r.headers)u.setRequestHeader(l,r.headers[l]);if(r.beforeSend&&(r.beforeSend.call(o,u,r)===!1||e===2))return u.abort();ut="abort";for(l in{success:1,error:1,complete:1})u[l](r[l]);if(s=wu(li,r,t,u),s){u.readyState=1;a&&g.trigger("ajaxSend",[u,r]);r.async&&r.timeout>0&&(d=setTimeout(function(){u.abort("timeout")},r.timeout));try{e=1;s.send(it,w)}catch(ft){if(e<2)w(-1,ft);else throw ft;}}else w(-1,"No Transport");return u},getJSON:function(n,t,r){return i.get(n,t,r,"json")},getScript:function(n,t){return i.get(n,undefined,t,"script")}});i.each(["get","post"],function(n,t){i[t]=function(n,r,u,f){return i.isFunction(r)&&(f=f||u,u=r,r=undefined),i.ajax({url:n,type:t,dataType:f,data:r,success:u})}});i.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(n,t){i.fn[t]=function(n){return this.on(t,n)}});i._evalUrl=function(n){return i.ajax({url:n,type:"GET",dataType:"script",async:!1,global:!1,throws:!0})};i.fn.extend({wrapAll:function(n){var t;return i.isFunction(n)?this.each(function(t){i(this).wrapAll(n.call(this,t))}):(this[0]&&(t=i(n,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var n=this;n.firstElementChild;)n=n.firstElementChild;return n}).append(this)),this)},wrapInner:function(n){return i.isFunction(n)?this.each(function(t){i(this).wrapInner(n.call(this,t))}):this.each(function(){var t=i(this),r=t.contents();r.length?r.wrapAll(n):t.append(n)})},wrap:function(n){var t=i.isFunction(n);return this.each(function(r){i(this).wrapAll(t?n.call(this,r):n)})},unwrap:function(){return this.parent().each(function(){i.nodeName(this,"body")||i(this).replaceWith(this.childNodes)}).end()}});i.expr.filters.hidden=function(n){return n.offsetWidth<=0&&n.offsetHeight<=0};i.expr.filters.visible=function(n){return!i.expr.filters.hidden(n)};var ye=/%20/g,pe=/\[\]$/,bu=/\r?\n/g,we=/^(?:submit|button|image|reset|file)$/i,be=/^(?:input|select|textarea|keygen)/i;i.param=function(n,t){var r,u=[],f=function(n,t){t=i.isFunction(t)?t():t==null?"":t;u[u.length]=encodeURIComponent(n)+"="+encodeURIComponent(t)};if(t===undefined&&(t=i.ajaxSettings&&i.ajaxSettings.traditional),i.isArray(n)||n.jquery&&!i.isPlainObject(n))i.each(n,function(){f(this.name,this.value)});else for(r in n)vi(r,n[r],t,f);return u.join("&").replace(ye,"+")};i.fn.extend({serialize:function(){return i.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var n=i.prop(this,"elements");return n?i.makeArray(n):this}).filter(function(){var n=this.type;return this.name&&!i(this).is(":disabled")&&be.test(this.nodeName)&&!we.test(n)&&(this.checked||!er.test(n))}).map(function(n,t){var r=i(this).val();return r==null?null:i.isArray(r)?i.map(r,function(n){return{name:t.name,value:n.replace(bu,"\r\n")}}):{name:t.name,value:r.replace(bu,"\r\n")}}).get()}});i.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(n){}};var ke=0,ni={},de={0:200,1223:204},ft=i.ajaxSettings.xhr();if(n.ActiveXObject)i(n).on("unload",function(){for(var n in ni)ni[n]()});return f.cors=!!ft&&"withCredentials"in ft,f.ajax=ft=!!ft,i.ajaxTransport(function(n){var t;if(f.cors||ft&&!n.crossDomain)return{send:function(i,r){var f,u=n.xhr(),e=++ke;if(u.open(n.type,n.url,n.async,n.username,n.password),n.xhrFields)for(f in n.xhrFields)u[f]=n.xhrFields[f];n.mimeType&&u.overrideMimeType&&u.overrideMimeType(n.mimeType);n.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");for(f in i)u.setRequestHeader(f,i[f]);t=function(n){return function(){t&&(delete ni[e],t=u.onload=u.onerror=null,n==="abort"?u.abort():n==="error"?r(u.status,u.statusText):r(de[u.status]||u.status,u.statusText,typeof u.responseText=="string"?{text:u.responseText}:undefined,u.getAllResponseHeaders()))}};u.onload=t();u.onerror=t("error");t=ni[e]=t("abort");try{u.send(n.hasContent&&n.data||null)}catch(o){if(t)throw o;}},abort:function(){t&&t()}}}),i.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(n){return i.globalEval(n),n}}}),i.ajaxPrefilter("script",function(n){n.cache===undefined&&(n.cache=!1);n.crossDomain&&(n.type="GET")}),i.ajaxTransport("script",function(n){if(n.crossDomain){var r,t;return{send:function(f,e){r=i("<script>").prop({async:!0,charset:n.scriptCharset,src:n.url}).on("load error",t=function(n){r.remove();t=null;n&&e(n.type==="error"?404:200,n.type)});u.head.appendChild(r[0])},abort:function(){t&&t()}}}}),yi=[],ti=/(=)\?(?=&|$)|\?\?/,i.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var n=yi.pop()||i.expando+"_"+dt++;return this[n]=!0,n}}),i.ajaxPrefilter("json jsonp",function(t,r,u){var f,o,e,s=t.jsonp!==!1&&(ti.test(t.url)?"url":typeof t.data=="string"&&!(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&ti.test(t.data)&&"data");if(s||t.dataTypes[0]==="jsonp")return f=t.jsonpCallback=i.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,s?t[s]=t[s].replace(ti,"$1"+f):t.jsonp!==!1&&(t.url+=(gt.test(t.url)?"&":"?")+t.jsonp+"="+f),t.converters["script json"]=function(){return e||i.error(f+" was not called"),e[0]},t.dataTypes[0]="json",o=n[f],n[f]=function(){e=arguments},u.always(function(){n[f]=o;t[f]&&(t.jsonpCallback=r.jsonpCallback,yi.push(f));e&&i.isFunction(o)&&o(e[0]);e=o=undefined}),"script"}),i.parseHTML=function(n,t,r){if(!n||typeof n!="string")return null;typeof t=="boolean"&&(r=t,t=!1);t=t||u;var f=gi.exec(n),e=!r&&[];return f?[t.createElement(f[1])]:(f=i.buildFragment([n],t,e),e&&e.length&&i(e).remove(),i.merge([],f.childNodes))},pi=i.fn.load,i.fn.load=function(n,t,r){if(typeof n!="string"&&pi)return pi.apply(this,arguments);var u,o,s,f=this,e=n.indexOf(" ");return e>=0&&(u=i.trim(n.slice(e)),n=n.slice(0,e)),i.isFunction(t)?(r=t,t=undefined):t&&typeof t=="object"&&(o="POST"),f.length>0&&i.ajax({url:n,type:o,dataType:"html",data:t}).done(function(n){s=arguments;f.html(u?i("<div>").append(i.parseHTML(n)).find(u):n)}).complete(r&&function(n,t){f.each(r,s||[n.responseText,t,n])}),this},i.expr.filters.animated=function(n){return i.grep(i.timers,function(t){return n===t.elem}).length},wi=n.document.documentElement,i.offset={setOffset:function(n,t,r){var e,o,s,h,u,c,v,l=i.css(n,"position"),a=i(n),f={};l==="static"&&(n.style.position="relative");u=a.offset();s=i.css(n,"top");c=i.css(n,"left");v=(l==="absolute"||l==="fixed")&&(s+c).indexOf("auto")>-1;v?(e=a.position(),h=e.top,o=e.left):(h=parseFloat(s)||0,o=parseFloat(c)||0);i.isFunction(t)&&(t=t.call(n,r,u));t.top!=null&&(f.top=t.top-u.top+h);t.left!=null&&(f.left=t.left-u.left+o);"using"in t?t.using.call(n,f):a.css(f)}},i.fn.extend({offset:function(n){if(arguments.length)return n===undefined?this:this.each(function(t){i.offset.setOffset(this,n,t)});var r,f,t=this[0],u={top:0,left:0},e=t&&t.ownerDocument;if(e)return(r=e.documentElement,!i.contains(r,t))?u:(typeof t.getBoundingClientRect!==d&&(u=t.getBoundingClientRect()),f=ku(e),{top:u.top+f.pageYOffset-r.clientTop,left:u.left+f.pageXOffset-r.clientLeft})},position:function(){if(this[0]){var n,r,u=this[0],t={top:0,left:0};return i.css(u,"position")==="fixed"?r=u.getBoundingClientRect():(n=this.offsetParent(),r=this.offset(),i.nodeName(n[0],"html")||(t=n.offset()),t.top+=i.css(n[0],"borderTopWidth",!0),t.left+=i.css(n[0],"borderLeftWidth",!0)),{top:r.top-t.top-i.css(u,"marginTop",!0),left:r.left-t.left-i.css(u,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var n=this.offsetParent||wi;n&&!i.nodeName(n,"html")&&i.css(n,"position")==="static";)n=n.offsetParent;return n||wi})}}),i.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,r){var u="pageYOffset"===r;i.fn[t]=function(i){return l(this,function(t,i,f){var e=ku(t);if(f===undefined)return e?e[r]:t[i];e?e.scrollTo(u?n.pageXOffset:f,u?f:n.pageYOffset):t[i]=f},t,i,arguments.length,null)}}),i.each(["top","left"],function(n,t){i.cssHooks[t]=br(f.pixelPosition,function(n,r){if(r)return r=rt(n,t),ci.test(r)?i(n).position()[t]+"px":r})}),i.each({Height:"height",Width:"width"},function(n,t){i.each({padding:"inner"+n,content:t,"":"outer"+n},function(r,u){i.fn[u]=function(u,f){var e=arguments.length&&(r||typeof u!="boolean"),o=r||(u===!0||f===!0?"margin":"border");return l(this,function(t,r,u){var f;return i.isWindow(t)?t.document.documentElement["client"+n]:t.nodeType===9?(f=t.documentElement,Math.max(t.body["scroll"+n],f["scroll"+n],t.body["offset"+n],f["offset"+n],f["client"+n])):u===undefined?i.css(t,r,o):i.style(t,r,u,o)},t,e?u:undefined,e,null)}})}),i.fn.size=function(){return this.length},i.fn.andSelf=i.fn.addBack,typeof define=="function"&&define.amd&&define("jquery",[],function(){return i}),du=n.jQuery,gu=n.$,i.noConflict=function(t){return n.$===i&&(n.$=gu),t&&n.jQuery===i&&(n.jQuery=du),i},typeof t===d&&(n.jQuery=n.$=i),i}),function(n){typeof define=="function"&&define.amd?define(["jquery"],n):n(jQuery)}(function(n){function o(t,i){var r,u,f,e=t.nodeName.toLowerCase();return"area"===e?(r=t.parentNode,u=r.name,!t.href||!u||r.nodeName.toLowerCase()!=="map")?!1:(f=n("img[usemap='#"+u+"']")[0],!!f&&s(f)):(/input|select|textarea|button|object/.test(e)?!t.disabled:"a"===e?t.href||i:i)&&s(t)}function s(t){return n.expr.filters.visible(t)&&!n(t).parents().addBack().filter(function(){return n.css(this,"visibility")==="hidden"}).length}function tt(n){for(var t,i;n.length&&n[0]!==document;){if(t=n.css("position"),(t==="absolute"||t==="relative"||t==="fixed")&&(i=parseInt(n.css("zIndex"),10),!isNaN(i)&&i!==0))return i;n=n.parent()}return 0}function v(){this._curInst=null;this._keyEvent=!1;this._disabledInputs=[];this._datepickerShowing=!1;this._inDialog=!1;this._mainDivId="ui-datepicker-div";this._inlineClass="ui-datepicker-inline";this._appendClass="ui-datepicker-append";this._triggerClass="ui-datepicker-trigger";this._dialogClass="ui-datepicker-dialog";this._disableClass="ui-datepicker-disabled";this._unselectableClass="ui-datepicker-unselectable";this._currentClass="ui-datepicker-current-day";this._dayOverClass="ui-datepicker-days-cell-over";this.regional=[];this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""};this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1};n.extend(this._defaults,this.regional[""]);this.regional.en=n.extend(!0,{},this.regional[""]);this.regional["en-US"]=n.extend(!0,{},this.regional.en);this.dpDiv=y(n("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'><\/div>"))}function y(t){var i="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return t.delegate(i,"mouseout",function(){n(this).removeClass("ui-state-hover");this.className.indexOf("ui-datepicker-prev")!==-1&&n(this).removeClass("ui-datepicker-prev-hover");this.className.indexOf("ui-datepicker-next")!==-1&&n(this).removeClass("ui-datepicker-next-hover")}).delegate(i,"mouseover",p)}function p(){n.datepicker._isDisabledDatepicker(r.inline?r.dpDiv.parent()[0]:r.input[0])||(n(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),n(this).addClass("ui-state-hover"),this.className.indexOf("ui-datepicker-prev")!==-1&&n(this).addClass("ui-datepicker-prev-hover"),this.className.indexOf("ui-datepicker-next")!==-1&&n(this).addClass("ui-datepicker-next-hover"))}function u(t,i){n.extend(t,i);for(var r in i)i[r]==null&&(t[r]=i[r]);return t}function t(n){return function(){var t=this.element.val();n.apply(this,arguments);this._refresh();t!==this.element.val()&&this._trigger("change")}}var h,f,k,i,d,nt,r,it,rt,ut,ft;n.ui=n.ui||{};n.extend(n.ui,{version:"1.11.1",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}});n.fn.extend({scrollParent:function(t){var i=this.css("position"),u=i==="absolute",f=t?/(auto|scroll|hidden)/:/(auto|scroll)/,r=this.parents().filter(function(){var t=n(this);return u&&t.css("position")==="static"?!1:f.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return i==="fixed"||!r.length?n(this[0].ownerDocument||document):r},uniqueId:function(){var n=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++n)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&n(this).removeAttr("id")})}});n.extend(n.expr[":"],{data:n.expr.createPseudo?n.expr.createPseudo(function(t){return function(i){return!!n.data(i,t)}}):function(t,i,r){return!!n.data(t,r[3])},focusable:function(t){return o(t,!isNaN(n.attr(t,"tabindex")))},tabbable:function(t){var i=n.attr(t,"tabindex"),r=isNaN(i);return(r||i>=0)&&o(t,!r)}});n("<a>").outerWidth(1).jquery||n.each(["Width","Height"],function(t,i){function f(t,i,r,u){return n.each(e,function(){i-=parseFloat(n.css(t,"padding"+this))||0;r&&(i-=parseFloat(n.css(t,"border"+this+"Width"))||0);u&&(i-=parseFloat(n.css(t,"margin"+this))||0)}),i}var e=i==="Width"?["Left","Right"]:["Top","Bottom"],r=i.toLowerCase(),u={innerWidth:n.fn.innerWidth,innerHeight:n.fn.innerHeight,outerWidth:n.fn.outerWidth,outerHeight:n.fn.outerHeight};n.fn["inner"+i]=function(t){return t===undefined?u["inner"+i].call(this):this.each(function(){n(this).css(r,f(this,t)+"px")})};n.fn["outer"+i]=function(t,e){return typeof t!="number"?u["outer"+i].call(this,t):this.each(function(){n(this).css(r,f(this,t,!0,e)+"px")})}});n.fn.addBack||(n.fn.addBack=function(n){return this.add(n==null?this.prevObject:this.prevObject.filter(n))});n("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(n.fn.removeData=function(t){return function(i){return arguments.length?t.call(this,n.camelCase(i)):t.call(this)}}(n.fn.removeData));n.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());n.fn.extend({focus:function(t){return function(i,r){return typeof i=="number"?this.each(function(){var t=this;setTimeout(function(){n(t).focus();r&&r.call(t)},i)}):t.apply(this,arguments)}}(n.fn.focus),disableSelection:function(){var n="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.bind(n+".ui-disableSelection",function(n){n.preventDefault()})}}(),enableSelection:function(){return this.unbind(".ui-disableSelection")},zIndex:function(t){if(t!==undefined)return this.css("zIndex",t);if(this.length)for(var i=n(this[0]),r,u;i.length&&i[0]!==document;){if(r=i.css("position"),(r==="absolute"||r==="relative"||r==="fixed")&&(u=parseInt(i.css("zIndex"),10),!isNaN(u)&&u!==0))return u;i=i.parent()}return 0}});n.ui.plugin={add:function(t,i,r){var u,f=n.ui[t].prototype;for(u in r)f.plugins[u]=f.plugins[u]||[],f.plugins[u].push([i,r[u]])},call:function(n,t,i,r){var u,f=n.plugins[t];if(f&&(r||n.element[0].parentNode&&n.element[0].parentNode.nodeType!==11))for(u=0;u<f.length;u++)n.options[f[u][0]]&&f[u][1].apply(n.element,i)}};h=0;f=Array.prototype.slice;n.cleanData=function(t){return function(i){for(var r,u,f=0;(u=i[f])!=null;f++)try{r=n._data(u,"events");r&&r.remove&&n(u).triggerHandler("remove")}catch(e){}t(i)}}(n.cleanData);n.widget=function(t,i,r){var s,f,u,o,h={},e=t.split(".")[0];return t=t.split(".")[1],s=e+"-"+t,r||(r=i,i=n.Widget),n.expr[":"][s.toLowerCase()]=function(t){return!!n.data(t,s)},n[e]=n[e]||{},f=n[e][t],u=n[e][t]=function(n,t){if(!this._createWidget)return new u(n,t);arguments.length&&this._createWidget(n,t)},n.extend(u,f,{version:r.version,_proto:n.extend({},r),_childConstructors:[]}),o=new i,o.options=n.widget.extend({},o.options),n.each(r,function(t,r){if(!n.isFunction(r)){h[t]=r;return}h[t]=function(){var n=function(){return i.prototype[t].apply(this,arguments)},u=function(n){return i.prototype[t].apply(this,n)};return function(){var i=this._super,f=this._superApply,t;return this._super=n,this._superApply=u,t=r.apply(this,arguments),this._super=i,this._superApply=f,t}}()}),u.prototype=n.widget.extend(o,{widgetEventPrefix:f?o.widgetEventPrefix||t:t},h,{constructor:u,namespace:e,widgetName:t,widgetFullName:s}),f?(n.each(f._childConstructors,function(t,i){var r=i.prototype;n.widget(r.namespace+"."+r.widgetName,u,i._proto)}),delete f._childConstructors):i._childConstructors.push(u),n.widget.bridge(t,u),u};n.widget.extend=function(t){for(var e=f.call(arguments,1),u=0,o=e.length,i,r;u<o;u++)for(i in e[u])r=e[u][i],e[u].hasOwnProperty(i)&&r!==undefined&&(t[i]=n.isPlainObject(r)?n.isPlainObject(t[i])?n.widget.extend({},t[i],r):n.widget.extend({},r):r);return t};n.widget.bridge=function(t,i){var r=i.prototype.widgetFullName||t;n.fn[t]=function(u){var s=typeof u=="string",o=f.call(arguments,1),e=this;return u=!s&&o.length?n.widget.extend.apply(null,[u].concat(o)):u,s?this.each(function(){var i,f=n.data(this,r);return u==="instance"?(e=f,!1):f?!n.isFunction(f[u])||u.charAt(0)==="_"?n.error("no such method '"+u+"' for "+t+" widget instance"):(i=f[u].apply(f,o),i!==f&&i!==undefined?(e=i&&i.jquery?e.pushStack(i.get()):i,!1):void 0):n.error("cannot call methods on "+t+" prior to initialization; attempted to call method '"+u+"'")}):this.each(function(){var t=n.data(this,r);t?(t.option(u||{}),t._init&&t._init()):n.data(this,r,new i(u,this))}),e}};n.Widget=function(){};n.Widget._childConstructors=[];n.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(t,i){i=n(i||this.defaultElement||this)[0];this.element=n(i);this.uuid=h++;this.eventNamespace="."+this.widgetName+this.uuid;this.options=n.widget.extend({},this.options,this._getCreateOptions(),t);this.bindings=n();this.hoverable=n();this.focusable=n();i!==this&&(n.data(i,this.widgetFullName,this),this._on(!0,this.element,{remove:function(n){n.target===i&&this.destroy()}}),this.document=n(i.style?i.ownerDocument:i.document||i),this.window=n(this.document[0].defaultView||this.document[0].parentWindow));this._create();this._trigger("create",null,this._getCreateEventData());this._init()},_getCreateOptions:n.noop,_getCreateEventData:n.noop,_create:n.noop,_init:n.noop,destroy:function(){this._destroy();this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(n.camelCase(this.widgetFullName));this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled ui-state-disabled");this.bindings.unbind(this.eventNamespace);this.hoverable.removeClass("ui-state-hover");this.focusable.removeClass("ui-state-focus")},_destroy:n.noop,widget:function(){return this.element},option:function(t,i){var e=t,r,u,f;if(arguments.length===0)return n.widget.extend({},this.options);if(typeof t=="string")if(e={},r=t.split("."),t=r.shift(),r.length){for(u=e[t]=n.widget.extend({},this.options[t]),f=0;f<r.length-1;f++)u[r[f]]=u[r[f]]||{},u=u[r[f]];if(t=r.pop(),arguments.length===1)return u[t]===undefined?null:u[t];u[t]=i}else{if(arguments.length===1)return this.options[t]===undefined?null:this.options[t];e[t]=i}return this._setOptions(e),this},_setOptions:function(n){var t;for(t in n)this._setOption(t,n[t]);return this},_setOption:function(n,t){return this.options[n]=t,n==="disabled"&&(this.widget().toggleClass(this.widgetFullName+"-disabled",!!t),t&&(this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus"))),this},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_on:function(t,i,r){var f,u=this;typeof t!="boolean"&&(r=i,i=t,t=!1);r?(i=f=n(i),this.bindings=this.bindings.add(i)):(r=i,i=this.element,f=this.widget());n.each(r,function(r,e){function o(){if(t||u.options.disabled!==!0&&!n(this).hasClass("ui-state-disabled"))return(typeof e=="string"?u[e]:e).apply(u,arguments)}typeof e!="string"&&(o.guid=e.guid=e.guid||o.guid||n.guid++);var s=r.match(/^([\w:-]*)\s*(.*)$/),h=s[1]+u.eventNamespace,c=s[2];c?f.delegate(c,h,o):i.bind(h,o)})},_off:function(n,t){t=(t||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace;n.unbind(t).undelegate(t)},_delay:function(n,t){function r(){return(typeof n=="string"?i[n]:n).apply(i,arguments)}var i=this;return setTimeout(r,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t);this._on(t,{mouseenter:function(t){n(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){n(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t);this._on(t,{focusin:function(t){n(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){n(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,i,r){var u,f,e=this.options[t];if(r=r||{},i=n.Event(i),i.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),i.target=this.element[0],f=i.originalEvent,f)for(u in f)u in i||(i[u]=f[u]);return this.element.trigger(i,r),!(n.isFunction(e)&&e.apply(this.element[0],[i].concat(r))===!1||i.isDefaultPrevented())}};n.each({show:"fadeIn",hide:"fadeOut"},function(t,i){n.Widget.prototype["_"+t]=function(r,u,f){typeof u=="string"&&(u={effect:u});var o,e=u?u===!0||typeof u=="number"?i:u.effect||i:t;u=u||{};typeof u=="number"&&(u={duration:u});o=!n.isEmptyObject(u);u.complete=f;u.delay&&r.delay(u.delay);o&&n.effects&&n.effects.effect[e]?r[t](u):e!==t&&r[e]?r[e](u.duration,u.easing,f):r.queue(function(i){n(this)[t]();f&&f.call(r[0]);i()})}});k=n.widget;i=!1;n(document).mouseup(function(){i=!1});d=n.widget("ui.mouse",{version:"1.11.1",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.bind("mousedown."+this.widgetName,function(n){return t._mouseDown(n)}).bind("click."+this.widgetName,function(i){if(!0===n.data(i.target,t.widgetName+".preventClickEvent"))return n.removeData(i.target,t.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1});this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);this._mouseMoveDelegate&&this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(t){if(!i){this._mouseStarted&&this._mouseUp(t);this._mouseDownEvent=t;var r=this,u=t.which===1,f=typeof this.options.cancel=="string"&&t.target.nodeName?n(t.target).closest(this.options.cancel).length:!1;return!u||f||!this._mouseCapture(t)?!0:(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){r.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(t)!==!1,!this._mouseStarted))?(t.preventDefault(),!0):(!0===n.data(t.target,this.widgetName+".preventClickEvent")&&n.removeData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(n){return r._mouseMove(n)},this._mouseUpDelegate=function(n){return r._mouseUp(n)},this.document.bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),t.preventDefault(),i=!0,!0)}},_mouseMove:function(t){return n.ui.ie&&(!document.documentMode||document.documentMode<9)&&!t.button?this._mouseUp(t):t.which?this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted):this._mouseUp(t)},_mouseUp:function(t){return this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&n.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),i=!1,!1},_mouseDistanceMet:function(n){return Math.max(Math.abs(this._mouseDownEvent.pageX-n.pageX),Math.abs(this._mouseDownEvent.pageY-n.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),function(){function a(n,t,i){return[parseFloat(n[0])*(l.test(n[0])?t/100:1),parseFloat(n[1])*(l.test(n[1])?i/100:1)]}function r(t,i){return parseInt(n.css(t,i),10)||0}function y(t){var i=t[0];return i.nodeType===9?{width:t.width(),height:t.height(),offset:{top:0,left:0}}:n.isWindow(i)?{width:t.width(),height:t.height(),offset:{top:t.scrollTop(),left:t.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:t.outerWidth(),height:t.outerHeight(),offset:t.offset()}}n.ui=n.ui||{};var u,f,i=Math.max,t=Math.abs,e=Math.round,o=/left|center|right/,s=/top|center|bottom/,h=/[\+\-]\d+(\.[\d]+)?%?/,c=/^\w+/,l=/%$/,v=n.fn.position;n.position={scrollbarWidth:function(){if(u!==undefined)return u;var r,i,t=n("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'><\/div><\/div>"),f=t.children()[0];return n("body").append(t),r=f.offsetWidth,t.css("overflow","scroll"),i=f.offsetWidth,r===i&&(i=t[0].clientWidth),t.remove(),u=r-i},getScrollInfo:function(t){var i=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),r=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),u=i==="scroll"||i==="auto"&&t.width<t.element[0].scrollWidth,f=r==="scroll"||r==="auto"&&t.height<t.element[0].scrollHeight;return{width:f?n.position.scrollbarWidth():0,height:u?n.position.scrollbarWidth():0}},getWithinInfo:function(t){var i=n(t||window),r=n.isWindow(i[0]),u=!!i[0]&&i[0].nodeType===9;return{element:i,isWindow:r,isDocument:u,offset:i.offset()||{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:r||u?i.width():i.outerWidth(),height:r||u?i.height():i.outerHeight()}}};n.fn.position=function(u){if(!u||!u.of)return v.apply(this,arguments);u=n.extend({},u);var k,l,p,b,w,g,nt=n(u.of),it=n.position.getWithinInfo(u.within),rt=n.position.getScrollInfo(it),d=(u.collision||"flip").split(" "),tt={};return g=y(nt),nt[0].preventDefault&&(u.at="left top"),l=g.width,p=g.height,b=g.offset,w=n.extend({},b),n.each(["my","at"],function(){var n=(u[this]||"").split(" "),t,i;n.length===1&&(n=o.test(n[0])?n.concat(["center"]):s.test(n[0])?["center"].concat(n):["center","center"]);n[0]=o.test(n[0])?n[0]:"center";n[1]=s.test(n[1])?n[1]:"center";t=h.exec(n[0]);i=h.exec(n[1]);tt[this]=[t?t[0]:0,i?i[0]:0];u[this]=[c.exec(n[0])[0],c.exec(n[1])[0]]}),d.length===1&&(d[1]=d[0]),u.at[0]==="right"?w.left+=l:u.at[0]==="center"&&(w.left+=l/2),u.at[1]==="bottom"?w.top+=p:u.at[1]==="center"&&(w.top+=p/2),k=a(tt.at,l,p),w.left+=k[0],w.top+=k[1],this.each(function(){var y,g,s=n(this),h=s.outerWidth(),c=s.outerHeight(),ut=r(this,"marginLeft"),ft=r(this,"marginTop"),et=h+ut+r(this,"marginRight")+rt.width,ot=c+ft+r(this,"marginBottom")+rt.height,o=n.extend({},w),v=a(tt.my,s.outerWidth(),s.outerHeight());u.my[0]==="right"?o.left-=h:u.my[0]==="center"&&(o.left-=h/2);u.my[1]==="bottom"?o.top-=c:u.my[1]==="center"&&(o.top-=c/2);o.left+=v[0];o.top+=v[1];f||(o.left=e(o.left),o.top=e(o.top));y={marginLeft:ut,marginTop:ft};n.each(["left","top"],function(t,i){n.ui.position[d[t]]&&n.ui.position[d[t]][i](o,{targetWidth:l,targetHeight:p,elemWidth:h,elemHeight:c,collisionPosition:y,collisionWidth:et,collisionHeight:ot,offset:[k[0]+v[0],k[1]+v[1]],my:u.my,at:u.at,within:it,elem:s})});u.using&&(g=function(n){var r=b.left-o.left,a=r+l-h,f=b.top-o.top,v=f+p-c,e={target:{element:nt,left:b.left,top:b.top,width:l,height:p},element:{element:s,left:o.left,top:o.top,width:h,height:c},horizontal:a<0?"left":r>0?"right":"center",vertical:v<0?"top":f>0?"bottom":"middle"};l<h&&t(r+a)<l&&(e.horizontal="center");p<c&&t(f+v)<p&&(e.vertical="middle");e.important=i(t(r),t(a))>i(t(f),t(v))?"horizontal":"vertical";u.using.call(this,n,e)});s.offset(n.extend(o,{using:g}))})};n.ui.position={fit:{left:function(n,t){var e=t.within,u=e.isWindow?e.scrollLeft:e.offset.left,o=e.width,s=n.left-t.collisionPosition.marginLeft,r=u-s,f=s+t.collisionWidth-o-u,h;t.collisionWidth>o?r>0&&f<=0?(h=n.left+r+t.collisionWidth-o-u,n.left+=r-h):n.left=f>0&&r<=0?u:r>f?u+o-t.collisionWidth:u:r>0?n.left+=r:f>0?n.left-=f:n.left=i(n.left-s,n.left)},top:function(n,t){var o=t.within,u=o.isWindow?o.scrollTop:o.offset.top,e=t.within.height,s=n.top-t.collisionPosition.marginTop,r=u-s,f=s+t.collisionHeight-e-u,h;t.collisionHeight>e?r>0&&f<=0?(h=n.top+r+t.collisionHeight-e-u,n.top+=r-h):n.top=f>0&&r<=0?u:r>f?u+e-t.collisionHeight:u:r>0?n.top+=r:f>0?n.top-=f:n.top=i(n.top-s,n.top)}},flip:{left:function(n,i){var r=i.within,y=r.offset.left+r.scrollLeft,c=r.width,o=r.isWindow?r.scrollLeft:r.offset.left,l=n.left-i.collisionPosition.marginLeft,a=l-o,v=l+i.collisionWidth-c-o,u=i.my[0]==="left"?-i.elemWidth:i.my[0]==="right"?i.elemWidth:0,f=i.at[0]==="left"?i.targetWidth:i.at[0]==="right"?-i.targetWidth:0,e=-2*i.offset[0],s,h;a<0?(s=n.left+u+f+e+i.collisionWidth-c-y,(s<0||s<t(a))&&(n.left+=u+f+e)):v>0&&(h=n.left-i.collisionPosition.marginLeft+u+f+e-o,(h>0||t(h)<v)&&(n.left+=u+f+e))},top:function(n,i){var r=i.within,y=r.offset.top+r.scrollTop,a=r.height,o=r.isWindow?r.scrollTop:r.offset.top,v=n.top-i.collisionPosition.marginTop,s=v-o,h=v+i.collisionHeight-a-o,p=i.my[1]==="top",u=p?-i.elemHeight:i.my[1]==="bottom"?i.elemHeight:0,f=i.at[1]==="top"?i.targetHeight:i.at[1]==="bottom"?-i.targetHeight:0,e=-2*i.offset[1],c,l;s<0?(l=n.top+u+f+e+i.collisionHeight-a-y,n.top+u+f+e>s&&(l<0||l<t(s))&&(n.top+=u+f+e)):h>0&&(c=n.top-i.collisionPosition.marginTop+u+f+e-o,n.top+u+f+e>h&&(c>0||t(c)<h)&&(n.top+=u+f+e))}},flipfit:{left:function(){n.ui.position.flip.left.apply(this,arguments);n.ui.position.fit.left.apply(this,arguments)},top:function(){n.ui.position.flip.top.apply(this,arguments);n.ui.position.fit.top.apply(this,arguments)}}},function(){var t,i,r,u,e,o=document.getElementsByTagName("body")[0],s=document.createElement("div");t=document.createElement(o?"div":"body");r={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"};o&&n.extend(r,{position:"absolute",left:"-1000px",top:"-1000px"});for(e in r)t.style[e]=r[e];t.appendChild(s);i=o||document.documentElement;i.insertBefore(t,i.firstChild);s.style.cssText="position: absolute; left: 10.7432222px;";u=n(s).offset().left;f=u>10&&u<11;t.innerHTML="";i.removeChild(t)}()}();var et=n.ui.position,ot=n.widget("ui.accordion",{version:"1.11.1",options:{active:0,animate:{},collapsible:!1,event:"click",header:"> li > :first-child,> :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var t=this.options;this.prevShow=this.prevHide=n();this.element.addClass("ui-accordion ui-widget ui-helper-reset").attr("role","tablist");t.collapsible||t.active!==!1&&t.active!=null||(t.active=0);this._processPanels();t.active<0&&(t.active+=this.headers.length);this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():n()}},_createIcons:function(){var t=this.options.icons;t&&(n("<span>").addClass("ui-accordion-header-icon ui-icon "+t.header).prependTo(this.headers),this.active.children(".ui-accordion-header-icon").removeClass(t.header).addClass(t.activeHeader),this.headers.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()},_destroy:function(){var n;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role");this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").removeUniqueId();this._destroyIcons();n=this.headers.next().removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").css("display","").removeAttr("role").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeUniqueId();this.options.heightStyle!=="content"&&n.css("height","")},_setOption:function(n,t){if(n==="active"){this._activate(t);return}n==="event"&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(t));this._super(n,t);n!=="collapsible"||t||this.options.active!==!1||this._activate(0);n==="icons"&&(this._destroyIcons(),t&&this._createIcons());n==="disabled"&&(this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t),this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!t))},_keydown:function(t){if(!t.altKey&&!t.ctrlKey){var i=n.ui.keyCode,u=this.headers.length,f=this.headers.index(t.target),r=!1;switch(t.keyCode){case i.RIGHT:case i.DOWN:r=this.headers[(f+1)%u];break;case i.LEFT:case i.UP:r=this.headers[(f-1+u)%u];break;case i.SPACE:case i.ENTER:this._eventHandler(t);break;case i.HOME:r=this.headers[0];break;case i.END:r=this.headers[u-1]}r&&(n(t.target).attr("tabIndex",-1),n(r).attr("tabIndex",0),r.focus(),t.preventDefault())}},_panelKeyDown:function(t){t.keyCode===n.ui.keyCode.UP&&t.ctrlKey&&n(t.currentTarget).prev().focus()},refresh:function(){var t=this.options;this._processPanels();(t.active!==!1||t.collapsible!==!0)&&this.headers.length?t.active===!1?this._activate(0):this.active.length&&!n.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(t.active=!1,this.active=n()):this._activate(Math.max(0,t.active-1)):t.active=this.headers.index(this.active):(t.active=!1,this.active=n());this._destroyIcons();this._refresh()},_processPanels:function(){this.headers=this.element.find(this.options.header).addClass("ui-accordion-header ui-state-default ui-corner-all");this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").filter(":not(.ui-accordion-content-active)").hide()},_refresh:function(){var t,i=this.options,r=i.heightStyle,u=this.element.parent();this.active=this._findActive(i.active).addClass("ui-accordion-header-active ui-state-active ui-corner-top").removeClass("ui-corner-all");this.active.next().addClass("ui-accordion-content-active").show();this.headers.attr("role","tab").each(function(){var t=n(this),r=t.uniqueId().attr("id"),i=t.next(),u=i.uniqueId().attr("id");t.attr("aria-controls",u);i.attr("aria-labelledby",r)}).next().attr("role","tabpanel");this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide();this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0);this._createIcons();this._setupEvents(i.event);r==="fill"?(t=u.height(),this.element.siblings(":visible").each(function(){var i=n(this),r=i.css("position");r!=="absolute"&&r!=="fixed"&&(t-=i.outerHeight(!0))}),this.headers.each(function(){t-=n(this).outerHeight(!0)}),this.headers.next().each(function(){n(this).height(Math.max(0,t-n(this).innerHeight()+n(this).height()))}).css("overflow","auto")):r==="auto"&&(t=0,this.headers.next().each(function(){t=Math.max(t,n(this).css("height","").height())}).height(t))},_activate:function(t){var i=this._findActive(t)[0];i!==this.active[0]&&(i=i||this.active[0],this._eventHandler({target:i,currentTarget:i,preventDefault:n.noop}))},_findActive:function(t){return typeof t=="number"?this.headers.eq(t):n()},_setupEvents:function(t){var i={keydown:"_keydown"};t&&n.each(t.split(" "),function(n,t){i[t]="_eventHandler"});this._off(this.headers.add(this.headers.next()));this._on(this.headers,i);this._on(this.headers.next(),{keydown:"_panelKeyDown"});this._hoverable(this.headers);this._focusable(this.headers)},_eventHandler:function(t){var i=this.options,u=this.active,r=n(t.currentTarget),f=r[0]===u[0],e=f&&i.collapsible,s=e?n():r.next(),h=u.next(),o={oldHeader:u,oldPanel:h,newHeader:e?n():r,newPanel:s};(t.preventDefault(),(!f||i.collapsible)&&this._trigger("beforeActivate",t,o)!==!1)&&(i.active=e?!1:this.headers.index(r),this.active=f?n():r,this._toggle(o),u.removeClass("ui-accordion-header-active ui-state-active"),i.icons&&u.children(".ui-accordion-header-icon").removeClass(i.icons.activeHeader).addClass(i.icons.header),f||(r.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),i.icons&&r.children(".ui-accordion-header-icon").removeClass(i.icons.header).addClass(i.icons.activeHeader),r.next().addClass("ui-accordion-content-active")))},_toggle:function(t){var r=t.newPanel,i=this.prevShow.length?this.prevShow:t.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0);this.prevShow=r;this.prevHide=i;this.options.animate?this._animate(r,i,t):(i.hide(),r.show(),this._toggleComplete(t));i.attr({"aria-hidden":"true"});i.prev().attr("aria-selected","false");r.length&&i.length?i.prev().attr({tabIndex:-1,"aria-expanded":"false"}):r.length&&this.headers.filter(function(){return n(this).attr("tabIndex")===0}).attr("tabIndex",-1);r.attr("aria-hidden","false").prev().attr({"aria-selected":"true",tabIndex:0,"aria-expanded":"true"})},_animate:function(n,t,i){var h,r,u,c=this,o=0,l=n.length&&(!t.length||n.index()<t.index()),e=this.options.animate||{},f=l&&e.down||e,s=function(){c._toggleComplete(i)};if(typeof f=="number"&&(u=f),typeof f=="string"&&(r=f),r=r||f.easing||e.easing,u=u||f.duration||e.duration,!t.length)return n.animate(this.showProps,u,r,s);if(!n.length)return t.animate(this.hideProps,u,r,s);h=n.show().outerHeight();t.animate(this.hideProps,{duration:u,easing:r,step:function(n,t){t.now=Math.round(n)}});n.hide().animate(this.showProps,{duration:u,easing:r,complete:s,step:function(n,i){i.now=Math.round(n);i.prop!=="height"?o+=i.now:c.options.heightStyle!=="content"&&(i.now=Math.round(h-t.outerHeight()-o),o=0)}})},_toggleComplete:function(n){var t=n.oldPanel;t.removeClass("ui-accordion-content-active").prev().removeClass("ui-corner-top").addClass("ui-corner-all");t.length&&(t.parent()[0].className=t.parent()[0].className);this._trigger("activate",null,n)}}),st=n.widget("ui.menu",{version:"1.11.1",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},items:"> *",menus:"ul",position:{my:"left-1 top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element;this.mouseHandled=!1;this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0});this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true");this._on({"mousedown .ui-menu-item":function(n){n.preventDefault()},"click .ui-menu-item":function(t){var i=n(t.target);!this.mouseHandled&&i.not(".ui-state-disabled").length&&(this.select(t),t.isPropagationStopped()||(this.mouseHandled=!0),i.has(".ui-menu").length?this.expand(t):!this.element.is(":focus")&&n(this.document[0].activeElement).closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&this.active.parents(".ui-menu").length===1&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(t){var i=n(t.currentTarget);i.siblings(".ui-state-active").removeClass("ui-state-active");this.focus(t,i)},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(n,t){var i=this.active||this.element.find(this.options.items).eq(0);t||this.focus(n,i)},blur:function(t){this._delay(function(){n.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(t)})},keydown:"_keydown"});this.refresh();this._on(this.document,{click:function(n){this._closeOnDocumentClick(n)&&this.collapseAll(n);this.mouseHandled=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-menu-icons ui-front").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show();this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").removeUniqueId().removeClass("ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var t=n(this);t.data("ui-menu-submenu-carat")&&t.remove()});this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(t){function s(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}var i,f,r,e,u,o=!0;switch(t.keyCode){case n.ui.keyCode.PAGE_UP:this.previousPage(t);break;case n.ui.keyCode.PAGE_DOWN:this.nextPage(t);break;case n.ui.keyCode.HOME:this._move("first","first",t);break;case n.ui.keyCode.END:this._move("last","last",t);break;case n.ui.keyCode.UP:this.previous(t);break;case n.ui.keyCode.DOWN:this.next(t);break;case n.ui.keyCode.LEFT:this.collapse(t);break;case n.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(t);break;case n.ui.keyCode.ENTER:case n.ui.keyCode.SPACE:this._activate(t);break;case n.ui.keyCode.ESCAPE:this.collapse(t);break;default:o=!1;f=this.previousFilter||"";r=String.fromCharCode(t.keyCode);e=!1;clearTimeout(this.filterTimer);r===f?e=!0:r=f+r;u=new RegExp("^"+s(r),"i");i=this.activeMenu.find(this.options.items).filter(function(){return u.test(n(this).text())});i=e&&i.index(this.active.next())!==-1?this.active.nextAll(".ui-menu-item"):i;i.length||(r=String.fromCharCode(t.keyCode),u=new RegExp("^"+s(r),"i"),i=this.activeMenu.find(this.options.items).filter(function(){return u.test(n(this).text())}));i.length?(this.focus(t,i),i.length>1?(this.previousFilter=r,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter):delete this.previousFilter}o&&t.preventDefault()},_activate:function(n){this.active.is(".ui-state-disabled")||(this.active.is("[aria-haspopup='true']")?this.expand(n):this.select(n))},refresh:function(){var i,t,u=this,f=this.options.icons.submenu,r=this.element.find(this.options.menus);this.element.toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length);r.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-front").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var t=n(this),i=t.parent(),r=n("<span>").addClass("ui-menu-icon ui-icon "+f).data("ui-menu-submenu-carat",!0);i.attr("aria-haspopup","true").prepend(r);t.attr("aria-labelledby",i.attr("id"))});i=r.add(this.element);t=i.find(this.options.items);t.not(".ui-menu-item").each(function(){var t=n(this);u._isDivider(t)&&t.addClass("ui-widget-content ui-menu-divider")});t.not(".ui-menu-item, .ui-menu-divider").addClass("ui-menu-item").uniqueId().attr({tabIndex:-1,role:this._itemRole()});t.filter(".ui-state-disabled").attr("aria-disabled","true");this.active&&!n.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(n,t){n==="icons"&&this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(t.submenu);n==="disabled"&&this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t);this._super(n,t)},focus:function(n,t){var i,r;this.blur(n,n&&n.type==="focus");this._scrollIntoView(t);this.active=t.first();r=this.active.addClass("ui-state-focus").removeClass("ui-state-active");this.options.role&&this.element.attr("aria-activedescendant",r.attr("id"));this.active.parent().closest(".ui-menu-item").addClass("ui-state-active");n&&n.type==="keydown"?this._close():this.timer=this._delay(function(){this._close()},this.delay);i=t.children(".ui-menu");i.length&&n&&/^mouse/.test(n.type)&&this._startOpening(i);this.activeMenu=t.parent();this._trigger("focus",n,{item:t})},_scrollIntoView:function(t){var e,o,i,r,u,f;this._hasScroll()&&(e=parseFloat(n.css(this.activeMenu[0],"borderTopWidth"))||0,o=parseFloat(n.css(this.activeMenu[0],"paddingTop"))||0,i=t.offset().top-this.activeMenu.offset().top-e-o,r=this.activeMenu.scrollTop(),u=this.activeMenu.height(),f=t.outerHeight(),i<0?this.activeMenu.scrollTop(r+i):i+f>u&&this.activeMenu.scrollTop(r+i-u+f))},blur:function(n,t){(t||clearTimeout(this.timer),this.active)&&(this.active.removeClass("ui-state-focus"),this.active=null,this._trigger("blur",n,{item:this.active}))},_startOpening:function(n){(clearTimeout(this.timer),n.attr("aria-hidden")==="true")&&(this.timer=this._delay(function(){this._close();this._open(n)},this.delay))},_open:function(t){var i=n.extend({of:this.active},this.options.position);clearTimeout(this.timer);this.element.find(".ui-menu").not(t.parents(".ui-menu")).hide().attr("aria-hidden","true");t.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(i)},collapseAll:function(t,i){clearTimeout(this.timer);this.timer=this._delay(function(){var r=i?this.element:n(t&&t.target).closest(this.element.find(".ui-menu"));r.length||(r=this.element);this._close(r);this.blur(t);this.activeMenu=r},this.delay)},_close:function(n){n||(n=this.active?this.active.parent():this.element);n.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find(".ui-state-active").not(".ui-state-focus").removeClass("ui-state-active")},_closeOnDocumentClick:function(t){return!n(t.target).closest(".ui-menu").length},_isDivider:function(n){return!/[^\-\u2014\u2013\s]/.test(n.text())},collapse:function(n){var t=this.active&&this.active.parent().closest(".ui-menu-item",this.element);t&&t.length&&(this._close(),this.focus(n,t))},expand:function(n){var t=this.active&&this.active.children(".ui-menu ").find(this.options.items).first();t&&t.length&&(this._open(t.parent()),this._delay(function(){this.focus(n,t)}))},next:function(n){this._move("next","first",n)},previous:function(n){this._move("prev","last",n)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(n,t,i){var r;this.active&&(r=n==="first"||n==="last"?this.active[n==="first"?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[n+"All"](".ui-menu-item").eq(0));r&&r.length&&this.active||(r=this.activeMenu.find(this.options.items)[t]());this.focus(i,r)},nextPage:function(t){var i,r,u;if(!this.active){this.next(t);return}this.isLastItem()||(this._hasScroll()?(r=this.active.offset().top,u=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return i=n(this),i.offset().top-r-u<0}),this.focus(t,i)):this.focus(t,this.activeMenu.find(this.options.items)[this.active?"last":"first"]()))},previousPage:function(t){var i,r,u;if(!this.active){this.next(t);return}this.isFirstItem()||(this._hasScroll()?(r=this.active.offset().top,u=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return i=n(this),i.offset().top-r+u>0}),this.focus(t,i)):this.focus(t,this.activeMenu.find(this.options.items).first()))},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(t){this.active=this.active||n(t.target).closest(".ui-menu-item");var i={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(t,!0);this._trigger("select",t,i)}});n.widget("ui.autocomplete",{version:"1.11.1",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var t,i,r,u=this.element[0].nodeName.toLowerCase(),f=u==="textarea",e=u==="input";this.isMultiLine=f?!0:e?!1:this.element.prop("isContentEditable");this.valueMethod=this.element[f||e?"val":"text"];this.isNewMenu=!0;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off");this._on(this.element,{keydown:function(u){if(this.element.prop("readOnly")){t=!0;r=!0;i=!0;return}t=!1;r=!1;i=!1;var f=n.ui.keyCode;switch(u.keyCode){case f.PAGE_UP:t=!0;this._move("previousPage",u);break;case f.PAGE_DOWN:t=!0;this._move("nextPage",u);break;case f.UP:t=!0;this._keyEvent("previous",u);break;case f.DOWN:t=!0;this._keyEvent("next",u);break;case f.ENTER:this.menu.active&&(t=!0,u.preventDefault(),this.menu.select(u));break;case f.TAB:this.menu.active&&this.menu.select(u);break;case f.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(u),u.preventDefault());break;default:i=!0;this._searchTimeout(u)}},keypress:function(r){if(t){t=!1;(!this.isMultiLine||this.menu.element.is(":visible"))&&r.preventDefault();return}if(!i){var u=n.ui.keyCode;switch(r.keyCode){case u.PAGE_UP:this._move("previousPage",r);break;case u.PAGE_DOWN:this._move("nextPage",r);break;case u.UP:this._keyEvent("previous",r);break;case u.DOWN:this._keyEvent("next",r)}}},input:function(n){if(r){r=!1;n.preventDefault();return}this._searchTimeout(n)},focus:function(){this.selectedItem=null;this.previous=this._value()},blur:function(n){if(this.cancelBlur){delete this.cancelBlur;return}clearTimeout(this.searching);this.close(n);this._change(n)}});this._initSource();this.menu=n("<ul>").addClass("ui-autocomplete ui-front").appendTo(this._appendTo()).menu({role:null}).hide().menu("instance");this._on(this.menu.element,{mousedown:function(t){t.preventDefault();this.cancelBlur=!0;this._delay(function(){delete this.cancelBlur});var i=this.menu.element[0];n(t.target).closest(".ui-menu-item").length||this._delay(function(){var t=this;this.document.one("mousedown",function(r){r.target===t.element[0]||r.target===i||n.contains(i,r.target)||t.close()})})},menufocus:function(t,i){var r,u;if(this.isNewMenu&&(this.isNewMenu=!1,t.originalEvent&&/^mouse/.test(t.originalEvent.type))){this.menu.blur();this.document.one("mousemove",function(){n(t.target).trigger(t.originalEvent)});return}u=i.item.data("ui-autocomplete-item");!1!==this._trigger("focus",t,{item:u})&&t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(u.value);r=i.item.attr("aria-label")||u.value;r&&n.trim(r).length&&(this.liveRegion.children().hide(),n("<div>").text(r).appendTo(this.liveRegion))},menuselect:function(n,t){var i=t.item.data("ui-autocomplete-item"),r=this.previous;this.element[0]!==this.document[0].activeElement&&(this.element.focus(),this.previous=r,this._delay(function(){this.previous=r;this.selectedItem=i}));!1!==this._trigger("select",n,{item:i})&&this._value(i.value);this.term=this._value();this.close(n);this.selectedItem=i}});this.liveRegion=n("<span>",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).addClass("ui-helper-hidden-accessible").appendTo(this.document[0].body);this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching);this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete");this.menu.element.remove();this.liveRegion.remove()},_setOption:function(n,t){this._super(n,t);n==="source"&&this._initSource();n==="appendTo"&&this.menu.element.appendTo(this._appendTo());n==="disabled"&&t&&this.xhr&&this.xhr.abort()},_appendTo:function(){var t=this.options.appendTo;return t&&(t=t.jquery||t.nodeType?n(t):this.document.find(t).eq(0)),t&&t[0]||(t=this.element.closest(".ui-front")),t.length||(t=this.document[0].body),t},_initSource:function(){var i,r,t=this;n.isArray(this.options.source)?(i=this.options.source,this.source=function(t,r){r(n.ui.autocomplete.filter(i,t.term))}):typeof this.options.source=="string"?(r=this.options.source,this.source=function(i,u){t.xhr&&t.xhr.abort();t.xhr=n.ajax({url:r,data:i,dataType:"json",success:function(n){u(n)},error:function(){u([])}})}):this.source=this.options.source},_searchTimeout:function(n){clearTimeout(this.searching);this.searching=this._delay(function(){var t=this.term===this._value(),i=this.menu.element.is(":visible"),r=n.altKey||n.ctrlKey||n.metaKey||n.shiftKey;t&&(!t||i||r)||(this.selectedItem=null,this.search(null,n))},this.options.delay)},search:function(n,t){return(n=n!=null?n:this._value(),this.term=this._value(),n.length<this.options.minLength)?this.close(t):this._trigger("search",t)===!1?void 0:this._search(n)},_search:function(n){this.pending++;this.element.addClass("ui-autocomplete-loading");this.cancelSearch=!1;this.source({term:n},this._response())},_response:function(){var t=++this.requestIndex;return n.proxy(function(n){t===this.requestIndex&&this.__response(n);this.pending--;this.pending||this.element.removeClass("ui-autocomplete-loading")},this)},__response:function(n){n&&(n=this._normalize(n));this._trigger("response",null,{content:n});!this.options.disabled&&n&&n.length&&!this.cancelSearch?(this._suggest(n),this._trigger("open")):this._close()},close:function(n){this.cancelSearch=!0;this._close(n)},_close:function(n){this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",n))},_change:function(n){this.previous!==this._value()&&this._trigger("change",n,{item:this.selectedItem})},_normalize:function(t){return t.length&&t[0].label&&t[0].value?t:n.map(t,function(t){return typeof t=="string"?{label:t,value:t}:n.extend({},t,{label:t.label||t.value,value:t.value||t.label})})},_suggest:function(t){var i=this.menu.element.empty();this._renderMenu(i,t);this.isNewMenu=!0;this.menu.refresh();i.show();this._resizeMenu();i.position(n.extend({of:this.element},this.options.position));this.options.autoFocus&&this.menu.next()},_resizeMenu:function(){var n=this.menu.element;n.outerWidth(Math.max(n.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(t,i){var r=this;n.each(i,function(n,i){r._renderItemData(t,i)})},_renderItemData:function(n,t){return this._renderItem(n,t).data("ui-autocomplete-item",t)},_renderItem:function(t,i){return n("<li>").text(i.label).appendTo(t)},_move:function(n,t){if(!this.menu.element.is(":visible")){this.search(null,t);return}if(this.menu.isFirstItem()&&/^previous/.test(n)||this.menu.isLastItem()&&/^next/.test(n)){this.isMultiLine||this._value(this.term);this.menu.blur();return}this.menu[n](t)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(n,t){(!this.isMultiLine||this.menu.element.is(":visible"))&&(this._move(n,t),t.preventDefault())}});n.extend(n.ui.autocomplete,{escapeRegex:function(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(t,i){var r=new RegExp(n.ui.autocomplete.escapeRegex(i),"i");return n.grep(t,function(n){return r.test(n.label||n.value||n)})}});n.widget("ui.autocomplete",n.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(n){return n+(n>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(t){var i;(this._superApply(arguments),this.options.disabled||this.cancelSearch)||(i=t&&t.length?this.options.messages.results(t.length):this.options.messages.noResults,this.liveRegion.children().hide(),n("<div>").text(i).appendTo(this.liveRegion))}});var ht=n.ui.autocomplete,e,c="ui-button ui-widget ui-state-default ui-corner-all",l="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",g=function(){var t=n(this);setTimeout(function(){t.find(":ui-button").button("refresh")},1)},a=function(t){var i=t.name,r=t.form,u=n([]);return i&&(i=i.replace(/'/g,"\\'"),u=r?n(r).find("[name='"+i+"'][type=radio]"):n("[name='"+i+"'][type=radio]",t.ownerDocument).filter(function(){return!this.form})),u};n.widget("ui.button",{version:"1.11.1",defaultElement:"<button>",options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset"+this.eventNamespace).bind("reset"+this.eventNamespace,g);typeof this.options.disabled!="boolean"?this.options.disabled=!!this.element.prop("disabled"):this.element.prop("disabled",this.options.disabled);this._determineButtonType();this.hasTitle=!!this.buttonElement.attr("title");var i=this,t=this.options,r=this.type==="checkbox"||this.type==="radio",u=r?"":"ui-state-active";t.label===null&&(t.label=this.type==="input"?this.buttonElement.val():this.buttonElement.html());this._hoverable(this.buttonElement);this.buttonElement.addClass(c).attr("role","button").bind("mouseenter"+this.eventNamespace,function(){t.disabled||this===e&&n(this).addClass("ui-state-active")}).bind("mouseleave"+this.eventNamespace,function(){t.disabled||n(this).removeClass(u)}).bind("click"+this.eventNamespace,function(n){t.disabled&&(n.preventDefault(),n.stopImmediatePropagation())});this._on({focus:function(){this.buttonElement.addClass("ui-state-focus")},blur:function(){this.buttonElement.removeClass("ui-state-focus")}});r&&this.element.bind("change"+this.eventNamespace,function(){i.refresh()});this.type==="checkbox"?this.buttonElement.bind("click"+this.eventNamespace,function(){if(t.disabled)return!1}):this.type==="radio"?this.buttonElement.bind("click"+this.eventNamespace,function(){if(t.disabled)return!1;n(this).addClass("ui-state-active");i.buttonElement.attr("aria-pressed","true");var r=i.element[0];a(r).not(r).map(function(){return n(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown"+this.eventNamespace,function(){if(t.disabled)return!1;n(this).addClass("ui-state-active");e=this;i.document.one("mouseup",function(){e=null})}).bind("mouseup"+this.eventNamespace,function(){if(t.disabled)return!1;n(this).removeClass("ui-state-active")}).bind("keydown"+this.eventNamespace,function(i){if(t.disabled)return!1;(i.keyCode===n.ui.keyCode.SPACE||i.keyCode===n.ui.keyCode.ENTER)&&n(this).addClass("ui-state-active")}).bind("keyup"+this.eventNamespace+" blur"+this.eventNamespace,function(){n(this).removeClass("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(t){t.keyCode===n.ui.keyCode.SPACE&&n(this).click()}));this._setOption("disabled",t.disabled);this._resetButton()},_determineButtonType:function(){var n,t,i;this.type=this.element.is("[type=checkbox]")?"checkbox":this.element.is("[type=radio]")?"radio":this.element.is("input")?"input":"button";this.type==="checkbox"||this.type==="radio"?(n=this.element.parents().last(),t="label[for='"+this.element.attr("id")+"']",this.buttonElement=n.find(t),this.buttonElement.length||(n=n.length?n.siblings():this.element.siblings(),this.buttonElement=n.filter(t),this.buttonElement.length||(this.buttonElement=n.find(t))),this.element.addClass("ui-helper-hidden-accessible"),i=this.element.is(":checked"),i&&this.buttonElement.addClass("ui-state-active"),this.buttonElement.prop("aria-pressed",i)):this.buttonElement=this.element},widget:function(){return this.buttonElement},_destroy:function(){this.element.removeClass("ui-helper-hidden-accessible");this.buttonElement.removeClass(c+" ui-state-active "+l).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html());this.hasTitle||this.buttonElement.removeAttr("title")},_setOption:function(n,t){if(this._super(n,t),n==="disabled"){this.widget().toggleClass("ui-state-disabled",!!t);this.element.prop("disabled",!!t);t&&(this.type==="checkbox"||this.type==="radio"?this.buttonElement.removeClass("ui-state-focus"):this.buttonElement.removeClass("ui-state-focus ui-state-active"));return}this._resetButton()},refresh:function(){var t=this.element.is("input, button")?this.element.is(":disabled"):this.element.hasClass("ui-button-disabled");t!==this.options.disabled&&this._setOption("disabled",t);this.type==="radio"?a(this.element[0]).each(function(){n(this).is(":checked")?n(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true"):n(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")}):this.type==="checkbox"&&(this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false"))},_resetButton:function(){if(this.type==="input"){this.options.label&&this.element.val(this.options.label);return}var i=this.buttonElement.removeClass(l),f=n("<span><\/span>",this.document[0]).addClass("ui-button-text").html(this.options.label).appendTo(i.empty()).text(),t=this.options.icons,u=t.primary&&t.secondary,r=[];t.primary||t.secondary?(this.options.text&&r.push("ui-button-text-icon"+(u?"s":t.primary?"-primary":"-secondary")),t.primary&&i.prepend("<span class='ui-button-icon-primary ui-icon "+t.primary+"'><\/span>"),t.secondary&&i.append("<span class='ui-button-icon-secondary ui-icon "+t.secondary+"'><\/span>"),this.options.text||(r.push(u?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||i.attr("title",n.trim(f)))):r.push("ui-button-text-only");i.addClass(r.join(" "))}});n.widget("ui.buttonset",{version:"1.11.1",options:{items:"button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(n,t){n==="disabled"&&this.buttons.button("option",n,t);this._super(n,t)},refresh:function(){var i=this.element.css("direction")==="rtl",t=this.element.find(this.options.items),r=t.filter(":ui-button");t.not(":ui-button").button();r.button("refresh");this.buttons=t.map(function(){return n(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(i?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(i?"ui-corner-left":"ui-corner-right").end().end()},_destroy:function(){this.element.removeClass("ui-buttonset");this.buttons.map(function(){return n(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy")}});nt=n.ui.button;n.extend(n.ui,{datepicker:{version:"1.11.1"}});n.extend(v.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(n){return u(this._defaults,n||{}),this},_attachDatepicker:function(t,i){var r,f,u;r=t.nodeName.toLowerCase();f=r==="div"||r==="span";t.id||(this.uuid+=1,t.id="dp"+this.uuid);u=this._newInst(n(t),f);u.settings=n.extend({},i||{});r==="input"?this._connectDatepicker(t,u):f&&this._inlineDatepicker(t,u)},_newInst:function(t,i){var r=t[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:r,input:t,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:i,dpDiv:i?y(n("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'><\/div>")):this.dpDiv}},_connectDatepicker:function(t,i){var r=n(t);(i.append=n([]),i.trigger=n([]),r.hasClass(this.markerClassName))||(this._attachments(r,i),r.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp),this._autoSize(i),n.data(t,"datepicker",i),i.settings.disabled&&this._disableDatepicker(t))},_attachments:function(t,i){var u,r,f,e=this._get(i,"appendText"),o=this._get(i,"isRTL");i.append&&i.append.remove();e&&(i.append=n("<span class='"+this._appendClass+"'>"+e+"<\/span>"),t[o?"before":"after"](i.append));t.unbind("focus",this._showDatepicker);i.trigger&&i.trigger.remove();u=this._get(i,"showOn");(u==="focus"||u==="both")&&t.focus(this._showDatepicker);(u==="button"||u==="both")&&(r=this._get(i,"buttonText"),f=this._get(i,"buttonImage"),i.trigger=n(this._get(i,"buttonImageOnly")?n("<img/>").addClass(this._triggerClass).attr({src:f,alt:r,title:r}):n("<button type='button'><\/button>").addClass(this._triggerClass).html(f?n("<img/>").attr({src:f,alt:r,title:r}):r)),t[o?"before":"after"](i.trigger),i.trigger.click(function(){return n.datepicker._datepickerShowing&&n.datepicker._lastInput===t[0]?n.datepicker._hideDatepicker():n.datepicker._datepickerShowing&&n.datepicker._lastInput!==t[0]?(n.datepicker._hideDatepicker(),n.datepicker._showDatepicker(t[0])):n.datepicker._showDatepicker(t[0]),!1}))},_autoSize:function(n){if(this._get(n,"autoSize")&&!n.inline){var r,u,f,t,i=new Date(2009,11,20),e=this._get(n,"dateFormat");e.match(/[DM]/)&&(r=function(n){for(u=0,f=0,t=0;t<n.length;t++)n[t].length>u&&(u=n[t].length,f=t);return f},i.setMonth(r(this._get(n,e.match(/MM/)?"monthNames":"monthNamesShort"))),i.setDate(r(this._get(n,e.match(/DD/)?"dayNames":"dayNamesShort"))+20-i.getDay()));n.input.attr("size",this._formatDate(n,i).length)}},_inlineDatepicker:function(t,i){var r=n(t);r.hasClass(this.markerClassName)||(r.addClass(this.markerClassName).append(i.dpDiv),n.data(t,"datepicker",i),this._setDate(i,this._getDefaultDate(i),!0),this._updateDatepicker(i),this._updateAlternate(i),i.settings.disabled&&this._disableDatepicker(t),i.dpDiv.css("display","block"))},_dialogDatepicker:function(t,i,r,f,e){var s,h,c,l,a,o=this._dialogInst;return o||(this.uuid+=1,s="dp"+this.uuid,this._dialogInput=n("<input type='text' id='"+s+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.keydown(this._doKeyDown),n("body").append(this._dialogInput),o=this._dialogInst=this._newInst(this._dialogInput,!1),o.settings={},n.data(this._dialogInput[0],"datepicker",o)),u(o.settings,f||{}),i=i&&i.constructor===Date?this._formatDate(o,i):i,this._dialogInput.val(i),this._pos=e?e.length?e:[e.pageX,e.pageY]:null,this._pos||(h=document.documentElement.clientWidth,c=document.documentElement.clientHeight,l=document.documentElement.scrollLeft||document.body.scrollLeft,a=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[h/2-100+l,c/2-150+a]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),o.settings.onSelect=r,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),n.blockUI&&n.blockUI(this.dpDiv),n.data(this._dialogInput[0],"datepicker",o),this},_destroyDatepicker:function(t){var i,r=n(t),u=n.data(t,"datepicker");r.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),n.removeData(t,"datepicker"),i==="input"?(u.append.remove(),u.trigger.remove(),r.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):(i==="div"||i==="span")&&r.removeClass(this.markerClassName).empty())},_enableDatepicker:function(t){var i,r,u=n(t),f=n.data(t,"datepicker");u.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),i==="input"?(t.disabled=!1,f.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):(i==="div"||i==="span")&&(r=u.children("."+this._inlineClass),r.children().removeClass("ui-state-disabled"),r.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=n.map(this._disabledInputs,function(n){return n===t?null:n}))},_disableDatepicker:function(t){var i,r,u=n(t),f=n.data(t,"datepicker");u.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),i==="input"?(t.disabled=!0,f.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):(i==="div"||i==="span")&&(r=u.children("."+this._inlineClass),r.children().addClass("ui-state-disabled"),r.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=n.map(this._disabledInputs,function(n){return n===t?null:n}),this._disabledInputs[this._disabledInputs.length]=t)},_isDisabledDatepicker:function(n){if(!n)return!1;for(var t=0;t<this._disabledInputs.length;t++)if(this._disabledInputs[t]===n)return!0;return!1},_getInst:function(t){try{return n.data(t,"datepicker")}catch(i){throw"Missing instance data for this datepicker";}},_optionDatepicker:function(t,i,r){var e,h,o,s,f=this._getInst(t);if(arguments.length===2&&typeof i=="string")return i==="defaults"?n.extend({},n.datepicker._defaults):f?i==="all"?n.extend({},f.settings):this._get(f,i):null;e=i||{};typeof i=="string"&&(e={},e[i]=r);f&&(this._curInst===f&&this._hideDatepicker(),h=this._getDateDatepicker(t,!0),o=this._getMinMaxDate(f,"min"),s=this._getMinMaxDate(f,"max"),u(f.settings,e),o!==null&&e.dateFormat!==undefined&&e.minDate===undefined&&(f.settings.minDate=this._formatDate(f,o)),s!==null&&e.dateFormat!==undefined&&e.maxDate===undefined&&(f.settings.maxDate=this._formatDate(f,s)),"disabled"in e&&(e.disabled?this._disableDatepicker(t):this._enableDatepicker(t)),this._attachments(n(t),f),this._autoSize(f),this._setDate(f,h),this._updateAlternate(f),this._updateDatepicker(f))},_changeDatepicker:function(n,t,i){this._optionDatepicker(n,t,i)},_refreshDatepicker:function(n){var t=this._getInst(n);t&&this._updateDatepicker(t)},_setDateDatepicker:function(n,t){var i=this._getInst(n);i&&(this._setDate(i,t),this._updateDatepicker(i),this._updateAlternate(i))},_getDateDatepicker:function(n,t){var i=this._getInst(n);return i&&!i.inline&&this._setDateFromField(i,t),i?this._getDate(i):null},_doKeyDown:function(t){var u,e,f,i=n.datepicker._getInst(t.target),r=!0,o=i.dpDiv.is(".ui-datepicker-rtl");if(i._keyEvent=!0,n.datepicker._datepickerShowing)switch(t.keyCode){case 9:n.datepicker._hideDatepicker();r=!1;break;case 13:return f=n("td."+n.datepicker._dayOverClass+":not(."+n.datepicker._currentClass+")",i.dpDiv),f[0]&&n.datepicker._selectDay(t.target,i.selectedMonth,i.selectedYear,f[0]),u=n.datepicker._get(i,"onSelect"),u?(e=n.datepicker._formatDate(i),u.apply(i.input?i.input[0]:null,[e,i])):n.datepicker._hideDatepicker(),!1;case 27:n.datepicker._hideDatepicker();break;case 33:n.datepicker._adjustDate(t.target,t.ctrlKey?-n.datepicker._get(i,"stepBigMonths"):-n.datepicker._get(i,"stepMonths"),"M");break;case 34:n.datepicker._adjustDate(t.target,t.ctrlKey?+n.datepicker._get(i,"stepBigMonths"):+n.datepicker._get(i,"stepMonths"),"M");break;case 35:(t.ctrlKey||t.metaKey)&&n.datepicker._clearDate(t.target);r=t.ctrlKey||t.metaKey;break;case 36:(t.ctrlKey||t.metaKey)&&n.datepicker._gotoToday(t.target);r=t.ctrlKey||t.metaKey;break;case 37:(t.ctrlKey||t.metaKey)&&n.datepicker._adjustDate(t.target,o?1:-1,"D");r=t.ctrlKey||t.metaKey;t.originalEvent.altKey&&n.datepicker._adjustDate(t.target,t.ctrlKey?-n.datepicker._get(i,"stepBigMonths"):-n.datepicker._get(i,"stepMonths"),"M");break;case 38:(t.ctrlKey||t.metaKey)&&n.datepicker._adjustDate(t.target,-7,"D");r=t.ctrlKey||t.metaKey;break;case 39:(t.ctrlKey||t.metaKey)&&n.datepicker._adjustDate(t.target,o?-1:1,"D");r=t.ctrlKey||t.metaKey;t.originalEvent.altKey&&n.datepicker._adjustDate(t.target,t.ctrlKey?+n.datepicker._get(i,"stepBigMonths"):+n.datepicker._get(i,"stepMonths"),"M");break;case 40:(t.ctrlKey||t.metaKey)&&n.datepicker._adjustDate(t.target,7,"D");r=t.ctrlKey||t.metaKey;break;default:r=!1}else t.keyCode===36&&t.ctrlKey?n.datepicker._showDatepicker(this):r=!1;r&&(t.preventDefault(),t.stopPropagation())},_doKeyPress:function(t){var i,r,u=n.datepicker._getInst(t.target);if(n.datepicker._get(u,"constrainInput"))return i=n.datepicker._possibleChars(n.datepicker._get(u,"dateFormat")),r=String.fromCharCode(t.charCode==null?t.keyCode:t.charCode),t.ctrlKey||t.metaKey||r<" "||!i||i.indexOf(r)>-1},_doKeyUp:function(t){var r,i=n.datepicker._getInst(t.target);if(i.input.val()!==i.lastVal)try{r=n.datepicker.parseDate(n.datepicker._get(i,"dateFormat"),i.input?i.input.val():null,n.datepicker._getFormatConfig(i));r&&(n.datepicker._setDateFromField(i),n.datepicker._updateAlternate(i),n.datepicker._updateDatepicker(i))}catch(u){}return!0},_showDatepicker:function(t){if(t=t.target||t,t.nodeName.toLowerCase()!=="input"&&(t=n("input",t.parentNode)[0]),!n.datepicker._isDisabledDatepicker(t)&&n.datepicker._lastInput!==t){var i,o,s,r,f,e,h;(i=n.datepicker._getInst(t),n.datepicker._curInst&&n.datepicker._curInst!==i&&(n.datepicker._curInst.dpDiv.stop(!0,!0),i&&n.datepicker._datepickerShowing&&n.datepicker._hideDatepicker(n.datepicker._curInst.input[0])),o=n.datepicker._get(i,"beforeShow"),s=o?o.apply(t,[t,i]):{},s!==!1)&&(u(i.settings,s),i.lastVal=null,n.datepicker._lastInput=t,n.datepicker._setDateFromField(i),n.datepicker._inDialog&&(t.value=""),n.datepicker._pos||(n.datepicker._pos=n.datepicker._findPos(t),n.datepicker._pos[1]+=t.offsetHeight),r=!1,n(t).parents().each(function(){return r|=n(this).css("position")==="fixed",!r}),f={left:n.datepicker._pos[0],top:n.datepicker._pos[1]},n.datepicker._pos=null,i.dpDiv.empty(),i.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),n.datepicker._updateDatepicker(i),f=n.datepicker._checkOffset(i,f,r),i.dpDiv.css({position:n.datepicker._inDialog&&n.blockUI?"static":r?"fixed":"absolute",display:"none",left:f.left+"px",top:f.top+"px"}),i.inline||(e=n.datepicker._get(i,"showAnim"),h=n.datepicker._get(i,"duration"),i.dpDiv.css("z-index",tt(n(t))+1),n.datepicker._datepickerShowing=!0,n.effects&&n.effects.effect[e]?i.dpDiv.show(e,n.datepicker._get(i,"showOptions"),h):i.dpDiv[e||"show"](e?h:null),n.datepicker._shouldFocusInput(i)&&i.input.focus(),n.datepicker._curInst=i))}},_updateDatepicker:function(t){this.maxRows=4;r=t;t.dpDiv.empty().append(this._generateHTML(t));this._attachHandlers(t);var i,u=this._getNumberOfMonths(t),f=u[1],e=t.dpDiv.find("."+this._dayOverClass+" a");e.length>0&&p.apply(e.get(0));t.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");f>1&&t.dpDiv.addClass("ui-datepicker-multi-"+f).css("width",17*f+"em");t.dpDiv[(u[0]!==1||u[1]!==1?"add":"remove")+"Class"]("ui-datepicker-multi");t.dpDiv[(this._get(t,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");t===n.datepicker._curInst&&n.datepicker._datepickerShowing&&n.datepicker._shouldFocusInput(t)&&t.input.focus();t.yearshtml&&(i=t.yearshtml,setTimeout(function(){i===t.yearshtml&&t.yearshtml&&t.dpDiv.find("select.ui-datepicker-year:first").replaceWith(t.yearshtml);i=t.yearshtml=null},0))},_shouldFocusInput:function(n){return n.input&&n.input.is(":visible")&&!n.input.is(":disabled")&&!n.input.is(":focus")},_checkOffset:function(t,i,r){var u=t.dpDiv.outerWidth(),f=t.dpDiv.outerHeight(),h=t.input?t.input.outerWidth():0,o=t.input?t.input.outerHeight():0,e=document.documentElement.clientWidth+(r?0:n(document).scrollLeft()),s=document.documentElement.clientHeight+(r?0:n(document).scrollTop());return i.left-=this._get(t,"isRTL")?u-h:0,i.left-=r&&i.left===t.input.offset().left?n(document).scrollLeft():0,i.top-=r&&i.top===t.input.offset().top+o?n(document).scrollTop():0,i.left-=Math.min(i.left,i.left+u>e&&e>u?Math.abs(i.left+u-e):0),i.top-=Math.min(i.top,i.top+f>s&&s>f?Math.abs(f+o):0),i},_findPos:function(t){for(var i,r=this._getInst(t),u=this._get(r,"isRTL");t&&(t.type==="hidden"||t.nodeType!==1||n.expr.filters.hidden(t));)t=t[u?"previousSibling":"nextSibling"];return i=n(t).offset(),[i.left,i.top]},_hideDatepicker:function(t){var r,f,u,e,i=this._curInst;i&&(!t||i===n.data(t,"datepicker"))&&this._datepickerShowing&&(r=this._get(i,"showAnim"),f=this._get(i,"duration"),u=function(){n.datepicker._tidyDialog(i)},n.effects&&(n.effects.effect[r]||n.effects[r])?i.dpDiv.hide(r,n.datepicker._get(i,"showOptions"),f,u):i.dpDiv[r==="slideDown"?"slideUp":r==="fadeIn"?"fadeOut":"hide"](r?f:null,u),r||u(),this._datepickerShowing=!1,e=this._get(i,"onClose"),e&&e.apply(i.input?i.input[0]:null,[i.input?i.input.val():"",i]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),n.blockUI&&(n.unblockUI(),n("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(n){n.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(t){if(n.datepicker._curInst){var i=n(t.target),r=n.datepicker._getInst(i[0]);(i[0].id===n.datepicker._mainDivId||i.parents("#"+n.datepicker._mainDivId).length!==0||i.hasClass(n.datepicker.markerClassName)||i.closest("."+n.datepicker._triggerClass).length||!n.datepicker._datepickerShowing||n.datepicker._inDialog&&n.blockUI)&&(!i.hasClass(n.datepicker.markerClassName)||n.datepicker._curInst===r)||n.datepicker._hideDatepicker()}},_adjustDate:function(t,i,r){var f=n(t),u=this._getInst(f[0]);this._isDisabledDatepicker(f[0])||(this._adjustInstDate(u,i+(r==="M"?this._get(u,"showCurrentAtPos"):0),r),this._updateDatepicker(u))},_gotoToday:function(t){var r,u=n(t),i=this._getInst(u[0]);this._get(i,"gotoCurrent")&&i.currentDay?(i.selectedDay=i.currentDay,i.drawMonth=i.selectedMonth=i.currentMonth,i.drawYear=i.selectedYear=i.currentYear):(r=new Date,i.selectedDay=r.getDate(),i.drawMonth=i.selectedMonth=r.getMonth(),i.drawYear=i.selectedYear=r.getFullYear());this._notifyChange(i);this._adjustDate(u)},_selectMonthYear:function(t,i,r){var f=n(t),u=this._getInst(f[0]);u["selected"+(r==="M"?"Month":"Year")]=u["draw"+(r==="M"?"Month":"Year")]=parseInt(i.options[i.selectedIndex].value,10);this._notifyChange(u);this._adjustDate(f)},_selectDay:function(t,i,r,u){var f,e=n(t);n(u).hasClass(this._unselectableClass)||this._isDisabledDatepicker(e[0])||(f=this._getInst(e[0]),f.selectedDay=f.currentDay=n("a",u).html(),f.selectedMonth=f.currentMonth=i,f.selectedYear=f.currentYear=r,this._selectDate(t,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear)))},_clearDate:function(t){var i=n(t);this._selectDate(i,"")},_selectDate:function(t,i){var u,f=n(t),r=this._getInst(f[0]);i=i!=null?i:this._formatDate(r);r.input&&r.input.val(i);this._updateAlternate(r);u=this._get(r,"onSelect");u?u.apply(r.input?r.input[0]:null,[i,r]):r.input&&r.input.trigger("change");r.inline?this._updateDatepicker(r):(this._hideDatepicker(),this._lastInput=r.input[0],typeof r.input[0]!="object"&&r.input.focus(),this._lastInput=null)},_updateAlternate:function(t){var i,r,u,f=this._get(t,"altField");f&&(i=this._get(t,"altFormat")||this._get(t,"dateFormat"),r=this._getDate(t),u=this.formatDate(i,r,this._getFormatConfig(t)),n(f).each(function(){n(this).val(u)}))},noWeekends:function(n){var t=n.getDay();return[t>0&&t<6,""]},iso8601Week:function(n){var i,t=new Date(n.getTime());return t.setDate(t.getDate()+4-(t.getDay()||7)),i=t.getTime(),t.setMonth(0),t.setDate(1),Math.floor(Math.round((i-t)/864e5)/7)+1},parseDate:function(t,i,r){if(t==null||i==null)throw"Invalid arguments";if(i=typeof i=="object"?i.toString():i+"",i==="")return null;for(var a,v,f=0,y=(r?r.shortYearCutoff:null)||this._defaults.shortYearCutoff,d=typeof y!="string"?y:(new Date).getFullYear()%100+parseInt(y,10),g=(r?r.dayNamesShort:null)||this._defaults.dayNamesShort,nt=(r?r.dayNames:null)||this._defaults.dayNames,tt=(r?r.monthNamesShort:null)||this._defaults.monthNamesShort,it=(r?r.monthNames:null)||this._defaults.monthNames,e=-1,s=-1,h=-1,p=-1,w=!1,u,l=function(n){var i=o+1<t.length&&t.charAt(o+1)===n;return i&&o++,i},c=function(n){var u=l(n),r=n==="@"?14:n==="!"?20:n==="y"&&u?4:n==="o"?3:2,e=n==="y"?r:1,o=new RegExp("^\\d{"+e+","+r+"}"),t=i.substring(f).match(o);if(!t)throw"Missing number at position "+f;return f+=t[0].length,parseInt(t[0],10)},k=function(t,r,u){var e=-1,o=n.map(l(t)?u:r,function(n,t){return[[t,n]]}).sort(function(n,t){return-(n[1].length-t[1].length)});if(n.each(o,function(n,t){var r=t[1];if(i.substr(f,r.length).toLowerCase()===r.toLowerCase())return e=t[0],f+=r.length,!1}),e!==-1)return e+1;throw"Unknown name at position "+f;},b=function(){if(i.charAt(f)!==t.charAt(o))throw"Unexpected literal at position "+f;f++},o=0;o<t.length;o++)if(w)t.charAt(o)!=="'"||l("'")?b():w=!1;else switch(t.charAt(o)){case"d":h=c("d");break;case"D":k("D",g,nt);break;case"o":p=c("o");break;case"m":s=c("m");break;case"M":s=k("M",tt,it);break;case"y":e=c("y");break;case"@":u=new Date(c("@"));e=u.getFullYear();s=u.getMonth()+1;h=u.getDate();break;case"!":u=new Date((c("!")-this._ticksTo1970)/1e4);e=u.getFullYear();s=u.getMonth()+1;h=u.getDate();break;case"'":l("'")?b():w=!0;break;default:b()}if(f<i.length&&(v=i.substr(f),!/^\s+/.test(v)))throw"Extra/unparsed characters found in date: "+v;if(e===-1?e=(new Date).getFullYear():e<100&&(e+=(new Date).getFullYear()-(new Date).getFullYear()%100+(e<=d?0:-100)),p>-1){s=1;h=p;do{if(a=this._getDaysInMonth(e,s-1),h<=a)break;s++;h-=a}while(1)}if(u=this._daylightSavingAdjust(new Date(e,s-1,h)),u.getFullYear()!==e||u.getMonth()+1!==s||u.getDate()!==h)throw"Invalid date";return u},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(1970/4)-Math.floor(1970/100)+Math.floor(1970/400))*864e9,formatDate:function(n,t,i){if(!t)return"";var u,h=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,c=(i?i.dayNames:null)||this._defaults.dayNames,l=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,a=(i?i.monthNames:null)||this._defaults.monthNames,f=function(t){var i=u+1<n.length&&n.charAt(u+1)===t;return i&&u++,i},e=function(n,t,i){var r=""+t;if(f(n))while(r.length<i)r="0"+r;return r},s=function(n,t,i,r){return f(n)?r[t]:i[t]},r="",o=!1;if(t)for(u=0;u<n.length;u++)if(o)n.charAt(u)!=="'"||f("'")?r+=n.charAt(u):o=!1;else switch(n.charAt(u)){case"d":r+=e("d",t.getDate(),2);break;case"D":r+=s("D",t.getDay(),h,c);break;case"o":r+=e("o",Math.round((new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()-new Date(t.getFullYear(),0,0).getTime())/864e5),3);break;case"m":r+=e("m",t.getMonth()+1,2);break;case"M":r+=s("M",t.getMonth(),l,a);break;case"y":r+=f("y")?t.getFullYear():(t.getYear()%100<10?"0":"")+t.getYear()%100;break;case"@":r+=t.getTime();break;case"!":r+=t.getTime()*1e4+this._ticksTo1970;break;case"'":f("'")?r+="'":o=!0;break;default:r+=n.charAt(u)}return r},_possibleChars:function(n){for(var i="",r=!1,u=function(i){var r=t+1<n.length&&n.charAt(t+1)===i;return r&&t++,r},t=0;t<n.length;t++)if(r)n.charAt(t)!=="'"||u("'")?i+=n.charAt(t):r=!1;else switch(n.charAt(t)){case"d":case"m":case"y":case"@":i+="0123456789";break;case"D":case"M":return null;case"'":u("'")?i+="'":r=!0;break;default:i+=n.charAt(t)}return i},_get:function(n,t){return n.settings[t]!==undefined?n.settings[t]:this._defaults[t]},_setDateFromField:function(n,t){if(n.input.val()!==n.lastVal){var f=this._get(n,"dateFormat"),r=n.lastVal=n.input?n.input.val():null,u=this._getDefaultDate(n),i=u,e=this._getFormatConfig(n);try{i=this.parseDate(f,r,e)||u}catch(o){r=t?"":r}n.selectedDay=i.getDate();n.drawMonth=n.selectedMonth=i.getMonth();n.drawYear=n.selectedYear=i.getFullYear();n.currentDay=r?i.getDate():0;n.currentMonth=r?i.getMonth():0;n.currentYear=r?i.getFullYear():0;this._adjustInstDate(n)}},_getDefaultDate:function(n){return this._restrictMinMax(n,this._determineDate(n,this._get(n,"defaultDate"),new Date))},_determineDate:function(t,i,r){var f=function(n){var t=new Date;return t.setDate(t.getDate()+n),t},e=function(i){try{return n.datepicker.parseDate(n.datepicker._get(t,"dateFormat"),i,n.datepicker._getFormatConfig(t))}catch(h){}for(var o=(i.toLowerCase().match(/^c/)?n.datepicker._getDate(t):null)||new Date,f=o.getFullYear(),e=o.getMonth(),r=o.getDate(),s=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,u=s.exec(i);u;){switch(u[2]||"d"){case"d":case"D":r+=parseInt(u[1],10);break;case"w":case"W":r+=parseInt(u[1],10)*7;break;case"m":case"M":e+=parseInt(u[1],10);r=Math.min(r,n.datepicker._getDaysInMonth(f,e));break;case"y":case"Y":f+=parseInt(u[1],10);r=Math.min(r,n.datepicker._getDaysInMonth(f,e))}u=s.exec(i)}return new Date(f,e,r)},u=i==null||i===""?r:typeof i=="string"?e(i):typeof i=="number"?isNaN(i)?r:f(i):new Date(i.getTime());return u=u&&u.toString()==="Invalid Date"?r:u,u&&(u.setHours(0),u.setMinutes(0),u.setSeconds(0),u.setMilliseconds(0)),this._daylightSavingAdjust(u)},_daylightSavingAdjust:function(n){return n?(n.setHours(n.getHours()>12?n.getHours()+2:0),n):null},_setDate:function(n,t,i){var u=!t,f=n.selectedMonth,e=n.selectedYear,r=this._restrictMinMax(n,this._determineDate(n,t,new Date));n.selectedDay=n.currentDay=r.getDate();n.drawMonth=n.selectedMonth=n.currentMonth=r.getMonth();n.drawYear=n.selectedYear=n.currentYear=r.getFullYear();f===n.selectedMonth&&e===n.selectedYear||i||this._notifyChange(n);this._adjustInstDate(n);n.input&&n.input.val(u?"":this._formatDate(n))},_getDate:function(n){return!n.currentYear||n.input&&n.input.val()===""?null:this._daylightSavingAdjust(new Date(n.currentYear,n.currentMonth,n.currentDay))},_attachHandlers:function(t){var r=this._get(t,"stepMonths"),i="#"+t.id.replace(/\\\\/g,"\\");t.dpDiv.find("[data-handler]").map(function(){var t={prev:function(){n.datepicker._adjustDate(i,-r,"M")},next:function(){n.datepicker._adjustDate(i,+r,"M")},hide:function(){n.datepicker._hideDatepicker()},today:function(){n.datepicker._gotoToday(i)},selectDay:function(){return n.datepicker._selectDay(i,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return n.datepicker._selectMonthYear(i,this,"M"),!1},selectYear:function(){return n.datepicker._selectMonthYear(i,this,"Y"),!1}};n(this).bind(this.getAttribute("data-event"),t[this.getAttribute("data-handler")])})},_generateHTML:function(n){var b,s,rt,h,ut,k,ft,et,ri,c,ot,ui,fi,ei,oi,st,g,si,ht,nt,f,y,ct,p,lt,l,u,at,vt,yt,pt,tt,wt,i,bt,kt,d,a,it,dt=new Date,gt=this._daylightSavingAdjust(new Date(dt.getFullYear(),dt.getMonth(),dt.getDate())),e=this._get(n,"isRTL"),li=this._get(n,"showButtonPanel"),hi=this._get(n,"hideIfNoPrevNext"),ni=this._get(n,"navigationAsDateFormat"),o=this._getNumberOfMonths(n),ai=this._get(n,"showCurrentAtPos"),ci=this._get(n,"stepMonths"),ti=o[0]!==1||o[1]!==1,ii=this._daylightSavingAdjust(n.currentDay?new Date(n.currentYear,n.currentMonth,n.currentDay):new Date(9999,9,9)),w=this._getMinMaxDate(n,"min"),v=this._getMinMaxDate(n,"max"),t=n.drawMonth-ai,r=n.drawYear;if(t<0&&(t+=12,r--),v)for(b=this._daylightSavingAdjust(new Date(v.getFullYear(),v.getMonth()-o[0]*o[1]+1,v.getDate())),b=w&&b<w?w:b;this._daylightSavingAdjust(new Date(r,t,1))>b;)t--,t<0&&(t=11,r--);for(n.drawMonth=t,n.drawYear=r,s=this._get(n,"prevText"),s=ni?this.formatDate(s,this._daylightSavingAdjust(new Date(r,t-ci,1)),this._getFormatConfig(n)):s,rt=this._canAdjustMonth(n,-1,r,t)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+s+"'><span class='ui-icon ui-icon-circle-triangle-"+(e?"e":"w")+"'>"+s+"<\/span><\/a>":hi?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+s+"'><span class='ui-icon ui-icon-circle-triangle-"+(e?"e":"w")+"'>"+s+"<\/span><\/a>",h=this._get(n,"nextText"),h=ni?this.formatDate(h,this._daylightSavingAdjust(new Date(r,t+ci,1)),this._getFormatConfig(n)):h,ut=this._canAdjustMonth(n,1,r,t)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+h+"'><span class='ui-icon ui-icon-circle-triangle-"+(e?"w":"e")+"'>"+h+"<\/span><\/a>":hi?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+h+"'><span class='ui-icon ui-icon-circle-triangle-"+(e?"w":"e")+"'>"+h+"<\/span><\/a>",k=this._get(n,"currentText"),ft=this._get(n,"gotoCurrent")&&n.currentDay?ii:gt,k=ni?this.formatDate(k,ft,this._getFormatConfig(n)):k,et=n.inline?"":"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>"+this._get(n,"closeText")+"<\/button>",ri=li?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(e?et:"")+(this._isInRange(n,ft)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+k+"<\/button>":"")+(e?"":et)+"<\/div>":"",c=parseInt(this._get(n,"firstDay"),10),c=isNaN(c)?0:c,ot=this._get(n,"showWeek"),ui=this._get(n,"dayNames"),fi=this._get(n,"dayNamesMin"),ei=this._get(n,"monthNames"),oi=this._get(n,"monthNamesShort"),st=this._get(n,"beforeShowDay"),g=this._get(n,"showOtherMonths"),si=this._get(n,"selectOtherMonths"),ht=this._getDefaultDate(n),nt="",f,y=0;y<o[0];y++){for(ct="",this.maxRows=4,p=0;p<o[1];p++){if(lt=this._daylightSavingAdjust(new Date(r,t,n.selectedDay)),l=" ui-corner-all",u="",ti){if(u+="<div class='ui-datepicker-group",o[1]>1)switch(p){case 0:u+=" ui-datepicker-group-first";l=" ui-corner-"+(e?"right":"left");break;case o[1]-1:u+=" ui-datepicker-group-last";l=" ui-corner-"+(e?"left":"right");break;default:u+=" ui-datepicker-group-middle";l=""}u+="'>"}for(u+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+l+"'>"+(/all|left/.test(l)&&y===0?e?ut:rt:"")+(/all|right/.test(l)&&y===0?e?rt:ut:"")+this._generateMonthYearHeader(n,t,r,w,v,y>0||p>0,ei,oi)+"<\/div><table class='ui-datepicker-calendar'><thead><tr>",at=ot?"<th class='ui-datepicker-week-col'>"+this._get(n,"weekHeader")+"<\/th>":"",f=0;f<7;f++)vt=(f+c)%7,at+="<th scope='col'"+((f+c+6)%7>=5?" class='ui-datepicker-week-end'":"")+"><span title='"+ui[vt]+"'>"+fi[vt]+"<\/span><\/th>";for(u+=at+"<\/tr><\/thead><tbody>",yt=this._getDaysInMonth(r,t),r===n.selectedYear&&t===n.selectedMonth&&(n.selectedDay=Math.min(n.selectedDay,yt)),pt=(this._getFirstDayOfMonth(r,t)-c+7)%7,tt=Math.ceil((pt+yt)/7),wt=ti?this.maxRows>tt?this.maxRows:tt:tt,this.maxRows=wt,i=this._daylightSavingAdjust(new Date(r,t,1-pt)),bt=0;bt<wt;bt++){for(u+="<tr>",kt=ot?"<td class='ui-datepicker-week-col'>"+this._get(n,"calculateWeek")(i)+"<\/td>":"",f=0;f<7;f++)d=st?st.apply(n.input?n.input[0]:null,[i]):[!0,""],a=i.getMonth()!==t,it=a&&!si||!d[0]||w&&i<w||v&&i>v,kt+="<td class='"+((f+c+6)%7>=5?" ui-datepicker-week-end":"")+(a?" ui-datepicker-other-month":"")+(i.getTime()===lt.getTime()&&t===n.selectedMonth&&n._keyEvent||ht.getTime()===i.getTime()&&ht.getTime()===lt.getTime()?" "+this._dayOverClass:"")+(it?" "+this._unselectableClass+" ui-state-disabled":"")+(a&&!g?"":" "+d[1]+(i.getTime()===ii.getTime()?" "+this._currentClass:"")+(i.getTime()===gt.getTime()?" ui-datepicker-today":""))+"'"+((!a||g)&&d[2]?" title='"+d[2].replace(/'/g,"&#39;")+"'":"")+(it?"":" data-handler='selectDay' data-event='click' data-month='"+i.getMonth()+"' data-year='"+i.getFullYear()+"'")+">"+(a&&!g?"&#xa0;":it?"<span class='ui-state-default'>"+i.getDate()+"<\/span>":"<a class='ui-state-default"+(i.getTime()===gt.getTime()?" ui-state-highlight":"")+(i.getTime()===ii.getTime()?" ui-state-active":"")+(a?" ui-priority-secondary":"")+"' href='#'>"+i.getDate()+"<\/a>")+"<\/td>",i.setDate(i.getDate()+1),i=this._daylightSavingAdjust(i);u+=kt+"<\/tr>"}t++;t>11&&(t=0,r++);u+="<\/tbody><\/table>"+(ti?"<\/div>"+(o[0]>0&&p===o[1]-1?"<div class='ui-datepicker-row-break'><\/div>":""):"");ct+=u}nt+=ct}return nt+=ri,n._keyEvent=!1,nt},_generateMonthYearHeader:function(n,t,i,r,u,f,e,o){var k,d,h,v,y,p,s,a,w=this._get(n,"changeMonth"),b=this._get(n,"changeYear"),g=this._get(n,"showMonthAfterYear"),c="<div class='ui-datepicker-title'>",l="";if(f||!w)l+="<span class='ui-datepicker-month'>"+e[t]+"<\/span>";else{for(k=r&&r.getFullYear()===i,d=u&&u.getFullYear()===i,l+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",h=0;h<12;h++)(!k||h>=r.getMonth())&&(!d||h<=u.getMonth())&&(l+="<option value='"+h+"'"+(h===t?" selected='selected'":"")+">"+o[h]+"<\/option>");l+="<\/select>"}if(g||(c+=l+(f||!(w&&b)?"&#xa0;":"")),!n.yearshtml)if(n.yearshtml="",f||!b)c+="<span class='ui-datepicker-year'>"+i+"<\/span>";else{for(v=this._get(n,"yearRange").split(":"),y=(new Date).getFullYear(),p=function(n){var t=n.match(/c[+\-].*/)?i+parseInt(n.substring(1),10):n.match(/[+\-].*/)?y+parseInt(n,10):parseInt(n,10);return isNaN(t)?y:t},s=p(v[0]),a=Math.max(s,p(v[1]||"")),s=r?Math.max(s,r.getFullYear()):s,a=u?Math.min(a,u.getFullYear()):a,n.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";s<=a;s++)n.yearshtml+="<option value='"+s+"'"+(s===i?" selected='selected'":"")+">"+s+"<\/option>";n.yearshtml+="<\/select>";c+=n.yearshtml;n.yearshtml=null}return c+=this._get(n,"yearSuffix"),g&&(c+=(f||!(w&&b)?"&#xa0;":"")+l),c+"<\/div>"},_adjustInstDate:function(n,t,i){var u=n.drawYear+(i==="Y"?t:0),f=n.drawMonth+(i==="M"?t:0),e=Math.min(n.selectedDay,this._getDaysInMonth(u,f))+(i==="D"?t:0),r=this._restrictMinMax(n,this._daylightSavingAdjust(new Date(u,f,e)));n.selectedDay=r.getDate();n.drawMonth=n.selectedMonth=r.getMonth();n.drawYear=n.selectedYear=r.getFullYear();(i==="M"||i==="Y")&&this._notifyChange(n)},_restrictMinMax:function(n,t){var i=this._getMinMaxDate(n,"min"),r=this._getMinMaxDate(n,"max"),u=i&&t<i?i:t;return r&&u>r?r:u},_notifyChange:function(n){var t=this._get(n,"onChangeMonthYear");t&&t.apply(n.input?n.input[0]:null,[n.selectedYear,n.selectedMonth+1,n])},_getNumberOfMonths:function(n){var t=this._get(n,"numberOfMonths");return t==null?[1,1]:typeof t=="number"?[1,t]:t},_getMinMaxDate:function(n,t){return this._determineDate(n,this._get(n,t+"Date"),null)},_getDaysInMonth:function(n,t){return 32-this._daylightSavingAdjust(new Date(n,t,32)).getDate()},_getFirstDayOfMonth:function(n,t){return new Date(n,t,1).getDay()},_canAdjustMonth:function(n,t,i,r){var f=this._getNumberOfMonths(n),u=this._daylightSavingAdjust(new Date(i,r+(t<0?t:f[0]*f[1]),1));return t<0&&u.setDate(this._getDaysInMonth(u.getFullYear(),u.getMonth())),this._isInRange(n,u)},_isInRange:function(n,t){var i,f,e=this._getMinMaxDate(n,"min"),o=this._getMinMaxDate(n,"max"),r=null,u=null,s=this._get(n,"yearRange");return s&&(i=s.split(":"),f=(new Date).getFullYear(),r=parseInt(i[0],10),u=parseInt(i[1],10),i[0].match(/[+\-].*/)&&(r+=f),i[1].match(/[+\-].*/)&&(u+=f)),(!e||t.getTime()>=e.getTime())&&(!o||t.getTime()<=o.getTime())&&(!r||t.getFullYear()>=r)&&(!u||t.getFullYear()<=u)},_getFormatConfig:function(n){var t=this._get(n,"shortYearCutoff");return t=typeof t!="string"?t:(new Date).getFullYear()%100+parseInt(t,10),{shortYearCutoff:t,dayNamesShort:this._get(n,"dayNamesShort"),dayNames:this._get(n,"dayNames"),monthNamesShort:this._get(n,"monthNamesShort"),monthNames:this._get(n,"monthNames")}},_formatDate:function(n,t,i,r){t||(n.currentDay=n.selectedDay,n.currentMonth=n.selectedMonth,n.currentYear=n.selectedYear);var u=t?typeof t=="object"?t:this._daylightSavingAdjust(new Date(r,i,t)):this._daylightSavingAdjust(new Date(n.currentYear,n.currentMonth,n.currentDay));return this.formatDate(this._get(n,"dateFormat"),u,this._getFormatConfig(n))}});n.fn.datepicker=function(t){if(!this.length)return this;n.datepicker.initialized||(n(document).mousedown(n.datepicker._checkExternalClick),n.datepicker.initialized=!0);n("#"+n.datepicker._mainDivId).length===0&&n("body").append(n.datepicker.dpDiv);var i=Array.prototype.slice.call(arguments,1);return typeof t=="string"&&(t==="isDisabled"||t==="getDate"||t==="widget")?n.datepicker["_"+t+"Datepicker"].apply(n.datepicker,[this[0]].concat(i)):t==="option"&&arguments.length===2&&typeof arguments[1]=="string"?n.datepicker["_"+t+"Datepicker"].apply(n.datepicker,[this[0]].concat(i)):this.each(function(){typeof t=="string"?n.datepicker["_"+t+"Datepicker"].apply(n.datepicker,[this].concat(i)):n.datepicker._attachDatepicker(this,t)})};n.datepicker=new v;n.datepicker.initialized=!1;n.datepicker.uuid=(new Date).getTime();n.datepicker.version="1.11.1";it=n.datepicker;n.widget("ui.draggable",n.ui.mouse,{version:"1.11.1",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){this.options.helper!=="original"||/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative");this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._setHandleClassName();this._mouseInit()},_setOption:function(n,t){this._super(n,t);n==="handle"&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){if((this.helper||this.element).is(".ui-draggable-dragging")){this.destroyOnClear=!0;return}this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._removeHandleClassName();this._mouseDestroy()},_mouseCapture:function(t){var i=this.document[0],r=this.options;try{i.activeElement&&i.activeElement.nodeName.toLowerCase()!=="body"&&n(i.activeElement).blur()}catch(u){}return this.helper||r.disabled||n(t.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(t),!this.handle)?!1:(n(r.iframeFix===!0?"iframe":r.iframeFix).each(function(){n("<div class='ui-draggable-iframeFix' style='background: #fff;'><\/div>").css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(n(this).offset()).appendTo("body")}),!0)},_mouseStart:function(t){var i=this.options;return(this.helper=this._createHelper(t),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),n.ui.ddmanager&&(n.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.offsetParentCssPosition=this.offsetParent.css("position"),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},this.offset.scroll=!1,n.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(t,!1),this.originalPageX=t.pageX,this.originalPageY=t.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),this._trigger("start",t)===!1)?(this._clear(),!1):(this._cacheHelperProportions(),n.ui.ddmanager&&!i.dropBehaviour&&n.ui.ddmanager.prepareOffsets(this,t),this._mouseDrag(t,!0),n.ui.ddmanager&&n.ui.ddmanager.dragStart(this,t),!0)},_mouseDrag:function(t,i){if(this.offsetParentCssPosition==="fixed"&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(t,!0),this.positionAbs=this._convertPositionTo("absolute"),!i){var r=this._uiHash();if(this._trigger("drag",t,r)===!1)return this._mouseUp({}),!1;this.position=r.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",n.ui.ddmanager&&n.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var r=this,i=!1;return n.ui.ddmanager&&!this.options.dropBehaviour&&(i=n.ui.ddmanager.drop(this,t)),this.dropped&&(i=this.dropped,this.dropped=!1),this.options.revert==="invalid"&&!i||this.options.revert==="valid"&&i||this.options.revert===!0||n.isFunction(this.options.revert)&&this.options.revert.call(this.element,i)?n(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){r._trigger("stop",t)!==!1&&r._clear()}):this._trigger("stop",t)!==!1&&this._clear(),!1},_mouseUp:function(t){return n("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),n.ui.ddmanager&&n.ui.ddmanager.dragStop(this,t),this.element.focus(),n.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(t){return this.options.handle?!!n(t.target).closest(this.element.find(this.options.handle)).length:!0},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element;this.handleElement.addClass("ui-draggable-handle")},_removeHandleClassName:function(){this.handleElement.removeClass("ui-draggable-handle")},_createHelper:function(t){var r=this.options,i=n.isFunction(r.helper)?n(r.helper.apply(this.element[0],[t])):r.helper==="clone"?this.element.clone().removeAttr("id"):this.element;return i.parents("body").length||i.appendTo(r.appendTo==="parent"?this.element[0].parentNode:r.appendTo),i[0]===this.element[0]||/(fixed|absolute)/.test(i.css("position"))||i.css("position","absolute"),i},_adjustOffsetFromHelper:function(t){typeof t=="string"&&(t=t.split(" "));n.isArray(t)&&(t={left:+t[0],top:+t[1]||0});"left"in t&&(this.offset.click.left=t.left+this.margins.left);"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left);"top"in t&&(this.offset.click.top=t.top+this.margins.top);"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_isRootNode:function(n){return/(html|body)/i.test(n.tagName)||n===this.document[0]},_getParentOffset:function(){var t=this.offsetParent.offset(),i=this.document[0];return this.cssPosition==="absolute"&&this.scrollParent[0]!==i&&n.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition!=="relative")return{top:0,left:0};var n=this.element.position(),t=this._isRootNode(this.scrollParent[0]);return{top:n.top-(parseInt(this.helper.css("top"),10)||0)+(t?0:this.scrollParent.scrollTop()),left:n.left-(parseInt(this.helper.css("left"),10)||0)+(t?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var f,t,i,r=this.options,u=this.document[0];if(this.relativeContainer=null,!r.containment){this.containment=null;return}if(r.containment==="window"){this.containment=[n(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,n(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,n(window).scrollLeft()+n(window).width()-this.helperProportions.width-this.margins.left,n(window).scrollTop()+(n(window).height()||u.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];return}if(r.containment==="document"){this.containment=[0,0,n(u).width()-this.helperProportions.width-this.margins.left,(n(u).height()||u.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];return}if(r.containment.constructor===Array){this.containment=r.containment;return}(r.containment==="parent"&&(r.containment=this.helper[0].parentNode),t=n(r.containment),i=t[0],i)&&(f=t.css("overflow")!=="hidden",this.containment=[(parseInt(t.css("borderLeftWidth"),10)||0)+(parseInt(t.css("paddingLeft"),10)||0),(parseInt(t.css("borderTopWidth"),10)||0)+(parseInt(t.css("paddingTop"),10)||0),(f?Math.max(i.scrollWidth,i.offsetWidth):i.offsetWidth)-(parseInt(t.css("borderRightWidth"),10)||0)-(parseInt(t.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(f?Math.max(i.scrollHeight,i.offsetHeight):i.offsetHeight)-(parseInt(t.css("borderBottomWidth"),10)||0)-(parseInt(t.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=t)},_convertPositionTo:function(n,t){t||(t=this.position);var i=n==="absolute"?1:-1,r=this._isRootNode(this.scrollParent[0]);return{top:t.top+this.offset.relative.top*i+this.offset.parent.top*i-(this.cssPosition==="fixed"?-this.offset.scroll.top:r?0:this.offset.scroll.top)*i,left:t.left+this.offset.relative.left*i+this.offset.parent.left*i-(this.cssPosition==="fixed"?-this.offset.scroll.left:r?0:this.offset.scroll.left)*i}},_generatePosition:function(n,t){var i,s,u,f,r=this.options,h=this._isRootNode(this.scrollParent[0]),e=n.pageX,o=n.pageY;return h&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),t&&(this.containment&&(this.relativeContainer?(s=this.relativeContainer.offset(),i=[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]):i=this.containment,n.pageX-this.offset.click.left<i[0]&&(e=i[0]+this.offset.click.left),n.pageY-this.offset.click.top<i[1]&&(o=i[1]+this.offset.click.top),n.pageX-this.offset.click.left>i[2]&&(e=i[2]+this.offset.click.left),n.pageY-this.offset.click.top>i[3]&&(o=i[3]+this.offset.click.top)),r.grid&&(u=r.grid[1]?this.originalPageY+Math.round((o-this.originalPageY)/r.grid[1])*r.grid[1]:this.originalPageY,o=i?u-this.offset.click.top>=i[1]||u-this.offset.click.top>i[3]?u:u-this.offset.click.top>=i[1]?u-r.grid[1]:u+r.grid[1]:u,f=r.grid[0]?this.originalPageX+Math.round((e-this.originalPageX)/r.grid[0])*r.grid[0]:this.originalPageX,e=i?f-this.offset.click.left>=i[0]||f-this.offset.click.left>i[2]?f:f-this.offset.click.left>=i[0]?f-r.grid[0]:f+r.grid[0]:f),r.axis==="y"&&(e=this.originalPageX),r.axis==="x"&&(o=this.originalPageY)),{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(this.cssPosition==="fixed"?-this.offset.scroll.top:h?0:this.offset.scroll.top),left:e-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition==="fixed"?-this.offset.scroll.left:h?0:this.offset.scroll.left)}},_clear:function(){this.helper.removeClass("ui-draggable-dragging");this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove();this.helper=null;this.cancelHelperRemoval=!1;this.destroyOnClear&&this.destroy()},_trigger:function(t,i,r){return r=r||this._uiHash(),n.ui.plugin.call(this,t,[i,r,this],!0),t==="drag"&&(this.positionAbs=this._convertPositionTo("absolute")),n.Widget.prototype._trigger.call(this,t,i,r)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}});n.ui.plugin.add("draggable","connectToSortable",{start:function(t,i,r){var u=r.options,f=n.extend({},i,{item:r.element});r.sortables=[];n(u.connectToSortable).each(function(){var i=n(this).sortable("instance");i&&!i.options.disabled&&(r.sortables.push({instance:i,shouldRevert:i.options.revert}),i.refreshPositions(),i._trigger("activate",t,f))})},stop:function(t,i,r){var u=n.extend({},i,{item:r.element});n.each(r.sortables,function(){this.instance.isOver?(this.instance.isOver=0,r.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=this.shouldRevert),this.instance._mouseStop(t),this.instance.options.helper=this.instance.options._helper,r.options.helper==="original"&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",t,u))})},drag:function(t,i,r){var u=this;n.each(r.sortables,function(){var f=!1,e=this;this.instance.positionAbs=r.positionAbs;this.instance.helperProportions=r.helperProportions;this.instance.offset.click=r.offset.click;this.instance._intersectsWith(this.instance.containerCache)&&(f=!0,n.each(r.sortables,function(){return this.instance.positionAbs=r.positionAbs,this.instance.helperProportions=r.helperProportions,this.instance.offset.click=r.offset.click,this!==e&&this.instance._intersectsWith(this.instance.containerCache)&&n.contains(e.instance.element[0],this.instance.element[0])&&(f=!1),f}));f?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=n(u).clone().removeAttr("id").appendTo(this.instance.element).data("ui-sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return i.helper[0]},t.target=this.instance.currentItem[0],this.instance._mouseCapture(t,!0),this.instance._mouseStart(t,!0,!0),this.instance.offset.click.top=r.offset.click.top,this.instance.offset.click.left=r.offset.click.left,this.instance.offset.parent.left-=r.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=r.offset.parent.top-this.instance.offset.parent.top,r._trigger("toSortable",t),r.dropped=this.instance.element,r.currentItem=r.element,this.instance.fromOutside=r),this.instance.currentItem&&this.instance._mouseDrag(t)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",t,this.instance._uiHash(this.instance)),this.instance._mouseStop(t,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),r._trigger("fromSortable",t),r.dropped=!1)})}});n.ui.plugin.add("draggable","cursor",{start:function(t,i,r){var u=n("body"),f=r.options;u.css("cursor")&&(f._cursor=u.css("cursor"));u.css("cursor",f.cursor)},stop:function(t,i,r){var u=r.options;u._cursor&&n("body").css("cursor",u._cursor)}});n.ui.plugin.add("draggable","opacity",{start:function(t,i,r){var u=n(i.helper),f=r.options;u.css("opacity")&&(f._opacity=u.css("opacity"));u.css("opacity",f.opacity)},stop:function(t,i,r){var u=r.options;u._opacity&&n(i.helper).css("opacity",u._opacity)}});n.ui.plugin.add("draggable","scroll",{start:function(n,t,i){i.scrollParentNotHidden||(i.scrollParentNotHidden=i.helper.scrollParent(!1));i.scrollParentNotHidden[0]!==i.document[0]&&i.scrollParentNotHidden[0].tagName!=="HTML"&&(i.overflowOffset=i.scrollParentNotHidden.offset())},drag:function(t,i,r){var u=r.options,o=!1,e=r.scrollParentNotHidden[0],f=r.document[0];e!==f&&e.tagName!=="HTML"?(u.axis&&u.axis==="x"||(r.overflowOffset.top+e.offsetHeight-t.pageY<u.scrollSensitivity?e.scrollTop=o=e.scrollTop+u.scrollSpeed:t.pageY-r.overflowOffset.top<u.scrollSensitivity&&(e.scrollTop=o=e.scrollTop-u.scrollSpeed)),u.axis&&u.axis==="y"||(r.overflowOffset.left+e.offsetWidth-t.pageX<u.scrollSensitivity?e.scrollLeft=o=e.scrollLeft+u.scrollSpeed:t.pageX-r.overflowOffset.left<u.scrollSensitivity&&(e.scrollLeft=o=e.scrollLeft-u.scrollSpeed))):(u.axis&&u.axis==="x"||(t.pageY-n(f).scrollTop()<u.scrollSensitivity?o=n(f).scrollTop(n(f).scrollTop()-u.scrollSpeed):n(window).height()-(t.pageY-n(f).scrollTop())<u.scrollSensitivity&&(o=n(f).scrollTop(n(f).scrollTop()+u.scrollSpeed))),u.axis&&u.axis==="y"||(t.pageX-n(f).scrollLeft()<u.scrollSensitivity?o=n(f).scrollLeft(n(f).scrollLeft()-u.scrollSpeed):n(window).width()-(t.pageX-n(f).scrollLeft())<u.scrollSensitivity&&(o=n(f).scrollLeft(n(f).scrollLeft()+u.scrollSpeed))));o!==!1&&n.ui.ddmanager&&!u.dropBehaviour&&n.ui.ddmanager.prepareOffsets(r,t)}});n.ui.plugin.add("draggable","snap",{start:function(t,i,r){var u=r.options;r.snapElements=[];n(u.snap.constructor!==String?u.snap.items||":data(ui-draggable)":u.snap).each(function(){var t=n(this),i=t.offset();this!==r.element[0]&&r.snapElements.push({item:this,width:t.outerWidth(),height:t.outerHeight(),top:i.top,left:i.left})})},drag:function(t,i,r){for(var e,o,s,h,c,a,l,v,w,b=r.options,f=b.snapTolerance,y=i.offset.left,k=y+r.helperProportions.width,p=i.offset.top,d=p+r.helperProportions.height,u=r.snapElements.length-1;u>=0;u--){if(c=r.snapElements[u].left,a=c+r.snapElements[u].width,l=r.snapElements[u].top,v=l+r.snapElements[u].height,k<c-f||y>a+f||d<l-f||p>v+f||!n.contains(r.snapElements[u].item.ownerDocument,r.snapElements[u].item)){r.snapElements[u].snapping&&r.options.snap.release&&r.options.snap.release.call(r.element,t,n.extend(r._uiHash(),{snapItem:r.snapElements[u].item}));r.snapElements[u].snapping=!1;continue}b.snapMode!=="inner"&&(e=Math.abs(l-d)<=f,o=Math.abs(v-p)<=f,s=Math.abs(c-k)<=f,h=Math.abs(a-y)<=f,e&&(i.position.top=r._convertPositionTo("relative",{top:l-r.helperProportions.height,left:0}).top-r.margins.top),o&&(i.position.top=r._convertPositionTo("relative",{top:v,left:0}).top-r.margins.top),s&&(i.position.left=r._convertPositionTo("relative",{top:0,left:c-r.helperProportions.width}).left-r.margins.left),h&&(i.position.left=r._convertPositionTo("relative",{top:0,left:a}).left-r.margins.left));w=e||o||s||h;b.snapMode!=="outer"&&(e=Math.abs(l-p)<=f,o=Math.abs(v-d)<=f,s=Math.abs(c-y)<=f,h=Math.abs(a-k)<=f,e&&(i.position.top=r._convertPositionTo("relative",{top:l,left:0}).top-r.margins.top),o&&(i.position.top=r._convertPositionTo("relative",{top:v-r.helperProportions.height,left:0}).top-r.margins.top),s&&(i.position.left=r._convertPositionTo("relative",{top:0,left:c}).left-r.margins.left),h&&(i.position.left=r._convertPositionTo("relative",{top:0,left:a-r.helperProportions.width}).left-r.margins.left));!r.snapElements[u].snapping&&(e||o||s||h||w)&&r.options.snap.snap&&r.options.snap.snap.call(r.element,t,n.extend(r._uiHash(),{snapItem:r.snapElements[u].item}));r.snapElements[u].snapping=e||o||s||h||w}}});n.ui.plugin.add("draggable","stack",{start:function(t,i,r){var f,e=r.options,u=n.makeArray(n(e.stack)).sort(function(t,i){return(parseInt(n(t).css("zIndex"),10)||0)-(parseInt(n(i).css("zIndex"),10)||0)});u.length&&(f=parseInt(n(u[0]).css("zIndex"),10)||0,n(u).each(function(t){n(this).css("zIndex",f+t)}),this.css("zIndex",f+u.length))}});n.ui.plugin.add("draggable","zIndex",{start:function(t,i,r){var u=n(i.helper),f=r.options;u.css("zIndex")&&(f._zIndex=u.css("zIndex"));u.css("zIndex",f.zIndex)},stop:function(t,i,r){var u=r.options;u._zIndex&&n(i.helper).css("zIndex",u._zIndex)}});rt=n.ui.draggable;n.widget("ui.resizable",n.ui.mouse,{version:"1.11.1",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(n){return parseInt(n,10)||0},_isNumber:function(n){return!isNaN(parseInt(n,10))},_hasScroll:function(t,i){if(n(t).css("overflow")==="hidden")return!1;var r=i&&i==="left"?"scrollLeft":"scrollTop",u=!1;return t[r]>0?!0:(t[r]=1,u=t[r]>0,t[r]=0,u)},_create:function(){var e,f,r,i,o,u=this,t=this.options;if(this.element.addClass("ui-resizable"),n.extend(this,{_aspectRatio:!!t.aspectRatio,aspectRatio:t.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:t.helper||t.ghost||t.animate?t.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(n("<div class='ui-wrapper' style='overflow: hidden;'><\/div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=t.handles||(n(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this.handles.constructor===String)for(this.handles==="all"&&(this.handles="n,e,s,w,se,sw,ne,nw"),e=this.handles.split(","),this.handles={},f=0;f<e.length;f++)r=n.trim(e[f]),o="ui-resizable-"+r,i=n("<div class='ui-resizable-handle "+o+"'><\/div>"),i.css({zIndex:t.zIndex}),"se"===r&&i.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[r]=".ui-resizable-"+r,this.element.append(i);this._renderAxis=function(t){var i,r,u,f;t=t||this.element;for(i in this.handles)this.handles[i].constructor===String&&(this.handles[i]=this.element.children(this.handles[i]).first().show()),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)&&(r=n(this.handles[i],this.element),f=/sw|ne|nw|se|n|s/.test(i)?r.outerHeight():r.outerWidth(),u=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),t.css(u,f),this._proportionallyResize()),!n(this.handles[i]).length};this._renderAxis(this.element);this._handles=n(".ui-resizable-handle",this.element).disableSelection();this._handles.mouseover(function(){u.resizing||(this.className&&(i=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),u.axis=i&&i[1]?i[1]:"se")});t.autoHide&&(this._handles.hide(),n(this.element).addClass("ui-resizable-autohide").mouseenter(function(){t.disabled||(n(this).removeClass("ui-resizable-autohide"),u._handles.show())}).mouseleave(function(){t.disabled||u.resizing||(n(this).addClass("ui-resizable-autohide"),u._handles.hide())}));this._mouseInit()},_destroy:function(){this._mouseDestroy();var t,i=function(t){n(t).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(i(this.element),t=this.element,this.originalElement.css({position:t.css("position"),width:t.outerWidth(),height:t.outerHeight(),top:t.css("top"),left:t.css("left")}).insertAfter(t),t.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_mouseCapture:function(t){var r,i,u=!1;for(r in this.handles)i=n(this.handles[r])[0],(i===t.target||n.contains(i,t.target))&&(u=!0);return!this.options.disabled&&u},_mouseStart:function(t){var u,f,e,r=this.options,i=this.element;return this.resizing=!0,this._renderProxy(),u=this._num(this.helper.css("left")),f=this._num(this.helper.css("top")),r.containment&&(u+=n(r.containment).scrollLeft()||0,f+=n(r.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:u,top:f},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:i.width(),height:i.height()},this.originalSize=this._helper?{width:i.outerWidth(),height:i.outerHeight()}:{width:i.width(),height:i.height()},this.sizeDiff={width:i.outerWidth()-i.width(),height:i.outerHeight()-i.height()},this.originalPosition={left:u,top:f},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio=typeof r.aspectRatio=="number"?r.aspectRatio:this.originalSize.width/this.originalSize.height||1,e=n(".ui-resizable-"+this.axis).css("cursor"),n("body").css("cursor",e==="auto"?this.axis+"-resize":e),i.addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(t){var i,r,u=this.originalMousePosition,e=this.axis,o=t.pageX-u.left||0,s=t.pageY-u.top||0,f=this._change[e];return(this._updatePrevProperties(),!f)?!1:(i=f.apply(this,[t,o,s]),this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(i=this._updateRatio(i,t)),i=this._respectSize(i,t),this._updateCache(i),this._propagate("resize",t),r=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),n.isEmptyObject(r)||(this._updatePrevProperties(),this._trigger("resize",t,this.ui()),this._applyChanges()),!1)},_mouseStop:function(t){this.resizing=!1;var r,u,f,e,o,s,h,c=this.options,i=this;return this._helper&&(r=this._proportionallyResizeElements,u=r.length&&/textarea/i.test(r[0].nodeName),f=u&&this._hasScroll(r[0],"left")?0:i.sizeDiff.height,e=u?0:i.sizeDiff.width,o={width:i.helper.width()-e,height:i.helper.height()-f},s=parseInt(i.element.css("left"),10)+(i.position.left-i.originalPosition.left)||null,h=parseInt(i.element.css("top"),10)+(i.position.top-i.originalPosition.top)||null,c.animate||this.element.css(n.extend(o,{top:h,left:s})),i.helper.height(i.size.height),i.helper.width(i.size.width),this._helper&&!c.animate&&this._proportionallyResize()),n("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left};this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var n={};return this.position.top!==this.prevPosition.top&&(n.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(n.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(n.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(n.height=this.size.height+"px"),this.helper.css(n),n},_updateVirtualBoundaries:function(n){var r,u,f,e,t,i=this.options;t={minWidth:this._isNumber(i.minWidth)?i.minWidth:0,maxWidth:this._isNumber(i.maxWidth)?i.maxWidth:Infinity,minHeight:this._isNumber(i.minHeight)?i.minHeight:0,maxHeight:this._isNumber(i.maxHeight)?i.maxHeight:Infinity};(this._aspectRatio||n)&&(r=t.minHeight*this.aspectRatio,f=t.minWidth/this.aspectRatio,u=t.maxHeight*this.aspectRatio,e=t.maxWidth/this.aspectRatio,r>t.minWidth&&(t.minWidth=r),f>t.minHeight&&(t.minHeight=f),u<t.maxWidth&&(t.maxWidth=u),e<t.maxHeight&&(t.maxHeight=e));this._vBoundaries=t},_updateCache:function(n){this.offset=this.helper.offset();this._isNumber(n.left)&&(this.position.left=n.left);this._isNumber(n.top)&&(this.position.top=n.top);this._isNumber(n.height)&&(this.size.height=n.height);this._isNumber(n.width)&&(this.size.width=n.width)},_updateRatio:function(n){var t=this.position,i=this.size,r=this.axis;return this._isNumber(n.height)?n.width=n.height*this.aspectRatio:this._isNumber(n.width)&&(n.height=n.width/this.aspectRatio),r==="sw"&&(n.left=t.left+(i.width-n.width),n.top=null),r==="nw"&&(n.top=t.top+(i.height-n.height),n.left=t.left+(i.width-n.width)),n},_respectSize:function(n){var t=this._vBoundaries,i=this.axis,r=this._isNumber(n.width)&&t.maxWidth&&t.maxWidth<n.width,u=this._isNumber(n.height)&&t.maxHeight&&t.maxHeight<n.height,f=this._isNumber(n.width)&&t.minWidth&&t.minWidth>n.width,e=this._isNumber(n.height)&&t.minHeight&&t.minHeight>n.height,o=this.originalPosition.left+this.originalSize.width,s=this.position.top+this.size.height,h=/sw|nw|w/.test(i),c=/nw|ne|n/.test(i);return f&&(n.width=t.minWidth),e&&(n.height=t.minHeight),r&&(n.width=t.maxWidth),u&&(n.height=t.maxHeight),f&&h&&(n.left=o-t.minWidth),r&&h&&(n.left=o-t.maxWidth),e&&c&&(n.top=s-t.minHeight),u&&c&&(n.top=s-t.maxHeight),n.width||n.height||n.left||!n.top?n.width||n.height||n.top||!n.left||(n.left=null):n.top=null,n},_getPaddingPlusBorderDimensions:function(n){for(var t=0,i=[],r=[n.css("borderTopWidth"),n.css("borderRightWidth"),n.css("borderBottomWidth"),n.css("borderLeftWidth")],u=[n.css("paddingTop"),n.css("paddingRight"),n.css("paddingBottom"),n.css("paddingLeft")];t<4;t++)i[t]=parseInt(r[t],10)||0,i[t]+=parseInt(u[t],10)||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var n,t=0,i=this.helper||this.element;t<this._proportionallyResizeElements.length;t++)n=this._proportionallyResizeElements[t],this.outerDimensions||(this.outerDimensions=this._getPaddingPlusBorderDimensions(n)),n.css({height:i.height()-this.outerDimensions.height||0,width:i.width()-this.outerDimensions.width||0})},_renderProxy:function(){var t=this.element,i=this.options;this.elementOffset=t.offset();this._helper?(this.helper=this.helper||n("<div style='overflow:hidden;'><\/div>"),this.helper.addClass(this._helper).css({width:this.element.outerWidth()-1,height:this.element.outerHeight()-1,position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(n,t){return{width:this.originalSize.width+t}},w:function(n,t){var i=this.originalSize,r=this.originalPosition;return{left:r.left+t,width:i.width-t}},n:function(n,t,i){var r=this.originalSize,u=this.originalPosition;return{top:u.top+i,height:r.height-i}},s:function(n,t,i){return{height:this.originalSize.height+i}},se:function(t,i,r){return n.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,i,r]))},sw:function(t,i,r){return n.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,i,r]))},ne:function(t,i,r){return n.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,i,r]))},nw:function(t,i,r){return n.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,i,r]))}},_propagate:function(t,i){n.ui.plugin.call(this,t,[i,this.ui()]);t!=="resize"&&this._trigger(t,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});n.ui.plugin.add("resizable","animate",{stop:function(t){var i=n(this).resizable("instance"),u=i.options,r=i._proportionallyResizeElements,f=r.length&&/textarea/i.test(r[0].nodeName),s=f&&i._hasScroll(r[0],"left")?0:i.sizeDiff.height,h=f?0:i.sizeDiff.width,c={width:i.size.width-h,height:i.size.height-s},e=parseInt(i.element.css("left"),10)+(i.position.left-i.originalPosition.left)||null,o=parseInt(i.element.css("top"),10)+(i.position.top-i.originalPosition.top)||null;i.element.animate(n.extend(c,o&&e?{top:o,left:e}:{}),{duration:u.animateDuration,easing:u.animateEasing,step:function(){var u={width:parseInt(i.element.css("width"),10),height:parseInt(i.element.css("height"),10),top:parseInt(i.element.css("top"),10),left:parseInt(i.element.css("left"),10)};r&&r.length&&n(r[0]).css({width:u.width,height:u.height});i._updateCache(u);i._propagate("resize",t)}})}});n.ui.plugin.add("resizable","containment",{start:function(){var r,f,e,o,s,h,c,t=n(this).resizable("instance"),l=t.options,a=t.element,u=l.containment,i=u instanceof n?u.get(0):/parent/.test(u)?a.parent().get(0):u;i&&(t.containerElement=n(i),/document/.test(u)||u===document?(t.containerOffset={left:0,top:0},t.containerPosition={left:0,top:0},t.parentData={element:n(document),left:0,top:0,width:n(document).width(),height:n(document).height()||document.body.parentNode.scrollHeight}):(r=n(i),f=[],n(["Top","Right","Left","Bottom"]).each(function(n,i){f[n]=t._num(r.css("padding"+i))}),t.containerOffset=r.offset(),t.containerPosition=r.position(),t.containerSize={height:r.innerHeight()-f[3],width:r.innerWidth()-f[1]},e=t.containerOffset,o=t.containerSize.height,s=t.containerSize.width,h=t._hasScroll(i,"left")?i.scrollWidth:s,c=t._hasScroll(i)?i.scrollHeight:o,t.parentData={element:i,left:e.left,top:e.top,width:h,height:c}))},resize:function(t){var o,s,h,c,i=n(this).resizable("instance"),v=i.options,r=i.containerOffset,l=i.position,f=i._aspectRatio||t.shiftKey,e={top:0,left:0},a=i.containerElement,u=!0;a[0]!==document&&/static/.test(a.css("position"))&&(e=r);l.left<(i._helper?r.left:0)&&(i.size.width=i.size.width+(i._helper?i.position.left-r.left:i.position.left-e.left),f&&(i.size.height=i.size.width/i.aspectRatio,u=!1),i.position.left=v.helper?r.left:0);l.top<(i._helper?r.top:0)&&(i.size.height=i.size.height+(i._helper?i.position.top-r.top:i.position.top),f&&(i.size.width=i.size.height*i.aspectRatio,u=!1),i.position.top=i._helper?r.top:0);h=i.containerElement.get(0)===i.element.parent().get(0);c=/relative|absolute/.test(i.containerElement.css("position"));h&&c?(i.offset.left=i.parentData.left+i.position.left,i.offset.top=i.parentData.top+i.position.top):(i.offset.left=i.element.offset().left,i.offset.top=i.element.offset().top);o=Math.abs(i.sizeDiff.width+(i._helper?i.offset.left-e.left:i.offset.left-r.left));s=Math.abs(i.sizeDiff.height+(i._helper?i.offset.top-e.top:i.offset.top-r.top));o+i.size.width>=i.parentData.width&&(i.size.width=i.parentData.width-o,f&&(i.size.height=i.size.width/i.aspectRatio,u=!1));s+i.size.height>=i.parentData.height&&(i.size.height=i.parentData.height-s,f&&(i.size.width=i.size.height*i.aspectRatio,u=!1));u||(i.position.left=i.prevPosition.left,i.position.top=i.prevPosition.top,i.size.width=i.prevSize.width,i.size.height=i.prevSize.height)},stop:function(){var t=n(this).resizable("instance"),r=t.options,u=t.containerOffset,f=t.containerPosition,e=t.containerElement,i=n(t.helper),o=i.offset(),s=i.outerWidth()-t.sizeDiff.width,h=i.outerHeight()-t.sizeDiff.height;t._helper&&!r.animate&&/relative/.test(e.css("position"))&&n(this).css({left:o.left-f.left-u.left,width:s,height:h});t._helper&&!r.animate&&/static/.test(e.css("position"))&&n(this).css({left:o.left-f.left-u.left,width:s,height:h})}});n.ui.plugin.add("resizable","alsoResize",{start:function(){var r=n(this).resizable("instance"),t=r.options,i=function(t){n(t).each(function(){var t=n(this);t.data("ui-resizable-alsoresize",{width:parseInt(t.width(),10),height:parseInt(t.height(),10),left:parseInt(t.css("left"),10),top:parseInt(t.css("top"),10)})})};typeof t.alsoResize!="object"||t.alsoResize.parentNode?i(t.alsoResize):t.alsoResize.length?(t.alsoResize=t.alsoResize[0],i(t.alsoResize)):n.each(t.alsoResize,function(n){i(n)})},resize:function(t,i){var r=n(this).resizable("instance"),u=r.options,f=r.originalSize,e=r.originalPosition,s={height:r.size.height-f.height||0,width:r.size.width-f.width||0,top:r.position.top-e.top||0,left:r.position.left-e.left||0},o=function(t,r){n(t).each(function(){var t=n(this),f=n(this).data("ui-resizable-alsoresize"),u={},e=r&&r.length?r:t.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];n.each(e,function(n,t){var i=(f[t]||0)+(s[t]||0);i&&i>=0&&(u[t]=i||null)});t.css(u)})};typeof u.alsoResize!="object"||u.alsoResize.nodeType?o(u.alsoResize):n.each(u.alsoResize,function(n,t){o(n,t)})},stop:function(){n(this).removeData("resizable-alsoresize")}});n.ui.plugin.add("resizable","ghost",{start:function(){var t=n(this).resizable("instance"),i=t.options,r=t.size;t.ghost=t.originalElement.clone();t.ghost.css({opacity:.25,display:"block",position:"relative",height:r.height,width:r.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof i.ghost=="string"?i.ghost:"");t.ghost.appendTo(t.helper)},resize:function(){var t=n(this).resizable("instance");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=n(this).resizable("instance");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}});n.ui.plugin.add("resizable","grid",{resize:function(){var h,t=n(this).resizable("instance"),i=t.options,y=t.size,e=t.originalSize,o=t.originalPosition,c=t.axis,l=typeof i.grid=="number"?[i.grid,i.grid]:i.grid,s=l[0]||1,f=l[1]||1,a=Math.round((y.width-e.width)/s)*s,v=Math.round((y.height-e.height)/f)*f,r=e.width+a,u=e.height+v,p=i.maxWidth&&i.maxWidth<r,w=i.maxHeight&&i.maxHeight<u,b=i.minWidth&&i.minWidth>r,k=i.minHeight&&i.minHeight>u;i.grid=l;b&&(r+=s);k&&(u+=f);p&&(r-=s);w&&(u-=f);/^(se|s|e)$/.test(c)?(t.size.width=r,t.size.height=u):/^(ne)$/.test(c)?(t.size.width=r,t.size.height=u,t.position.top=o.top-v):/^(sw)$/.test(c)?(t.size.width=r,t.size.height=u,t.position.left=o.left-a):((u-f<=0||r-s<=0)&&(h=t._getPaddingPlusBorderDimensions(this)),u-f>0?(t.size.height=u,t.position.top=o.top-v):(u=f-h.height,t.size.height=u,t.position.top=o.top+e.height-u),r-s>0?(t.size.width=r,t.position.left=o.left-a):(r=f-h.height,t.size.width=r,t.position.left=o.left+e.width-r))}});ut=n.ui.resizable;ft=n.widget("ui.dialog",{version:"1.11.1",options:{appendTo:"body",autoOpen:!0,buttons:[],closeOnEscape:!0,closeText:"Close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(t){var i=n(this).css(t).offset().top;i<0&&n(this).css("top",t.top-i)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},sizeRelatedOptions:{buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},resizableRelatedOptions:{maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height};this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)};this.originalTitle=this.element.attr("title");this.options.title=this.options.title||this.originalTitle;this._createWrapper();this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(this.uiDialog);this._createTitlebar();this._createButtonPane();this.options.draggable&&n.fn.draggable&&this._makeDraggable();this.options.resizable&&n.fn.resizable&&this._makeResizable();this._isOpen=!1;this._trackFocus()},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var t=this.options.appendTo;return t&&(t.jquery||t.nodeType)?n(t):this.document.find(t||"body").eq(0)},_destroy:function(){var n,t=this.originalPosition;this._destroyOverlay();this.element.removeUniqueId().removeClass("ui-dialog-content ui-widget-content").css(this.originalCss).detach();this.uiDialog.stop(!0,!0).remove();this.originalTitle&&this.element.attr("title",this.originalTitle);n=t.parent.children().eq(t.index);n.length&&n[0]!==this.element[0]?n.before(this.element):t.parent.append(this.element)},widget:function(){return this.uiDialog},disable:n.noop,enable:n.noop,close:function(t){var i,r=this;if(this._isOpen&&this._trigger("beforeClose",t)!==!1){if(this._isOpen=!1,this._focusedElement=null,this._destroyOverlay(),this._untrackInstance(),!this.opener.filter(":focusable").focus().length)try{i=this.document[0].activeElement;i&&i.nodeName.toLowerCase()!=="body"&&n(i).blur()}catch(u){}this._hide(this.uiDialog,this.options.hide,function(){r._trigger("close",t)})}},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(t,i){var r=!1,f=this.uiDialog.siblings(".ui-front:visible").map(function(){return+n(this).css("z-index")}).get(),u=Math.max.apply(null,f);return u>=+this.uiDialog.css("z-index")&&(this.uiDialog.css("z-index",u+1),r=!0),r&&!i&&this._trigger("focus",t),r},open:function(){var t=this;if(this._isOpen){this._moveToTop()&&this._focusTabbable();return}this._isOpen=!0;this.opener=n(this.document[0].activeElement);this._size();this._position();this._createOverlay();this._moveToTop(null,!0);this.overlay&&this.overlay.css("z-index",this.uiDialog.css("z-index")-1);this._show(this.uiDialog,this.options.show,function(){t._focusTabbable();t._trigger("focus")});this._makeFocusTarget();this._trigger("open")},_focusTabbable:function(){var n=this._focusedElement;n||(n=this.element.find("[autofocus]"));n.length||(n=this.element.find(":tabbable"));n.length||(n=this.uiDialogButtonPane.find(":tabbable"));n.length||(n=this.uiDialogTitlebarClose.filter(":tabbable"));n.length||(n=this.uiDialog);n.eq(0).focus()},_keepFocus:function(t){function i(){var t=this.document[0].activeElement,i=this.uiDialog[0]===t||n.contains(this.uiDialog[0],t);i||this._focusTabbable()}t.preventDefault();i.call(this);this._delay(i)},_createWrapper:function(){this.uiDialog=n("<div>").addClass("ui-dialog ui-widget ui-widget-content ui-corner-all ui-front "+this.options.dialogClass).hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo());this._on(this.uiDialog,{keydown:function(t){if(this.options.closeOnEscape&&!t.isDefaultPrevented()&&t.keyCode&&t.keyCode===n.ui.keyCode.ESCAPE){t.preventDefault();this.close(t);return}if(t.keyCode===n.ui.keyCode.TAB&&!t.isDefaultPrevented()){var i=this.uiDialog.find(":tabbable"),r=i.filter(":first"),u=i.filter(":last");t.target!==u[0]&&t.target!==this.uiDialog[0]||t.shiftKey?(t.target===r[0]||t.target===this.uiDialog[0])&&t.shiftKey&&(this._delay(function(){u.focus()}),t.preventDefault()):(this._delay(function(){r.focus()}),t.preventDefault())}},mousedown:function(n){this._moveToTop(n)&&this._focusTabbable()}});this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var t;this.uiDialogTitlebar=n("<div>").addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(this.uiDialog);this._on(this.uiDialogTitlebar,{mousedown:function(t){n(t.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.focus()}});this.uiDialogTitlebarClose=n("<button type='button'><\/button>").button({label:this.options.closeText,icons:{primary:"ui-icon-closethick"},text:!1}).addClass("ui-dialog-titlebar-close").appendTo(this.uiDialogTitlebar);this._on(this.uiDialogTitlebarClose,{click:function(n){n.preventDefault();this.close(n)}});t=n("<span>").uniqueId().addClass("ui-dialog-title").prependTo(this.uiDialogTitlebar);this._title(t);this.uiDialog.attr({"aria-labelledby":t.attr("id")})},_title:function(n){this.options.title||n.html("&#160;");n.text(this.options.title)},_createButtonPane:function(){this.uiDialogButtonPane=n("<div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix");this.uiButtonSet=n("<div>").addClass("ui-dialog-buttonset").appendTo(this.uiDialogButtonPane);this._createButtons()},_createButtons:function(){var i=this,t=this.options.buttons;if(this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),n.isEmptyObject(t)||n.isArray(t)&&!t.length){this.uiDialog.removeClass("ui-dialog-buttons");return}n.each(t,function(t,r){var u,f;r=n.isFunction(r)?{click:r,text:t}:r;r=n.extend({type:"button"},r);u=r.click;r.click=function(){u.apply(i.element[0],arguments)};f={icons:r.icons,text:r.showText};delete r.icons;delete r.showText;n("<button><\/button>",r).button(f).appendTo(i.uiButtonSet)});this.uiDialog.addClass("ui-dialog-buttons");this.uiDialogButtonPane.appendTo(this.uiDialog)},_makeDraggable:function(){function i(n){return{position:n.position,offset:n.offset}}var t=this,r=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(r,u){n(this).addClass("ui-dialog-dragging");t._blockFrames();t._trigger("dragStart",r,i(u))},drag:function(n,r){t._trigger("drag",n,i(r))},stop:function(u,f){var e=f.offset.left-t.document.scrollLeft(),o=f.offset.top-t.document.scrollTop();r.position={my:"left top",at:"left"+(e>=0?"+":"")+e+" top"+(o>=0?"+":"")+o,of:t.window};n(this).removeClass("ui-dialog-dragging");t._unblockFrames();t._trigger("dragStop",u,i(f))}})},_makeResizable:function(){function r(n){return{originalPosition:n.originalPosition,originalSize:n.originalSize,position:n.position,size:n.size}}var t=this,i=this.options,u=i.resizable,f=this.uiDialog.css("position"),e=typeof u=="string"?u:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:i.maxWidth,maxHeight:i.maxHeight,minWidth:i.minWidth,minHeight:this._minHeight(),handles:e,start:function(i,u){n(this).addClass("ui-dialog-resizing");t._blockFrames();t._trigger("resizeStart",i,r(u))},resize:function(n,i){t._trigger("resize",n,r(i))},stop:function(u,f){var e=t.uiDialog.offset(),o=e.left-t.document.scrollLeft(),s=e.top-t.document.scrollTop();i.height=t.uiDialog.height();i.width=t.uiDialog.width();i.position={my:"left top",at:"left"+(o>=0?"+":"")+o+" top"+(s>=0?"+":"")+s,of:t.window};n(this).removeClass("ui-dialog-resizing");t._unblockFrames();t._trigger("resizeStop",u,r(f))}}).css("position",f)},_trackFocus:function(){this._on(this.widget(),{focusin:function(t){this._makeFocusTarget();this._focusedElement=n(t.target)}})},_makeFocusTarget:function(){this._untrackInstance();this._trackingInstances().unshift(this)},_untrackInstance:function(){var t=this._trackingInstances(),i=n.inArray(this,t);i!==-1&&t.splice(i,1)},_trackingInstances:function(){var n=this.document.data("ui-dialog-instances");return n||(n=[],this.document.data("ui-dialog-instances",n)),n},_minHeight:function(){var n=this.options;return n.height==="auto"?n.minHeight:Math.min(n.minHeight,n.height)},_position:function(){var n=this.uiDialog.is(":visible");n||this.uiDialog.show();this.uiDialog.position(this.options.position);n||this.uiDialog.hide()},_setOptions:function(t){var i=this,r=!1,u={};n.each(t,function(n,t){i._setOption(n,t);n in i.sizeRelatedOptions&&(r=!0);n in i.resizableRelatedOptions&&(u[n]=t)});r&&(this._size(),this._position());this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",u)},_setOption:function(n,t){var u,r,i=this.uiDialog;(n==="dialogClass"&&i.removeClass(this.options.dialogClass).addClass(t),n!=="disabled")&&(this._super(n,t),n==="appendTo"&&this.uiDialog.appendTo(this._appendTo()),n==="buttons"&&this._createButtons(),n==="closeText"&&this.uiDialogTitlebarClose.button({label:""+t}),n==="draggable"&&(u=i.is(":data(ui-draggable)"),u&&!t&&i.draggable("destroy"),!u&&t&&this._makeDraggable()),n==="position"&&this._position(),n==="resizable"&&(r=i.is(":data(ui-resizable)"),r&&!t&&i.resizable("destroy"),r&&typeof t=="string"&&i.resizable("option","handles",t),r||t===!1||this._makeResizable()),n==="title"&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var t,i,r,n=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0});n.minWidth>n.width&&(n.width=n.minWidth);t=this.uiDialog.css({height:"auto",width:n.width}).outerHeight();i=Math.max(0,n.minHeight-t);r=typeof n.maxHeight=="number"?Math.max(0,n.maxHeight-t):"none";n.height==="auto"?this.element.css({minHeight:i,maxHeight:r,height:"auto"}):this.element.height(Math.max(0,n.height-t));this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var t=n(this);return n("<div>").css({position:"absolute",width:t.outerWidth(),height:t.outerHeight()}).appendTo(t.parent()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(t){return n(t.target).closest(".ui-dialog").length?!0:!!n(t.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var t=!0;this._delay(function(){t=!1});this.document.data("ui-dialog-overlays")||this._on(this.document,{focusin:function(n){t||this._allowInteraction(n)||(n.preventDefault(),this._trackingInstances()[0]._focusTabbable())}});this.overlay=n("<div>").addClass("ui-widget-overlay ui-front").appendTo(this._appendTo());this._on(this.overlay,{mousedown:"_keepFocus"});this.document.data("ui-dialog-overlays",(this.document.data("ui-dialog-overlays")||0)+1)}},_destroyOverlay:function(){if(this.options.modal&&this.overlay){var n=this.document.data("ui-dialog-overlays")-1;n?this.document.data("ui-dialog-overlays",n):this.document.unbind("focusin").removeData("ui-dialog-overlays");this.overlay.remove();this.overlay=null}}});n.widget("ui.droppable",{version:"1.11.1",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var t,i=this.options,r=i.accept;this.isover=!1;this.isout=!0;this.accept=n.isFunction(r)?r:function(n){return n.is(r)};this.proportions=function(){if(arguments.length)t=arguments[0];else return t?t:t={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}};this._addToManager(i.scope);i.addClasses&&this.element.addClass("ui-droppable")},_addToManager:function(t){n.ui.ddmanager.droppables[t]=n.ui.ddmanager.droppables[t]||[];n.ui.ddmanager.droppables[t].push(this)},_splice:function(n){for(var t=0;t<n.length;t++)n[t]===this&&n.splice(t,1)},_destroy:function(){var t=n.ui.ddmanager.droppables[this.options.scope];this._splice(t);this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(t,i){if(t==="accept")this.accept=n.isFunction(i)?i:function(n){return n.is(i)};else if(t==="scope"){var r=n.ui.ddmanager.droppables[this.options.scope];this._splice(r);this._addToManager(i)}this._super(t,i)},_activate:function(t){var i=n.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass);i&&this._trigger("activate",t,this.ui(i))},_deactivate:function(t){var i=n.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass);i&&this._trigger("deactivate",t,this.ui(i))},_over:function(t){var i=n.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",t,this.ui(i)))},_out:function(t){var i=n.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",t,this.ui(i)))},_drop:function(t,i){var r=i||n.ui.ddmanager.current,u=!1;return!r||(r.currentItem||r.element)[0]===this.element[0]?!1:(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var i=n(this).droppable("instance");if(i.options.greedy&&!i.options.disabled&&i.options.scope===r.options.scope&&i.accept.call(i.element[0],r.currentItem||r.element)&&n.ui.intersect(r,n.extend(i,{offset:i.element.offset()}),i.options.tolerance,t))return u=!0,!1}),u)?!1:this.accept.call(this.element[0],r.currentItem||r.element)?(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",t,this.ui(r)),this.element):!1},ui:function(n){return{draggable:n.currentItem||n.element,helper:n.helper,position:n.position,offset:n.positionAbs}}});n.ui.intersect=function(){function n(n,t,i){return n>=t&&n<t+i}return function(t,i,r,u){if(!i.offset)return!1;var o=(t.positionAbs||t.position.absolute).left,s=(t.positionAbs||t.position.absolute).top,h=o+t.helperProportions.width,c=s+t.helperProportions.height,f=i.offset.left,e=i.offset.top,l=f+i.proportions().width,a=e+i.proportions().height;switch(r){case"fit":return f<=o&&h<=l&&e<=s&&c<=a;case"intersect":return f<o+t.helperProportions.width/2&&h-t.helperProportions.width/2<l&&e<s+t.helperProportions.height/2&&c-t.helperProportions.height/2<a;case"pointer":return n(u.pageY,e,i.proportions().height)&&n(u.pageX,f,i.proportions().width);case"touch":return(s>=e&&s<=a||c>=e&&c<=a||s<e&&c>a)&&(o>=f&&o<=l||h>=f&&h<=l||o<f&&h>l);default:return!1}}}();n.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(t,i){var r,f,u=n.ui.ddmanager.droppables[t.options.scope]||[],o=i?i.type:null,e=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();n:for(r=0;r<u.length;r++)if(!u[r].options.disabled&&(!t||u[r].accept.call(u[r].element[0],t.currentItem||t.element))){for(f=0;f<e.length;f++)if(e[f]===u[r].element[0]){u[r].proportions().height=0;continue n}(u[r].visible=u[r].element.css("display")!=="none",u[r].visible)&&(o==="mousedown"&&u[r]._activate.call(u[r],i),u[r].offset=u[r].element.offset(),u[r].proportions({width:u[r].element[0].offsetWidth,height:u[r].element[0].offsetHeight}))}},drop:function(t,i){var r=!1;return n.each((n.ui.ddmanager.droppables[t.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&n.ui.intersect(t,this,this.options.tolerance,i)&&(r=this._drop.call(this,i)||r),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,i)))}),r},dragStart:function(t,i){t.element.parentsUntil("body").bind("scroll.droppable",function(){t.options.refreshPositions||n.ui.ddmanager.prepareOffsets(t,i)})},drag:function(t,i){t.options.refreshPositions&&n.ui.ddmanager.prepareOffsets(t,i);n.each(n.ui.ddmanager.droppables[t.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var r,e,f,o=n.ui.intersect(t,this,this.options.tolerance,i),u=!o&&this.isover?"isout":o&&!this.isover?"isover":null;u&&(this.options.greedy&&(e=this.options.scope,f=this.element.parents(":data(ui-droppable)").filter(function(){return n(this).droppable("instance").options.scope===e}),f.length&&(r=n(f[0]).droppable("instance"),r.greedyChild=u==="isover")),r&&u==="isover"&&(r.isover=!1,r.isout=!0,r._out.call(r,i)),this[u]=!0,this[u==="isout"?"isover":"isout"]=!1,this[u==="isover"?"_over":"_out"].call(this,i),r&&u==="isout"&&(r.isout=!1,r.isover=!0,r._over.call(r,i)))}})},dragStop:function(t,i){t.element.parentsUntil("body").unbind("scroll.droppable");t.options.refreshPositions||n.ui.ddmanager.prepareOffsets(t,i)}};var ct=n.ui.droppable,w="ui-effects-",b=n;n.effects={effect:{}},function(n,t){function e(n,t,i){var r=s[t.type]||{};return n==null?i||!t.def?null:t.def:(n=r.floor?~~n:parseFloat(n),isNaN(n))?t.def:r.mod?(n+r.mod)%r.mod:0>n?0:r.max<n?r.max:n}function l(t){var e=i(),o=e._rgba=[];return(t=t.toLowerCase(),r(v,function(n,i){var r,s=i.re.exec(t),h=s&&i.parse(s),f=i.space||"rgba";if(h)return r=e[f](h),e[u[f].cache]=r[u[f].cache],o=e._rgba=r._rgba,!1}),o.length)?(o.join()==="0,0,0,0"&&n.extend(o,f.transparent),e):f[t]}function o(n,t,i){return(i=(i+1)%1,i*6<1)?n+(t-n)*i*6:i*2<1?t:i*3<2?n+(t-n)*(2/3-i)*6:n}var a=/^([\-+])=\s*(\d+\.?\d*)/,v=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,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*)?\)/,parse:function(n){return[n[1]*2.55,n[2]*2.55,n[3]*2.55,n[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(n){return[parseInt(n[1],16),parseInt(n[2],16),parseInt(n[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(n){return[parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16),parseInt(n[3]+n[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(n){return[n[1],n[2]/100,n[3]/100,n[4]]}}],i=n.Color=function(t,i,r,u){return new n.Color.fn.parse(t,i,r,u)},u={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},s={byte:{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},h=i.support={},c=n("<p>")[0],f,r=n.each;c.style.cssText="background-color:rgba(1,1,1,.5)";h.rgba=c.style.backgroundColor.indexOf("rgba")>-1;r(u,function(n,t){t.cache="_"+n;t.props.alpha={idx:3,type:"percent",def:1}});i.fn=n.extend(i.prototype,{parse:function(o,s,h,c){if(o===t)return this._rgba=[null,null,null,null],this;(o.jquery||o.nodeType)&&(o=n(o).css(s),s=t);var a=this,v=n.type(o),y=this._rgba=[];return(s!==t&&(o=[o,s,h,c],v="array"),v==="string")?this.parse(l(o)||f._default):v==="array"?(r(u.rgba.props,function(n,t){y[t.idx]=e(o[t.idx],t)}),this):v==="object"?(o instanceof i?r(u,function(n,t){o[t.cache]&&(a[t.cache]=o[t.cache].slice())}):r(u,function(t,i){var u=i.cache;r(i.props,function(n,t){if(!a[u]&&i.to){if(n==="alpha"||o[n]==null)return;a[u]=i.to(a._rgba)}a[u][t.idx]=e(o[n],t,!0)});a[u]&&n.inArray(null,a[u].slice(0,3))<0&&(a[u][3]=1,i.from&&(a._rgba=i.from(a[u])))}),this):void 0},is:function(n){var e=i(n),t=!0,f=this;return r(u,function(n,i){var o,u=e[i.cache];return u&&(o=f[i.cache]||i.to&&i.to(f._rgba)||[],r(i.props,function(n,i){if(u[i.idx]!=null)return t=u[i.idx]===o[i.idx]})),t}),t},_space:function(){var n=[],t=this;return r(u,function(i,r){t[r.cache]&&n.push(i)}),n.pop()},transition:function(n,t){var f=i(n),c=f._space(),o=u[c],l=this.alpha()===0?i("transparent"):this,a=l[o.cache]||o.to(l._rgba),h=a.slice();return f=f[o.cache],r(o.props,function(n,i){var c=i.idx,r=a[c],u=f[c],o=s[i.type]||{};u!==null&&(r===null?h[c]=u:(o.mod&&(u-r>o.mod/2?r+=o.mod:r-u>o.mod/2&&(r-=o.mod)),h[c]=e((u-r)*t+r,i)))}),this[c](h)},blend:function(t){if(this._rgba[3]===1)return this;var r=this._rgba.slice(),u=r.pop(),f=i(t)._rgba;return i(n.map(r,function(n,t){return(1-u)*f[t]+u*n}))},toRgbaString:function(){var i="rgba(",t=n.map(this._rgba,function(n,t){return n==null?t>2?1:0:n});return t[3]===1&&(t.pop(),i="rgb("),i+t.join()+")"},toHslaString:function(){var i="hsla(",t=n.map(this.hsla(),function(n,t){return n==null&&(n=t>2?1:0),t&&t<3&&(n=Math.round(n*100)+"%"),n});return t[3]===1&&(t.pop(),i="hsl("),i+t.join()+")"},toHexString:function(t){var i=this._rgba.slice(),r=i.pop();return t&&i.push(~~(r*255)),"#"+n.map(i,function(n){return n=(n||0).toString(16),n.length===1?"0"+n:n}).join("")},toString:function(){return this._rgba[3]===0?"transparent":this.toRgbaString()}});i.fn.parse.prototype=i.fn;u.hsla.to=function(n){if(n[0]==null||n[1]==null||n[2]==null)return[null,null,null,n[3]];var i=n[0]/255,r=n[1]/255,f=n[2]/255,s=n[3],u=Math.max(i,r,f),e=Math.min(i,r,f),t=u-e,o=u+e,h=o*.5,c,l;return c=e===u?0:i===u?60*(r-f)/t+360:r===u?60*(f-i)/t+120:60*(i-r)/t+240,l=t===0?0:h<=.5?t/o:t/(2-o),[Math.round(c)%360,l,h,s==null?1:s]};u.hsla.from=function(n){if(n[0]==null||n[1]==null||n[2]==null)return[null,null,null,n[3]];var r=n[0]/360,u=n[1],t=n[2],e=n[3],i=t<=.5?t*(1+u):t+u-t*u,f=2*t-i;return[Math.round(o(f,i,r+1/3)*255),Math.round(o(f,i,r)*255),Math.round(o(f,i,r-1/3)*255),e]};r(u,function(u,f){var s=f.props,o=f.cache,h=f.to,c=f.from;i.fn[u]=function(u){if(h&&!this[o]&&(this[o]=h(this._rgba)),u===t)return this[o].slice();var l,a=n.type(u),v=a==="array"||a==="object"?u:arguments,f=this[o].slice();return r(s,function(n,t){var i=v[a==="object"?n:t.idx];i==null&&(i=f[t.idx]);f[t.idx]=e(i,t)}),c?(l=i(c(f)),l[o]=f,l):i(f)};r(s,function(t,r){i.fn[t]||(i.fn[t]=function(i){var f=n.type(i),h=t==="alpha"?this._hsla?"hsla":"rgba":u,o=this[h](),s=o[r.idx],e;return f==="undefined"?s:(f==="function"&&(i=i.call(this,s),f=n.type(i)),i==null&&r.empty)?this:(f==="string"&&(e=a.exec(i),e&&(i=s+parseFloat(e[2])*(e[1]==="+"?1:-1))),o[r.idx]=i,this[h](o))})})});i.hook=function(t){var u=t.split(" ");r(u,function(t,r){n.cssHooks[r]={set:function(t,u){var o,f,e="";if(u!=="transparent"&&(n.type(u)!=="string"||(o=l(u)))){if(u=i(o||u),!h.rgba&&u._rgba[3]!==1){for(f=r==="backgroundColor"?t.parentNode:t;(e===""||e==="transparent")&&f&&f.style;)try{e=n.css(f,"backgroundColor");f=f.parentNode}catch(s){}u=u.blend(e&&e!=="transparent"?e:"_default")}u=u.toRgbaString()}try{t.style[r]=u}catch(s){}}};n.fx.step[r]=function(t){t.colorInit||(t.start=i(t.elem,r),t.end=i(t.end),t.colorInit=!0);n.cssHooks[r].set(t.elem,t.start.transition(t.end,t.pos))}})};i.hook("backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor");n.cssHooks.borderColor={expand:function(n){var t={};return r(["Top","Right","Bottom","Left"],function(i,r){t["border"+r+"Color"]=n}),t}};f=n.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(b),function(){function t(t){var r,u,i=t.ownerDocument.defaultView?t.ownerDocument.defaultView.getComputedStyle(t,null):t.currentStyle,f={};if(i&&i.length&&i[0]&&i[i[0]])for(u=i.length;u--;)r=i[u],typeof i[r]=="string"&&(f[n.camelCase(r)]=i[r]);else for(r in i)typeof i[r]=="string"&&(f[r]=i[r]);return f}function u(t,i){var e={},u,f;for(u in i)f=i[u],t[u]!==f&&(r[u]||(n.fx.step[u]||!isNaN(parseFloat(f)))&&(e[u]=f));return e}var i=["add","remove","toggle"],r={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};n.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(t,i){n.fx.step[i]=function(n){(n.end==="none"||n.setAttr)&&(n.pos!==1||n.setAttr)||(b.style(n.elem,i,n.end),n.setAttr=!0)}});n.fn.addBack||(n.fn.addBack=function(n){return this.add(n==null?this.prevObject:this.prevObject.filter(n))});n.effects.animateClass=function(r,f,e,o){var s=n.speed(f,e,o);return this.queue(function(){var e=n(this),h=e.attr("class")||"",o,f=s.children?e.find("*").addBack():e;f=f.map(function(){var i=n(this);return{el:i,start:t(this)}});o=function(){n.each(i,function(n,t){r[t]&&e[t+"Class"](r[t])})};o();f=f.map(function(){return this.end=t(this.el[0]),this.diff=u(this.start,this.end),this});e.attr("class",h);f=f.map(function(){var i=this,t=n.Deferred(),r=n.extend({},s,{queue:!1,complete:function(){t.resolve(i)}});return this.el.animate(this.diff,r),t.promise()});n.when.apply(n,f.get()).done(function(){o();n.each(arguments,function(){var t=this.el;n.each(this.diff,function(n){t.css(n,"")})});s.complete.call(e[0])})})};n.fn.extend({addClass:function(t){return function(i,r,u,f){return r?n.effects.animateClass.call(this,{add:i},r,u,f):t.apply(this,arguments)}}(n.fn.addClass),removeClass:function(t){return function(i,r,u,f){return arguments.length>1?n.effects.animateClass.call(this,{remove:i},r,u,f):t.apply(this,arguments)}}(n.fn.removeClass),toggleClass:function(t){return function(i,r,u,f,e){return typeof r=="boolean"||r===undefined?u?n.effects.animateClass.call(this,r?{add:i}:{remove:i},u,f,e):t.apply(this,arguments):n.effects.animateClass.call(this,{toggle:i},r,u,f)}}(n.fn.toggleClass),switchClass:function(t,i,r,u,f){return n.effects.animateClass.call(this,{add:i,remove:t},r,u,f)}})}(),function(){function t(t,i,r,u){return n.isPlainObject(t)&&(i=t,t=t.effect),t={effect:t},i==null&&(i={}),n.isFunction(i)&&(u=i,r=null,i={}),(typeof i=="number"||n.fx.speeds[i])&&(u=r,r=i,i={}),n.isFunction(r)&&(u=r,r=null),i&&n.extend(t,i),r=r||i.duration,t.duration=n.fx.off?0:typeof r=="number"?r:r in n.fx.speeds?n.fx.speeds[r]:n.fx.speeds._default,t.complete=u||i.complete,t}function i(t){return!t||typeof t=="number"||n.fx.speeds[t]?!0:typeof t=="string"&&!n.effects.effect[t]?!0:n.isFunction(t)?!0:typeof t=="object"&&!t.effect?!0:!1}n.extend(n.effects,{version:"1.11.1",save:function(n,t){for(var i=0;i<t.length;i++)t[i]!==null&&n.data(w+t[i],n[0].style[t[i]])},restore:function(n,t){for(var r,i=0;i<t.length;i++)t[i]!==null&&(r=n.data(w+t[i]),r===undefined&&(r=""),n.css(t[i],r))},setMode:function(n,t){return t==="toggle"&&(t=n.is(":hidden")?"show":"hide"),t},getBaseline:function(n,t){var i,r;switch(n[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=n[0]/t.height}switch(n[1]){case"left":r=0;break;case"center":r=.5;break;case"right":r=1;break;default:r=n[1]/t.width}return{x:r,y:i}},createWrapper:function(t){if(t.parent().is(".ui-effects-wrapper"))return t.parent();var i={width:t.outerWidth(!0),height:t.outerHeight(!0),float:t.css("float")},u=n("<div><\/div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),f={width:t.width(),height:t.height()},r=document.activeElement;try{r.id}catch(e){r=document.body}return t.wrap(u),(t[0]===r||n.contains(t[0],r))&&n(r).focus(),u=t.parent(),t.css("position")==="static"?(u.css({position:"relative"}),t.css({position:"relative"})):(n.extend(i,{position:t.css("position"),zIndex:t.css("z-index")}),n.each(["top","left","bottom","right"],function(n,r){i[r]=t.css(r);isNaN(parseInt(i[r],10))&&(i[r]="auto")}),t.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),t.css(f),u.css(i).show()},removeWrapper:function(t){var i=document.activeElement;return t.parent().is(".ui-effects-wrapper")&&(t.parent().replaceWith(t),(t[0]===i||n.contains(t[0],i))&&n(i).focus()),t},setTransition:function(t,i,r,u){return u=u||{},n.each(i,function(n,i){var f=t.cssUnit(i);f[0]>0&&(u[i]=f[0]*r+f[1])}),u}});n.fn.extend({effect:function(){function e(t){function o(){n.isFunction(e)&&e.call(r[0]);n.isFunction(t)&&t()}var r=n(this),e=i.complete,u=i.mode;(r.is(":hidden")?u==="hide":u==="show")?(r[u](),o()):f.call(r[0],i,o)}var i=t.apply(this,arguments),r=i.mode,u=i.queue,f=n.effects.effect[i.effect];return n.fx.off||!f?r?this[r](i.duration,i.complete):this.each(function(){i.complete&&i.complete.call(this)}):u===!1?this.each(e):this.queue(u||"fx",e)},show:function(n){return function(r){if(i(r))return n.apply(this,arguments);var u=t.apply(this,arguments);return u.mode="show",this.effect.call(this,u)}}(n.fn.show),hide:function(n){return function(r){if(i(r))return n.apply(this,arguments);var u=t.apply(this,arguments);return u.mode="hide",this.effect.call(this,u)}}(n.fn.hide),toggle:function(n){return function(r){if(i(r)||typeof r=="boolean")return n.apply(this,arguments);var u=t.apply(this,arguments);return u.mode="toggle",this.effect.call(this,u)}}(n.fn.toggle),cssUnit:function(t){var i=this.css(t),r=[];return n.each(["em","px","%","pt"],function(n,t){i.indexOf(t)>0&&(r=[parseFloat(i),t])}),r}})}(),function(){var t={};n.each(["Quad","Cubic","Quart","Quint","Expo"],function(n,i){t[i]=function(t){return Math.pow(t,n+2)}});n.extend(t,{Sine:function(n){return 1-Math.cos(n*Math.PI/2)},Circ:function(n){return 1-Math.sqrt(1-n*n)},Elastic:function(n){return n===0||n===1?n:-Math.pow(2,8*(n-1))*Math.sin(((n-1)*80-7.5)*Math.PI/15)},Back:function(n){return n*n*(3*n-2)},Bounce:function(n){for(var t,i=4;n<((t=Math.pow(2,--i))-1)/11;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((t*3-2)/22-n,2)}});n.each(t,function(t,i){n.easing["easeIn"+t]=i;n.easing["easeOut"+t]=function(n){return 1-i(1-n)};n.easing["easeInOut"+t]=function(n){return n<.5?i(n*2)/2:1-i(n*-2+2)/2}})}();var lt=n.effects,at=n.effects.effect.blind=function(t,i){var r=n(this),s=["position","top","bottom","left","right","height","width"],v=n.effects.setMode(r,t.mode||"hide"),y=t.direction||"up",f=/up|down|vertical/.test(y),h=f?"height":"width",c=f?"top":"left",p=/up|left|vertical|horizontal/.test(y),l={},a=v==="show",u,e,o;r.parent().is(".ui-effects-wrapper")?n.effects.save(r.parent(),s):n.effects.save(r,s);r.show();u=n.effects.createWrapper(r).css({overflow:"hidden"});e=u[h]();o=parseFloat(u.css(c))||0;l[h]=a?e:0;p||(r.css(f?"bottom":"right",0).css(f?"top":"left","auto").css({position:"absolute"}),l[c]=a?o:e+o);a&&(u.css(h,0),p||u.css(c,o+e));u.animate(l,{duration:t.duration,easing:t.easing,queue:!1,complete:function(){v==="hide"&&r.hide();n.effects.restore(r,s);n.effects.removeWrapper(r);i()}})},vt=n.effects.effect.bounce=function(t,i){var r=n(this),v=["position","top","bottom","left","right","height","width"],k=n.effects.setMode(r,t.mode||"effect"),f=k==="hide",y=k==="show",h=t.direction||"up",u=t.distance,p=t.times||5,d=p*2+(y||f?1:0),c=t.duration/d,l=t.easing,e=h==="up"||h==="down"?"top":"left",w=h==="up"||h==="left",b,o,s,a=r.queue(),g=a.length;for((y||f)&&v.push("opacity"),n.effects.save(r,v),r.show(),n.effects.createWrapper(r),u||(u=r[e==="top"?"outerHeight":"outerWidth"]()/3),y&&(s={opacity:1},s[e]=0,r.css("opacity",0).css(e,w?-u*2:u*2).animate(s,c,l)),f&&(u=u/Math.pow(2,p-1)),s={},s[e]=0,b=0;b<p;b++)o={},o[e]=(w?"-=":"+=")+u,r.animate(o,c,l).animate(s,c,l),u=f?u*2:u/2;f&&(o={opacity:0},o[e]=(w?"-=":"+=")+u,r.animate(o,c,l));r.queue(function(){f&&r.hide();n.effects.restore(r,v);n.effects.removeWrapper(r);i()});g>1&&a.splice.apply(a,[1,0].concat(a.splice(g,d+1)));r.dequeue()},yt=n.effects.effect.clip=function(t,i){var r=n(this),h=["position","top","bottom","left","right","height","width"],v=n.effects.setMode(r,t.mode||"hide"),f=v==="show",y=t.direction||"vertical",c=y==="vertical",o=c?"height":"width",l=c?"top":"left",s={},a,u,e;n.effects.save(r,h);r.show();a=n.effects.createWrapper(r).css({overflow:"hidden"});u=r[0].tagName==="IMG"?a:r;e=u[o]();f&&(u.css(o,0),u.css(l,e/2));s[o]=f?e:0;s[l]=f?0:e/2;u.animate(s,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){f||r.hide();n.effects.restore(r,h);n.effects.removeWrapper(r);i()}})},pt=n.effects.effect.drop=function(t,i){var r=n(this),h=["position","top","bottom","left","right","opacity","height","width"],c=n.effects.setMode(r,t.mode||"hide"),e=c==="show",u=t.direction||"left",o=u==="up"||u==="down"?"top":"left",s=u==="up"||u==="left"?"pos":"neg",l={opacity:e?1:0},f;n.effects.save(r,h);r.show();n.effects.createWrapper(r);f=t.distance||r[o==="top"?"outerHeight":"outerWidth"](!0)/2;e&&r.css("opacity",0).css(o,s==="pos"?-f:f);l[o]=(e?s==="pos"?"+=":"-=":s==="pos"?"-=":"+=")+f;r.animate(l,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){c==="hide"&&r.hide();n.effects.restore(r,h);n.effects.removeWrapper(r);i()}})},wt=n.effects.effect.explode=function(t,i){function k(){l.push(this);l.length===o*c&&d()}function d(){r.css({visibility:"visible"});n(l).remove();u||r.hide();i()}for(var o=t.pieces?Math.round(Math.sqrt(t.pieces)):3,c=o,r=n(this),b=n.effects.setMode(r,t.mode||"hide"),u=b==="show",w=r.show().css("visibility","hidden").offset(),s=Math.ceil(r.outerWidth()/c),h=Math.ceil(r.outerHeight()/o),l=[],e,a,v,y,p,f=0;f<o;f++)for(v=w.top+f*h,p=f-(o-1)/2,e=0;e<c;e++)a=w.left+e*s,y=e-(c-1)/2,r.clone().appendTo("body").wrap("<div><\/div>").css({position:"absolute",visibility:"visible",left:-e*s,top:-f*h}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:s,height:h,left:a+(u?y*s:0),top:v+(u?p*h:0),opacity:u?0:1}).animate({left:a+(u?0:y*s),top:v+(u?0:p*h),opacity:u?1:0},t.duration||500,t.easing,k)},bt=n.effects.effect.fade=function(t,i){var r=n(this),u=n.effects.setMode(r,t.mode||"toggle");r.animate({opacity:u},{queue:!1,duration:t.duration,easing:t.easing,complete:i})},kt=n.effects.effect.fold=function(t,i){var r=n(this),s=["position","top","bottom","left","right","height","width"],h=n.effects.setMode(r,t.mode||"hide"),e=h==="show",c=h==="hide",f=t.size||15,l=/([0-9]+)%/.exec(f),a=!!t.horizFirst,v=e!==a,y=v?["width","height"]:["height","width"],p=t.duration/2,u,o,w={},b={};n.effects.save(r,s);r.show();u=n.effects.createWrapper(r).css({overflow:"hidden"});o=v?[u.width(),u.height()]:[u.height(),u.width()];l&&(f=parseInt(l[1],10)/100*o[c?0:1]);e&&u.css(a?{height:0,width:f}:{height:f,width:0});w[y[0]]=e?o[0]:f;b[y[1]]=e?o[1]:0;u.animate(w,p,t.easing).animate(b,p,t.easing,function(){c&&r.hide();n.effects.restore(r,s);n.effects.removeWrapper(r);i()})},dt=n.effects.effect.highlight=function(t,i){var r=n(this),u=["backgroundImage","backgroundColor","opacity"],f=n.effects.setMode(r,t.mode||"show"),e={backgroundColor:r.css("backgroundColor")};f==="hide"&&(e.opacity=0);n.effects.save(r,u);r.show().css({backgroundImage:"none",backgroundColor:t.color||"#ffff99"}).animate(e,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){f==="hide"&&r.hide();n.effects.restore(r,u);i()}})},gt=n.effects.effect.size=function(t,i){var f,l,u,r=n(this),w=["position","top","bottom","left","right","width","height","overflow","opacity"],a=["width","height","overflow"],v=["fontSize"],e=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],o=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],h=n.effects.setMode(r,t.mode||"effect"),y=t.restore||h!=="effect",c=t.scale||"both",b=t.origin||["middle","center"],k=r.css("position"),s=y?w:["position","top","bottom","left","right","overflow","opacity"],p={height:0,width:0,outerHeight:0,outerWidth:0};h==="show"&&r.show();f={height:r.height(),width:r.width(),outerHeight:r.outerHeight(),outerWidth:r.outerWidth()};t.mode==="toggle"&&h==="show"?(r.from=t.to||p,r.to=t.from||f):(r.from=t.from||(h==="show"?p:f),r.to=t.to||(h==="hide"?p:f));u={from:{y:r.from.height/f.height,x:r.from.width/f.width},to:{y:r.to.height/f.height,x:r.to.width/f.width}};(c==="box"||c==="both")&&(u.from.y!==u.to.y&&(s=s.concat(e),r.from=n.effects.setTransition(r,e,u.from.y,r.from),r.to=n.effects.setTransition(r,e,u.to.y,r.to)),u.from.x!==u.to.x&&(s=s.concat(o),r.from=n.effects.setTransition(r,o,u.from.x,r.from),r.to=n.effects.setTransition(r,o,u.to.x,r.to)));(c==="content"||c==="both")&&u.from.y!==u.to.y&&(s=s.concat(v).concat(a),r.from=n.effects.setTransition(r,v,u.from.y,r.from),r.to=n.effects.setTransition(r,v,u.to.y,r.to));n.effects.save(r,s);r.show();n.effects.createWrapper(r);r.css("overflow","hidden").css(r.from);b&&(l=n.effects.getBaseline(b,f),r.from.top=(f.outerHeight-r.outerHeight())*l.y,r.from.left=(f.outerWidth-r.outerWidth())*l.x,r.to.top=(f.outerHeight-r.to.outerHeight)*l.y,r.to.left=(f.outerWidth-r.to.outerWidth)*l.x);r.css(r.from);(c==="content"||c==="both")&&(e=e.concat(["marginTop","marginBottom"]).concat(v),o=o.concat(["marginLeft","marginRight"]),a=w.concat(e).concat(o),r.find("*[width]").each(function(){var i=n(this),r={height:i.height(),width:i.width(),outerHeight:i.outerHeight(),outerWidth:i.outerWidth()};y&&n.effects.save(i,a);i.from={height:r.height*u.from.y,width:r.width*u.from.x,outerHeight:r.outerHeight*u.from.y,outerWidth:r.outerWidth*u.from.x};i.to={height:r.height*u.to.y,width:r.width*u.to.x,outerHeight:r.height*u.to.y,outerWidth:r.width*u.to.x};u.from.y!==u.to.y&&(i.from=n.effects.setTransition(i,e,u.from.y,i.from),i.to=n.effects.setTransition(i,e,u.to.y,i.to));u.from.x!==u.to.x&&(i.from=n.effects.setTransition(i,o,u.from.x,i.from),i.to=n.effects.setTransition(i,o,u.to.x,i.to));i.css(i.from);i.animate(i.to,t.duration,t.easing,function(){y&&n.effects.restore(i,a)})}));r.animate(r.to,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){r.to.opacity===0&&r.css("opacity",r.from.opacity);h==="hide"&&r.hide();n.effects.restore(r,s);y||(k==="static"?r.css({position:"relative",top:r.to.top,left:r.to.left}):n.each(["top","left"],function(n,t){r.css(t,function(t,i){var f=parseInt(i,10),u=n?r.to.left:r.to.top;return i==="auto"?u+"px":f+u+"px"})}));n.effects.removeWrapper(r);i()}})},ni=n.effects.effect.scale=function(t,i){var u=n(this),r=n.extend(!0,{},t),f=n.effects.setMode(u,t.mode||"effect"),s=parseInt(t.percent,10)||(parseInt(t.percent,10)===0?0:f==="hide"?0:100),h=t.direction||"both",c=t.origin,e={height:u.height(),width:u.width(),outerHeight:u.outerHeight(),outerWidth:u.outerWidth()},o={y:h!=="horizontal"?s/100:1,x:h!=="vertical"?s/100:1};r.effect="size";r.queue=!1;r.complete=i;f!=="effect"&&(r.origin=c||["middle","center"],r.restore=!0);r.from=t.from||(f==="show"?{height:0,width:0,outerHeight:0,outerWidth:0}:e);r.to={height:e.height*o.y,width:e.width*o.x,outerHeight:e.outerHeight*o.y,outerWidth:e.outerWidth*o.x};r.fade&&(f==="show"&&(r.from.opacity=0,r.to.opacity=1),f==="hide"&&(r.from.opacity=1,r.to.opacity=0));u.effect(r)},ti=n.effects.effect.puff=function(t,i){var r=n(this),e=n.effects.setMode(r,t.mode||"hide"),o=e==="hide",s=parseInt(t.percent,10)||150,f=s/100,u={height:r.height(),width:r.width(),outerHeight:r.outerHeight(),outerWidth:r.outerWidth()};n.extend(t,{effect:"scale",queue:!1,fade:!0,mode:e,complete:i,percent:o?s:100,from:o?u:{height:u.height*f,width:u.width*f,outerHeight:u.outerHeight*f,outerWidth:u.outerWidth*f}});r.effect(t)},ii=n.effects.effect.pulsate=function(t,i){var r=n(this),e=n.effects.setMode(r,t.mode||"show"),h=e==="show",a=e==="hide",v=h||e==="hide",o=(t.times||5)*2+(v?1:0),c=t.duration/o,u=0,f=r.queue(),l=f.length,s;for((h||!r.is(":visible"))&&(r.css("opacity",0).show(),u=1),s=1;s<o;s++)r.animate({opacity:u},c,t.easing),u=1-u;r.animate({opacity:u},c,t.easing);r.queue(function(){a&&r.hide();i()});l>1&&f.splice.apply(f,[1,0].concat(f.splice(l,o+1)));r.dequeue()},ri=n.effects.effect.shake=function(t,i){var r=n(this),v=["position","top","bottom","left","right","height","width"],k=n.effects.setMode(r,t.mode||"effect"),f=t.direction||"left",o=t.distance||20,y=t.times||3,p=y*2+1,u=Math.round(t.duration/p),s=f==="up"||f==="down"?"top":"left",h=f==="up"||f==="left",c={},l={},w={},a,e=r.queue(),b=e.length;for(n.effects.save(r,v),r.show(),n.effects.createWrapper(r),c[s]=(h?"-=":"+=")+o,l[s]=(h?"+=":"-=")+o*2,w[s]=(h?"-=":"+=")+o*2,r.animate(c,u,t.easing),a=1;a<y;a++)r.animate(l,u,t.easing).animate(w,u,t.easing);r.animate(l,u,t.easing).animate(c,u/2,t.easing).queue(function(){k==="hide"&&r.hide();n.effects.restore(r,v);n.effects.removeWrapper(r);i()});b>1&&e.splice.apply(e,[1,0].concat(e.splice(b,p+1)));r.dequeue()},ui=n.effects.effect.slide=function(t,i){var r=n(this),s=["position","top","bottom","left","right","width","height"],h=n.effects.setMode(r,t.mode||"show"),c=h==="show",f=t.direction||"left",e=f==="up"||f==="down"?"top":"left",o=f==="up"||f==="left",u,l={};n.effects.save(r,s);r.show();u=t.distance||r[e==="top"?"outerHeight":"outerWidth"](!0);n.effects.createWrapper(r).css({overflow:"hidden"});c&&r.css(e,o?isNaN(u)?"-"+u:-u:u);l[e]=(c?o?"+=":"-=":o?"-=":"+=")+u;r.animate(l,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){h==="hide"&&r.hide();n.effects.restore(r,s);n.effects.removeWrapper(r);i()}})},fi=n.effects.effect.transfer=function(t,i){var u=n(this),r=n(t.to),f=r.css("position")==="fixed",e=n("body"),o=f?e.scrollTop():0,s=f?e.scrollLeft():0,h=r.offset(),l={top:h.top-o,left:h.left-s,height:r.innerHeight(),width:r.innerWidth()},c=u.offset(),a=n("<div class='ui-effects-transfer'><\/div>").appendTo(document.body).addClass(t.className).css({top:c.top-o,left:c.left-s,height:u.innerHeight(),width:u.innerWidth(),position:f?"fixed":"absolute"}).animate(l,t.duration,t.easing,function(){a.remove();i()})},ei=n.widget("ui.progressbar",{version:"1.11.1",options:{max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue();this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min});this.valueDiv=n("<div class='ui-progressbar-value ui-widget-header ui-corner-left'><\/div>").appendTo(this.element);this._refreshValue()},_destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow");this.valueDiv.remove()},value:function(n){if(n===undefined)return this.options.value;this.options.value=this._constrainedValue(n);this._refreshValue()},_constrainedValue:function(n){return n===undefined&&(n=this.options.value),this.indeterminate=n===!1,typeof n!="number"&&(n=0),this.indeterminate?!1:Math.min(this.options.max,Math.max(this.min,n))},_setOptions:function(n){var t=n.value;delete n.value;this._super(n);this.options.value=this._constrainedValue(t);this._refreshValue()},_setOption:function(n,t){n==="max"&&(t=Math.max(this.min,t));n==="disabled"&&this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t);this._super(n,t)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var t=this.options.value,i=this._percentage();this.valueDiv.toggle(this.indeterminate||t>this.min).toggleClass("ui-corner-right",t===this.options.max).width(i.toFixed(0)+"%");this.element.toggleClass("ui-progressbar-indeterminate",this.indeterminate);this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=n("<div class='ui-progressbar-overlay'><\/div>").appendTo(this.valueDiv))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":t}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null));this.oldValue!==t&&(this.oldValue=t,this._trigger("change"));t===this.options.max&&this._trigger("complete")}}),oi=n.widget("ui.selectable",n.ui.mouse,{version:"1.11.1",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var t,i=this;this.element.addClass("ui-selectable");this.dragged=!1;this.refresh=function(){t=n(i.options.filter,i.element[0]);t.addClass("ui-selectee");t.each(function(){var t=n(this),i=t.offset();n.data(this,"selectable-item",{element:this,$element:t,left:i.left,top:i.top,right:i.left+t.outerWidth(),bottom:i.top+t.outerHeight(),startselected:!1,selected:t.hasClass("ui-selected"),selecting:t.hasClass("ui-selecting"),unselecting:t.hasClass("ui-unselecting")})})};this.refresh();this.selectees=t.addClass("ui-selectee");this._mouseInit();this.helper=n("<div class='ui-selectable-helper'><\/div>")},_destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item");this.element.removeClass("ui-selectable ui-selectable-disabled");this._mouseDestroy()},_mouseStart:function(t){var i=this,r=this.options;(this.opos=[t.pageX,t.pageY],this.options.disabled)||(this.selectees=n(r.filter,this.element[0]),this._trigger("start",t),n(r.appendTo).append(this.helper),this.helper.css({left:t.pageX,top:t.pageY,width:0,height:0}),r.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var r=n.data(this,"selectable-item");r.startselected=!0;t.metaKey||t.ctrlKey||(r.$element.removeClass("ui-selected"),r.selected=!1,r.$element.addClass("ui-unselecting"),r.unselecting=!0,i._trigger("unselecting",t,{unselecting:r.element}))}),n(t.target).parents().addBack().each(function(){var u,r=n.data(this,"selectable-item");if(r)return u=!t.metaKey&&!t.ctrlKey||!r.$element.hasClass("ui-selected"),r.$element.removeClass(u?"ui-unselecting":"ui-selected").addClass(u?"ui-selecting":"ui-unselecting"),r.unselecting=!u,r.selecting=u,r.selected=u,u?i._trigger("selecting",t,{selecting:r.element}):i._trigger("unselecting",t,{unselecting:r.element}),!1}))},_mouseDrag:function(t){if(this.dragged=!0,!this.options.disabled){var e,o=this,s=this.options,i=this.opos[0],r=this.opos[1],u=t.pageX,f=t.pageY;return i>u&&(e=u,u=i,i=e),r>f&&(e=f,f=r,r=e),this.helper.css({left:i,top:r,width:u-i,height:f-r}),this.selectees.each(function(){var e=n.data(this,"selectable-item"),h=!1;e&&e.element!==o.element[0]&&(s.tolerance==="touch"?h=!(e.left>u||e.right<i||e.top>f||e.bottom<r):s.tolerance==="fit"&&(h=e.left>i&&e.right<u&&e.top>r&&e.bottom<f),h?(e.selected&&(e.$element.removeClass("ui-selected"),e.selected=!1),e.unselecting&&(e.$element.removeClass("ui-unselecting"),e.unselecting=!1),e.selecting||(e.$element.addClass("ui-selecting"),e.selecting=!0,o._trigger("selecting",t,{selecting:e.element}))):(e.selecting&&((t.metaKey||t.ctrlKey)&&e.startselected?(e.$element.removeClass("ui-selecting"),e.selecting=!1,e.$element.addClass("ui-selected"),e.selected=!0):(e.$element.removeClass("ui-selecting"),e.selecting=!1,e.startselected&&(e.$element.addClass("ui-unselecting"),e.unselecting=!0),o._trigger("unselecting",t,{unselecting:e.element}))),e.selected&&(t.metaKey||t.ctrlKey||e.startselected||(e.$element.removeClass("ui-selected"),e.selected=!1,e.$element.addClass("ui-unselecting"),e.unselecting=!0,o._trigger("unselecting",t,{unselecting:e.element})))))}),!1}},_mouseStop:function(t){var i=this;return this.dragged=!1,n(".ui-unselecting",this.element[0]).each(function(){var r=n.data(this,"selectable-item");r.$element.removeClass("ui-unselecting");r.unselecting=!1;r.startselected=!1;i._trigger("unselected",t,{unselected:r.element})}),n(".ui-selecting",this.element[0]).each(function(){var r=n.data(this,"selectable-item");r.$element.removeClass("ui-selecting").addClass("ui-selected");r.selecting=!1;r.selected=!0;r.startselected=!0;i._trigger("selected",t,{selected:r.element})}),this._trigger("stop",t),this.helper.remove(),!1}}),si=n.widget("ui.selectmenu",{version:"1.11.1",defaultElement:"<select>",options:{appendTo:null,disabled:null,icons:{button:"ui-icon-triangle-1-s"},position:{my:"left top",at:"left bottom",collision:"none"},width:null,change:null,close:null,focus:null,open:null,select:null},_create:function(){var n=this.element.uniqueId().attr("id");this.ids={element:n,button:n+"-button",menu:n+"-menu"};this._drawButton();this._drawMenu();this.options.disabled&&this.disable()},_drawButton:function(){var t=this,i=this.element.attr("tabindex");this.label=n("label[for='"+this.ids.element+"']").attr("for",this.ids.button);this._on(this.label,{click:function(n){this.button.focus();n.preventDefault()}});this.element.hide();this.button=n("<span>",{"class":"ui-selectmenu-button ui-widget ui-state-default ui-corner-all",tabindex:i||this.options.disabled?-1:0,id:this.ids.button,role:"combobox","aria-expanded":"false","aria-autocomplete":"list","aria-owns":this.ids.menu,"aria-haspopup":"true"}).insertAfter(this.element);n("<span>",{"class":"ui-icon "+this.options.icons.button}).prependTo(this.button);this.buttonText=n("<span>",{"class":"ui-selectmenu-text"}).appendTo(this.button);this._setText(this.buttonText,this.element.find("option:selected").text());this._resizeButton();this._on(this.button,this._buttonEvents);this.button.one("focusin",function(){t.menuItems||t._refreshMenu()});this._hoverable(this.button);this._focusable(this.button)},_drawMenu:function(){var t=this;this.menu=n("<ul>",{"aria-hidden":"true","aria-labelledby":this.ids.button,id:this.ids.menu});this.menuWrap=n("<div>",{"class":"ui-selectmenu-menu ui-front"}).append(this.menu).appendTo(this._appendTo());this.menuInstance=this.menu.menu({role:"listbox",select:function(n,i){n.preventDefault();t._select(i.item.data("ui-selectmenu-item"),n)},focus:function(n,i){var r=i.item.data("ui-selectmenu-item");t.focusIndex!=null&&r.index!==t.focusIndex&&(t._trigger("focus",n,{item:r}),t.isOpen||t._select(r,n));t.focusIndex=r.index;t.button.attr("aria-activedescendant",t.menuItems.eq(r.index).attr("id"))}}).menu("instance");this.menu.addClass("ui-corner-bottom").removeClass("ui-corner-all");this.menuInstance._off(this.menu,"mouseleave");this.menuInstance._closeOnDocumentClick=function(){return!1};this.menuInstance._isDivider=function(){return!1}},refresh:function(){this._refreshMenu();this._setText(this.buttonText,this._getSelectedItem().text());this.options.width||this._resizeButton()},_refreshMenu:function(){this.menu.empty();var n,t=this.element.find("option");t.length&&(this._parseOptions(t),this._renderMenu(this.menu,this.items),this.menuInstance.refresh(),this.menuItems=this.menu.find("li").not(".ui-selectmenu-optgroup"),n=this._getSelectedItem(),this.menuInstance.focus(null,n),this._setAria(n.data("ui-selectmenu-item")),this._setOption("disabled",this.element.prop("disabled")))},open:function(n){this.options.disabled||(this.menuItems?(this.menu.find(".ui-state-focus").removeClass("ui-state-focus"),this.menuInstance.focus(null,this._getSelectedItem())):this._refreshMenu(),this.isOpen=!0,this._toggleAttr(),this._resizeMenu(),this._position(),this._on(this.document,this._documentClick),this._trigger("open",n))},_position:function(){this.menuWrap.position(n.extend({of:this.button},this.options.position))},close:function(n){this.isOpen&&(this.isOpen=!1,this._toggleAttr(),this._off(this.document),this._trigger("close",n))},widget:function(){return this.button},menuWidget:function(){return this.menu},_renderMenu:function(t,i){var u=this,r="";n.each(i,function(i,f){f.optgroup!==r&&(n("<li>",{"class":"ui-selectmenu-optgroup ui-menu-divider"+(f.element.parent("optgroup").prop("disabled")?" ui-state-disabled":""),text:f.optgroup}).appendTo(t),r=f.optgroup);u._renderItemData(t,f)})},_renderItemData:function(n,t){return this._renderItem(n,t).data("ui-selectmenu-item",t)},_renderItem:function(t,i){var r=n("<li>");return i.disabled&&r.addClass("ui-state-disabled"),this._setText(r,i.label),r.appendTo(t)},_setText:function(n,t){t?n.text(t):n.html("&#160;")},_move:function(n,t){var i,r,u=".ui-menu-item";this.isOpen?i=this.menuItems.eq(this.focusIndex):(i=this.menuItems.eq(this.element[0].selectedIndex),u+=":not(.ui-state-disabled)");r=n==="first"||n==="last"?i[n==="first"?"prevAll":"nextAll"](u).eq(-1):i[n+"All"](u).eq(0);r.length&&this.menuInstance.focus(t,r)},_getSelectedItem:function(){return this.menuItems.eq(this.element[0].selectedIndex)},_toggle:function(n){this[this.isOpen?"close":"open"](n)},_documentClick:{mousedown:function(t){this.isOpen&&(n(t.target).closest(".ui-selectmenu-menu, #"+this.ids.button).length||this.close(t))}},_buttonEvents:{mousedown:function(n){n.preventDefault()},click:"_toggle",keydown:function(t){var i=!0;switch(t.keyCode){case n.ui.keyCode.TAB:case n.ui.keyCode.ESCAPE:this.close(t);i=!1;break;case n.ui.keyCode.ENTER:this.isOpen&&this._selectFocusedItem(t);break;case n.ui.keyCode.UP:t.altKey?this._toggle(t):this._move("prev",t);break;case n.ui.keyCode.DOWN:t.altKey?this._toggle(t):this._move("next",t);break;case n.ui.keyCode.SPACE:this.isOpen?this._selectFocusedItem(t):this._toggle(t);break;case n.ui.keyCode.LEFT:this._move("prev",t);break;case n.ui.keyCode.RIGHT:this._move("next",t);break;case n.ui.keyCode.HOME:case n.ui.keyCode.PAGE_UP:this._move("first",t);break;case n.ui.keyCode.END:case n.ui.keyCode.PAGE_DOWN:this._move("last",t);break;default:this.menu.trigger(t);i=!1}i&&t.preventDefault()}},_selectFocusedItem:function(n){var t=this.menuItems.eq(this.focusIndex);t.hasClass("ui-state-disabled")||this._select(t.data("ui-selectmenu-item"),n)},_select:function(n,t){var i=this.element[0].selectedIndex;this.element[0].selectedIndex=n.index;this._setText(this.buttonText,n.label);this._setAria(n);this._trigger("select",t,{item:n});n.index!==i&&this._trigger("change",t,{item:n});this.close(t)},_setAria:function(n){var t=this.menuItems.eq(n.index).attr("id");this.button.attr({"aria-labelledby":t,"aria-activedescendant":t});this.menu.attr("aria-activedescendant",t)},_setOption:function(n,t){n==="icons"&&this.button.find("span.ui-icon").removeClass(this.options.icons.button).addClass(t.button);this._super(n,t);n==="appendTo"&&this.menuWrap.appendTo(this._appendTo());n==="disabled"&&(this.menuInstance.option("disabled",t),this.button.toggleClass("ui-state-disabled",t).attr("aria-disabled",t),this.element.prop("disabled",t),t?(this.button.attr("tabindex",-1),this.close()):this.button.attr("tabindex",0));n==="width"&&this._resizeButton()},_appendTo:function(){var t=this.options.appendTo;return t&&(t=t.jquery||t.nodeType?n(t):this.document.find(t).eq(0)),t&&t[0]||(t=this.element.closest(".ui-front")),t.length||(t=this.document[0].body),t},_toggleAttr:function(){this.button.toggleClass("ui-corner-top",this.isOpen).toggleClass("ui-corner-all",!this.isOpen).attr("aria-expanded",this.isOpen);this.menuWrap.toggleClass("ui-selectmenu-open",this.isOpen);this.menu.attr("aria-hidden",!this.isOpen)},_resizeButton:function(){var n=this.options.width;n||(n=this.element.show().outerWidth(),this.element.hide());this.button.outerWidth(n)},_resizeMenu:function(){this.menu.outerWidth(Math.max(this.button.outerWidth(),this.menu.width("").outerWidth()+1))},_getCreateOptions:function(){return{disabled:this.element.prop("disabled")}},_parseOptions:function(t){var i=[];t.each(function(t,r){var u=n(r),f=u.parent("optgroup");i.push({element:u,index:t,value:u.attr("value"),label:u.text(),optgroup:f.attr("label")||"",disabled:f.prop("disabled")||u.prop("disabled")})});this.items=i},_destroy:function(){this.menuWrap.remove();this.button.remove();this.element.show();this.element.removeUniqueId();this.label.attr("for",this.ids.element)}}),hi=n.widget("ui.slider",n.ui.mouse,{version:"1.11.1",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},numPages:5,_create:function(){this._keySliding=!1;this._mouseSliding=!1;this._animateOff=!0;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget ui-widget-content ui-corner-all");this._refresh();this._setOption("disabled",this.options.disabled);this._animateOff=!1},_refresh:function(){this._createRange();this._createHandles();this._setupEvents();this._refreshValue()},_createHandles:function(){var r,i,u=this.options,t=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),f=[];for(i=u.values&&u.values.length||1,t.length>i&&(t.slice(i).remove(),t=t.slice(0,i)),r=t.length;r<i;r++)f.push("<span class='ui-slider-handle ui-state-default ui-corner-all' tabindex='0'><\/span>");this.handles=t.add(n(f.join("")).appendTo(this.element));this.handle=this.handles.eq(0);this.handles.each(function(t){n(this).data("ui-slider-handle-index",t)})},_createRange:function(){var t=this.options,i="";t.range?(t.range===!0&&(t.values?t.values.length&&t.values.length!==2?t.values=[t.values[0],t.values[0]]:n.isArray(t.values)&&(t.values=t.values.slice(0)):t.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?this.range.removeClass("ui-slider-range-min ui-slider-range-max").css({left:"",bottom:""}):(this.range=n("<div><\/div>").appendTo(this.element),i="ui-slider-range ui-widget-header ui-corner-all"),this.range.addClass(i+(t.range==="min"||t.range==="max"?" ui-slider-range-"+t.range:""))):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){this._off(this.handles);this._on(this.handles,this._handleEvents);this._hoverable(this.handles);this._focusable(this.handles)},_destroy:function(){this.handles.remove();this.range&&this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-widget ui-widget-content ui-corner-all");this._mouseDestroy()},_mouseCapture:function(t){var s,f,r,i,u,h,e,c,o=this,l=this.options;return l.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),s={x:t.pageX,y:t.pageY},f=this._normValueFromMouse(s),r=this._valueMax()-this._valueMin()+1,this.handles.each(function(t){var e=Math.abs(f-o.values(t));(r>e||r===e&&(t===o._lastChangedValue||o.values(t)===l.min))&&(r=e,i=n(this),u=t)}),h=this._start(t,u),h===!1)?!1:(this._mouseSliding=!0,this._handleIndex=u,i.addClass("ui-state-active").focus(),e=i.offset(),c=!n(t.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=c?{left:0,top:0}:{left:t.pageX-e.left-i.width()/2,top:t.pageY-e.top-i.height()/2-(parseInt(i.css("borderTopWidth"),10)||0)-(parseInt(i.css("borderBottomWidth"),10)||0)+(parseInt(i.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(t,u,f),this._animateOff=!0,!0)},_mouseStart:function(){return!0},_mouseDrag:function(n){var t={x:n.pageX,y:n.pageY},i=this._normValueFromMouse(t);return this._slide(n,this._handleIndex,i),!1},_mouseStop:function(n){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(n,this._handleIndex),this._change(n,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(n){var i,r,t,u,f;return this.orientation==="horizontal"?(i=this.elementSize.width,r=n.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(i=this.elementSize.height,r=n.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),t=r/i,t>1&&(t=1),t<0&&(t=0),this.orientation==="vertical"&&(t=1-t),u=this._valueMax()-this._valueMin(),f=this._valueMin()+t*u,this._trimAlignValue(f)},_start:function(n,t){var i={handle:this.handles[t],value:this.value()};return this.options.values&&this.options.values.length&&(i.value=this.values(t),i.values=this.values()),this._trigger("start",n,i)},_slide:function(n,t,i){var r,f,u;this.options.values&&this.options.values.length?(r=this.values(t?0:1),this.options.values.length===2&&this.options.range===!0&&(t===0&&i>r||t===1&&i<r)&&(i=r),i!==this.values(t)&&(f=this.values(),f[t]=i,u=this._trigger("slide",n,{handle:this.handles[t],value:i,values:f}),r=this.values(t?0:1),u!==!1&&this.values(t,i))):i!==this.value()&&(u=this._trigger("slide",n,{handle:this.handles[t],value:i}),u!==!1&&this.value(i))},_stop:function(n,t){var i={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(t),i.values=this.values());this._trigger("stop",n,i)},_change:function(n,t){if(!this._keySliding&&!this._mouseSliding){var i={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(t),i.values=this.values());this._lastChangedValue=t;this._trigger("change",n,i)}},value:function(n){if(arguments.length){this.options.value=this._trimAlignValue(n);this._refreshValue();this._change(null,0);return}return this._value()},values:function(t,i){var u,f,r;if(arguments.length>1){this.options.values[t]=this._trimAlignValue(i);this._refreshValue();this._change(null,t);return}if(arguments.length)if(n.isArray(arguments[0])){for(u=this.options.values,f=arguments[0],r=0;r<u.length;r+=1)u[r]=this._trimAlignValue(f[r]),this._change(null,r);this._refreshValue()}else return this.options.values&&this.options.values.length?this._values(t):this.value();else return this._values()},_setOption:function(t,i){var r,u=0;t==="range"&&this.options.range===!0&&(i==="min"?(this.options.value=this._values(0),this.options.values=null):i==="max"&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null));n.isArray(this.options.values)&&(u=this.options.values.length);t==="disabled"&&this.element.toggleClass("ui-state-disabled",!!i);this._super(t,i);switch(t){case"orientation":this._detectOrientation();this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue();this.handles.css(i==="horizontal"?"bottom":"left","");break;case"value":this._animateOff=!0;this._refreshValue();this._change(null,0);this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),r=0;r<u;r+=1)this._change(null,r);this._animateOff=!1;break;case"min":case"max":this._animateOff=!0;this._refreshValue();this._animateOff=!1;break;case"range":this._animateOff=!0;this._refresh();this._animateOff=!1}},_value:function(){var n=this.options.value;return this._trimAlignValue(n)},_values:function(n){var r,t,i;if(arguments.length)return r=this.options.values[n],this._trimAlignValue(r);if(this.options.values&&this.options.values.length){for(t=this.options.values.slice(),i=0;i<t.length;i+=1)t[i]=this._trimAlignValue(t[i]);return t}return[]},_trimAlignValue:function(n){if(n<=this._valueMin())return this._valueMin();if(n>=this._valueMax())return this._valueMax();var t=this.options.step>0?this.options.step:1,i=(n-this._valueMin())%t,r=n-i;return Math.abs(i)*2>=t&&(r+=i>0?t:-t),parseFloat(r.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var s,t,c,f,h,e=this.options.range,i=this.options,r=this,u=this._animateOff?!1:i.animate,o={};this.options.values&&this.options.values.length?this.handles.each(function(f){t=(r.values(f)-r._valueMin())/(r._valueMax()-r._valueMin())*100;o[r.orientation==="horizontal"?"left":"bottom"]=t+"%";n(this).stop(1,1)[u?"animate":"css"](o,i.animate);r.options.range===!0&&(r.orientation==="horizontal"?(f===0&&r.range.stop(1,1)[u?"animate":"css"]({left:t+"%"},i.animate),f===1&&r.range[u?"animate":"css"]({width:t-s+"%"},{queue:!1,duration:i.animate})):(f===0&&r.range.stop(1,1)[u?"animate":"css"]({bottom:t+"%"},i.animate),f===1&&r.range[u?"animate":"css"]({height:t-s+"%"},{queue:!1,duration:i.animate})));s=t}):(c=this.value(),f=this._valueMin(),h=this._valueMax(),t=h!==f?(c-f)/(h-f)*100:0,o[this.orientation==="horizontal"?"left":"bottom"]=t+"%",this.handle.stop(1,1)[u?"animate":"css"](o,i.animate),e==="min"&&this.orientation==="horizontal"&&this.range.stop(1,1)[u?"animate":"css"]({width:t+"%"},i.animate),e==="max"&&this.orientation==="horizontal"&&this.range[u?"animate":"css"]({width:100-t+"%"},{queue:!1,duration:i.animate}),e==="min"&&this.orientation==="vertical"&&this.range.stop(1,1)[u?"animate":"css"]({height:t+"%"},i.animate),e==="max"&&this.orientation==="vertical"&&this.range[u?"animate":"css"]({height:100-t+"%"},{queue:!1,duration:i.animate}))},_handleEvents:{keydown:function(t){var e,r,i,u,f=n(t.target).data("ui-slider-handle-index");switch(t.keyCode){case n.ui.keyCode.HOME:case n.ui.keyCode.END:case n.ui.keyCode.PAGE_UP:case n.ui.keyCode.PAGE_DOWN:case n.ui.keyCode.UP:case n.ui.keyCode.RIGHT:case n.ui.keyCode.DOWN:case n.ui.keyCode.LEFT:if(t.preventDefault(),!this._keySliding&&(this._keySliding=!0,n(t.target).addClass("ui-state-active"),e=this._start(t,f),e===!1))return}u=this.options.step;r=this.options.values&&this.options.values.length?i=this.values(f):i=this.value();switch(t.keyCode){case n.ui.keyCode.HOME:i=this._valueMin();break;case n.ui.keyCode.END:i=this._valueMax();break;case n.ui.keyCode.PAGE_UP:i=this._trimAlignValue(r+(this._valueMax()-this._valueMin())/this.numPages);break;case n.ui.keyCode.PAGE_DOWN:i=this._trimAlignValue(r-(this._valueMax()-this._valueMin())/this.numPages);break;case n.ui.keyCode.UP:case n.ui.keyCode.RIGHT:if(r===this._valueMax())return;i=this._trimAlignValue(r+u);break;case n.ui.keyCode.DOWN:case n.ui.keyCode.LEFT:if(r===this._valueMin())return;i=this._trimAlignValue(r-u)}this._slide(t,f,i)},keyup:function(t){var i=n(t.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(t,i),this._change(t,i),n(t.target).removeClass("ui-state-active"))}}}),ci=n.widget("ui.sortable",n.ui.mouse,{version:"1.11.1",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(n,t,i){return n>=t&&n<t+i},_isFloating:function(n){return/left|right/.test(n.css("float"))||/inline|table-cell/.test(n.css("display"))},_create:function(){var n=this.options;this.containerCache={};this.element.addClass("ui-sortable");this.refresh();this.floating=this.items.length?n.axis==="x"||this._isFloating(this.items[0].item):!1;this.offset=this.element.offset();this._mouseInit();this._setHandleClassName();this.ready=!0},_setOption:function(n,t){this._super(n,t);n==="handle"&&this._setHandleClassName()},_setHandleClassName:function(){this.element.find(".ui-sortable-handle").removeClass("ui-sortable-handle");n.each(this.items,function(){(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item).addClass("ui-sortable-handle")})},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").find(".ui-sortable-handle").removeClass("ui-sortable-handle");this._mouseDestroy();for(var n=this.items.length-1;n>=0;n--)this.items[n].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(t,i){var r=null,f=!1,u=this;return this.reverting?!1:this.options.disabled||this.options.type==="static"?!1:(this._refreshItems(t),n(t.target).parents().each(function(){if(n.data(this,u.widgetName+"-item")===u)return r=n(this),!1}),n.data(t.target,u.widgetName+"-item")===u&&(r=n(t.target)),!r)?!1:this.options.handle&&!i&&(n(this.options.handle,r).find("*").addBack().each(function(){this===t.target&&(f=!0)}),!f)?!1:(this.currentItem=r,this._removeCurrentsFromItems(),!0)},_mouseStart:function(t,i,r){var f,e,u=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(t),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},n.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,u.cursorAt&&this._adjustOffsetFromHelper(u.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),u.containment&&this._setContainment(),u.cursor&&u.cursor!=="auto"&&(e=this.document.find("body"),this.storedCursor=e.css("cursor"),e.css("cursor",u.cursor),this.storedStylesheet=n("<style>*{ cursor: "+u.cursor+" !important; }<\/style>").appendTo(e)),u.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",u.opacity)),u.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",u.zIndex)),this.scrollParent[0]!==document&&this.scrollParent[0].tagName!=="HTML"&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",t,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!r)for(f=this.containers.length-1;f>=0;f--)this.containers[f]._trigger("activate",t,this._uiHash(this));return n.ui.ddmanager&&(n.ui.ddmanager.current=this),n.ui.ddmanager&&!u.dropBehaviour&&n.ui.ddmanager.prepareOffsets(this,t),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(t),!0},_mouseDrag:function(t){var e,u,f,o,i=this.options,r=!1;for(this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==document&&this.scrollParent[0].tagName!=="HTML"?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageY<i.scrollSensitivity?this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop+i.scrollSpeed:t.pageY-this.overflowOffset.top<i.scrollSensitivity&&(this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop-i.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-t.pageX<i.scrollSensitivity?this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft+i.scrollSpeed:t.pageX-this.overflowOffset.left<i.scrollSensitivity&&(this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft-i.scrollSpeed)):(t.pageY-n(document).scrollTop()<i.scrollSensitivity?r=n(document).scrollTop(n(document).scrollTop()-i.scrollSpeed):n(window).height()-(t.pageY-n(document).scrollTop())<i.scrollSensitivity&&(r=n(document).scrollTop(n(document).scrollTop()+i.scrollSpeed)),t.pageX-n(document).scrollLeft()<i.scrollSensitivity?r=n(document).scrollLeft(n(document).scrollLeft()-i.scrollSpeed):n(window).width()-(t.pageX-n(document).scrollLeft())<i.scrollSensitivity&&(r=n(document).scrollLeft(n(document).scrollLeft()+i.scrollSpeed))),r!==!1&&n.ui.ddmanager&&!i.dropBehaviour&&n.ui.ddmanager.prepareOffsets(this,t)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&this.options.axis==="y"||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&this.options.axis==="x"||(this.helper[0].style.top=this.position.top+"px"),e=this.items.length-1;e>=0;e--)if((u=this.items[e],f=u.item[0],o=this._intersectsWithPointer(u),o)&&u.instance===this.currentContainer&&f!==this.currentItem[0]&&this.placeholder[o===1?"next":"prev"]()[0]!==f&&!n.contains(this.placeholder[0],f)&&(this.options.type==="semi-dynamic"?!n.contains(this.element[0],f):!0)){if(this.direction=o===1?"down":"up",this.options.tolerance==="pointer"||this._intersectsWithSides(u))this._rearrange(t,u);else break;this._trigger("change",t,this._uiHash());break}return this._contactContainers(t),n.ui.ddmanager&&n.ui.ddmanager.drag(this,t),this._trigger("sort",t,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(t,i){if(t){if(n.ui.ddmanager&&!this.options.dropBehaviour&&n.ui.ddmanager.drop(this,t),this.options.revert){var e=this,f=this.placeholder.offset(),r=this.options.axis,u={};r&&r!=="x"||(u.left=f.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollLeft));r&&r!=="y"||(u.top=f.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollTop));this.reverting=!0;n(this.helper).animate(u,parseInt(this.options.revert,10)||500,function(){e._clear(t)})}else this._clear(t,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null});this.options.helper==="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var t=this.containers.length-1;t>=0;t--)this.containers[t]._trigger("deactivate",null,this._uiHash(this)),this.containers[t].containerCache.over&&(this.containers[t]._trigger("out",null,this._uiHash(this)),this.containers[t].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.options.helper!=="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),n.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?n(this.domPosition.prev).after(this.currentItem):n(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(t){var r=this._getItemsAsjQuery(t&&t.connected),i=[];return t=t||{},n(r).each(function(){var r=(n(t.item||this).attr(t.attribute||"id")||"").match(t.expression||/(.+)[\-=_](.+)/);r&&i.push((t.key||r[1]+"[]")+"="+(t.key&&t.expression?r[1]:r[2]))}),!i.length&&t.key&&i.push(t.key+"="),i.join("&")},toArray:function(t){var r=this._getItemsAsjQuery(t&&t.connected),i=[];return t=t||{},r.each(function(){i.push(n(t.item||this).attr(t.attribute||"id")||"")}),i},_intersectsWith:function(n){var t=this.positionAbs.left,h=t+this.helperProportions.width,i=this.positionAbs.top,c=i+this.helperProportions.height,r=n.left,f=r+n.width,u=n.top,e=u+n.height,o=this.offset.click.top,s=this.offset.click.left,l=this.options.axis==="x"||i+o>u&&i+o<e,a=this.options.axis==="y"||t+s>r&&t+s<f,v=l&&a;return this.options.tolerance==="pointer"||this.options.forcePointerForContainers||this.options.tolerance!=="pointer"&&this.helperProportions[this.floating?"width":"height"]>n[this.floating?"width":"height"]?v:r<t+this.helperProportions.width/2&&h-this.helperProportions.width/2<f&&u<i+this.helperProportions.height/2&&c-this.helperProportions.height/2<e},_intersectsWithPointer:function(n){var r=this.options.axis==="x"||this._isOverAxis(this.positionAbs.top+this.offset.click.top,n.top,n.height),u=this.options.axis==="y"||this._isOverAxis(this.positionAbs.left+this.offset.click.left,n.left,n.width),f=r&&u,t=this._getDragVerticalDirection(),i=this._getDragHorizontalDirection();return f?this.floating?i&&i==="right"||t==="down"?2:1:t&&(t==="down"?2:1):!1},_intersectsWithSides:function(n){var r=this._isOverAxis(this.positionAbs.top+this.offset.click.top,n.top+n.height/2,n.height),u=this._isOverAxis(this.positionAbs.left+this.offset.click.left,n.left+n.width/2,n.width),t=this._getDragVerticalDirection(),i=this._getDragHorizontalDirection();return this.floating&&i?i==="right"&&u||i==="left"&&!u:t&&(t==="down"&&r||t==="up"&&!r)},_getDragVerticalDirection:function(){var n=this.positionAbs.top-this.lastPositionAbs.top;return n!==0&&(n>0?"down":"up")},_getDragHorizontalDirection:function(){var n=this.positionAbs.left-this.lastPositionAbs.left;return n!==0&&(n>0?"right":"left")},refresh:function(n){return this._refreshItems(n),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var n=this.options;return n.connectWith.constructor===String?[n.connectWith]:n.connectWith},_getItemsAsjQuery:function(t){function h(){s.push(this)}var r,u,e,i,s=[],f=[],o=this._connectWith();if(o&&t)for(r=o.length-1;r>=0;r--)for(e=n(o[r]),u=e.length-1;u>=0;u--)i=n.data(e[u],this.widgetFullName),i&&i!==this&&!i.options.disabled&&f.push([n.isFunction(i.options.items)?i.options.items.call(i.element):n(i.options.items,i.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),i]);for(f.push([n.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):n(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),r=f.length-1;r>=0;r--)f[r][0].each(h);return n(s)},_removeCurrentsFromItems:function(){var t=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=n.grep(this.items,function(n){for(var i=0;i<t.length;i++)if(t[i]===n.item[0])return!1;return!0})},_refreshItems:function(t){this.items=[];this.containers=[this];var r,u,e,i,o,s,h,l,a=this.items,f=[[n.isFunction(this.options.items)?this.options.items.call(this.element[0],t,{item:this.currentItem}):n(this.options.items,this.element),this]],c=this._connectWith();if(c&&this.ready)for(r=c.length-1;r>=0;r--)for(e=n(c[r]),u=e.length-1;u>=0;u--)i=n.data(e[u],this.widgetFullName),i&&i!==this&&!i.options.disabled&&(f.push([n.isFunction(i.options.items)?i.options.items.call(i.element[0],t,{item:this.currentItem}):n(i.options.items,i.element),i]),this.containers.push(i));for(r=f.length-1;r>=0;r--)for(o=f[r][1],s=f[r][0],u=0,l=s.length;u<l;u++)h=n(s[u]),h.data(this.widgetName+"-item",o),a.push({item:h,instance:o,width:0,height:0,left:0,top:0})},refreshPositions:function(t){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());for(var r,f,u,i=this.items.length-1;i>=0;i--)(r=this.items[i],r.instance!==this.currentContainer&&this.currentContainer&&r.item[0]!==this.currentItem[0])||(f=this.options.toleranceElement?n(this.options.toleranceElement,r.item):r.item,t||(r.width=f.outerWidth(),r.height=f.outerHeight()),u=f.offset(),r.left=u.left,r.top=u.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--)u=this.containers[i].element.offset(),this.containers[i].containerCache.left=u.left,this.containers[i].containerCache.top=u.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(t){t=t||this;var r,i=t.options;i.placeholder&&i.placeholder.constructor!==String||(r=i.placeholder,i.placeholder={element:function(){var u=t.currentItem[0].nodeName.toLowerCase(),i=n("<"+u+">",t.document[0]).addClass(r||t.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");return u==="tr"?t.currentItem.children().each(function(){n("<td>&#160;<\/td>",t.document[0]).attr("colspan",n(this).attr("colspan")||1).appendTo(i)}):u==="img"&&i.attr("src",t.currentItem.attr("src")),r||i.css("visibility","hidden"),i},update:function(n,u){(!r||i.forcePlaceholderSize)&&(u.height()||u.height(t.currentItem.innerHeight()-parseInt(t.currentItem.css("paddingTop")||0,10)-parseInt(t.currentItem.css("paddingBottom")||0,10)),u.width()||u.width(t.currentItem.innerWidth()-parseInt(t.currentItem.css("paddingLeft")||0,10)-parseInt(t.currentItem.css("paddingRight")||0,10)))}});t.placeholder=n(i.placeholder.element.call(t.element,t.currentItem));t.currentItem.after(t.placeholder);i.placeholder.update(t,t.placeholder)},_contactContainers:function(t){for(var u,c,f,a,v,o,l,s,h,e=null,r=null,i=this.containers.length-1;i>=0;i--)if(!n.contains(this.currentItem[0],this.containers[i].element[0]))if(this._intersectsWith(this.containers[i].containerCache)){if(e&&n.contains(this.containers[i].element[0],e.element[0]))continue;e=this.containers[i];r=i}else this.containers[i].containerCache.over&&(this.containers[i]._trigger("out",t,this._uiHash(this)),this.containers[i].containerCache.over=0);if(e)if(this.containers.length===1)this.containers[r].containerCache.over||(this.containers[r]._trigger("over",t,this._uiHash(this)),this.containers[r].containerCache.over=1);else{for(c=1e4,f=null,s=e.floating||this._isFloating(this.currentItem),a=s?"left":"top",v=s?"width":"height",h=s?"clientX":"clientY",u=this.items.length-1;u>=0;u--)n.contains(this.containers[r].element[0],this.items[u].item[0])&&this.items[u].item[0]!==this.currentItem[0]&&(o=this.items[u].item.offset()[a],l=!1,t[h]-o>this.items[u][v]/2&&(l=!0),Math.abs(t[h]-o)<c&&(c=Math.abs(t[h]-o),f=this.items[u],this.direction=l?"up":"down"));if(!f&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[r])return;f?this._rearrange(t,f,null,!0):this._rearrange(t,null,this.containers[r].element,!0);this._trigger("change",t,this._uiHash());this.containers[r]._trigger("change",t,this._uiHash(this));this.currentContainer=this.containers[r];this.options.placeholder.update(this.currentContainer,this.placeholder);this.containers[r]._trigger("over",t,this._uiHash(this));this.containers[r].containerCache.over=1}},_createHelper:function(t){var r=this.options,i=n.isFunction(r.helper)?n(r.helper.apply(this.element[0],[t,this.currentItem])):r.helper==="clone"?this.currentItem.clone():this.currentItem;return i.parents("body").length||n(r.appendTo!=="parent"?r.appendTo:this.currentItem[0].parentNode)[0].appendChild(i[0]),i[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(!i[0].style.width||r.forceHelperSize)&&i.width(this.currentItem.width()),(!i[0].style.height||r.forceHelperSize)&&i.height(this.currentItem.height()),i},_adjustOffsetFromHelper:function(t){typeof t=="string"&&(t=t.split(" "));n.isArray(t)&&(t={left:+t[0],top:+t[1]||0});"left"in t&&(this.offset.click.left=t.left+this.margins.left);"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left);"top"in t&&(this.offset.click.top=t.top+this.margins.top);"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();return this.cssPosition==="absolute"&&this.scrollParent[0]!==document&&n.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()==="html"&&n.ui.ie)&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition==="relative"){var n=this.currentItem.position();return{top:n.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:n.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,r,u,i=this.options;i.containment==="parent"&&(i.containment=this.helper[0].parentNode);(i.containment==="document"||i.containment==="window")&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,n(i.containment==="document"?document:window).width()-this.helperProportions.width-this.margins.left,(n(i.containment==="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]);/^(document|window|parent)$/.test(i.containment)||(t=n(i.containment)[0],r=n(i.containment).offset(),u=n(t).css("overflow")!=="hidden",this.containment=[r.left+(parseInt(n(t).css("borderLeftWidth"),10)||0)+(parseInt(n(t).css("paddingLeft"),10)||0)-this.margins.left,r.top+(parseInt(n(t).css("borderTopWidth"),10)||0)+(parseInt(n(t).css("paddingTop"),10)||0)-this.margins.top,r.left+(u?Math.max(t.scrollWidth,t.offsetWidth):t.offsetWidth)-(parseInt(n(t).css("borderLeftWidth"),10)||0)-(parseInt(n(t).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,r.top+(u?Math.max(t.scrollHeight,t.offsetHeight):t.offsetHeight)-(parseInt(n(t).css("borderTopWidth"),10)||0)-(parseInt(n(t).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(t,i){i||(i=this.position);var r=t==="absolute"?1:-1,u=this.cssPosition==="absolute"&&!(this.scrollParent[0]!==document&&n.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(u[0].tagName);return{top:i.top+this.offset.relative.top*r+this.offset.parent.top*r-(this.cssPosition==="fixed"?-this.scrollParent.scrollTop():f?0:u.scrollTop())*r,left:i.left+this.offset.relative.left*r+this.offset.parent.left*r-(this.cssPosition==="fixed"?-this.scrollParent.scrollLeft():f?0:u.scrollLeft())*r}},_generatePosition:function(t){var r,u,i=this.options,f=t.pageX,e=t.pageY,o=this.cssPosition==="absolute"&&!(this.scrollParent[0]!==document&&n.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,s=/(html|body)/i.test(o[0].tagName);return this.cssPosition!=="relative"||this.scrollParent[0]!==document&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(t.pageX-this.offset.click.left<this.containment[0]&&(f=this.containment[0]+this.offset.click.left),t.pageY-this.offset.click.top<this.containment[1]&&(e=this.containment[1]+this.offset.click.top),t.pageX-this.offset.click.left>this.containment[2]&&(f=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3]&&(e=this.containment[3]+this.offset.click.top)),i.grid&&(r=this.originalPageY+Math.round((e-this.originalPageY)/i.grid[1])*i.grid[1],e=this.containment?r-this.offset.click.top>=this.containment[1]&&r-this.offset.click.top<=this.containment[3]?r:r-this.offset.click.top>=this.containment[1]?r-i.grid[1]:r+i.grid[1]:r,u=this.originalPageX+Math.round((f-this.originalPageX)/i.grid[0])*i.grid[0],f=this.containment?u-this.offset.click.left>=this.containment[0]&&u-this.offset.click.left<=this.containment[2]?u:u-this.offset.click.left>=this.containment[0]?u-i.grid[0]:u+i.grid[0]:u)),{top:e-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(this.cssPosition==="fixed"?-this.scrollParent.scrollTop():s?0:o.scrollTop()),left:f-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition==="fixed"?-this.scrollParent.scrollLeft():s?0:o.scrollLeft())}},_rearrange:function(n,t,i,r){i?i[0].appendChild(this.placeholder[0]):t.item[0].parentNode.insertBefore(this.placeholder[0],this.direction==="down"?t.item[0]:t.item[0].nextSibling);this.counter=this.counter?++this.counter:1;var u=this.counter;this._delay(function(){u===this.counter&&this.refreshPositions(!r)})},_clear:function(n,t){function u(n,t,i){return function(r){i._trigger(n,r,t._uiHash(t))}}this.reverting=!1;var i,r=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(i in this._storedCSS)(this._storedCSS[i]==="auto"||this._storedCSS[i]==="static")&&(this._storedCSS[i]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!t&&r.push(function(n){this._trigger("receive",n,this._uiHash(this.fromOutside))}),(this.fromOutside||this.domPosition.prev!==this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!==this.currentItem.parent()[0])&&!t&&r.push(function(n){this._trigger("update",n,this._uiHash())}),this!==this.currentContainer&&(t||(r.push(function(n){this._trigger("remove",n,this._uiHash())}),r.push(function(n){return function(t){n._trigger("receive",t,this._uiHash(this))}}.call(this,this.currentContainer)),r.push(function(n){return function(t){n._trigger("update",t,this._uiHash(this))}}.call(this,this.currentContainer)))),i=this.containers.length-1;i>=0;i--)t||r.push(u("deactivate",this,this.containers[i])),this.containers[i].containerCache.over&&(r.push(u("out",this,this.containers[i])),this.containers[i].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex",this._storedZIndex==="auto"?"":this._storedZIndex),this.dragging=!1,this.cancelHelperRemoval){if(!t){for(this._trigger("beforeStop",n,this._uiHash()),i=0;i<r.length;i++)r[i].call(this,n);this._trigger("stop",n,this._uiHash())}return this.fromOutside=!1,!1}if(t||this._trigger("beforeStop",n,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null,!t){for(i=0;i<r.length;i++)r[i].call(this,n);this._trigger("stop",n,this._uiHash())}return this.fromOutside=!1,!0},_trigger:function(){n.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(t){var i=t||this;return{helper:i.helper,placeholder:i.placeholder||n([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:t?t.element:null}}});var li=n.widget("ui.spinner",{version:"1.11.1",defaultElement:"<input>",widgetEventPrefix:"spin",options:{culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max);this._setOption("min",this.options.min);this._setOption("step",this.options.step);this.value()!==""&&this._value(this.element.val(),!0);this._draw();this._on(this._events);this._refresh();this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var t={},i=this.element;return n.each(["min","max","step"],function(n,r){var u=i.attr(r);u!==undefined&&u.length&&(t[r]=u)}),t},_events:{keydown:function(n){this._start(n)&&this._keydown(n)&&n.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(n){if(this.cancelBlur){delete this.cancelBlur;return}this._stop();this._refresh();this.previous!==this.element.val()&&this._trigger("change",n)},mousewheel:function(n,t){if(t){if(!this.spinning&&!this._start(n))return!1;this._spin((t>0?1:-1)*this.options.step,n);clearTimeout(this.mousewheelTimer);this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(n)},100);n.preventDefault()}},"mousedown .ui-spinner-button":function(t){function r(){var n=this.element[0]===this.document[0].activeElement;n||(this.element.focus(),this.previous=i,this._delay(function(){this.previous=i}))}var i;(i=this.element[0]===this.document[0].activeElement?this.previous:this.element.val(),t.preventDefault(),r.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur;r.call(this)}),this._start(t)!==!1)&&this._repeat(null,n(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(t){if(n(t.currentTarget).hasClass("ui-state-active")){if(this._start(t)===!1)return!1;this._repeat(null,n(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)}},"mouseleave .ui-spinner-button":"_stop"},_draw:function(){var n=this.uiSpinner=this.element.addClass("ui-spinner-input").attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml());this.element.attr("role","spinbutton");this.buttons=n.find(".ui-spinner-button").attr("tabIndex",-1).button().removeClass("ui-corner-all");this.buttons.height()>Math.ceil(n.height()*.5)&&n.height()>0&&n.height(n.height());this.options.disabled&&this.disable()},_keydown:function(t){var r=this.options,i=n.ui.keyCode;switch(t.keyCode){case i.UP:return this._repeat(null,1,t),!0;case i.DOWN:return this._repeat(null,-1,t),!0;case i.PAGE_UP:return this._repeat(null,r.page,t),!0;case i.PAGE_DOWN:return this._repeat(null,-r.page,t),!0}return!1},_uiSpinnerHtml:function(){return"<span class='ui-spinner ui-widget ui-widget-content ui-corner-all'><\/span>"},_buttonHtml:function(){return"<a class='ui-spinner-button ui-spinner-up ui-corner-tr'><span class='ui-icon "+this.options.icons.up+"'>&#9650;<\/span><\/a><a class='ui-spinner-button ui-spinner-down ui-corner-br'><span class='ui-icon "+this.options.icons.down+"'>&#9660;<\/span><\/a>"},_start:function(n){return!this.spinning&&this._trigger("start",n)===!1?!1:(this.counter||(this.counter=1),this.spinning=!0,!0)},_repeat:function(n,t,i){n=n||500;clearTimeout(this.timer);this.timer=this._delay(function(){this._repeat(40,t,i)},n);this._spin(t*this.options.step,i)},_spin:function(n,t){var i=this.value()||0;this.counter||(this.counter=1);i=this._adjustValue(i+n*this._increment(this.counter));this.spinning&&this._trigger("spin",t,{value:i})===!1||(this._value(i),this.counter++)},_increment:function(t){var i=this.options.incremental;return i?n.isFunction(i)?i(t):Math.floor(t*t*t/5e4-t*t/500+17*t/200+1):1},_precision:function(){var n=this._precisionOf(this.options.step);return this.options.min!==null&&(n=Math.max(n,this._precisionOf(this.options.min))),n},_precisionOf:function(n){var t=n.toString(),i=t.indexOf(".");return i===-1?0:t.length-i-1},_adjustValue:function(n){var r,i,t=this.options;return(r=t.min!==null?t.min:0,i=n-r,i=Math.round(i/t.step)*t.step,n=r+i,n=parseFloat(n.toFixed(this._precision())),t.max!==null&&n>t.max)?t.max:t.min!==null&&n<t.min?t.min:n},_stop:function(n){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",n))},_setOption:function(n,t){if(n==="culture"||n==="numberFormat"){var i=this._parse(this.element.val());this.options[n]=t;this.element.val(this._format(i));return}(n==="max"||n==="min"||n==="step")&&typeof t=="string"&&(t=this._parse(t));n==="icons"&&(this.buttons.first().find(".ui-icon").removeClass(this.options.icons.up).addClass(t.up),this.buttons.last().find(".ui-icon").removeClass(this.options.icons.down).addClass(t.down));this._super(n,t);n==="disabled"&&(this.widget().toggleClass("ui-state-disabled",!!t),this.element.prop("disabled",!!t),this.buttons.button(t?"disable":"enable"))},_setOptions:t(function(n){this._super(n)}),_parse:function(n){return typeof n=="string"&&n!==""&&(n=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(n,10,this.options.culture):+n),n===""||isNaN(n)?null:n},_format:function(n){return n===""?"":window.Globalize&&this.options.numberFormat?Globalize.format(n,this.options.numberFormat,this.options.culture):n},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},isValid:function(){var n=this.value();return n===null?!1:n===this._adjustValue(n)},_value:function(n,t){var i;n!==""&&(i=this._parse(n),i!==null&&(t||(i=this._adjustValue(i)),n=this._format(i)));this.element.val(n);this._refresh()},_destroy:function(){this.element.removeClass("ui-spinner-input").prop("disabled",!1).removeAttr("autocomplete").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow");this.uiSpinner.replaceWith(this.element)},stepUp:t(function(n){this._stepUp(n)}),_stepUp:function(n){this._start()&&(this._spin((n||1)*this.options.step),this._stop())},stepDown:t(function(n){this._stepDown(n)}),_stepDown:function(n){this._start()&&(this._spin((n||1)*-this.options.step),this._stop())},pageUp:t(function(n){this._stepUp((n||1)*this.options.page)}),pageDown:t(function(n){this._stepDown((n||1)*this.options.page)}),value:function(n){if(!arguments.length)return this._parse(this.element.val());t(this._value).call(this,n)},widget:function(){return this.uiSpinner}}),ai=n.widget("ui.tabs",{version:"1.11.1",delay:300,options:{active:null,collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:function(){var n=/#.*$/;return function(t){var i,r;t=t.cloneNode(!1);i=t.href.replace(n,"");r=location.href.replace(n,"");try{i=decodeURIComponent(i)}catch(u){}try{r=decodeURIComponent(r)}catch(u){}return t.hash.length>1&&i===r}}(),_create:function(){var i=this,t=this.options;this.running=!1;this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",t.collapsible);this._processTabs();t.active=this._initialActive();n.isArray(t.disabled)&&(t.disabled=n.unique(t.disabled.concat(n.map(this.tabs.filter(".ui-state-disabled"),function(n){return i.tabs.index(n)}))).sort());this.active=this.options.active!==!1&&this.anchors.length?this._findActive(t.active):n();this._refresh();this.active.length&&this.load(t.active)},_initialActive:function(){var t=this.options.active,i=this.options.collapsible,r=location.hash.substring(1);return t===null&&(r&&this.tabs.each(function(i,u){if(n(u).attr("aria-controls")===r)return t=i,!1}),t===null&&(t=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),(t===null||t===-1)&&(t=this.tabs.length?0:!1)),t!==!1&&(t=this.tabs.index(this.tabs.eq(t)),t===-1&&(t=i?!1:0)),!i&&t===!1&&this.anchors.length&&(t=0),t},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):n()}},_tabKeydown:function(t){var r=n(this.document[0].activeElement).closest("li"),i=this.tabs.index(r),u=!0;if(!this._handlePageNav(t)){switch(t.keyCode){case n.ui.keyCode.RIGHT:case n.ui.keyCode.DOWN:i++;break;case n.ui.keyCode.UP:case n.ui.keyCode.LEFT:u=!1;i--;break;case n.ui.keyCode.END:i=this.anchors.length-1;break;case n.ui.keyCode.HOME:i=0;break;case n.ui.keyCode.SPACE:t.preventDefault();clearTimeout(this.activating);this._activate(i);return;case n.ui.keyCode.ENTER:t.preventDefault();clearTimeout(this.activating);this._activate(i===this.options.active?!1:i);return;default:return}t.preventDefault();clearTimeout(this.activating);i=this._focusNextTab(i,u);t.ctrlKey||(r.attr("aria-selected","false"),this.tabs.eq(i).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",i)},this.delay))}},_panelKeydown:function(t){this._handlePageNav(t)||t.ctrlKey&&t.keyCode===n.ui.keyCode.UP&&(t.preventDefault(),this.active.focus())},_handlePageNav:function(t){return t.altKey&&t.keyCode===n.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):t.altKey&&t.keyCode===n.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(t,i){function u(){return t>r&&(t=0),t<0&&(t=r),t}for(var r=this.tabs.length-1;n.inArray(u(),this.options.disabled)!==-1;)t=i?t+1:t-1;return t},_focusNextTab:function(n,t){return n=this._findNextTab(n,t),this.tabs.eq(n).focus(),n},_setOption:function(n,t){if(n==="active"){this._activate(t);return}if(n==="disabled"){this._setupDisabled(t);return}this._super(n,t);n==="collapsible"&&(this.element.toggleClass("ui-tabs-collapsible",t),t||this.options.active!==!1||this._activate(0));n==="event"&&this._setupEvents(t);n==="heightStyle"&&this._setupHeightStyle(t)},_sanitizeSelector:function(n){return n?n.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var t=this.options,i=this.tablist.children(":has(a[href])");t.disabled=n.map(i.filter(".ui-state-disabled"),function(n){return i.index(n)});this._processTabs();t.active!==!1&&this.anchors.length?this.active.length&&!n.contains(this.tablist[0],this.active[0])?this.tabs.length===t.disabled.length?(t.active=!1,this.active=n()):this._activate(this._findNextTab(Math.max(0,t.active-1),!1)):t.active=this.tabs.index(this.active):(t.active=!1,this.active=n());this._refresh()},_refresh:function(){this._setupDisabled(this.options.disabled);this._setupEvents(this.options.event);this._setupHeightStyle(this.options.heightStyle);this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1});this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden":"true"});this.active.length?(this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}),this._getPanelForTab(this.active).show().attr({"aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var t=this;this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist").delegate("> li","mousedown"+this.eventNamespace,function(t){n(this).is(".ui-state-disabled")&&t.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){n(this).closest("li").is(".ui-state-disabled")&&this.blur()});this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1});this.anchors=this.tabs.map(function(){return n("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1});this.panels=n();this.anchors.each(function(i,r){var f,u,e,s=n(r).uniqueId().attr("id"),o=n(r).closest("li"),h=o.attr("aria-controls");t._isLocal(r)?(f=r.hash,e=f.substring(1),u=t.element.find(t._sanitizeSelector(f))):(e=o.attr("aria-controls")||n({}).uniqueId()[0].id,f="#"+e,u=t.element.find(f),u.length||(u=t._createPanel(e),u.insertAfter(t.panels[i-1]||t.tablist)),u.attr("aria-live","polite"));u.length&&(t.panels=t.panels.add(u));h&&o.data("ui-tabs-aria-controls",h);o.attr({"aria-controls":e,"aria-labelledby":s});u.attr("aria-labelledby",s)});this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel")},_getList:function(){return this.tablist||this.element.find("ol,ul").eq(0)},_createPanel:function(t){return n("<div>").attr("id",t).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupDisabled:function(t){n.isArray(t)&&(t.length?t.length===this.anchors.length&&(t=!0):t=!1);for(var i=0,r;r=this.tabs[i];i++)t===!0||n.inArray(i,t)!==-1?n(r).addClass("ui-state-disabled").attr("aria-disabled","true"):n(r).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=t},_setupEvents:function(t){var i={};t&&n.each(t.split(" "),function(n,t){i[t]="_eventHandler"});this._off(this.anchors.add(this.tabs).add(this.panels));this._on(!0,this.anchors,{click:function(n){n.preventDefault()}});this._on(this.anchors,i);this._on(this.tabs,{keydown:"_tabKeydown"});this._on(this.panels,{keydown:"_panelKeydown"});this._focusable(this.tabs);this._hoverable(this.tabs)},_setupHeightStyle:function(t){var i,r=this.element.parent();t==="fill"?(i=r.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var t=n(this),r=t.css("position");r!=="absolute"&&r!=="fixed"&&(i-=t.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=n(this).outerHeight(!0)}),this.panels.each(function(){n(this).height(Math.max(0,i-n(this).innerHeight()+n(this).height()))}).css("overflow","auto")):t==="auto"&&(i=0,this.panels.each(function(){i=Math.max(i,n(this).height("").height())}).height(i))},_eventHandler:function(t){var u=this.options,r=this.active,c=n(t.currentTarget),i=c.closest("li"),f=i[0]===r[0],e=f&&u.collapsible,o=e?n():this._getPanelForTab(i),s=r.length?this._getPanelForTab(r):n(),h={oldTab:r,oldPanel:s,newTab:e?n():i,newPanel:o};(t.preventDefault(),i.hasClass("ui-state-disabled")||i.hasClass("ui-tabs-loading")||this.running||f&&!u.collapsible||this._trigger("beforeActivate",t,h)===!1)||(u.active=e?!1:this.tabs.index(i),this.active=f?n():i,this.xhr&&this.xhr.abort(),s.length||o.length||n.error("jQuery UI Tabs: Mismatching fragment identifier."),o.length&&this.load(this.tabs.index(i),t),this._toggle(t,h))},_toggle:function(t,i){function e(){u.running=!1;u._trigger("activate",t,i)}function o(){i.newTab.closest("li").addClass("ui-tabs-active ui-state-active");r.length&&u.options.show?u._show(r,u.options.show,e):(r.show(),e())}var u=this,r=i.newPanel,f=i.oldPanel;this.running=!0;f.length&&this.options.hide?this._hide(f,this.options.hide,function(){i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active");o()}):(i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),f.hide(),o());f.attr("aria-hidden","true");i.oldTab.attr({"aria-selected":"false","aria-expanded":"false"});r.length&&f.length?i.oldTab.attr("tabIndex",-1):r.length&&this.tabs.filter(function(){return n(this).attr("tabIndex")===0}).attr("tabIndex",-1);r.attr("aria-hidden","false");i.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(t){var r,i=this._findActive(t);i[0]!==this.active[0]&&(i.length||(i=this.active),r=i.find(".ui-tabs-anchor")[0],this._eventHandler({target:r,currentTarget:r,preventDefault:n.noop}))},_findActive:function(t){return t===!1?n():this.tabs.eq(t)},_getIndex:function(n){return typeof n=="string"&&(n=this.anchors.index(this.anchors.filter("[href$='"+n+"']"))),n},_destroy:function(){this.xhr&&this.xhr.abort();this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible");this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role");this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeUniqueId();this.tablist.unbind(this.eventNamespace);this.tabs.add(this.panels).each(function(){n.data(this,"ui-tabs-destroy")?n(this).remove():n(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role")});this.tabs.each(function(){var t=n(this),i=t.data("ui-tabs-aria-controls");i?t.attr("aria-controls",i).removeData("ui-tabs-aria-controls"):t.removeAttr("aria-controls")});this.panels.show();this.options.heightStyle!=="content"&&this.panels.css("height","")},enable:function(t){var i=this.options.disabled;i!==!1&&(t===undefined?i=!1:(t=this._getIndex(t),i=n.isArray(i)?n.map(i,function(n){return n!==t?n:null}):n.map(this.tabs,function(n,i){return i!==t?i:null})),this._setupDisabled(i))},disable:function(t){var i=this.options.disabled;if(i!==!0){if(t===undefined)i=!0;else{if(t=this._getIndex(t),n.inArray(t,i)!==-1)return;i=n.isArray(i)?n.merge([t],i).sort():[t]}this._setupDisabled(i)}},load:function(t,i){t=this._getIndex(t);var u=this,r=this.tabs.eq(t),e=r.find(".ui-tabs-anchor"),f=this._getPanelForTab(r),o={tab:r,panel:f};this._isLocal(e[0])||(this.xhr=n.ajax(this._ajaxSettings(e,i,o)),this.xhr&&this.xhr.statusText!=="canceled"&&(r.addClass("ui-tabs-loading"),f.attr("aria-busy","true"),this.xhr.success(function(n){setTimeout(function(){f.html(n);u._trigger("load",i,o)},1)}).complete(function(n,t){setTimeout(function(){t==="abort"&&u.panels.stop(!1,!0);r.removeClass("ui-tabs-loading");f.removeAttr("aria-busy");n===u.xhr&&delete u.xhr},1)})))},_ajaxSettings:function(t,i,r){var u=this;return{url:t.attr("href"),beforeSend:function(t,f){return u._trigger("beforeLoad",i,n.extend({jqXHR:t,ajaxSettings:f},r))}}},_getPanelForTab:function(t){var i=n(t).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+i))}}),vi=n.widget("ui.tooltip",{version:"1.11.1",options:{content:function(){var t=n(this).attr("title")||"";return n("<a>").text(t).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,tooltipClass:null,track:!1,close:null,open:null},_addDescribedBy:function(t,i){var r=(t.attr("aria-describedby")||"").split(/\s+/);r.push(i);t.data("ui-tooltip-id",i).attr("aria-describedby",n.trim(r.join(" ")))},_removeDescribedBy:function(t){var u=t.data("ui-tooltip-id"),i=(t.attr("aria-describedby")||"").split(/\s+/),r=n.inArray(u,i);r!==-1&&i.splice(r,1);t.removeData("ui-tooltip-id");i=n.trim(i.join(" "));i?t.attr("aria-describedby",i):t.removeAttr("aria-describedby")},_create:function(){this._on({mouseover:"open",focusin:"open"});this.tooltips={};this.parents={};this.options.disabled&&this._disable();this.liveRegion=n("<div>").attr({role:"log","aria-live":"assertive","aria-relevant":"additions"}).addClass("ui-helper-hidden-accessible").appendTo(this.document[0].body)},_setOption:function(t,i){var r=this;if(t==="disabled"){this[i?"_disable":"_enable"]();this.options[t]=i;return}this._super(t,i);t==="content"&&n.each(this.tooltips,function(n,t){r._updateContent(t)})},_disable:function(){var t=this;n.each(this.tooltips,function(i,r){var u=n.Event("blur");u.target=u.currentTarget=r[0];t.close(u,!0)});this.element.find(this.options.items).addBack().each(function(){var t=n(this);t.is("[title]")&&t.data("ui-tooltip-title",t.attr("title")).removeAttr("title")})},_enable:function(){this.element.find(this.options.items).addBack().each(function(){var t=n(this);t.data("ui-tooltip-title")&&t.attr("title",t.data("ui-tooltip-title"))})},open:function(t){var r=this,i=n(t?t.target:this.element).closest(this.options.items);i.length&&!i.data("ui-tooltip-id")&&(i.attr("title")&&i.data("ui-tooltip-title",i.attr("title")),i.data("ui-tooltip-open",!0),t&&t.type==="mouseover"&&i.parents().each(function(){var t=n(this),i;t.data("ui-tooltip-open")&&(i=n.Event("blur"),i.target=i.currentTarget=this,r.close(i,!0));t.attr("title")&&(t.uniqueId(),r.parents[this.id]={element:this,title:t.attr("title")},t.attr("title",""))}),this._updateContent(i,t))},_updateContent:function(n,t){var i,r=this.options.content,u=this,f=t?t.type:null;if(typeof r=="string")return this._open(t,n,r);i=r.call(n[0],function(i){n.data("ui-tooltip-open")&&u._delay(function(){t&&(t.type=f);this._open(t,n,i)})});i&&this._open(t,n,i)},_open:function(t,i,r){function s(n){(o.of=n,u.is(":hidden"))||u.position(o)}var u,f,h,e,o=n.extend({},this.options.position);if(r){if(u=this._find(i),u.length){u.find(".ui-tooltip-content").html(r);return}i.is("[title]")&&(t&&t.type==="mouseover"?i.attr("title",""):i.removeAttr("title"));u=this._tooltip(i);this._addDescribedBy(i,u.attr("id"));u.find(".ui-tooltip-content").html(r);this.liveRegion.children().hide();r.clone?(e=r.clone(),e.removeAttr("id").find("[id]").removeAttr("id")):e=r;n("<div>").html(e).appendTo(this.liveRegion);this.options.track&&t&&/^mouse/.test(t.type)?(this._on(this.document,{mousemove:s}),s(t)):u.position(n.extend({of:i},this.options.position));this.hiding=!1;this.closing=!1;u.hide();this._show(u,this.options.show);this.options.show&&this.options.show.delay&&(h=this.delayedShow=setInterval(function(){u.is(":visible")&&(s(o.of),clearInterval(h))},n.fx.interval));this._trigger("open",t,{tooltip:u});f={keyup:function(t){if(t.keyCode===n.ui.keyCode.ESCAPE){var r=n.Event(t);r.currentTarget=i[0];this.close(r,!0)}}};i[0]!==this.element[0]&&(f.remove=function(){this._removeTooltip(u)});t&&t.type!=="mouseover"||(f.mouseleave="close");t&&t.type!=="focusin"||(f.focusout="close");this._on(!0,i,f)}},close:function(t){var u=this,i=n(t?t.currentTarget:this.element),r=this._find(i);this.closing||(clearInterval(this.delayedShow),i.data("ui-tooltip-title")&&!i.attr("title")&&i.attr("title",i.data("ui-tooltip-title")),this._removeDescribedBy(i),this.hiding=!0,r.stop(!0),this._hide(r,this.options.hide,function(){u._removeTooltip(n(this));this.hiding=!1;this.closing=!1}),i.removeData("ui-tooltip-open"),this._off(i,"mouseleave focusout keyup"),i[0]!==this.element[0]&&this._off(i,"remove"),this._off(this.document,"mousemove"),t&&t.type==="mouseleave"&&n.each(this.parents,function(t,i){n(i.element).attr("title",i.title);delete u.parents[t]}),this.closing=!0,this._trigger("close",t,{tooltip:r}),this.hiding||(this.closing=!1))},_tooltip:function(t){var i=n("<div>").attr("role","tooltip").addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+(this.options.tooltipClass||"")),r=i.uniqueId().attr("id");return n("<div>").addClass("ui-tooltip-content").appendTo(i),i.appendTo(this.document[0].body),this.tooltips[r]=t,i},_find:function(t){var i=t.data("ui-tooltip-id");return i?n("#"+i):n()},_removeTooltip:function(n){n.remove();delete this.tooltips[n.attr("id")]},_destroy:function(){var t=this;n.each(this.tooltips,function(i,r){var u=n.Event("blur");u.target=u.currentTarget=r[0];t.close(u,!0);n("#"+i).remove();r.data("ui-tooltip-title")&&(r.attr("title")||r.attr("title",r.data("ui-tooltip-title")),r.removeData("ui-tooltip-title"))});this.liveRegion.remove()}})});Handlebars=function(){var r=function(){"use strict";function n(n){this.string=n}return n.prototype.toString=function(){return""+this.string},n}(),t=function(n){"use strict";function h(n){return e[n]||"&amp;"}function c(n,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}function l(n){return n instanceof f?n.toString():!n&&n!==0?"":(n=""+n,!s.test(n))?n:n.replace(o,h)}function a(n){return n||n===0?u(n)&&n.length===0?!0:!1:!0}var t={},f=n,e={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},o=/[&<>"'`]/g,s=/[&<>"'`]/,i,r,u;return t.extend=c,i=Object.prototype.toString,t.toString=i,r=function(n){return typeof n=="function"},r(/x/)&&(r=function(n){return typeof n=="function"&&i.call(n)==="[object Function]"}),t.isFunction=r,u=Array.isArray||function(n){return n&&typeof n=="object"?i.call(n)==="[object Array]":!1},t.isArray=u,t.escapeExpression=l,t.isEmpty=a,t}(r),n=function(){"use strict";function t(t,i){var u,f,r;for(i&&i.firstLine&&(u=i.firstLine,t+=" - "+u+":"+i.firstColumn),f=Error.prototype.constructor.call(this,t),r=0;r<n.length;r++)this[n[r]]=f[n[r]];u&&(this.lineNumber=u,this.column=i.firstColumn)}var n=["description","fileName","lineNumber","message","name","number","stack"];return t.prototype=new Error,t}(),i=function(n,t){"use strict";function e(n,t){this.helpers=n||{};this.partials=t||{};p(this)}function p(n){n.registerHelper("helperMissing",function(n){if(arguments.length===2)return undefined;throw new s("Missing helper: '"+n+"'");});n.registerHelper("blockHelperMissing",function(t,i){var r=i.inverse||function(){},u=i.fn;return f(t)&&(t=t.call(this)),t===!0?u(this):t===!1||t==null?r(this):l(t)?t.length>0?n.helpers.each(t,i):r(this):u(t)});n.registerHelper("each",function(n,t){var s=t.fn,c=t.inverse,r=0,u="",i,h,e;if(f(n)&&(n=n.call(this)),t.data&&(i=o(t.data)),n&&typeof n=="object")if(l(n))for(h=n.length;r<h;r++)i&&(i.index=r,i.first=r===0,i.last=r===n.length-1),u=u+s(n[r],{data:i});else for(e in n)n.hasOwnProperty(e)&&(i&&(i.key=e,i.index=r,i.first=r===0),u=u+s(n[e],{data:i}),r++);return r===0&&(u=c(this)),u});n.registerHelper("if",function(n,t){return f(n)&&(n=n.call(this)),(t.hash.includeZero||n)&&!r.isEmpty(n)?t.fn(this):t.inverse(this)});n.registerHelper("unless",function(t,i){return n.helpers["if"].call(this,t,{fn:i.inverse,inverse:i.fn,hash:i.hash})});n.registerHelper("with",function(n,t){return f(n)&&(n=n.call(this)),r.isEmpty(n)?void 0:t.fn(n)});n.registerHelper("log",function(t,i){var r=i.data&&i.data.level!=null?parseInt(i.data.level,10):1;n.log(r,t)})}function y(n,t){u.log(n,t)}var i={},r=n,s=t,h,c,u,o;i.VERSION="1.3.0";h=4;i.COMPILER_REVISION=h;c={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:">= 1.0.0"};i.REVISION_CHANGES=c;var l=r.isArray,f=r.isFunction,a=r.toString,v="[object Object]";return i.HandlebarsEnvironment=e,e.prototype={constructor:e,logger:u,log:y,registerHelper:function(n,t,i){if(a.call(n)===v){if(i||t)throw new s("Arg not supported with multiple helpers");r.extend(this.helpers,n)}else i&&(t.not=i),this.helpers[n]=t},registerPartial:function(n,t){a.call(n)===v?r.extend(this.partials,n):this.partials[n]=t}},u={methodMap:{0:"debug",1:"info",2:"warn",3:"error"},DEBUG:0,INFO:1,WARN:2,ERROR:3,level:3,log:function(n,t){if(u.level<=n){var i=u.methodMap[n];typeof console!="undefined"&&console[i]&&console[i].call(console,t)}}},i.logger=u,i.log=y,o=function(n){var t={};return r.extend(t,n),t},i.createFrame=o,i}(t,n),f=function(n,t,i){"use strict";function h(n){var t=n&&n[0]||1,i=s,r,f;if(t!==i)if(t<i){r=o[i];f=o[t];throw new u("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+r+") or downgrade your runtime to an older version ("+f+").");}else throw new u("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+n[1]+").");}function c(n,t){if(!t)throw new u("No environment passed to template");var r=function(n,i,r,f,e,o){var s=t.VM.invokePartial.apply(this,arguments),h;if(s!=null)return s;if(t.compile)return h={helpers:f,partials:e,data:o},e[i]=t.compile(n,{data:o!==undefined},t),e[i](r,h);throw new u("The partial "+i+" could not be compiled when running in runtime-only mode");},i={escapeExpression:f.escapeExpression,invokePartial:r,programs:[],program:function(n,t,i){var r=this.programs[n];return i?r=e(n,t,i):r||(r=this.programs[n]=e(n,t)),r},merge:function(n,t){var i=n||t;return n&&t&&n!==t&&(i={},f.extend(i,t),f.extend(i,n)),i},programWithDepth:t.VM.programWithDepth,noop:t.VM.noop,compilerInfo:null};return function(r,u){var f,e,o,s;return u=u||{},f=u.partial?u:t,u.partial||(e=u.helpers,o=u.partials),s=n.call(i,f,r,e,o,u.data),u.partial||t.VM.checkRevision(i.compilerInfo),s}}function l(n,t,i){var u=Array.prototype.slice.call(arguments,3),r=function(n,r){return r=r||{},t.apply(this,[n,r.data||i].concat(u))};return r.program=n,r.depth=u.length,r}function e(n,t,i){var r=function(n,r){return r=r||{},t(n,r.data||i)};return r.program=n,r.depth=0,r}function a(n,t,i,r,f,e){var o={partial:!0,helpers:r,partials:f,data:e};if(n===undefined)throw new u("The partial "+t+" could not be found");else if(n instanceof Function)return n(i,o)}function v(){return""}var r={},f=n,u=t,s=i.COMPILER_REVISION,o=i.REVISION_CHANGES;return r.checkRevision=h,r.template=c,r.programWithDepth=l,r.program=e,r.invokePartial=a,r.noop=v,r}(t,n,i),e=function(n,t,i,r,u){"use strict";var f=n,c=t,l=i,e=r,o=u,s=function(){var n=new f.HandlebarsEnvironment;return e.extend(n,f),n.SafeString=c,n.Exception=l,n.Utils=e,n.VM=o,n.template=function(t){return o.template(t,n)},n},h=s();return h.create=s,h}(i,r,n,t,f),u=function(n){"use strict";function t(n){n=n||{};this.firstLine=n.first_line;this.firstColumn=n.first_column;this.lastColumn=n.last_column;this.lastLine=n.last_line}var r=n,i={ProgramNode:function(n,r,u,f){var o,e;arguments.length===3?(f=u,u=null):arguments.length===2&&(f=r,r=null);t.call(this,f);this.type="program";this.statements=n;this.strip={};u?(e=u[0],e?(o={first_line:e.firstLine,last_line:e.lastLine,last_column:e.lastColumn,first_column:e.firstColumn},this.inverse=new i.ProgramNode(u,r,o)):this.inverse=new i.ProgramNode(u,r),this.strip.right=r.left):r&&(this.strip.left=r.right)},MustacheNode:function(n,r,u,f,e){if(t.call(this,e),this.type="mustache",this.strip=f,u!=null&&u.charAt){var o=u.charAt(3)||u.charAt(2);this.escaped=o!=="{"&&o!=="&"}else this.escaped=!!u;this.sexpr=n instanceof i.SexprNode?n:new i.SexprNode(n,r);this.sexpr.isRoot=!0;this.id=this.sexpr.id;this.params=this.sexpr.params;this.hash=this.sexpr.hash;this.eligibleHelper=this.sexpr.eligibleHelper;this.isHelper=this.sexpr.isHelper},SexprNode:function(n,i,r){t.call(this,r);this.type="sexpr";this.hash=i;var u=this.id=n[0],f=this.params=n.slice(1),e=this.eligibleHelper=u.isSimple;this.isHelper=e&&(f.length||i)},PartialNode:function(n,i,r,u){t.call(this,u);this.type="partial";this.partialName=n;this.context=i;this.strip=r},BlockNode:function(n,i,u,f,e){if(t.call(this,e),n.sexpr.id.original!==f.path.original)throw new r(n.sexpr.id.original+" doesn't match "+f.path.original,this);this.type="block";this.mustache=n;this.program=i;this.inverse=u;this.strip={left:n.strip.left,right:f.strip.right};(i||u).strip.left=n.strip.right;(u||i).strip.right=f.strip.left;u&&!i&&(this.isInverse=!0)},ContentNode:function(n,i){t.call(this,i);this.type="content";this.string=n},HashNode:function(n,i){t.call(this,i);this.type="hash";this.pairs=n},IdNode:function(n,i){var f,h,u;t.call(this,i);this.type="ID";var o="",e=[],s=0;for(f=0,h=n.length;f<h;f++)if(u=n[f].part,o+=(n[f].separator||"")+u,u===".."||u==="."||u==="this")if(e.length>0)throw new r("Invalid path: "+o,this);else u===".."?s++:this.isScoped=!0;else e.push(u);this.original=o;this.parts=e;this.string=e.join(".");this.depth=s;this.isSimple=n.length===1&&!this.isScoped&&s===0;this.stringModeValue=this.string},PartialNameNode:function(n,i){t.call(this,i);this.type="PARTIAL_NAME";this.name=n.original},DataNode:function(n,i){t.call(this,i);this.type="DATA";this.id=n},StringNode:function(n,i){t.call(this,i);this.type="STRING";this.original=this.string=this.stringModeValue=n},IntegerNode:function(n,i){t.call(this,i);this.type="INTEGER";this.original=this.integer=n;this.stringModeValue=Number(n)},BooleanNode:function(n,i){t.call(this,i);this.type="BOOLEAN";this.bool=n;this.stringModeValue=n==="true"},CommentNode:function(n,i){t.call(this,i);this.type="comment";this.comment=n}};return i}(n),o=function(){"use strict";return function(){function n(n,t){return{left:n.charAt(2)==="~",right:t.charAt(0)==="~"||t.charAt(1)==="~"}}function i(){this.yy={}}var t={trace:function(){},yy:{},symbols_:{error:2,root:3,statements:4,EOF:5,program:6,simpleInverse:7,statement:8,openInverse:9,closeBlock:10,openBlock:11,mustache:12,partial:13,CONTENT:14,COMMENT:15,OPEN_BLOCK:16,sexpr:17,CLOSE:18,OPEN_INVERSE:19,OPEN_ENDBLOCK:20,path:21,OPEN:22,OPEN_UNESCAPED:23,CLOSE_UNESCAPED:24,OPEN_PARTIAL:25,partialName:26,partial_option0:27,sexpr_repetition0:28,sexpr_option0:29,dataName:30,param:31,STRING:32,INTEGER:33,BOOLEAN:34,OPEN_SEXPR:35,CLOSE_SEXPR:36,hash:37,hash_repetition_plus0:38,hashSegment:39,ID:40,EQUALS:41,DATA:42,pathSegments:43,SEP:44,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",14:"CONTENT",15:"COMMENT",16:"OPEN_BLOCK",18:"CLOSE",19:"OPEN_INVERSE",20:"OPEN_ENDBLOCK",22:"OPEN",23:"OPEN_UNESCAPED",24:"CLOSE_UNESCAPED",25:"OPEN_PARTIAL",32:"STRING",33:"INTEGER",34:"BOOLEAN",35:"OPEN_SEXPR",36:"CLOSE_SEXPR",40:"ID",41:"EQUALS",42:"DATA",44:"SEP"},productions_:[0,[3,2],[3,1],[6,2],[6,3],[6,2],[6,1],[6,1],[6,0],[4,1],[4,2],[8,3],[8,3],[8,1],[8,1],[8,1],[8,1],[11,3],[9,3],[10,3],[12,3],[12,3],[13,4],[7,2],[17,3],[17,1],[31,1],[31,1],[31,1],[31,1],[31,1],[31,3],[37,1],[39,3],[26,1],[26,1],[26,1],[30,2],[21,1],[43,3],[43,1],[27,0],[27,1],[28,0],[28,2],[29,0],[29,1],[38,1],[38,2]],performAction:function(t,i,r,u,f,e){var o=e.length-1;switch(f){case 1:return new u.ProgramNode(e[o-1],this._$);case 2:return new u.ProgramNode([],this._$);case 3:this.$=new u.ProgramNode([],e[o-1],e[o],this._$);break;case 4:this.$=new u.ProgramNode(e[o-2],e[o-1],e[o],this._$);break;case 5:this.$=new u.ProgramNode(e[o-1],e[o],[],this._$);break;case 6:this.$=new u.ProgramNode(e[o],this._$);break;case 7:this.$=new u.ProgramNode([],this._$);break;case 8:this.$=new u.ProgramNode([],this._$);break;case 9:this.$=[e[o]];break;case 10:e[o-1].push(e[o]);this.$=e[o-1];break;case 11:this.$=new u.BlockNode(e[o-2],e[o-1].inverse,e[o-1],e[o],this._$);break;case 12:this.$=new u.BlockNode(e[o-2],e[o-1],e[o-1].inverse,e[o],this._$);break;case 13:this.$=e[o];break;case 14:this.$=e[o];break;case 15:this.$=new u.ContentNode(e[o],this._$);break;case 16:this.$=new u.CommentNode(e[o],this._$);break;case 17:this.$=new u.MustacheNode(e[o-1],null,e[o-2],n(e[o-2],e[o]),this._$);break;case 18:this.$=new u.MustacheNode(e[o-1],null,e[o-2],n(e[o-2],e[o]),this._$);break;case 19:this.$={path:e[o-1],strip:n(e[o-2],e[o])};break;case 20:this.$=new u.MustacheNode(e[o-1],null,e[o-2],n(e[o-2],e[o]),this._$);break;case 21:this.$=new u.MustacheNode(e[o-1],null,e[o-2],n(e[o-2],e[o]),this._$);break;case 22:this.$=new u.PartialNode(e[o-2],e[o-1],n(e[o-3],e[o]),this._$);break;case 23:this.$=n(e[o-1],e[o]);break;case 24:this.$=new u.SexprNode([e[o-2]].concat(e[o-1]),e[o],this._$);break;case 25:this.$=new u.SexprNode([e[o]],null,this._$);break;case 26:this.$=e[o];break;case 27:this.$=new u.StringNode(e[o],this._$);break;case 28:this.$=new u.IntegerNode(e[o],this._$);break;case 29:this.$=new u.BooleanNode(e[o],this._$);break;case 30:this.$=e[o];break;case 31:e[o-1].isHelper=!0;this.$=e[o-1];break;case 32:this.$=new u.HashNode(e[o],this._$);break;case 33:this.$=[e[o-2],e[o]];break;case 34:this.$=new u.PartialNameNode(e[o],this._$);break;case 35:this.$=new u.PartialNameNode(new u.StringNode(e[o],this._$),this._$);break;case 36:this.$=new u.PartialNameNode(new u.IntegerNode(e[o],this._$));break;case 37:this.$=new u.DataNode(e[o],this._$);break;case 38:this.$=new u.IdNode(e[o],this._$);break;case 39:e[o-2].push({part:e[o],separator:e[o-1]});this.$=e[o-2];break;case 40:this.$=[{part:e[o]}];break;case 43:this.$=[];break;case 44:e[o-1].push(e[o]);break;case 47:this.$=[e[o]];break;case 48:e[o-1].push(e[o])}},table:[{3:1,4:2,5:[1,3],8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],22:[1,13],23:[1,14],25:[1,15]},{1:[3]},{5:[1,16],8:17,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],22:[1,13],23:[1,14],25:[1,15]},{1:[2,2]},{5:[2,9],14:[2,9],15:[2,9],16:[2,9],19:[2,9],20:[2,9],22:[2,9],23:[2,9],25:[2,9]},{4:20,6:18,7:19,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,21],20:[2,8],22:[1,13],23:[1,14],25:[1,15]},{4:20,6:22,7:19,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,21],20:[2,8],22:[1,13],23:[1,14],25:[1,15]},{5:[2,13],14:[2,13],15:[2,13],16:[2,13],19:[2,13],20:[2,13],22:[2,13],23:[2,13],25:[2,13]},{5:[2,14],14:[2,14],15:[2,14],16:[2,14],19:[2,14],20:[2,14],22:[2,14],23:[2,14],25:[2,14]},{5:[2,15],14:[2,15],15:[2,15],16:[2,15],19:[2,15],20:[2,15],22:[2,15],23:[2,15],25:[2,15]},{5:[2,16],14:[2,16],15:[2,16],16:[2,16],19:[2,16],20:[2,16],22:[2,16],23:[2,16],25:[2,16]},{17:23,21:24,30:25,40:[1,28],42:[1,27],43:26},{17:29,21:24,30:25,40:[1,28],42:[1,27],43:26},{17:30,21:24,30:25,40:[1,28],42:[1,27],43:26},{17:31,21:24,30:25,40:[1,28],42:[1,27],43:26},{21:33,26:32,32:[1,34],33:[1,35],40:[1,28],43:26},{1:[2,1]},{5:[2,10],14:[2,10],15:[2,10],16:[2,10],19:[2,10],20:[2,10],22:[2,10],23:[2,10],25:[2,10]},{10:36,20:[1,37]},{4:38,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,7],22:[1,13],23:[1,14],25:[1,15]},{7:39,8:17,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,21],20:[2,6],22:[1,13],23:[1,14],25:[1,15]},{17:23,18:[1,40],21:24,30:25,40:[1,28],42:[1,27],43:26},{10:41,20:[1,37]},{18:[1,42]},{18:[2,43],24:[2,43],28:43,32:[2,43],33:[2,43],34:[2,43],35:[2,43],36:[2,43],40:[2,43],42:[2,43]},{18:[2,25],24:[2,25],36:[2,25]},{18:[2,38],24:[2,38],32:[2,38],33:[2,38],34:[2,38],35:[2,38],36:[2,38],40:[2,38],42:[2,38],44:[1,44]},{21:45,40:[1,28],43:26},{18:[2,40],24:[2,40],32:[2,40],33:[2,40],34:[2,40],35:[2,40],36:[2,40],40:[2,40],42:[2,40],44:[2,40]},{18:[1,46]},{18:[1,47]},{24:[1,48]},{18:[2,41],21:50,27:49,40:[1,28],43:26},{18:[2,34],40:[2,34]},{18:[2,35],40:[2,35]},{18:[2,36],40:[2,36]},{5:[2,11],14:[2,11],15:[2,11],16:[2,11],19:[2,11],20:[2,11],22:[2,11],23:[2,11],25:[2,11]},{21:51,40:[1,28],43:26},{8:17,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,3],22:[1,13],23:[1,14],25:[1,15]},{4:52,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,5],22:[1,13],23:[1,14],25:[1,15]},{14:[2,23],15:[2,23],16:[2,23],19:[2,23],20:[2,23],22:[2,23],23:[2,23],25:[2,23]},{5:[2,12],14:[2,12],15:[2,12],16:[2,12],19:[2,12],20:[2,12],22:[2,12],23:[2,12],25:[2,12]},{14:[2,18],15:[2,18],16:[2,18],19:[2,18],20:[2,18],22:[2,18],23:[2,18],25:[2,18]},{18:[2,45],21:56,24:[2,45],29:53,30:60,31:54,32:[1,57],33:[1,58],34:[1,59],35:[1,61],36:[2,45],37:55,38:62,39:63,40:[1,64],42:[1,27],43:26},{40:[1,65]},{18:[2,37],24:[2,37],32:[2,37],33:[2,37],34:[2,37],35:[2,37],36:[2,37],40:[2,37],42:[2,37]},{14:[2,17],15:[2,17],16:[2,17],19:[2,17],20:[2,17],22:[2,17],23:[2,17],25:[2,17]},{5:[2,20],14:[2,20],15:[2,20],16:[2,20],19:[2,20],20:[2,20],22:[2,20],23:[2,20],25:[2,20]},{5:[2,21],14:[2,21],15:[2,21],16:[2,21],19:[2,21],20:[2,21],22:[2,21],23:[2,21],25:[2,21]},{18:[1,66]},{18:[2,42]},{18:[1,67]},{8:17,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,4],22:[1,13],23:[1,14],25:[1,15]},{18:[2,24],24:[2,24],36:[2,24]},{18:[2,44],24:[2,44],32:[2,44],33:[2,44],34:[2,44],35:[2,44],36:[2,44],40:[2,44],42:[2,44]},{18:[2,46],24:[2,46],36:[2,46]},{18:[2,26],24:[2,26],32:[2,26],33:[2,26],34:[2,26],35:[2,26],36:[2,26],40:[2,26],42:[2,26]},{18:[2,27],24:[2,27],32:[2,27],33:[2,27],34:[2,27],35:[2,27],36:[2,27],40:[2,27],42:[2,27]},{18:[2,28],24:[2,28],32:[2,28],33:[2,28],34:[2,28],35:[2,28],36:[2,28],40:[2,28],42:[2,28]},{18:[2,29],24:[2,29],32:[2,29],33:[2,29],34:[2,29],35:[2,29],36:[2,29],40:[2,29],42:[2,29]},{18:[2,30],24:[2,30],32:[2,30],33:[2,30],34:[2,30],35:[2,30],36:[2,30],40:[2,30],42:[2,30]},{17:68,21:24,30:25,40:[1,28],42:[1,27],43:26},{18:[2,32],24:[2,32],36:[2,32],39:69,40:[1,70]},{18:[2,47],24:[2,47],36:[2,47],40:[2,47]},{18:[2,40],24:[2,40],32:[2,40],33:[2,40],34:[2,40],35:[2,40],36:[2,40],40:[2,40],41:[1,71],42:[2,40],44:[2,40]},{18:[2,39],24:[2,39],32:[2,39],33:[2,39],34:[2,39],35:[2,39],36:[2,39],40:[2,39],42:[2,39],44:[2,39]},{5:[2,22],14:[2,22],15:[2,22],16:[2,22],19:[2,22],20:[2,22],22:[2,22],23:[2,22],25:[2,22]},{5:[2,19],14:[2,19],15:[2,19],16:[2,19],19:[2,19],20:[2,19],22:[2,19],23:[2,19],25:[2,19]},{36:[1,72]},{18:[2,48],24:[2,48],36:[2,48],40:[2,48]},{41:[1,71]},{21:56,30:60,31:73,32:[1,57],33:[1,58],34:[1,59],35:[1,61],40:[1,28],42:[1,27],43:26},{18:[2,31],24:[2,31],32:[2,31],33:[2,31],34:[2,31],35:[2,31],36:[2,31],40:[2,31],42:[2,31]},{18:[2,33],24:[2,33],36:[2,33],40:[2,33]}],defaultActions:{3:[2,2],16:[2,1],50:[2,42]},parseError:function(n){throw new Error(n);},parse:function(n){function it(){var n;return n=k.lexer.lex()||1,typeof n!="number"&&(n=k.symbols_[n]||n),n}var k=this,r=[0],f=[null],t=[],h=this.table,d="",c=0,g=0,y=0,l,nt,i,p,o,u,w,s,a,e,tt,v,b;for(this.lexer.setInput(n),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,typeof this.lexer.yylloc=="undefined"&&(this.lexer.yylloc={}),l=this.lexer.yylloc,t.push(l),nt=this.lexer.options&&this.lexer.options.ranges,typeof this.yy.parseError=="function"&&(this.parseError=this.yy.parseError),s={};;){if(o=r[r.length-1],this.defaultActions[o]?u=this.defaultActions[o]:((i===null||typeof i=="undefined")&&(i=it()),u=h[o]&&h[o][i]),(typeof u=="undefined"||!u.length||!u[0])&&(b="",!y)){v=[];for(a in h[o])this.terminals_[a]&&a>2&&v.push("'"+this.terminals_[a]+"'");b=this.lexer.showPosition?"Parse error on line "+(c+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+v.join(", ")+", got '"+(this.terminals_[i]||i)+"'":"Parse error on line "+(c+1)+": Unexpected "+(i==1?"end of input":"'"+(this.terminals_[i]||i)+"'");this.parseError(b,{text:this.lexer.match,token:this.terminals_[i]||i,line:this.lexer.yylineno,loc:l,expected:v})}if(u[0]instanceof Array&&u.length>1)throw new Error("Parse Error: multiple actions possible at state: "+o+", token: "+i);switch(u[0]){case 1:r.push(i);f.push(this.lexer.yytext);t.push(this.lexer.yylloc);r.push(u[1]);i=null;p?(i=p,p=null):(g=this.lexer.yyleng,d=this.lexer.yytext,c=this.lexer.yylineno,l=this.lexer.yylloc,y>0&&y--);break;case 2:if(e=this.productions_[u[1]][1],s.$=f[f.length-e],s._$={first_line:t[t.length-(e||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(e||1)].first_column,last_column:t[t.length-1].last_column},nt&&(s._$.range=[t[t.length-(e||1)].range[0],t[t.length-1].range[1]]),w=this.performAction.call(s,d,g,c,this.yy,u[1],f,t),typeof w!="undefined")return w;e&&(r=r.slice(0,-2*e),f=f.slice(0,-1*e),t=t.slice(0,-1*e));r.push(this.productions_[u[1]][0]);f.push(s.$);t.push(s._$);tt=h[r[r.length-2]][r[r.length-1]];r.push(tt);break;case 3:return!0}}return!0}},r=function(){var n={EOF:1,parseError:function(n,t){if(this.yy.parser)this.yy.parser.parseError(n,t);else throw new Error(n);},setInput:function(n){return this._input=n,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var n=this._input[0],t;return this.yytext+=n,this.yyleng++,this.offset++,this.match+=n,this.matched+=n,t=n.match(/(?:\r\n?|\n).*/g),t?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),n},unput:function(n){var i=n.length,t=n.split(/(?:\r\n?|\n)/g),r,u;return this._input=n+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-i-1),this.offset-=i,r=this.match.split(/(?:\r\n?|\n)/g),this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),t.length-1&&(this.yylineno-=t.length-1),u=this.yylloc.range,this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:t?(t.length===r.length?this.yylloc.first_column:0)+r[r.length-t.length].length-t[0].length:this.yylloc.first_column-i},this.options.ranges&&(this.yylloc.range=[u[0],u[0]+this.yyleng-i]),this},more:function(){return this._more=!0,this},less:function(n){this.unput(this.match.slice(n))},pastInput:function(){var n=this.matched.substr(0,this.matched.length-this.match.length);return(n.length>20?"...":"")+n.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var n=this.match;return n.length<20&&(n+=this._input.substr(0,20-n.length)),(n.substr(0,20)+(n.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var n=this.pastInput(),t=new Array(n.length+1).join("-");return n+this.upcomingInput()+"\n"+t+"^"},next:function(){var f,n,r,e,t,u,i;if(this.done)return this.EOF;for(this._input||(this.done=!0),this._more||(this.yytext="",this.match=""),u=this._currentRules(),i=0;i<u.length;i++)if(r=this._input.match(this.rules[u[i]]),r&&(!n||r[0].length>n[0].length)&&(n=r,e=i,!this.options.flex))break;return n?(t=n[0].match(/(?:\r\n?|\n).*/g),t&&(this.yylineno+=t.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:t?t[t.length-1].length-t[t.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+n[0].length},this.yytext+=n[0],this.match+=n[0],this.matches=n,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(n[0].length),this.matched+=n[0],f=this.performAction.call(this,this.yy,this,u[e],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),f)?f:void 0:this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var n=this.next();return typeof n!="undefined"?n:this.lex()},begin:function(n){this.conditionStack.push(n)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(n){this.begin(n)}};return n.options={},n.performAction=function(n,t,i,r){function u(n,i){return t.yytext=t.yytext.substr(n,t.yyleng-i)}var f=r;switch(i){case 0:if(t.yytext.slice(-2)==="\\\\"?(u(0,1),this.begin("mu")):t.yytext.slice(-1)==="\\"?(u(0,1),this.begin("emu")):this.begin("mu"),t.yytext)return 14;break;case 1:return 14;case 2:return this.popState(),14;case 3:return u(0,4),this.popState(),15;case 4:return 35;case 5:return 36;case 6:return 25;case 7:return 16;case 8:return 20;case 9:return 19;case 10:return 19;case 11:return 23;case 12:return 22;case 13:this.popState();this.begin("com");break;case 14:return u(3,5),this.popState(),15;case 15:return 22;case 16:return 41;case 17:return 40;case 18:return 40;case 19:return 44;case 21:return this.popState(),24;case 22:return this.popState(),18;case 23:return t.yytext=u(1,2).replace(/\\"/g,'"'),32;case 24:return t.yytext=u(1,2).replace(/\\'/g,"'"),32;case 25:return 42;case 26:return 34;case 27:return 34;case 28:return 33;case 29:return 40;case 30:return t.yytext=u(1,2),40;case 31:return"INVALID";case 32:return 5}},n.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:[\s\S]*?--\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{!--)/,/^(?:\{\{![\s\S]*?\}\})/,/^(?:\{\{(~)?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:-?[0-9]+(?=([~}\s)])))/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)]))))/,/^(?:\[[^\]]*\])/,/^(?:.)/,/^(?:$)/],n.conditions={mu:{rules:[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[3],inclusive:!1},INITIAL:{rules:[0,1,32],inclusive:!0}},n}();return t.lexer=r,i.prototype=t,t.Parser=i,new i}()}(),s=function(n,t){"use strict";function f(n){return n.constructor===u.ProgramNode?n:(r.yy=u,r.parse(n))}var i={},r=n,u=t;return i.parser=r,i.parse=f,i}(o,u),h=function(n){"use strict";function r(){}function u(n,t,r){if(n==null||typeof n!="string"&&n.constructor!==r.AST.ProgramNode)throw new i("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+n);t=t||{};"data"in t||(t.data=!0);var u=r.parse(n),f=(new r.Compiler).compile(u,t);return(new r.JavaScriptCompiler).compile(f,t)}function f(n,t,r){function f(){var i=r.parse(n),u=(new r.Compiler).compile(i,t),f=(new r.JavaScriptCompiler).compile(u,t,undefined,!0);return r.template(f)}if(n==null||typeof n!="string"&&n.constructor!==r.AST.ProgramNode)throw new i("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+n);t=t||{};"data"in t||(t.data=!0);var u;return function(n,t){return u||(u=f()),u.call(this,n,t)}}var t={},i=n;return t.Compiler=r,r.prototype={compiler:r,disassemble:function(){for(var e=this.opcodes,n,u=[],f,t,r,i=0,o=e.length;i<o;i++)if(n=e[i],n.opcode==="DECLARE")u.push("DECLARE "+n.name+"="+n.value);else{for(f=[],r=0;r<n.args.length;r++)t=n.args[r],typeof t=="string"&&(t='"'+t.replace("\n","\\n")+'"'),f.push(t);u.push(n.opcode+" "+f.join(" "))}return u.join("\n")},equals:function(n){var i=this.opcodes.length,t,r,f,u;if(n.opcodes.length!==i)return!1;for(t=0;t<i;t++){if(r=this.opcodes[t],f=n.opcodes[t],r.opcode!==f.opcode||r.args.length!==f.args.length)return!1;for(u=0;u<r.args.length;u++)if(r.args[u]!==f.args[u])return!1}if(i=this.children.length,n.children.length!==i)return!1;for(t=0;t<i;t++)if(!this.children[t].equals(n.children[t]))return!1;return!0},guid:0,compile:function(n,t){var i,r;if(this.opcodes=[],this.children=[],this.depths={list:[]},this.options=t,i=this.options.knownHelpers,this.options.knownHelpers={helperMissing:!0,blockHelperMissing:!0,each:!0,"if":!0,unless:!0,"with":!0,log:!0},i)for(r in i)this.options.knownHelpers[r]=i[r];return this.accept(n)},accept:function(n){var t=n.strip||{},i;return t.left&&this.opcode("strip"),i=this[n.type](n),t.right&&this.opcode("strip"),i},program:function(n){for(var r=n.statements,t=0,i=r.length;t<i;t++)this.accept(r[t]);return this.isSimple=i===1,this.depths.list=this.depths.list.sort(function(n,t){return n-t}),this},compileProgram:function(n){var t=(new this.compiler).compile(n,this.options),u=this.guid++,r,i,f;for(this.usePartial=this.usePartial||t.usePartial,this.children[u]=t,i=0,f=t.depths.list.length;i<f;i++)if(r=t.depths.list[i],r<2)continue;else this.addDepth(r-1);return u},block:function(n){var f=n.mustache,t=n.program,i=n.inverse,r,u;t&&(t=this.compileProgram(t));i&&(i=this.compileProgram(i));r=f.sexpr;u=this.classifySexpr(r);u==="helper"?this.helperSexpr(r,t,i):u==="simple"?(this.simpleSexpr(r),this.opcode("pushProgram",t),this.opcode("pushProgram",i),this.opcode("emptyHash"),this.opcode("blockValue")):(this.ambiguousSexpr(r,t,i),this.opcode("pushProgram",t),this.opcode("pushProgram",i),this.opcode("emptyHash"),this.opcode("ambiguousBlockValue"));this.opcode("append")},hash:function(n){var u=n.pairs,r,t,i,f;for(this.opcode("pushHash"),i=0,f=u.length;i<f;i++)r=u[i],t=r[1],this.options.stringParams?(t.depth&&this.addDepth(t.depth),this.opcode("getContext",t.depth||0),this.opcode("pushStringParam",t.stringModeValue,t.type),t.type==="sexpr"&&this.sexpr(t)):this.accept(t),this.opcode("assignToHash",r[0]);this.opcode("popHash")},partial:function(n){var t=n.partialName;this.usePartial=!0;n.context?this.ID(n.context):this.opcode("push","depth0");this.opcode("invokePartial",t.name);this.opcode("append")},content:function(n){this.opcode("appendContent",n.string)},mustache:function(n){this.sexpr(n.sexpr);n.escaped&&!this.options.noEscape?this.opcode("appendEscaped"):this.opcode("append")},ambiguousSexpr:function(n,t,i){var r=n.id,u=r.parts[0],f=t!=null||i!=null;this.opcode("getContext",r.depth);this.opcode("pushProgram",t);this.opcode("pushProgram",i);this.opcode("invokeAmbiguous",u,f)},simpleSexpr:function(n){var t=n.id;t.type==="DATA"?this.DATA(t):t.parts.length?this.ID(t):(this.addDepth(t.depth),this.opcode("getContext",t.depth),this.opcode("pushContext"));this.opcode("resolvePossibleLambda")},helperSexpr:function(n,t,r){var f=this.setupFullMustacheParams(n,t,r),u=n.id.parts[0];if(this.options.knownHelpers[u])this.opcode("invokeKnownHelper",f.length,u);else if(this.options.knownHelpersOnly)throw new i("You specified knownHelpersOnly, but used the unknown helper "+u,n);else this.opcode("invokeHelper",f.length,u,n.isRoot)},sexpr:function(n){var t=this.classifySexpr(n);t==="simple"?this.simpleSexpr(n):t==="helper"?this.helperSexpr(n):this.ambiguousSexpr(n)},ID:function(n){var i,t,r;for(this.addDepth(n.depth),this.opcode("getContext",n.depth),i=n.parts[0],i?this.opcode("lookupOnContext",n.parts[0]):this.opcode("pushContext"),t=1,r=n.parts.length;t<r;t++)this.opcode("lookup",n.parts[t])},DATA:function(n){var r,t,u;if(this.options.data=!0,n.id.isScoped||n.id.depth)throw new i("Scoped data references are not supported: "+n.original,n);for(this.opcode("lookupData"),r=n.id.parts,t=0,u=r.length;t<u;t++)this.opcode("lookup",r[t])},STRING:function(n){this.opcode("pushString",n.string)},INTEGER:function(n){this.opcode("pushLiteral",n.integer)},BOOLEAN:function(n){this.opcode("pushLiteral",n.bool)},comment:function(){},opcode:function(n){this.opcodes.push({opcode:n,args:[].slice.call(arguments,1)})},declare:function(n,t){this.opcodes.push({opcode:"DECLARE",name:n,value:t})},addDepth:function(n){n!==0&&(this.depths[n]||(this.depths[n]=!0,this.depths.list.push(n)))},classifySexpr:function(n){var t=n.isHelper,i=n.eligibleHelper,r=this.options,u;return i&&!t&&(u=n.id.parts[0],r.knownHelpers[u]?t=!0:r.knownHelpersOnly&&(i=!1)),t?"helper":i?"ambiguous":"simple"},pushParams:function(n){for(var i=n.length,t;i--;)t=n[i],this.options.stringParams?(t.depth&&this.addDepth(t.depth),this.opcode("getContext",t.depth||0),this.opcode("pushStringParam",t.stringModeValue,t.type),t.type==="sexpr"&&this.sexpr(t)):this[t.type](t)},setupFullMustacheParams:function(n,t,i){var r=n.params;return this.pushParams(r),this.opcode("pushProgram",t),this.opcode("pushProgram",i),n.hash?this.hash(n.hash):this.opcode("emptyHash"),r}},t.precompile=u,t.compile=f,t}(n),c=function(n,t){"use strict";function r(n){this.value=n}function i(){}var c=n.COMPILER_REVISION,l=n.REVISION_CHANGES,e=n.log,o=t,f,s,u,h;for(i.prototype={nameLookup:function(n,t){var u,r;return n.indexOf("depth")===0&&(u=!0),r=/^[0-9]+$/.test(t)?n+"["+t+"]":i.isValidJavaScriptVariableName(t)?n+"."+t:n+"['"+t+"']",u?"("+n+" && "+r+")":r},compilerInfo:function(){var n=c,t=l[n];return"this.compilerInfo = ["+n+",'"+t+"'];\n"},appendToBuffer:function(n){return this.environment.isSimple?"return "+n+";":{appendToBuffer:!0,content:n,toString:function(){return"buffer += "+n+";"}}},initializeBuffer:function(){return this.quotedString("")},namespace:"Handlebars",compile:function(n,t,i,r){var f,u,s;for(this.environment=n,this.options=t||{},e("debug",this.environment.disassemble()+"\n\n"),this.name=this.environment.name,this.isChild=!!i,this.context=i||{programs:[],environments:[],aliases:{}},this.preamble(),this.stackSlot=0,this.stackVars=[],this.registers={list:[]},this.hashes=[],this.compileStack=[],this.inlineStack=[],this.compileChildren(n,t),f=n.opcodes,this.i=0,s=f.length;this.i<s;this.i++)u=f[this.i],u.opcode==="DECLARE"?this[u.name]=u.value:this[u.opcode].apply(this,u.args),u.opcode!==this.stripNext&&(this.stripNext=!1);if(this.pushSource(""),this.stackSlot||this.inlineStack.length||this.compileStack.length)throw new o("Compile completed with content left on stack");return this.createFunctionContext(r)},preamble:function(){var t=[],i,n;this.isChild?t.push(""):(i=this.namespace,n="helpers = this.merge(helpers, "+i+".helpers);",this.environment.usePartial&&(n=n+" partials = this.merge(partials, "+i+".partials);"),this.options.data&&(n=n+" data = data || {};"),t.push(n));this.environment.isSimple?t.push(""):t.push(", buffer = "+this.initializeBuffer());this.lastContext=0;this.source=t},createFunctionContext:function(n){var o=this.stackVars.concat(this.registers.list),r,t,u,s,i,f;if(o.length>0&&(this.source[1]=this.source[1]+", "+o.join(", ")),!this.isChild)for(r in this.context.aliases)this.context.aliases.hasOwnProperty(r)&&(this.source[1]=this.source[1]+", "+r+"="+this.context.aliases[r]);for(this.source[1]&&(this.source[1]="var "+this.source[1].substring(2)+";"),this.isChild||(this.source[1]+="\n"+this.context.programs.join("\n")+"\n"),this.environment.isSimple||this.pushSource("return buffer;"),t=this.isChild?["depth0","data"]:["Handlebars","depth0","helpers","partials","data"],u=0,s=this.environment.depths.list.length;u<s;u++)t.push("depth"+this.environment.depths.list[u]);return i=this.mergeSource(),this.isChild||(i=this.compilerInfo()+i),n?(t.push(i),Function.apply(this,t)):(f="function "+(this.name||"")+"("+t.join(",")+") {\n  "+i+"}",e("debug",f+"\n\n"),f)},mergeSource:function(){for(var r="",n,t,i=0,u=this.source.length;i<u;i++)t=this.source[i],t.appendToBuffer?n=n?n+"\n    + "+t.content:t.content:(n&&(r+="buffer += "+n+";\n  ",n=undefined),r+=t+"\n  ");return r},blockValue:function(){this.context.aliases.blockHelperMissing="helpers.blockHelperMissing";var n=["depth0"];this.setupParams(0,n);this.replaceStack(function(t){return n.splice(1,0,t),"blockHelperMissing.call("+n.join(", ")+")"})},ambiguousBlockValue:function(){var n,t;this.context.aliases.blockHelperMissing="helpers.blockHelperMissing";n=["depth0"];this.setupParams(0,n);t=this.topStack();n.splice(1,0,t);this.pushSource("if (!"+this.lastHelper+") { "+t+" = blockHelperMissing.call("+n.join(", ")+"); }")},appendContent:function(n){this.pendingContent&&(n=this.pendingContent+n);this.stripNext&&(n=n.replace(/^\s+/,""));this.pendingContent=n},strip:function(){this.pendingContent&&(this.pendingContent=this.pendingContent.replace(/\s+$/,""));this.stripNext="strip"},append:function(){this.flushInline();var n=this.popStack();this.pushSource("if("+n+" || "+n+" === 0) { "+this.appendToBuffer(n)+" }");this.environment.isSimple&&this.pushSource("else { "+this.appendToBuffer("''")+" }")},appendEscaped:function(){this.context.aliases.escapeExpression="this.escapeExpression";this.pushSource(this.appendToBuffer("escapeExpression("+this.popStack()+")"))},getContext:function(n){this.lastContext!==n&&(this.lastContext=n)},lookupOnContext:function(n){this.push(this.nameLookup("depth"+this.lastContext,n,"context"))},pushContext:function(){this.pushStackLiteral("depth"+this.lastContext)},resolvePossibleLambda:function(){this.context.aliases.functionType='"function"';this.replaceStack(function(n){return"typeof "+n+" === functionType ? "+n+".apply(depth0) : "+n})},lookup:function(n){this.replaceStack(function(t){return t+" == null || "+t+" === false ? "+t+" : "+this.nameLookup(t,n,"context")})},lookupData:function(){this.pushStackLiteral("data")},pushStringParam:function(n,t){this.pushStackLiteral("depth"+this.lastContext);this.pushString(t);t!=="sexpr"&&(typeof n=="string"?this.pushString(n):this.pushStackLiteral(n))},emptyHash:function(){this.pushStackLiteral("{}");this.options.stringParams&&(this.push("{}"),this.push("{}"))},pushHash:function(){this.hash&&this.hashes.push(this.hash);this.hash={values:[],types:[],contexts:[]}},popHash:function(){var n=this.hash;this.hash=this.hashes.pop();this.options.stringParams&&(this.push("{"+n.contexts.join(",")+"}"),this.push("{"+n.types.join(",")+"}"));this.push("{\n    "+n.values.join(",\n    ")+"\n  }")},pushString:function(n){this.pushStackLiteral(this.quotedString(n))},push:function(n){return this.inlineStack.push(n),n},pushLiteral:function(n){this.pushStackLiteral(n)},pushProgram:function(n){n!=null?this.pushStackLiteral(this.programExpression(n)):this.pushStackLiteral(null)},invokeHelper:function(n,t,i){this.context.aliases.helperMissing="helpers.helperMissing";this.useRegister("helper");var r=this.lastHelper=this.setupHelper(n,t,!0),f=this.nameLookup("depth"+this.lastContext,t,"context"),u="helper = "+r.name+" || "+f;r.paramsInit&&(u+=","+r.paramsInit);this.push("("+u+",helper ? helper.call("+r.callParams+") : helperMissing.call("+r.helperMissingParams+"))");i||this.flushInline()},invokeKnownHelper:function(n,t){var i=this.setupHelper(n,t);this.push(i.name+".call("+i.callParams+")")},invokeAmbiguous:function(n,t){this.context.aliases.functionType='"function"';this.useRegister("helper");this.emptyHash();var i=this.setupHelper(0,n,t),u=this.lastHelper=this.nameLookup("helpers",n,"helper"),f=this.nameLookup("depth"+this.lastContext,n,"context"),r=this.nextStack();i.paramsInit&&this.pushSource(i.paramsInit);this.pushSource("if (helper = "+u+") { "+r+" = helper.call("+i.callParams+"); }");this.pushSource("else { helper = "+f+"; "+r+" = typeof helper === functionType ? helper.call("+i.callParams+") : helper; }")},invokePartial:function(n){var t=[this.nameLookup("partials",n,"partial"),"'"+n+"'",this.popStack(),"helpers","partials"];this.options.data&&t.push("data");this.context.aliases.self="this";this.push("self.invokePartial("+t.join(", ")+")")},assignToHash:function(n){var u=this.popStack(),i,r,t;this.options.stringParams&&(r=this.popStack(),i=this.popStack());t=this.hash;i&&t.contexts.push("'"+n+"': "+i);r&&t.types.push("'"+n+"': "+r);t.values.push("'"+n+"': ("+u+")")},compiler:i,compileChildren:function(n,t){for(var f=n.children,r,e,i,u=0,o=f.length;u<o;u++)r=f[u],e=new this.compiler,i=this.matchExistingProgram(r),i==null?(this.context.programs.push(""),i=this.context.programs.length,r.index=i,r.name="program"+i,this.context.programs[i]=e.compile(r,t,this.context),this.context.environments[i]=r):(r.index=i,r.name="program"+i)},matchExistingProgram:function(n){for(var i,t=0,r=this.context.environments.length;t<r;t++)if(i=this.context.environments[t],i&&i.equals(n))return t},programExpression:function(n){var t,e;if(this.context.aliases.self="this",n==null)return"self.noop";var i=this.environment.children[n],r=i.depths.list,u,f=[i.index,i.name,"data"];for(t=0,e=r.length;t<e;t++)u=r[t],u===1?f.push("depth0"):f.push("depth"+(u-1));return(r.length===0?"self.program(":"self.programWithDepth(")+f.join(", ")+")"},register:function(n,t){this.useRegister(n);this.pushSource(n+" = "+t+";")},useRegister:function(n){this.registers[n]||(this.registers[n]=!0,this.registers.list.push(n))},pushStackLiteral:function(n){return this.push(new r(n))},pushSource:function(n){this.pendingContent&&(this.source.push(this.appendToBuffer(this.quotedString(this.pendingContent))),this.pendingContent=undefined);n&&this.source.push(n)},pushStack:function(n){this.flushInline();var t=this.incrStack();return n&&this.pushSource(t+" = "+n+";"),this.compileStack.push(t),t},replaceStack:function(n){var u="",o=this.isInline(),t,f,s,i,h,e;return o?(i=this.popStack(!0),i instanceof r?(t=i.value,s=!0):(f=!this.stackSlot,h=f?this.incrStack():this.topStackName(),u="("+this.push(h)+" = "+i+"),",t=this.topStack())):t=this.topStack(),e=n.call(this,t),o?(s||this.popStack(),f&&this.stackSlot--,this.push("("+u+e+")")):(/^stack/.test(t)||(t=this.nextStack()),this.pushSource(t+" = ("+u+e+");")),t},nextStack:function(){return this.pushStack()},incrStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var i=this.inlineStack,n,u,t;if(i.length)for(this.inlineStack=[],n=0,u=i.length;n<u;n++)t=i[n],t instanceof r?this.compileStack.push(t):this.pushStack(t)},isInline:function(){return this.inlineStack.length},popStack:function(n){var i=this.isInline(),t=(i?this.inlineStack:this.compileStack).pop();if(!n&&t instanceof r)return t.value;if(!i){if(!this.stackSlot)throw new o("Invalid stack pop");this.stackSlot--}return t},topStack:function(n){var i=this.isInline()?this.inlineStack:this.compileStack,t=i[i.length-1];return!n&&t instanceof r?t.value:t},quotedString:function(n){return'"'+n.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")+'"'},setupHelper:function(n,t,i){var r=[],u=this.setupParams(n,r,i),f=this.nameLookup("helpers",t,"helper");return{params:r,paramsInit:u,name:f,callParams:["depth0"].concat(r).join(", "),helperMissingParams:i&&["depth0",this.quotedString(t)].concat(r).join(", ")}},setupOptions:function(n,t){var i=[],e=[],o=[],s,r,u,f;for(i.push("hash:"+this.popStack()),this.options.stringParams&&(i.push("hashTypes:"+this.popStack()),i.push("hashContexts:"+this.popStack())),r=this.popStack(),u=this.popStack(),(u||r)&&(u||(this.context.aliases.self="this",u="self.noop"),r||(this.context.aliases.self="this",r="self.noop"),i.push("inverse:"+r),i.push("fn:"+u)),f=0;f<n;f++)s=this.popStack(),t.push(s),this.options.stringParams&&(o.push(this.popStack()),e.push(this.popStack()));return this.options.stringParams&&(i.push("contexts:["+e.join(",")+"]"),i.push("types:["+o.join(",")+"]")),this.options.data&&i.push("data:data"),i},setupParams:function(n,t,i){var r="{"+this.setupOptions(n,t).join(",")+"}";return i?(this.useRegister("options"),t.push("options"),"options="+r):(t.push(r),"")}},f="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield".split(" "),s=i.RESERVED_WORDS={},u=0,h=f.length;u<h;u++)s[f[u]]=!0;return i.isValidJavaScriptVariableName=function(n){return!i.RESERVED_WORDS[n]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(n)?!0:!1},i}(i,n);return function(n,t,i,r,u){"use strict";var f=n,o=t,s=i.parser,h=i.parse,c=r.Compiler,l=r.compile,a=r.precompile,v=u,y=f.create,e=function(){var n=y();return n.compile=function(t,i){return l(t,i,n)},n.precompile=function(t,i){return a(t,i,n)},n.AST=o,n.Compiler=c,n.JavaScriptCompiler=v,n.Parser=s,n.parse=h,n};return f=e(),f.create=e,f}(e,u,s,h,c)}(),function(n){n.fn.ruler=function(t){var i=n.extend({},{vRuleSize:18,hRuleSize:18},t),r='<div class="ruler hRule"><\/div>',u='<div class="ruler vRule"><\/div>',f='<div class="ruler corner"><\/div>';return this.each(function(){var h=n(this);i.hRuleSize>=0&&n(r).height(i.hRuleSize).prependTo(n(".site-wrapper"));i.vRuleSize>=0&&n(u).width(i.vRuleSize).height(h.outerHeight()).prependTo(n(".site-wrapper"));i.hRuleSize>=0&&i.vRuleSize>=0&&n(f).appendTo(n(".site-wrapper"));for(var o=n(".hRule"),s=n(".vRule"),t=i.vRuleSize,e="";t<=o.width()-18;)(t-i.vRuleSize)%50==0?(e="<div class='tickLabel'>"+(t-i.vRuleSize)+"<\/div>",n(e).css("left",t+"px").appendTo(o)):(t-i.vRuleSize)%10==0&&(e="<div class='tickMajor'><\/div>",n(e).css("left",t+"px").appendTo(o)),t=t+10;for(t=0,e="";t<=s.height();)(+t)%50==0?(e="<div class='tickLabel'><span>"+ +t+"<\/span><\/div>",n(e).css("top",t+"px").appendTo(s)):(+t)%10==0&&(e="<div class='tickMajor'><\/div>",n(e).css("top",t+"px").appendTo(s)),t=t+10})}}(jQuery);var $JssorDebug$=new function(){function n(t){if(t.constructor===n.caller)throw new Error("Cannot create instance of an abstract class.");}this.$DebugMode=!0;this.$Log=function(n,t){var i=window.console||{},r=this.$DebugMode;r&&i.log?i.log(n):r&&t&&alert(n)};this.$Error=function(n,t){var r=window.console||{},i=this.$DebugMode;if(i&&r.error?r.error(n):i&&alert(n),i)throw t||new Error(n);};this.$Fail=function(n){throw new Error(n);};this.$Assert=function(n,t){var i=this.$DebugMode;if(i&&!n)throw new Error("Assert failed "+t||"");};this.$Trace=function(n){var t=window.console||{},i=this.$DebugMode;i&&t.log&&t.log(n)};this.$Execute=function(n){var t=this.$DebugMode;t&&n()};this.$LiveStamp=function(n,t){var r=this.$DebugMode,i;r&&(i=document.createElement("DIV"),i.setAttribute("id",t),n.$Live=i)};this.$C_AbstractMethod=function(){throw new Error("The method is abstract, it should be implemented by subclass.");};this.$C_AbstractClass=n},$JssorEasing$=window.$JssorEasing$={$EaseLinear:function(n){return n},$EaseGoBack:function(n){return 1-Math.abs((n*=2)-1)},$EaseSwing:function(n){return-Math.cos(n*Math.PI)/2+.5},$EaseInQuad:function(n){return n*n},$EaseOutQuad:function(n){return-n*(n-2)},$EaseInOutQuad:function(n){return(n*=2)<1?1/2*n*n:-1/2*(--n*(n-2)-1)},$EaseInCubic:function(n){return n*n*n},$EaseOutCubic:function(n){return(n-=1)*n*n+1},$EaseInOutCubic:function(n){return(n*=2)<1?1/2*n*n*n:1/2*((n-=2)*n*n+2)},$EaseInQuart:function(n){return n*n*n*n},$EaseOutQuart:function(n){return-((n-=1)*n*n*n-1)},$EaseInOutQuart:function(n){return(n*=2)<1?1/2*n*n*n*n:-1/2*((n-=2)*n*n*n-2)},$EaseInQuint:function(n){return n*n*n*n*n},$EaseOutQuint:function(n){return(n-=1)*n*n*n*n+1},$EaseInOutQuint:function(n){return(n*=2)<1?1/2*n*n*n*n*n:1/2*((n-=2)*n*n*n*n+2)},$EaseInSine:function(n){return 1-Math.cos(n*Math.PI/2)},$EaseOutSine:function(n){return Math.sin(n*Math.PI/2)},$EaseInOutSine:function(n){return-1/2*(Math.cos(Math.PI*n)-1)},$EaseInExpo:function(n){return n==0?0:Math.pow(2,10*(n-1))},$EaseOutExpo:function(n){return n==1?1:-Math.pow(2,-10*n)+1},$EaseInOutExpo:function(n){return n==0||n==1?n:(n*=2)<1?1/2*Math.pow(2,10*(n-1)):1/2*(-Math.pow(2,-10*--n)+2)},$EaseInCirc:function(n){return-(Math.sqrt(1-n*n)-1)},$EaseOutCirc:function(n){return Math.sqrt(1-(n-=1)*n)},$EaseInOutCirc:function(n){return(n*=2)<1?-1/2*(Math.sqrt(1-n*n)-1):1/2*(Math.sqrt(1-(n-=2)*n)+1)},$EaseInElastic:function(n){if(!n||n==1)return n;return-(Math.pow(2,10*(n-=1))*Math.sin((n-.075)*2*Math.PI/.3))},$EaseOutElastic:function(n){if(!n||n==1)return n;return Math.pow(2,-10*n)*Math.sin((n-.075)*2*Math.PI/.3)+1},$EaseInOutElastic:function(n){if(!n||n==1)return n;var t=.45,i=.1125;return(n*=2)<1?-.5*Math.pow(2,10*(n-=1))*Math.sin((n-i)*2*Math.PI/t):Math.pow(2,-10*(n-=1))*Math.sin((n-i)*2*Math.PI/t)*.5+1},$EaseInBack:function(n){var t=1.70158;return n*n*((t+1)*n-t)},$EaseOutBack:function(n){var t=1.70158;return(n-=1)*n*((t+1)*n+t)+1},$EaseInOutBack:function(n){var t=1.70158;return(n*=2)<1?1/2*n*n*(((t*=1.525)+1)*n-t):1/2*((n-=2)*n*(((t*=1.525)+1)*n+t)+2)},$EaseInBounce:function(n){return 1-$JssorEasing$.$EaseOutBounce(1-n)},$EaseOutBounce:function(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},$EaseInOutBounce:function(n){return n<1/2?$JssorEasing$.$EaseInBounce(n*2)*.5:$JssorEasing$.$EaseOutBounce(n*2-1)*.5+.5},$EaseInWave:function(n){return 1-Math.cos(n*Math.PI*2)},$EaseOutWave:function(n){return Math.sin(n*Math.PI*2)},$EaseOutJump:function(n){return 1-((n*=2)<1?(n=1-n)*n*n:(n-=1)*n*n)},$EaseInJump:function(n){return(n*=2)<1?n*n*n:(n=2-n)*n*n}},$JssorDirection$=window.$JssorDirection$={$TO_LEFT:1,$TO_RIGHT:2,$TO_TOP:4,$TO_BOTTOM:8,$HORIZONTAL:3,$VERTICAL:12,$LEFTRIGHT:3,$TOPBOTOM:12,$TOPLEFT:5,$TOPRIGHT:6,$BOTTOMLEFT:9,$BOTTOMRIGHT:10,$AROUND:15,$GetDirectionHorizontal:function(n){return n&3},$GetDirectionVertical:function(n){return n&12},$ChessHorizontal:function(n){return(~n&3)+(n&12)},$ChessVertical:function(n){return(~n&12)+(n&3)},$IsToLeft:function(n){return(n&3)==1},$IsToRight:function(n){return(n&3)==2},$IsToTop:function(n){return(n&12)==4},$IsToBottom:function(n){return(n&12)==8},$IsHorizontal:function(n){return(n&3)>0},$IsVertical:function(n){return(n&12)>0}},$JssorKeyCode$={$BACKSPACE:8,$COMMA:188,$DELETE:46,$DOWN:40,$END:35,$ENTER:13,$ESCAPE:27,$HOME:36,$LEFT:37,$NUMPAD_ADD:107,$NUMPAD_DECIMAL:110,$NUMPAD_DIVIDE:111,$NUMPAD_ENTER:108,$NUMPAD_MULTIPLY:106,$NUMPAD_SUBTRACT:109,$PAGE_DOWN:34,$PAGE_UP:33,$PERIOD:190,$RIGHT:39,$SPACE:32,$TAB:9,$UP:38},$JssorAlignment$={$TopLeft:17,$TopCenter:18,$TopRight:20,$MiddleLeft:33,$MiddleCenter:34,$MiddleRight:36,$BottomLeft:65,$BottomCenter:66,$BottomRight:68,$IsTop:function(n){return n&!0},$IsMiddle:function(n){return n&!0},$IsBottom:function(n){return n&!0},$IsLeft:function(n){return n&!0},$IsCenter:function(n){return n&!0},$IsRight:function(n){return n&!0}},$JssorMatrix$,$JssorAnimator$,$Jssor$=window.$Jssor$=new function(){function v(){var n,h,f;if(!u)if(ri!="Microsoft Internet Explorer"||!window.attachEvent||!window.ActiveXObject)if(ri!="Netscape"||!window.addEventListener)f=/(opera)(?:.*version|)[ \/]([\w.]+)/i.exec(t),f&&(u=ti,r=o(f[2]));else{var e=t.indexOf("Firefox"),i=t.indexOf("Safari"),l=t.indexOf("Chrome"),s=t.indexOf("AppleWebKit");e>=0?(u=b,r=o(t.substring(e+8))):i>=0&&(h=t.substring(0,i).lastIndexOf("/"),u=l>=0?ni:b,r=o(t.substring(h+1,i)));s>=0&&(k=o(t.substring(s+12)))}else{n=t.indexOf("MSIE");u=gt;c=o(t.substring(n+5,t.indexOf(";",n)));/*@cc_on ii=@_jscript_version@*/;r=document.documentMode||c}}function h(){return v(),u==gt}function ht(){return h()&&(r<6||document.compatMode=="BackCompat")}function ki(){return v(),u==b}function ui(){return v(),u==b}function fi(){return v(),u==ni}function ei(){return v(),u==ti}function oi(){return ui()&&k>534&&k<535}function g(){return h()&&r<9}function l(n){return d||(i(["transform","WebkitTransform","msTransform","MozTransform","OTransform"],function(t){if(n.style[t]!=undefined)return d=t,!0}),d=d||"transform"),d}function si(n){return Object.prototype.toString.call(n)}function i(n,t){var i,r;if(si(n)=="[object Array]"){for(i=0;i<n.length;i++)if(t(n[i],i,n))return!0}else for(r in n)if(t(n[r],r,n))return!0}function di(){return it||(it={},i(["Boolean","Number","String","Function","Array","Date","RegExp","Object"],function(n){it["[object "+n+"]"]=n.toLowerCase()})),it}function y(n){return n==null?String(n):di()[si(n)]||"object"}function gi(t){var i,r;if(!t||y(t)!=="object"||t.nodeType||n.$IsWindow(t))return!1;i=Object.prototype.hasOwnProperty;try{if(t.constructor&&!i.call(t,"constructor")&&!i.call(t.constructor.prototype,"isPrototypeOf"))return!1}catch(u){return!1}for(r in t);return r===undefined||i.call(t,r)}function p(n,t){return{x:n,y:t}}function hi(n,t){setTimeout(n,t||0)}function rt(n,t,r){var u=!n||n=="inherit"?"":n;return i(t,function(n){var t=n.exec(u),i,r;t&&(i=u.substr(0,t.index),r=u.substr(t.lastIndex+1,u.length-(t.lastIndex+1)),u=i+r)}),u=r+(u.indexOf(" ")!=0?" ":"")+u}function ci(n,t){r<9&&(n.style.filter=t)}function nr(t,i,r){if(ii<9){var u=t.style.filter,f=new RegExp(/[\s]*progid:DXImageTransform\.Microsoft\.Matrix\([^\)]*\)/g),e=i?"progid:DXImageTransform.Microsoft.Matrix(M11="+i[0][0]+", M12="+i[0][1]+", M21="+i[1][0]+", M22="+i[1][1]+", SizingMethod='auto expand')":"",o=rt(u,[f],e);ci(t,o);n.$CssMarginTop(t,r.y);n.$CssMarginLeft(t,r.x)}}function li(n){n.constructor===li.caller&&n.$Construct&&n.$Construct()}function a(n){return n||window.event}function nt(n,t,i){if(i!=undefined)n.style[t]=i;else{var r=n.currentStyle||n.style;return i=r[t],i==""&&window.getComputedStyle&&(r=n.ownerDocument.defaultView.getComputedStyle(n,null),r&&(i=r.getPropertyValue(t)||r[t])),i}}function ct(n,t,i,r){if(i!=undefined)r&&(i+="px"),nt(n,t,i);else return o(nt(n,t))}function tr(n,t,i){return ct(n,t,i,!0)}function e(n,t){var i=t&2,r=t?ct:nt;return function(t,u){return r(t,n,u,i)}}function ir(n){if(h()&&c<9){var t=/opacity=([^)]*)/.exec(n.style.filter||"");return t?o(t[1])/100:1}return o(n.style.opacity||"1")}function rr(n,t,i){var f;if(h()&&c<9){var e=n.style.filter||"",o=new RegExp(/[\s]*alpha\([^\)]*\)/g),r=Math.round(100*t),u="";(r<100||i)&&(u="alpha(opacity="+r+") ");f=rt(e,[o],u);ci(n,f)}else n.style.opacity=t==1?"":Math.round(t*100)/100}function ai(t,i){var u=i.$Rotate||0,r=i.$Scale==undefined?1:i.$Scale,f,e,o;g()?(f=n.$CreateMatrix(u/180*Math.PI,r,r),nr(t,!u&&r==1?null:f,n.$GetMatrixOffset(f,i.$OriginalWidth,i.$OriginalHeight))):(e=l(t),e&&(o="rotate("+u%360+"deg) scale("+r+")",fi()&&k>535&&"ontouchstart"in window&&(o+=" perspective(2000px)"),t.style[e]=o))}function vi(n,t,i,r){for(r=r||"u",n=n?n.firstChild:null;n;n=n.nextSibling)if(n.nodeType==1){if(wt(n,r)==t)return n;if(!i){var u=vi(n,t,i,r);if(u)return u}}}function yi(n,t,i,r){var u,f;for(r=r||"u",u=[],n=n?n.firstChild:null;n;n=n.nextSibling)n.nodeType==1&&(wt(n,r)==t&&u.push(n),i||(f=yi(n,t,i,r),f.length&&(u=u.concat(f))));return u}function pi(n,t,i){for(n=n?n.firstChild:null;n;n=n.nextSibling)if(n.nodeType==1){if(n.tagName==t)return n;if(!i){var r=pi(n,t,i);if(r)return r}}}function wi(n,t,i){var r=[],u;for(n=n?n.firstChild:null;n;n=n.nextSibling)n.nodeType==1&&(t&&n.tagName!=t||r.push(n),i||(u=wi(n,t,i),u.length&&(r=r.concat(u))));return r}function vt(n){for(var i,r,t=1;t<arguments.length;t++)if(i=arguments[t],i)for(r in i)n[r]=i[r];return n}function ur(n,t){var r,i;$JssorDebug$.$Assert(t);r={};for(i in n)n[i]!=t[i]&&(r[i]=n[i]);return r}function yt(n){return document.createElement(n)}function pt(n,t,i){if(i==undefined)return n.getAttribute(t);n.setAttribute(t,i)}function wt(n,t){return pt(n,t)||pt(n,"data-"+t)}function s(n,t){if(t==undefined)return n.className;n.className=t}function ft(n){var t={};return i(n,function(n){t[n]=n}),t}function bt(n,t){var r="";return i(t,function(t){r&&(r+=n);r+=t}),r}function o(n){return parseFloat(n)}function kt(n,t){return n.cloneNode(!t)}function dt(n){if(n){var t=n.$FlyDirection;t&1&&(n.x=n.$ScaleHorizontal||1);t&2&&(n.x=-n.$ScaleHorizontal||-1);t&4&&(n.y=n.$ScaleVertical||1);t&8&&(n.y=-n.$ScaleVertical||-1);n.$Rotate==!0&&(n.$Rotate=1);dt(n.$Brother)}}function fr(t){function f(){var n=h;u?n+="ds":e?n+="dn":o&&(n+="av");s(t,n)}function c(t){u?n.$CancelEvent(t):(tt.push(r),e=!0,f())}var r=this,h,e,o,u;r.$MouseUp=function(){e=!1;f()};r.$Activate=function(n){if(n!=undefined)o=n,f();else return o};r.$Enable=function(n){if(n!=undefined)u=!n,f();else return!u};t=n.$GetElement(t);tt||(n.$AddEventBrowserMouseUp(function(){var n=tt;tt=[];i(n,function(n){n.$MouseUp()})}),tt=[]);h=s(t);$Jssor$.$AddEvent(t,"mousedown",c)}function ot(){return w||(w=vt({$MarginTop:n.$CssMarginTop,$MarginLeft:n.$CssMarginLeft,$Clip:n.$SetStyleClip,$Transform:n.$SetStyleTransform},et)),w}function bi(){return ot(),w.$Transform=w.$Transform,w}var n=this,st=/\S+/g,gt=1,b=2,b=3,ni=4,ti=5,u=0,r=0,c=0,ii=0,k=0,ri=navigator.appName,er=navigator.appVersion,t=navigator.userAgent,f=document.documentElement,d,it,lt,at,ut,tt,et,w;n.$IsBrowserIE=h;n.$IsBrowserIeQuirks=ht;n.$IsBrowserFireFox=ki;n.$IsBrowserSafari=ui;n.$IsBrowserChrome=fi;n.$IsBrowserOpera=ei;n.$IsBrowserBadTransform=oi;n.$IsBrowserIe9Earlier=g;n.$BrowserVersion=function(){return r};n.$BrowserEngineVersion=function(){return c||r};n.$WebKitVersion=function(){return v(),k};n.$Delay=hi;n.$Inherit=function(n,t){return t.apply(n,[].slice.call(arguments,2)),vt({},n)};n.$Construct=li;n.$GetElement=function(t){return n.$IsString(t)&&(t=document.getElementById(t)),t};n.$GetEvent=a;n.$EventSrc=function(n){return n=a(n),n.target||n.srcElement||document};n.$EventDst=function(n){return n=a(n),n.relatedTarget||n.toElement};n.$MousePosition=function(n){n=a(n);var t=document.body;return{x:n.pageX||n.clientX+(f.scrollLeft||t.scrollLeft||0)-(f.clientLeft||t.clientLeft||0)||0,y:n.pageY||n.clientY+(f.scrollTop||t.scrollTop||0)-(f.clientTop||t.clientTop||0)||0}};n.$PageScroll=function(){var n=document.body;return{x:(window.pageXOffset||f.scrollLeft||n.scrollLeft||0)-(f.clientLeft||n.clientLeft||0),y:(window.pageYOffset||f.scrollTop||n.scrollTop||0)-(f.clientTop||n.clientTop||0)}};n.$WindowSize=function(){var n=document.body;return{x:n.clientWidth||f.clientWidth,y:n.clientHeight||f.clientHeight}};n.$SetStyleTransform=function(t,i){oi()?hi(n.$CreateCallback(null,ai,t,i)):ai(t,i)};n.$SetStyleTransformOrigin=function(n,t){var i=l(n);i&&(n.style[i+"Origin"]=t)};n.$CssScale=function(n,t){var i;if(h()&&c<9||c<10&&ht())n.style.zoom=t==1?"":t;else if(i=l(n),i){var r="scale("+t+")",u=n.style[i],f=new RegExp(/[\s]*scale\(.*?\)/g),e=rt(u,[f],r);n.style[i]=e}};n.$EnableHWA=function(n){n.style[l(n)]&&n.style[l(n)]!="none"||(n.style[l(n)]="perspective(2000px)")};n.$DisableHWA=function(n){n.style[l(n)]="none"};lt=0;at=0;n.$WindowResizeFilter=function(n,t){return g()?function(){var f=!0,i=ht()?n.document.body:n.document.documentElement,r,u;i&&(r=i.offsetWidth-lt,u=i.offsetHeight-at,r||u?(lt+=r,at+=u):f=!1);f&&t()}:t};n.$MouseOverOutFilter=function(t,i){return $JssorDebug$.$Execute(function(){if(!i)throw new Error('Null reference, parameter "target".');}),function(r){r=a(r);var f=r.type,u=r.relatedTarget||(f=="mouseout"?r.toElement:r.fromElement);u&&(u===i||n.$IsChild(i,u))||t(r)}};n.$AddEvent=function(t,i,r,u){t=n.$GetElement(t);t.addEventListener?(i=="mousewheel"&&t.addEventListener("DOMMouseScroll",r,u),t.addEventListener(i,r,u)):t.attachEvent&&(t.attachEvent("on"+i,r),u&&t.setCapture&&t.setCapture());$JssorDebug$.$Execute(function(){t.addEventListener||t.attachEvent||$JssorDebug$.$Fail("Unable to attach event handler, no known technique.")})};n.$RemoveEvent=function(t,i,r,u){t=n.$GetElement(t);t.removeEventListener?(i=="mousewheel"&&t.removeEventListener("DOMMouseScroll",r,u),t.removeEventListener(i,r,u)):t.detachEvent&&(t.detachEvent("on"+i,r),u&&t.releaseCapture&&t.releaseCapture())};n.$FireEvent=function(n,t){var i,r;$JssorDebug$.$Execute(function(){document.createEvent||document.createEventObject||$JssorDebug$.$Fail("Unable to fire event, no known technique.");n.dispatchEvent||n.fireEvent||$JssorDebug$.$Fail("Unable to fire event, no known technique.")});document.createEvent?(i=document.createEvent("HTMLEvents"),i.initEvent(t,!1,!1),n.dispatchEvent(i)):(r="on"+t,i=document.createEventObject(),n.fireEvent(r,i))};n.$AddEventBrowserMouseUp=function(t,i){n.$AddEvent(g()?document:window,"mouseup",t,i)};n.$RemoveEventBrowserMouseUp=function(t,i){n.$RemoveEvent(g()?document:window,"mouseup",t,i)};n.$CancelEvent=function(n){n=a(n);n.preventDefault&&n.preventDefault();n.cancel=!0;n.returnValue=!1};n.$StopEvent=function(n){n=a(n);n.stopPropagation&&n.stopPropagation();n.cancelBubble=!0};n.$CreateCallback=function(n,t){var i=[].slice.call(arguments,2);return function(){var r=i.concat([].slice.call(arguments,0));return t.apply(n,r)}};n.$FreeElement=function(t){ut||(ut=n.$CreateDiv());t&&($Jssor$.$AppendChild(ut,t),$Jssor$.$ClearInnerHtml(ut))};n.$InnerText=function(t,i){if(i==undefined)return t.textContent||t.innerText;var r=document.createTextNode(i);n.$ClearInnerHtml(t);t.appendChild(r)};n.$InnerHtml=function(n,t){if(t==undefined)return n.innerHTML;n.innerHTML=t};n.$GetClientRect=function(n){var t=n.getBoundingClientRect();return{x:t.left,y:t.top,w:t.right-t.left,h:t.bottom-t.top}};n.$ClearInnerHtml=function(n){n.innerHTML=""};n.$EncodeHtml=function(t){var i=n.$CreateDiv();return n.$InnerText(i,t),n.$InnerHtml(i)};n.$DecodeHtml=function(t){var i=n.$CreateDiv();return n.$InnerHtml(i,t),n.$InnerText(i)};n.$SelectElement=function(n){var i,t;window.getSelection&&(i=window.getSelection());t=null;document.createRange?(t=document.createRange(),t.selectNode(n)):(t=document.body.createTextRange(),t.moveToElementText(n),t.select());i&&i.addRange(t)};n.$DeselectElements=function(){document.selection?document.selection.empty():window.getSelection&&window.getSelection().removeAllRanges()};n.$Children=function(n){for(var i=[],t=n.firstChild;t;t=t.nextSibling)t.nodeType==1&&i.push(t);return i};n.$FindChild=vi;n.$FindChildren=yi;n.$FindChildByTag=pi;n.$FindChildrenByTag=wi;n.$GetElementsByTag=function(n,t){return n.getElementsByTagName(t)};n.$Extend=vt;n.$Unextend=ur;n.$IsUndefined=function(n){return y(n)=="undefined"};n.$IsFunction=function(n){return y(n)=="function"};n.$IsArray=function(n){return y(n)=="array"};n.$IsString=function(n){return y(n)=="string"};n.$IsNumeric=function(n){return!isNaN(o(n))&&isFinite(n)};n.$IsWindow=function(n){return n&&n==n.window};n.$Type=y;n.$Each=i;n.$IsPlainObject=gi;n.$CreateElement=yt;n.$CreateDiv=function(){return yt("DIV",document)};n.$CreateSpan=function(){return yt("SPAN",document)};n.$EmptyFunction=function(){};n.$Attribute=pt;n.$AttributeEx=wt;n.$ClassName=s;n.$ToHash=ft;n.$Join=bt;n.$AddClass=function(n,t){var i=s(n)+" "+t;s(n,bt(" ",ft(i.match(st))))};n.$RemoveClass=function(t,i){s(t,bt(" ",n.$Unextend(ft(s(t).match(st)),ft(i.match(st)))))};n.$ParentNode=function(n){return n.parentNode};n.$HideElement=function(t){n.$CssDisplay(t,"none")};n.$EnableElement=function(t,i){i?n.$Attribute(t,"disabled",!0):n.$RemoveAttribute(t,"disabled")};n.$HideElements=function(t){for(var i=0;i<t.length;i++)n.$HideElement(t[i])};n.$ShowElement=function(t,i){n.$CssDisplay(t,i?"none":"")};n.$ShowElements=function(t,i){for(var r=0;r<t.length;r++)n.$ShowElement(t[r],i)};n.$RemoveAttribute=function(n,t){n.removeAttribute(t)};n.$CanClearClip=function(){return h()&&r<10};n.$SetStyleClip=function(n,t){if(t)n.style.clip="rect("+Math.round(t.$Top)+"px "+Math.round(t.$Right)+"px "+Math.round(t.$Bottom)+"px "+Math.round(t.$Left)+"px)";else{var i=n.style.cssText,r=[new RegExp(/[\s]*clip: rect\(.*?\)[;]?/i),new RegExp(/[\s]*cliptop: .*?[;]?/i),new RegExp(/[\s]*clipright: .*?[;]?/i),new RegExp(/[\s]*clipbottom: .*?[;]?/i),new RegExp(/[\s]*clipleft: .*?[;]?/i)],u=rt(i,r,"");$Jssor$.$CssCssText(n,u)}};n.$GetNow=function(){return(new Date).getTime()};n.$AppendChild=function(n,t){n.appendChild(t)};n.$AppendChildren=function(t,r){i(r,function(i){n.$AppendChild(t,i)})};n.$InsertBefore=function(n,t,i){n.insertBefore(t,i)};n.$InsertAdjacentHtml=function(n,t,i){n.insertAdjacentHTML(t,i)};n.$RemoveChild=function(n,t){n.removeChild(t)};n.$RemoveChildren=function(t,r){i(r,function(i){n.$RemoveChild(t,i)})};n.$ClearChildren=function(t){n.$RemoveChildren(t,n.$Children(t))};n.$ParseInt=function(n,t){return parseInt(n,t||10)};n.$ParseFloat=o;n.$IsChild=function(n,t){for(var i=document.body;t&&n!=t&&i!=t;)try{t=t.parentNode}catch(r){return!1}return n==t};n.$CloneNode=kt;n.$TranslateTransitions=function(n){var t,i;if(n){for(t=0;t<n.length;t++)dt(n[t]);for(i in n)dt(n[i])}};n.$LoadImage=function(t,i){function f(t){n.$RemoveEvent(u,"load",f);n.$RemoveEvent(u,"abort",e);n.$RemoveEvent(u,"error",e);i&&i(u,t)}function e(){f(!0)}var u=new Image;ei()&&r<11.6||!t?f(!t):(n.$AddEvent(u,"load",f),n.$AddEvent(u,"abort",e),n.$AddEvent(u,"error",e),u.src=t)};n.$LoadImages=function(t,r,u){function e(n){f--;r&&n&&n.src==r.src&&(r=n);!f&&u&&u(r)}var f=t.length+1;i(t,function(t){n.$LoadImage(t.src,e)});e()};n.$BuildElement=function(n,t,i,r){var o,f,u,e,h;for(r&&(n=kt(n)),o=$Jssor$.$GetElementsByTag(n,t),f=o.length-1;f>-1;f--)u=o[f],e=kt(i),s(e,s(u)),$Jssor$.$CssCssText(e,u.style.cssText),h=$Jssor$.$ParentNode(u),$Jssor$.$InsertBefore(h,e,u),$Jssor$.$RemoveChild(h,u);return n};n.$Buttonize=function(n){return new fr(n)};n.$Css=nt;n.$CssN=ct;n.$CssP=tr;n.$CssOverflow=e("overflow");n.$CssTop=e("top",2);n.$CssLeft=e("left",2);n.$CssWidth=e("width",2);n.$CssHeight=e("height",2);n.$CssMarginLeft=e("marginLeft",2);n.$CssMarginTop=e("marginTop",2);n.$CssPosition=e("position");n.$CssDisplay=e("display");n.$CssZIndex=e("zIndex",1);n.$CssFloat=function(n,t){return nt(n,h()?"styleFloat":"cssFloat",t)};n.$CssOpacity=function(n,t,i){if(t!=undefined)rr(n,t,i);else return ir(n)};n.$CssCssText=function(n,t){if(t!=undefined)n.style.cssText=t;else return n.style.cssText};et={$Opacity:n.$CssOpacity,$Top:n.$CssTop,$Left:n.$CssLeft,$Width:n.$CssWidth,$Height:n.$CssHeight,$Position:n.$CssPosition,$Display:n.$CssDisplay,$ZIndex:n.$CssZIndex};n.$StyleSetter=ot;n.$StyleSetterEx=bi;n.$GetStyles=function(n,t){ot();var r={};return i(t,function(t,i){et[i]&&(r[i]=et[i](n))}),r};n.$SetStyles=function(n,t){var r=ot();i(t,function(t,i){r[i]&&r[i](n,t)})};n.$SetStylesEx=function(t,i){bi();n.$SetStyles(t,i)};$JssorMatrix$=new function(){function t(n,t){for(var s=n[0].length,h=n.length,c=t[0].length,e=[],o,r,f,u,i=0;i<h;i++)for(o=e[i]=[],r=0;r<c;r++){for(f=0,u=0;u<s;u++)f+=n[i][u]*t[u][r];o[r]=f}return e}var n=this;n.$ScaleX=function(t,i){return n.$ScaleXY(t,i,0)};n.$ScaleY=function(t,i){return n.$ScaleXY(t,0,i)};n.$ScaleXY=function(n,i,r){return t(n,[[i,0],[0,r]])};n.$TransformPoint=function(n,i){var r=t(n,[[i.x],[i.y]]);return p(r[0][0],r[1][0])}};n.$CreateMatrix=function(n,t,i){var r=Math.cos(n),u=Math.sin(n);return[[r*t,-u*i],[u*t,r*i]]};n.$GetMatrixOffset=function(n,t,i){var r=$JssorMatrix$.$TransformPoint(n,p(-t/2,-i/2)),u=$JssorMatrix$.$TransformPoint(n,p(t/2,-i/2)),f=$JssorMatrix$.$TransformPoint(n,p(t/2,i/2)),e=$JssorMatrix$.$TransformPoint(n,p(-t/2,i/2));return p(Math.min(r.x,u.x,f.x,e.x)+t/2,Math.min(r.y,u.y,f.y,e.y)+i/2)};n.$Transform=function(n,t,i,r,u,f,e){var o=t,s,a;if(n){o={};for(s in t){var d=f[s]||1,w=u[s]||[0,1],h=(i-w[0])/w[1];h=Math.min(Math.max(h,0),1);h=h*d;a=Math.floor(h);h!=a&&(h-=a);var g=r[s]||r.$Default,b=g(h),c,k=n[s],v=t[s];$Jssor$.$IsNumeric(v)?c=k+(v-k)*b:(c=$Jssor$.$Extend({$Offset:{}},n[s]),$Jssor$.$Each(v.$Offset,function(n,t){var i=n*b;c.$Offset[t]=i;c[t]+=i}));o[s]=c}n.$Zoom&&(o.$Transform={$Rotate:o.$Rotate||0,$Scale:o.$Zoom,$OriginalWidth:e.$OriginalWidth,$OriginalHeight:e.$OriginalHeight})}if(t.$Clip&&e.$Move){var l=o.$Clip.$Offset,y=(l.$Top||0)+(l.$Bottom||0),p=(l.$Left||0)+(l.$Right||0);o.$Left=(o.$Left||0)+p;o.$Top=(o.$Top||0)+y;o.$Clip.$Left-=p;o.$Clip.$Right-=p;o.$Clip.$Top-=y;o.$Clip.$Bottom-=y}return o.$Clip&&$Jssor$.$CanClearClip()&&!o.$Clip.$Top&&!o.$Clip.$Left&&o.$Clip.$Right==e.$OriginalWidth&&o.$Clip.$Bottom==e.$OriginalHeight&&(o.$Clip=null),o}},$JssorObject$=window.$JssorObject$=function(){function u(n,i){$JssorDebug$.$Execute(function(){if(n==undefined||n==null)throw new Error("param 'eventName' is null or empty.");if(typeof i!="function")throw"param 'handler' must be a function.";$Jssor$.$Each(t,function(t){if(t.$EventName==n&&t.$Handler===i)throw new Error("The handler listened to the event already, cannot listen to the same event of the same object with the same handler twice.");})});t.push({$EventName:n,$Handler:i})}function f(n,i){$JssorDebug$.$Execute(function(){if(n==undefined||n==null)throw new Error("param 'eventName' is null or empty.");if(typeof i!="function")throw"param 'handler' must be a function.";});$Jssor$.$Each(t,function(r,u){r.$EventName==n&&r.$Handler===i&&t.splice(u,1)})}function e(){t=[]}function r(){$Jssor$.$Each(i,function(n){$Jssor$.$RemoveEvent(n.$Obj,n.$EventName,n.$Handler)});i=[]}var n=this,t=[],i=[];n.$Listen=function(n,t,r,u){$JssorDebug$.$Execute(function(){if(!n)throw new Error("param 'obj' is null or empty.");if(t==undefined||t==null)throw new Error("param 'eventName' is null or empty.");if(typeof r!="function")throw"param 'handler' must be a function.";$Jssor$.$Each(i,function(i){if(i.$Obj===n&&i.$EventName==t&&i.$Handler===r)throw new Error("The handler listened to the event already, cannot listen to the same event of the same object with the same handler twice.");})});$Jssor$.$AddEvent(n,t,r,u);i.push({$Obj:n,$EventName:t,$Handler:r})};n.$Unlisten=function(n,t,r){$JssorDebug$.$Execute(function(){if(!n)throw new Error("param 'obj' is null or empty.");if(t==undefined||t==null)throw new Error("param 'eventName' is null or empty.");if(typeof r!="function")throw"param 'handler' must be a function.";});$Jssor$.$Each(i,function(u,f){u.$Obj===n&&u.$EventName==t&&u.$Handler===r&&($Jssor$.$RemoveEvent(n,t,r),i.splice(f,1))})};n.$UnlistenAll=r;n.$On=n.addEventListener=u;n.$Off=n.removeEventListener=f;n.$TriggerEvent=function(n){var i=[].slice.call(arguments,1);$Jssor$.$Each(t,function(t){try{t.$EventName==n&&t.$Handler.apply(window,i)}catch(r){$JssorDebug$.$Error(r.name+" while executing "+n+" handler: "+r.message,r)}})};n.$Destroy=function(){r();e();for(var t in n)delete n[t]};$JssorDebug$.$C_AbstractClass(n)};$JssorAnimator$=function(n,t,i,r,u,f){function ht(n){h+=n;o+=n;c+=n;k+=n;s+=n;b+=n;$Jssor$.$Each(d,function(t){t;t.$Shift(n)})}function vt(t,i){var r=t-h+n*i;return ht(r),o}function g(n,l){var a=n,v,p,k,g,nt;y&&(a>=o||a<=h)&&(a=((a-h)%y+y)%y+h);(!rt||w||l||s!=a)&&(v=Math.min(a,o),v=Math.max(v,h),(!rt||w||l||v!=b)&&(f&&(p=(v-c)/(t||1),i.$Reverse&&(p=1-p),k=$Jssor$.$Transform(u,f,p,et,st,ot,i),$Jssor$.$Each(k,function(n,t){ut[t]&&ut[t](r,n)})),e.$OnInnerOffsetChange(b-c,v-c)),b=v,$Jssor$.$Each(d,function(t,i){var r=n<s?d[d.length-i-1]:t;r.$GoToPosition(n,l)}),g=s,nt=n,s=a,rt=!0,e.$OnPositionChange(g,nt))}function ft(n,t){$JssorDebug$.$Execute(function(){t!==0&&t!==1&&$JssorDebug$.$Fail("Argument out of range, the value of 'combineMode' should be either 0 or 1.")});t&&n.$Locate(o,1);o=Math.max(o,n.$GetPosition_OuterEnd());d.push(n)}function ct(){if(l){var t=$Jssor$.$GetNow(),r=Math.min(t-tt,i.$IntervalMax),n=s+r*v;tt=t;n*v>=a*v&&(n=a);g(n);!w&&n*v>=a*v?lt(it):p(ct)}}function nt(n,t,i){l||(l=!0,w=i,it=t,n=Math.max(n,h),n=Math.min(n,o),a=n,v=a<s?-1:1,e.$OnStart(),tt=$Jssor$.$GetNow(),p(ct))}function lt(n){l&&(w=l=it=!1,e.$OnStop(),n&&n())}var p;n=n||0;var e=this,l,at,a,v,w,tt=0,et,ot,st,it,s=0,b=0,rt,c=n,k=n+t,h,o,y,d=[],ut;p=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame;$Jssor$.$IsBrowserSafari()&&$Jssor$.$BrowserVersion()<7&&(p=null,$JssorDebug$.$Log("Custom animation frame for safari before 7."));p=p||function(n){$Jssor$.$Delay(n,i.$Interval)};e.$Play=function(n,t,i){nt(n?s+n:o,t,i)};e.$PlayToPosition=nt;e.$PlayToBegin=function(n,t){nt(h,n,t)};e.$PlayToEnd=function(n,t){nt(o,n,t)};e.$Stop=lt;e.$Continue=function(n){nt(n)};e.$GetPosition=function(){return s};e.$GetPlayToPosition=function(){return a};e.$GetPosition_Display=function(){return b};e.$GoToPosition=g;e.$GoToBegin=function(){g(h,!0)};e.$GoToEnd=function(){g(o,!0)};e.$Move=function(n){g(s+n)};e.$CombineMode=function(){return at};e.$GetDuration=function(){return t};e.$IsPlaying=function(){return l};e.$IsOnTheWay=function(){return s>c&&s<=k};e.$SetLoopLength=function(n){y=n};e.$Locate=vt;e.$Shift=ht;e.$Join=ft;e.$Combine=function(n){ft(n,0)};e.$Chain=function(n){ft(n,1)};e.$GetPosition_InnerBegin=function(){return c};e.$GetPosition_InnerEnd=function(){return k};e.$GetPosition_OuterBegin=function(){return h};e.$GetPosition_OuterEnd=function(){return o};e.$OnPositionChange=e.$OnStart=e.$OnStop=e.$OnInnerOffsetChange=$Jssor$.$EmptyFunction;e.$Version=$Jssor$.$GetNow();i=$Jssor$.$Extend({$Interval:16,$IntervalMax:50},i);$JssorDebug$.$Execute(function(){i=$Jssor$.$Extend({$LoopLength:undefined,$Setter:undefined,$Easing:undefined},i)});y=i.$LoopLength;ut=$Jssor$.$Extend({},$Jssor$.$StyleSetter(),i.$Setter);h=c=n;o=k=n+t;ot=i.$Round||{};st=i.$During||{};et=$Jssor$.$Extend({$Default:$Jssor$.$IsFunction(i.$Easing)&&i.$Easing||$JssorEasing$.$EaseSwing},i.$Easing)};$JssorSlideshowFormations$=window.$JssorSlideshowFormations$={},new function(){function ut(n){return(n&p)==p}function ft(n){return(n&w)==w}function f(n,t,i){i.push(t);n[t]=n[t]||[];n[t].push(i)}function et(n){var t=n.$Formation(n);return n.$Reverse?t.reverse():t}function k(n,t){var i={$Interval:t,$Duration:1,$Delay:0,$Cols:1,$Rows:1,$Opacity:0,$Zoom:0,$Clip:0,$Move:!1,$SlideOut:!1,$Reverse:!1,$Formation:$JssorSlideshowFormations$.$FormationRandom,$Assembly:v,$ChessMode:{$Column:0,$Row:0},$Easing:$JssorEasing$.$EaseSwing,$Round:{},$Blocks:[],$During:{}};return $Jssor$.$Extend(i,n),i.$Count=i.$Cols*i.$Rows,$Jssor$.$IsFunction(i.$Easing)&&(i.$Easing={$Default:i.$Easing}),i.$FramesCount=Math.ceil(i.$Duration/i.$Interval),i.$EasingInstance=ot(i),i.$GetBlocks=function(n,t){var f,r,u;if(n/=i.$Cols,t/=i.$Rows,f=n+"x"+t,!i.$Blocks[f])for(i.$Blocks[f]={$Width:n,$Height:t},r=0;r<i.$Cols;r++)for(u=0;u<i.$Rows;u++)i.$Blocks[f][u+","+r]={$Top:u*t,$Right:r*n+n,$Bottom:u*t+t,$Left:r*n};return i.$Blocks[f]},i.$Brother&&(i.$Brother=k(i.$Brother,t),i.$SlideOut=!0),i}function ot(n){var t=n.$Easing,i,r,u;return t.$Default||(t.$Default=$JssorEasing$.$EaseSwing),i=n.$FramesCount,r=t.$Cache,r||(u=$Jssor$.$Extend({},n.$Easing,n.$Round),r=t.$Cache={},$Jssor$.$Each(u,function(u,f){var e=t[f]||t.$Default,c=n.$Round[f]||1,o,s,h,l;if($Jssor$.$IsArray(e.$Cache)||(e.$Cache=[]),o=e.$Cache[i]=e.$Cache[i]||[],!o[c])for(o[c]=[0],s=1;s<=i;s++)h=s/i*c,l=Math.floor(h),h!=l&&(h-=l),o[c][s]=e(h);r[f]=o})),r}function it(n,t,i,r,u,f){function tt(n){$Jssor$.$DisableHWA(n);var t=$Jssor$.$Children(n);$Jssor$.$Each(t,function(n){tt(n)})}var k=this,w,d={},c={},l=[],o,e,a,v=i.$ChessMode.$Column||0,y=i.$ChessMode.$Row||0,s=i.$GetBlocks(u,f),p=et(i),ut=p.length-1,b=i.$Duration+i.$Delay*ut,g=r+b,h=i.$SlideOut,nt,it,rt;g+=$Jssor$.$IsBrowserChrome()?260:50;k.$EndTime=g;k.$ShowFrame=function(n){var t,u;n-=r;t=n<b;(t||nt)&&(nt=t,h||(n=b-n),u=Math.ceil(n/i.$Interval),$Jssor$.$Each(c,function(n,t){var i=Math.max(u,n.$Min);i=Math.min(i,n.length-1);n.$LastFrameIndex!=i&&(n.$LastFrameIndex||h?i==n.$Max&&h&&$Jssor$.$HideElement(l[t]):$Jssor$.$ShowElement(l[t]),n.$LastFrameIndex=i,$Jssor$.$SetStylesEx(l[t],n[i]))}))};t=$Jssor$.$CloneNode(t);tt(t);$Jssor$.$IsBrowserIe9Earlier()&&(it=!t["no-image"],rt=$Jssor$.$FindChildrenByTag(t),$Jssor$.$Each(rt,function(n){(it||n["jssor-slider"])&&$Jssor$.$CssOpacity(n,$Jssor$.$CssOpacity(n),!0)}));$Jssor$.$Each(p,function(n,t){$Jssor$.$Each(n,function(n){var vt=n[0],yt=n[1],g=vt+","+yt,p=!1,b=!1,nt=!1,st,ht,pt,k,l,wt,bt,kt,ct,tt,it,r;v&&yt%2&&($JssorDirection$.$IsHorizontal(v)&&(p=!p),$JssorDirection$.$IsVertical(v)&&(b=!b),v&16&&(nt=!nt));y&&vt%2&&($JssorDirection$.$IsHorizontal(y)&&(p=!p),$JssorDirection$.$IsVertical(y)&&(b=!b),y&16&&(nt=!nt));i.$Top=i.$Top||i.$Clip&4;i.$Bottom=i.$Bottom||i.$Clip&8;i.$Left=i.$Left||i.$Clip&1;i.$Right=i.$Right||i.$Clip&2;var ut=b?i.$Bottom:i.$Top,ft=b?i.$Top:i.$Bottom,et=p?i.$Right:i.$Left,ot=p?i.$Left:i.$Right;for(i.$Clip=ut||ft||et||ot,a={},e={$Top:0,$Left:0,$Opacity:1,$Width:u,$Height:f},o=$Jssor$.$Extend({},e),w=$Jssor$.$Extend({},s[g]),i.$Opacity&&(e.$Opacity=2-i.$Opacity),i.$ZIndex&&(e.$ZIndex=i.$ZIndex,o.$ZIndex=0),st=i.$Cols*i.$Rows>1||i.$Clip,(i.$Zoom||i.$Rotate)&&(ht=!0,$Jssor$.$IsBrowserIE()&&$Jssor$.$BrowserEngineVersion()<9&&(i.$Cols*i.$Rows>1?ht=!1:st=!1),ht&&(e.$Zoom=i.$Zoom?i.$Zoom-1:1,o.$Zoom=1,($Jssor$.$IsBrowserIe9Earlier()||$Jssor$.$IsBrowserOpera())&&(e.$Zoom=Math.min(e.$Zoom,2)),pt=i.$Rotate,e.$Rotate=pt*360*(nt?-1:1),o.$Rotate=0)),st&&(i.$Clip&&(k=i.$ScaleClip||1,l=w.$Offset={},ut&&ft?(l.$Top=s.$Height/2*k,l.$Bottom=-l.$Top):ut?l.$Bottom=-s.$Height*k:ft&&(l.$Top=s.$Height*k),et&&ot?(l.$Left=s.$Width/2*k,l.$Right=-l.$Left):et?l.$Right=-s.$Width*k:ot&&(l.$Left=s.$Width*k)),a.$Clip=w,o.$Clip=s[g]),wt=p?1:-1,bt=b?1:-1,i.x&&(e.$Left+=u*i.x*wt),i.y&&(e.$Top+=f*i.y*bt),$Jssor$.$Each(e,function(n,t){$Jssor$.$IsNumeric(n)&&n!=o[t]&&(a[t]=n-o[t])}),d[g]=h?o:e,kt=[],ct=Math.round(t*i.$Delay/i.$Interval),c[g]=new Array(ct),c[g].$Min=ct,tt=i.$FramesCount,it=0;it<=tt;it++){if(r={},$Jssor$.$Each(a,function(n,t){var h=i.$EasingInstance[t]||i.$EasingInstance.$Default,c=h[i.$Round[t]||1],s=i.$During[t]||[0,1],f=(it/tt-s[0])/s[1]*tt,e,u;f=Math.round(Math.min(tt,Math.max(f,0)));e=c[f];$Jssor$.$IsNumeric(n)?r[t]=o[t]+n*e:(u=r[t]=$Jssor$.$Extend({},o[t]),u.$Offset=[],$Jssor$.$Each(n.$Offset,function(n,t){var i=n*e;u.$Offset[t]=i;u[t]+=i}))}),o.$Zoom&&(r.$Transform={$Rotate:r.$Rotate||0,$Scale:r.$Zoom,$OriginalWidth:u,$OriginalHeight:f}),r.$Clip&&i.$Move){var rt=r.$Clip.$Offset,lt=(rt.$Top||0)+(rt.$Bottom||0),at=(rt.$Left||0)+(rt.$Right||0);r.$Left=(r.$Left||0)+at;r.$Top=(r.$Top||0)+lt;r.$Clip.$Left-=at;r.$Clip.$Right-=at;r.$Clip.$Top-=lt;r.$Clip.$Bottom-=lt}r.$ZIndex=r.$ZIndex||1;c[g].push(r)}})});p.reverse();$Jssor$.$Each(p,function(i){$Jssor$.$Each(i,function(i){var u=i[0],f=i[1],e=u+","+f,r=t;(f||u)&&(r=$Jssor$.$CloneNode(t));$Jssor$.$SetStyles(r,d[e]);$Jssor$.$CssOverflow(r,"hidden");$Jssor$.$CssPosition(r,"absolute");n.$AddClipElement(r);l[e]=r;$Jssor$.$ShowElement(r,!h)})})}function n(t,i){function ff(){var t=this;$JssorAnimator$.call(t,-1e8,2e8);t.$GetCurrentSlideInfo=function(){var n=t.$GetPosition_Display(),i=Math.floor(n),r=o(i),u=n-Math.floor(n);return{$Index:r,$VirtualIndex:i,$Position:u}};t.$OnPositionChange=function(t,i){var r=Math.floor(i);r!=i&&i>t&&r++;su(r,!0);u.$TriggerEvent(n.$EVT_POSITION_CHANGE,o(i),o(t),i,t)}}function ef(){var n=this;$JssorAnimator$.call(n,0,0,{$LoopLength:e});$Jssor$.$Each(p,function(t){st&1&&t.$SetLoopLength(e);n.$Chain(t);t.$Shift(wi/pu)})}function of(){var n=this,t=kr.$Elmt;$JssorAnimator$.call(n,-1,2,{$Easing:$JssorEasing$.$EaseLinear,$Setter:{$Position:ru},$LoopLength:e},t,{$Position:1},{$Position:-1});n.$Wrapper=t;$JssorDebug$.$Execute(function(){$Jssor$.$Attribute(kr.$Elmt,"debug-id","slide_container")})}function sf(t,i){var e=this,s,h,c,l,v;$JssorAnimator$.call(e,-1e8,2e8,{$IntervalMax:100});e.$OnStart=function(){yt=!0;gt=null;u.$TriggerEvent(n.$EVT_SWIPE_START,o(a.$GetPosition()),a.$GetPosition())};e.$OnStop=function(){yt=!1;l=!1;var t=a.$GetCurrentSlideInfo();u.$TriggerEvent(n.$EVT_SWIPE_END,o(a.$GetPosition()),a.$GetPosition());t.$Position||pf(t.$VirtualIndex,f)};e.$OnPositionChange=function(n,t){var i,u;l?i=v:(i=h,c&&(u=t/c,i=r.$SlideEasing(u)*(h-s)+s));a.$GoToPosition(i)};e.$PlayCarousel=function(n,t,i,r){$JssorDebug$.$Execute(function(){e.$IsPlaying()&&$JssorDebug$.$Fail("The carousel is already playing.")});s=n;h=t;c=i;a.$GoToPosition(n);e.$GoToPosition(0);e.$PlayToPosition(i,r)};e.$StandBy=function(n){l=!0;v=n;e.$Play(n,null,!0)};e.$SetStandByPosition=function(n){v=n};e.$MoveCarouselTo=function(n){a.$GoToPosition(n)};a=new ff;a.$Combine(t);a.$Combine(i)}function hf(){var t=this,n=hu();$Jssor$.$CssZIndex(n,0);$Jssor$.$Css(n,"pointerEvents","none");t.$Elmt=n;t.$AddClipElement=function(t){$Jssor$.$AppendChild(n,t);$Jssor$.$ShowElement(n)};t.$Clear=function(){$Jssor$.$HideElement(n);$Jssor$.$ClearInnerHtml(n)}}function cf(t,i){function st(n){k&&k.$Revert();y&&y.$Revert();ii(t,n);ot=!0;y=new it.$Class(t,it,1);$JssorDebug$.$LiveStamp(y,"caption_slider_"+ci+"_in");k=new it.$Class(t,it);$JssorDebug$.$LiveStamp(k,"caption_slider_"+ci+"_out");$JssorDebug$.$Execute(function(){ci++});k.$GoToBegin();y.$GoToBegin()}function fi(){y.$Version<it.$Version&&st()}function pt(t,i,f){var c,v;if(!ut&&(ut=!0,h&&f)){var e=f.width,o=f.height,l=e,a=o;e&&o&&r.$FillMode&&(r.$FillMode&3&&(!(r.$FillMode&4)||e>ft||o>et)&&(c=!1,v=ft/et*o/e,r.$FillMode&1?c=v>1:r.$FillMode&2&&(c=v<1),l=c?e*et/o:ft,a=c?et:o*ft/e),$Jssor$.$CssWidth(h,l),$Jssor$.$CssHeight(h,a),$Jssor$.$CssTop(h,(et-a)/2),$Jssor$.$CssLeft(h,(ft-l)/2));$Jssor$.$CssPosition(h,"absolute");u.$TriggerEvent(n.$EVT_LOAD_END,iu)}$Jssor$.$HideElement(i);t&&t(s)}function ei(n,t,r,u){if(u==gt&&f==i&&at&&!re){var e=o(n);w.$Initialize(e,i,t,s,r);t.$HideContentForSlideshow();ui.$Locate(e,1);ui.$GoToPosition(e);v.$PlayCarousel(n,n,0)}}function oi(n){if(n==gt&&f==i){if(!l){var r=null;w&&(w.$Index==i?r=w.$GetProcessor():w.$Clear());fi();l=new lf(t,i,r,s.$GetCaptionSliderIn(),s.$GetCaptionSliderOut());l.$SetPlayer(a)}l.$IsPlaying()||l.$Replay()}}function wt(n,t,u){var h,f,o;n==i?(n!=t?p[t]&&p[t].$ParkOut():!u&&l&&l.$AdjustIdleOnPark(),a&&a.$Enable(),h=gt=$Jssor$.$GetNow(),s.$LoadImage($Jssor$.$CreateCallback(null,oi,h))):(f=Math.abs(i-n),o=c+r.$LazyLoading,(!vt||f<=o||e-f<=o)&&s.$LoadImage())}function si(){f==i&&l&&(l.$Stop(),a&&a.$Quit(),a&&a.$Disable(),l.$OpenSlideshowPanel())}function hi(){f==i&&l&&l.$Stop()}function bt(t){dt?$Jssor$.$CancelEvent(t):u.$TriggerEvent(n.$EVT_CLICK,i,t)}function ni(){a=nt.pInstance;l&&l.$SetPlayer(a)}function ii(n,t,i){if(!n["jssor-slider"]){i=i||0;ot||(n.tagName=="IMG"&&(rt.push(n),n.src||(vt=!0,n["display-origin"]=$Jssor$.$CssDisplay(n),$Jssor$.$HideElement(n))),$Jssor$.$IsBrowserIe9Earlier()&&$Jssor$.$CssZIndex(n,($Jssor$.$CssZIndex(n)||0)+1),r.$HWA&&$Jssor$.$WebKitVersion()&&(!kt||$Jssor$.$WebKitVersion()<534||!pi&&!$Jssor$.$IsBrowserChrome())&&$Jssor$.$EnableHWA(n));var u=$Jssor$.$Children(n);$Jssor$.$Each(u,function(r){var f=$Jssor$.$AttributeEx(r,"u"),u;f!="player"||nt||(nt=r,nt.pInstance?ni():$Jssor$.$AddEvent(nt,"dataavailable",ni));f=="caption"?$Jssor$.$IsBrowserIE()||t||(u=$Jssor$.$CloneNode(r),$Jssor$.$InsertBefore(n,u,r),$Jssor$.$RemoveChild(n,r),r=u,t=!0):ot||i||h||$Jssor$.$AttributeEx(r,"u")!="image"||(h=r,h&&(h.tagName=="A"&&(ct=h,$Jssor$.$SetStyles(ct,ht),b=$Jssor$.$CloneNode(h,!0),$Jssor$.$AddEvent(b,"click",bt),$Jssor$.$SetStyles(b,ht),$Jssor$.$CssDisplay(b,"block"),$Jssor$.$CssOpacity(b,0),$Jssor$.$Css(b,"backgroundColor","#000"),h=$Jssor$.$FindChildByTag(h,"IMG"),$JssorDebug$.$Execute(function(){h||$JssorDebug$.$Error("slide html code definition error, no 'IMG' found in a 'image with link' slide.\r\n"+n.outerHTML)})),h.border=0,$Jssor$.$SetStyles(h,ht)));ii(r,t,i+1)})}}var s=this,y,k,g,li=t,d,h,rt=[],ct,b,lt,ut,vt,ot,l,nt,a,yt,tt;$JssorAnimator$.call(s,-c,c+1,{$SlideItemAnimator:!0});s.$LoadImage=function(t,i){i=i||d;rt.length&&!ut?($Jssor$.$ShowElement(i),lt||(lt=!0,u.$TriggerEvent(n.$EVT_LOAD_START),$Jssor$.$Each(rt,function(n){n.src||(n.src=$Jssor$.$AttributeEx(n,"src2"),$Jssor$.$CssDisplay(n,n["display-origin"]))})),$Jssor$.$LoadImages(rt,h,$Jssor$.$CreateCallback(null,pt,t,i))):pt(t,i)};s.$GoForNextSlide=function(){var n;if(w&&(n=w.$GetTransition(e),n)){var s=gt=$Jssor$.$GetNow(),t=i+lu,u=p[o(t)];return u.$LoadImage($Jssor$.$CreateCallback(null,ei,t,u,n,s),d)}ti(f+r.$AutoPlaySteps*lu)};s.$TryActivate=function(){wt(i,i,!0)};s.$ParkOut=function(){a&&a.$Quit();a&&a.$Disable();s.$UnhideContentForSlideshow();l&&l.$Abort();l=null;st()};s.$StampSlideItemElements=function(n){n=yt+"_"+n;$JssorDebug$.$Execute(function(){h&&$Jssor$.$Attribute(h,"debug-id",n+"_slide_item_image_id");$Jssor$.$Attribute(t,"debug-id",n+"_slide_item_item_id")});$JssorDebug$.$Execute(function(){$Jssor$.$Attribute(g,"debug-id",n+"_slide_item_wrapper_id")});$JssorDebug$.$Execute(function(){$Jssor$.$Attribute(d,"debug-id",n+"_loading_container_id")})};s.$HideContentForSlideshow=function(){$Jssor$.$HideElement(t)};s.$UnhideContentForSlideshow=function(){$Jssor$.$ShowElement(t)};s.$EnablePlayer=function(){a&&a.$Enable()};s.$OnInnerOffsetChange=function(n,t){var i=c-t;ru(g,i)};s.$GetCaptionSliderIn=function(){return y};s.$GetCaptionSliderOut=function(){return k};s.$Index=i;$JssorObject$.call(s);tt=$Jssor$.$FindChild(t,"thumb",!0);tt&&(s.$Thumb=$Jssor$.$CloneNode(tt),$Jssor$.$RemoveAttribute(tt,"id"),$Jssor$.$HideElement(tt));$Jssor$.$ShowElement(t);d=$Jssor$.$CloneNode(ri);$Jssor$.$CssZIndex(d,1e3);$Jssor$.$AddEvent(t,"click",bt);st(!0);s.$Image=h;s.$Link=b;s.$Item=t;s.$Wrapper=g=t;$Jssor$.$AppendChild(g,d);u.$On(203,wt);u.$On(28,hi);u.$On(24,si);$JssorDebug$.$Execute(function(){yt=te++});$JssorDebug$.$Execute(function(){$Jssor$.$Attribute(g,"debug-id","slide-"+i)})}function lf(t,i,e,o,s){function ut(){$Jssor$.$ClearChildren(pt);du&&b&&d.$Link&&$Jssor$.$AppendChild(pt,d.$Link);$Jssor$.$ShowElement(pt,!b&&d.$Image)}function et(){nt&&(nt=!1,u.$TriggerEvent(n.$EVT_ROLLBACK_END,i,c,v,a,c,l),h.$GoToPosition(a));h.$Replay()}function st(n){rt=n;h.$Stop();h.$Replay()}var h=this,v=0,tt=0,k,ft,a,c,l,b,nt,it,rt,d=p[i];$JssorAnimator$.call(h,0,0);h.$Replay=function(){var t=h.$GetPosition_Display(),r,e,o;y||yt||rt||f!=i||(t||(k&&!b&&(b=!0,h.$OpenSlideshowPanel(!0),u.$TriggerEvent(n.$EVT_SLIDESHOW_START,i,v,tt,k,l)),ut()),e=n.$EVT_STATE_CHANGE,t!=l&&(t==c?r=l:t==a?r=c:t?t>c?(nt=!0,r=c,e=n.$EVT_ROLLBACK_START):r=h.$GetPlayToPosition():r=a),u.$TriggerEvent(e,i,t,v,a,c,l),o=at&&(!ot||g),t==l?(c==l||ot&12)&&!o||d.$GoForNextSlide():(o||t!=c)&&h.$PlayToPosition(r,et))};h.$AdjustIdleOnPark=function(){c==l&&c==h.$GetPosition_Display()&&h.$GoToPosition(a)};h.$Abort=function(){w&&w.$Index==i&&w.$Clear();var t=h.$GetPosition_Display();t<l&&u.$TriggerEvent(n.$EVT_STATE_CHANGE,i,-t-1,v,a,c,l)};h.$OpenSlideshowPanel=function(n){e&&$Jssor$.$CssOverflow(vi,n&&e.$Transition.$Outside?"":"hidden")};h.$OnInnerOffsetChange=function(t,r){b&&r>=k&&(b=!1,ut(),d.$UnhideContentForSlideshow(),w.$Clear(),u.$TriggerEvent(n.$EVT_SLIDESHOW_END,i,v,tt,k,l));u.$TriggerEvent(n.$EVT_PROGRESS_CHANGE,i,r,v,a,c,l)};h.$SetPlayer=function(n){n&&!it&&(it=n,n.$On($JssorPlayer$.$EVT_SWITCH,st))};e&&h.$Chain(e);k=h.$GetPosition_OuterEnd();ft=h.$GetPosition_OuterEnd();h.$Chain(o);a=o.$GetPosition_OuterEnd();c=a+($Jssor$.$ParseFloat($Jssor$.$AttributeEx(t,"idle"))||r.$AutoPlayInterval);s.$Shift(c);h.$Combine(s);l=h.$GetPosition_OuterEnd()}function ru(n,t){var u=l>0?l:wt,i=lr*t*(u&1),r=ar*t*(u>>1&1);$Jssor$.$IsBrowserChrome()&&$Jssor$.$BrowserVersion()<38?(i=i.toFixed(3),r=r.toFixed(3)):(i=Math.round(i),r=Math.round(r));$Jssor$.$IsBrowserIE()&&$Jssor$.$BrowserVersion()>=10&&$Jssor$.$BrowserVersion()<11?n.style.msTransform="translate("+i+"px, "+r+"px)":$Jssor$.$IsBrowserChrome()&&$Jssor$.$BrowserVersion()>=30&&$Jssor$.$BrowserVersion()<34?(n.style.WebkitTransition="transform 0s",n.style.WebkitTransform="translate3d("+i+"px, "+r+"px, 0px) perspective(2000px)"):($Jssor$.$CssLeft(n,i),$Jssor$.$CssTop(n,r))}function af(n){var t=$Jssor$.$EventSrc(n).tagName;!ct&&t!="INPUT"&&t!="TEXTAREA"&&t!="SELECT"&&wf()&&vf(n)}function uu(){nu=yt;rf=v.$GetPlayToPosition();tt=a.$GetPosition()}function fu(){uu();(y||!g&&ot&12)&&(v.$Stop(),u.$TriggerEvent(n.$EVT_FREEZE))}function eu(n){var i,t,u;n&&uu();y||!g&&ot&12||v.$IsPlaying()||(i=a.$GetPosition(),t=Math.ceil(tt),n&&Math.abs(nt)>=r.$MinDragOffsetToSlide&&(t=Math.ceil(i)+ki),st&1||(t=Math.min(e-c,Math.max(t,0))),u=Math.abs(t-i),u=1-Math.pow(1-u,5),!dt&&nu?v.$Continue(rf):i==t?(cr.$EnablePlayer(),cr.$TryActivate()):v.$PlayCarousel(i,t,u*gu))}function vf(t){var i,r;y=!0;vr=!1;gt=null;$Jssor$.$AddEvent(document,gi,ou);tf=$Jssor$.$GetNow()-50;dt=0;fu();nu||(l=0);yi?(i=t.touches[0],pr=i.clientX,wr=i.clientY):(r=$Jssor$.$MousePosition(t),pr=r.x,wr=r.y,$Jssor$.$CancelEvent(t));nt=0;bi=0;ki=0;u.$TriggerEvent(n.$EVT_DRAG_START,o(tt),tt,t)}function ou(n){var u,o,s,h,t,a,i,r;y&&(!$Jssor$.$IsBrowserIe9Earlier()||n.button)?(yi?(o=n.touches,o&&o.length>0&&(u={x:o[0].clientX,y:o[0].clientY})):u=$Jssor$.$MousePosition(n),u&&(s=u.x-pr,h=u.y-wr,Math.floor(tt)!=tt&&(l=l||wt&ct),(s||h)&&!l&&(l=ct==3?Math.abs(h)>Math.abs(s)?2:1:ct,kt&&l==1&&Math.abs(h)-Math.abs(s)>3&&(vr=!0)),l&&(t=h,a=ar,l==1&&(t=s,a=lr),st&1||(t>0&&(i=a*f,r=t-i,r>0&&(t=i+Math.sqrt(r)*5)),t<0&&(i=a*(e-c-f),r=-t-i,r>0&&(t=-i-Math.sqrt(r)*5))),nt-bi<-2?ki=0:nt-bi>2&&(ki=-1),bi=nt,nt=t,tu=tt-nt/a/(fi||1),nt&&l&&!vr?($Jssor$.$CancelEvent(n),yt?v.$SetStandByPosition(tu):v.$StandBy(tu)):$Jssor$.$IsBrowserIe9Earlier()&&$Jssor$.$CancelEvent(n)))):ir(n)}function ir(t){if(bf(),y){y=!1;tf=$Jssor$.$GetNow();$Jssor$.$RemoveEvent(document,gi,ou);dt=nt;dt&&$Jssor$.$CancelEvent(t);v.$Stop();var i=a.$GetPosition();u.$TriggerEvent(n.$EVT_DRAG_END,o(i),i,o(tt),tt,t);eu(!0)}}function yf(n){return ie=p[f],vu=f,f=o(n),cr=p[f],su(n),f}function pf(t,i){l=0;yf(t);u.$TriggerEvent(n.$EVT_PARK,o(t),i)}function su(n,t){hr=n;$Jssor$.$Each(lt,function(i){i.$SetCurrentIndex(o(n),n,t)})}function wf(){var i=n.$DragRegistry||0,t=vt;return kt&&t&1&&(t&=1),n.$DragRegistry|=t,ct=t&~i}function bf(){ct&&(n.$DragRegistry&=~vt,ct=0)}function hu(){var n=$Jssor$.$CreateDiv();return $Jssor$.$SetStyles(n,ht),$Jssor$.$CssPosition(n,"absolute"),n}function o(n){return(n%e+e)%e}function kf(n,t){t&&(st?st&2&&(n=o(n+hr),t=!1):(n=Math.min(Math.max(n+hr,0),e-c),t=!1));ti(n,r.$SlideDuration,t)}function rr(){$Jssor$.$Each(lt,function(n){n.$Show(n.$Options.$ChanceToShow<=g)})}function df(){g||(g=1,rr(),y||(ot&12&&eu(),ot&3&&p[f].$TryActivate()))}function gf(){g&&(g=0,rr(),!y&&ot&12&&fu())}function ne(){ht={$Width:ft,$Height:et,$Top:0,$Left:0};$Jssor$.$Each(ut,function(n){$Jssor$.$SetStyles(n,ht);$Jssor$.$CssPosition(n,"absolute");$Jssor$.$CssOverflow(n,"hidden");$Jssor$.$HideElement(n)});$Jssor$.$SetStyles(ri,ht)}function si(n,t){ti(n,t,!0)}function ti(n,t,i){var f,u,h,s;nf&&(!y||r.$NaviQuitDrag)&&(yt=!0,y=!1,v.$Stop(),t==undefined&&(t=gu),f=br.$GetPosition_Display(),u=n,i&&(u=f+n,u=n>0?Math.ceil(u):Math.floor(u)),st&1||(u=o(u),u=Math.max(0,Math.min(u,e-c))),h=(u-f)%e,u=f+h,s=f==u?0:t*Math.abs(h),s=Math.min(s,t*c*1.5),v.$PlayCarousel(f,u,s||1))}function ii(){return $Jssor$.$CssWidth(s||t)}function hi(){return $Jssor$.$CssHeight(s||t)}function ur(n,i){var r,o,h,f,e;if(n==undefined)return $Jssor$.$CssWidth(t);$JssorDebug$.$Execute(function(){(!n||n<0)&&$JssorDebug$.$Fail("'$ScaleWidth' error, 'dimension' should be positive value.")});s||($JssorDebug$.$Execute(function(){var n=$Jssor$.$Css(t,"width"),i=$Jssor$.$Css(t,"height"),r=$Jssor$.$CssP(t,"width"),u=$Jssor$.$CssP(t,"height");n||$JssorDebug$.$Fail("Cannot scale jssor slider, 'dimension' of 'outer container' not specified. Please specify 'dimension' in pixel. e.g. 'dimension: 600px;'");i||$JssorDebug$.$Fail("Cannot scale jssor slider, 'height' of 'outer container' not specified. Please specify 'height' in pixel. e.g. 'height: 300px;'");n.indexOf("%")!=-1&&$JssorDebug$.$Fail("Cannot scale jssor slider, 'dimension' of 'outer container' not valid. Please specify 'dimension' in pixel. e.g. 'dimension: 600px;'");i.indexOf("%")!=-1&&$JssorDebug$.$Fail("Cannot scale jssor slider, 'height' of 'outer container' not valid. Please specify 'height' in pixel. e.g. 'height: 300px;'");r||$JssorDebug$.$Fail("Cannot scale jssor slider, 'dimension' of 'outer container' not valid. 'dimension' of 'outer container' should be positive number. e.g. 'dimension: 600px;'");u||$JssorDebug$.$Fail("Cannot scale jssor slider, 'height' of 'outer container' not valid. 'height' of 'outer container' should be positive number. e.g. 'height: 300px;'")}),r=$Jssor$.$CreateDiv(document),$Jssor$.$CssCssText(r,$Jssor$.$CssCssText(t)),$Jssor$.$ClassName(r,$Jssor$.$ClassName(t)),$Jssor$.$CssPosition(r,"relative"),$Jssor$.$CssTop(r,0),$Jssor$.$CssLeft(r,0),$Jssor$.$CssOverflow(r,"visible"),s=$Jssor$.$CreateDiv(document),$Jssor$.$CssPosition(s,"absolute"),$Jssor$.$CssTop(s,0),$Jssor$.$CssLeft(s,0),$Jssor$.$CssWidth(s,$Jssor$.$CssWidth(t)),$Jssor$.$CssHeight(s,$Jssor$.$CssHeight(t)),$Jssor$.$SetStyleTransformOrigin(s,"0 0"),$Jssor$.$AppendChild(s,r),o=$Jssor$.$Children(t),$Jssor$.$AppendChild(t,s),$Jssor$.$Css(t,"backgroundImage",""),h={navigator:rt&&rt.$Scale==!1,arrowleft:k&&k.$Scale==!1,arrowright:k&&k.$Scale==!1,thumbnavigator:b&&b.$Scale==!1,thumbwrapper:b&&b.$Scale==!1},$Jssor$.$Each(o,function(n){$Jssor$.$AppendChild(h[$Jssor$.$AttributeEx(n,"u")]?t:r,n)}),$Jssor$.$ShowElement(r),$Jssor$.$ShowElement(s));$JssorDebug$.$Execute(function(){cu||(cu=u.$Elmt.scrollWidth)});fi=n/(i?$Jssor$.$CssHeight:$Jssor$.$CssWidth)(s);$Jssor$.$CssScale(s,fi);f=i?fi*ii():n;e=i?n:fi*hi();$Jssor$.$CssWidth(t,f);$Jssor$.$CssHeight(t,e);$Jssor$.$Each(lt,function(n){n.$Relocate(f,e)})}var u=this,cu,ci,r,li,ai,ht,ut,au,tr,ei,uf,iu,oi;u.$PlayTo=ti;u.$GoTo=function(n){ti(n,1)};u.$Next=function(){si(1)};u.$Prev=function(){si(-1)};u.$Pause=function(){at=!1};u.$Play=function(){at||(at=!0,p[f]&&p[f].$TryActivate())};u.$SetSlideshowTransitions=function(n){$JssorDebug$.$Execute(function(){n&&n.length||$JssorDebug$.$Error("Can not set slideshow transitions, no transitions specified.")});$Jssor$.$TranslateTransitions(n);r.$SlideshowOptions.$Transitions=n};u.$SetCaptionTransitions=function(n){$JssorDebug$.$Execute(function(){n&&n.length||$JssorDebug$.$Error("Can not set caption transitions, no transitions specified")});$Jssor$.$TranslateTransitions(n);it.$CaptionTransitions=n;it.$Version=$Jssor$.$GetNow()};u.$SlidesCount=function(){return ut.length};u.$CurrentIndex=function(){return f};u.$IsAutoPlaying=function(){return at};u.$IsDragging=function(){return y};u.$IsSliding=function(){return yt};u.$IsMouseOver=function(){return!g};u.$LastDragSucceded=function(){return dt};u.$OriginalWidth=u.$GetOriginalWidth=ii;u.$OriginalHeight=u.$GetOriginalHeight=hi;u.$ScaleHeight=u.$GetScaleHeight=function(n){if(n==undefined)return $Jssor$.$CssHeight(t);ur(n,!0)};u.$ScaleWidth=u.$SetScaleWidth=u.$GetScaleWidth=ur;u.$GetVirtualIndex=function(n){var t=Math.ceil(o(wi/pu)),i=o(n-f+t);return i>c?n-f>e/2?n-=e:n-f<=-e/2&&(n+=e):n=f+i-t,n};$JssorObject$.call(u);$JssorDebug$.$Execute(function(){var n=$Jssor$.$GetElement(t);n||$JssorDebug$.$Fail("Outer container '"+t+"' not found.")});u.$Elmt=t=$Jssor$.$GetElement(t);ci=1;r=$Jssor$.$Extend({$FillMode:0,$LazyLoading:1,$StartIndex:0,$AutoPlay:!1,$Loop:1,$HWA:!0,$NaviQuitDrag:!0,$AutoPlaySteps:1,$AutoPlayInterval:3e3,$PauseOnHover:1,$SlideDuration:500,$SlideEasing:$JssorEasing$.$EaseOutQuad,$MinDragOffsetToSlide:20,$SlideSpacing:0,$DisplayPieces:1,$ParkingPosition:0,$UISearchMode:1,$PlayOrientation:1,$DragOrientation:1},i);$JssorDebug$.$Execute(function(){r=$Jssor$.$Extend({$ArrowKeyNavigation:undefined,$SlideWidth:undefined,$SlideHeight:undefined,$SlideshowOptions:undefined,$CaptionSliderOptions:undefined,$BulletNavigatorOptions:undefined,$ArrowNavigatorOptions:undefined,$ThumbnailNavigatorOptions:undefined},r)});var wt=r.$PlayOrientation&3,lu=(r.$PlayOrientation&4)/-4||1,d=r.$SlideshowOptions,it=$Jssor$.$Extend({$Class:$JssorCaptionSliderBase$,$PlayInMode:1,$PlayOutMode:1},r.$CaptionSliderOptions);$Jssor$.$TranslateTransitions(it.$CaptionTransitions);var rt=r.$BulletNavigatorOptions,k=r.$ArrowNavigatorOptions,b=r.$ThumbnailNavigatorOptions;$JssorDebug$.$Execute(function(){d&&!d.$Class&&$JssorDebug$.$Fail("Option $SlideshowOptions error, class not specified.")});$JssorDebug$.$Execute(function(){r.$CaptionSliderOptions&&!r.$CaptionSliderOptions.$Class&&$JssorDebug$.$Fail("Option $CaptionSliderOptions error, class not specified.")});$JssorDebug$.$Execute(function(){rt&&!rt.$Class&&$JssorDebug$.$Fail("Option $BulletNavigatorOptions error, class not specified.")});$JssorDebug$.$Execute(function(){k&&!k.$Class&&$JssorDebug$.$Fail("Option $ArrowNavigatorOptions error, class not specified.")});$JssorDebug$.$Execute(function(){b&&!b.$Class&&$JssorDebug$.$Fail("Option $ThumbnailNavigatorOptions error, class not specified.")});var bt=!r.$UISearchMode,s,h=$Jssor$.$FindChild(t,"slides",bt),ri=$Jssor$.$FindChild(t,"loading",bt)||$Jssor$.$CreateDiv(document),fr=$Jssor$.$FindChild(t,"navigator",bt),er=$Jssor$.$FindChild(t,"arrowleft",bt),or=$Jssor$.$FindChild(t,"arrowright",bt),sr=$Jssor$.$FindChild(t,"thumbnavigator",bt);$JssorDebug$.$Execute(function(){if(fr&&!rt)throw new Error("Bullet navigator container defined but $BulletNavigatorOptions not specified.");if((er||or)&&!k)throw new Error("arrowleft or arrowright defined, but $ArrowNavigatorOptions not specified.");if(sr&&!b)throw new Error("Thumbnail navigator container defined, but $ThumbnailNavigatorOptions not specified.");});li=$Jssor$.$CssWidth(h);ai=$Jssor$.$CssHeight(h);$JssorDebug$.$Execute(function(){isNaN(li)&&$JssorDebug$.$Fail("Width of slides container wrong specification, it should be specified in pixel (like style='width: 600px;').");li==undefined&&$JssorDebug$.$Fail("Width of slides container not specified, it should be specified in pixel (like style='width: 600px;').");isNaN(ai)&&$JssorDebug$.$Fail("Height of slides container wrong specification, it should be specified in pixel (like style='height: 300px;').");ai==undefined&&$JssorDebug$.$Fail("Height of slides container not specified, it should be specified in pixel (like style='height: 300px;').");var n=$Jssor$.$CssOverflow(h),t=$Jssor$.$Css(h,"overflowX"),i=$Jssor$.$Css(h,"overflowY");n!="hidden"&&(t!="hidden"||i!="hidden")&&$JssorDebug$.$Fail("Overflow of slides container wrong specification, it should be specified as 'hidden' (style='overflow:hidden;').")});$JssorDebug$.$Execute(function(){$Jssor$.$IsNumeric(r.$DisplayPieces)||$JssorDebug$.$Fail("Option $DisplayPieces error, it should be a numeric value and greater than or equal to 1.");r.$DisplayPieces<1&&$JssorDebug$.$Fail("Option $DisplayPieces error, it should be greater than or equal to 1.");r.$DisplayPieces>1&&r.$DragOrientation&&r.$DragOrientation!=wt&&$JssorDebug$.$Fail("Option $DragOrientation error, it should be 0 or the same of $PlayOrientation when $DisplayPieces is greater than 1.");$Jssor$.$IsNumeric(r.$ParkingPosition)||$JssorDebug$.$Fail("Option $ParkingPosition error, it should be a numeric value.");r.$ParkingPosition&&r.$DragOrientation&&r.$DragOrientation!=wt&&$JssorDebug$.$Fail("Option $DragOrientation error, it should be 0 or the same of $PlayOrientation when $ParkingPosition is not equal to 0.")});ut=[];au=$Jssor$.$Children(h);$Jssor$.$Each(au,function(n){n.tagName!="DIV"||$Jssor$.$AttributeEx(n,"u")||ut.push(n)});$JssorDebug$.$Execute(function(){ut.length<1&&$JssorDebug$.$Error("Slides html code definition error, there must be at least 1 slide to initialize a slider.")});var te=0,vu,f=-1,hr,ie,cr,e=ut.length,ft=r.$SlideWidth||li,et=r.$SlideHeight||ai,yu=r.$SlideSpacing,lr=ft+yu,ar=et+yu,pu=wt&1?lr:ar,c=Math.min(r.$DisplayPieces,e),vi,l,ct,vr,yi,kt,lt=[],wu,bu,ku,du,re,at,ue=r.$AutoPlaySteps,ot=r.$PauseOnHover,fe=r.$AutoPlayInterval,gu=r.$SlideDuration,yr,pi,wi,nf=c<e,st=nf?r.$Loop:0,vt,dt,g=1,yt,y,gt,pr=0,wr=0,nt,bi,ki,br,a,ui,v,kr=new hf,fi;at=r.$AutoPlay;u.$Options=i;ne();t["jssor-slider"]=!0;$Jssor$.$CssZIndex(h,$Jssor$.$CssZIndex(h)||0);$Jssor$.$CssPosition(h,"absolute");vi=$Jssor$.$CloneNode(h);$Jssor$.$InsertBefore($Jssor$.$ParentNode(h),vi,h);d&&(du=d.$ShowLink,yr=d.$Class,$JssorDebug$.$Execute(function(){d.$Transitions&&d.$Transitions.length||$JssorDebug$.$Error("Invalid '$SlideshowOptions', no '$Transitions' specified.")}),$Jssor$.$TranslateTransitions(d.$Transitions),pi=c==1&&e>1&&yr&&(!$Jssor$.$IsBrowserIE()||$Jssor$.$BrowserVersion()>=8));wi=pi||c>=e||!(st&1)?0:r.$ParkingPosition;vt=(c>1||wi?wt:-1)&r.$DragOrientation;var di=h,p=[],w,pt,dr="mousedown",gi="mousemove",gr="mouseup",nr,tf,tt,nu,rf,tu,ni;for(window.navigator.pointerEnabled||(ni=window.navigator.msPointerEnabled)?(kt=!0,dr=ni?"MSPointerDown":"pointerdown",gi=ni?"MSPointerMove":"pointermove",gr=ni?"MSPointerUp":"pointerup",nr=ni?"MSPointerCancel":"pointercancel",vt&&(tr="auto",vt==2?tr="pan-x":vt&&(tr="pan-y"),$Jssor$.$Css(di,ni?"msTouchAction":"touchAction",tr))):("ontouchstart"in window||"createTouch"in document)&&(yi=!0,kt=!0,dr="touchstart",gi="touchmove",gr="touchend",nr="touchcancel"),ui=new of,pi&&(w=new yr(kr,ft,et,d,yi)),$Jssor$.$AppendChild(vi,ui.$Wrapper),$Jssor$.$CssOverflow(h,"hidden"),pt=hu(),$Jssor$.$Css(pt,"backgroundColor","#000"),$Jssor$.$CssOpacity(pt,0),$Jssor$.$InsertBefore(di,pt,di.firstChild),ei=0;ei<ut.length;ei++)uf=ut[ei],iu=new cf(uf,ei),p.push(iu);$Jssor$.$HideElement(ri);$JssorDebug$.$Execute(function(){$Jssor$.$Attribute(ri,"debug-id","loading-container")});br=new ef;v=new sf(br,ui);$JssorDebug$.$Execute(function(){$Jssor$.$Attribute(di,"debug-id","slide-board")});vt&&($Jssor$.$AddEvent(h,dr,af),$Jssor$.$AddEvent(document,gr,ir),nr&&$Jssor$.$AddEvent(document,nr,ir));ot&=kt?10:5;fr&&rt&&(wu=new rt.$Class(fr,rt,ii(),hi()),lt.push(wu));k&&er&&or&&(bu=new k.$Class(er,or,k,ii(),hi()),lt.push(bu));sr&&b&&(b.$StartIndex=r.$StartIndex,ku=new b.$Class(sr,b),lt.push(ku));$Jssor$.$Each(lt,function(n){n.$Reset(e,p,ri);n.$On($JssorNavigatorEvents$.$NAVIGATIONREQUEST,kf)});ur(ii());$Jssor$.$AddEvent(t,"mouseout",$Jssor$.$MouseOverOutFilter(df,t));$Jssor$.$AddEvent(t,"mouseover",$Jssor$.$MouseOverOutFilter(gf,t));rr();r.$ArrowKeyNavigation&&$Jssor$.$AddEvent(document,"keydown",function(n){n.keyCode==$JssorKeyCode$.$LEFT?si(-1):n.keyCode==$JssorKeyCode$.$RIGHT&&si(1)});oi=r.$StartIndex;st&1||(oi=Math.max(0,Math.min(oi,e-c)));v.$PlayCarousel(oi,oi,0)}var t=0,i=1,r=2,u=3,y=1,p=2,w=4,b=8,d=256,g=512,nt=1024,tt=2048,e=tt+y,o=tt+p,s=g+y,h=g+p,c=d+w,l=d+b,a=nt+w,v=nt+b,rt;$JssorSlideshowFormations$.$FormationStraight=function(n){for(var u=n.$Cols,v=n.$Rows,k=n.$Assembly,d=n.$Count,p=[],t=0,i=0,w=u-1,b=v-1,y=d-1,g,r,i=0;i<v;i++)for(t=0;t<u;t++){g=i+","+t;switch(k){case e:r=y-(t*v+(b-i));break;case a:r=y-(i*u+(w-t));break;case s:r=y-(t*v+i);case c:r=y-(i*u+t);break;case o:r=t*v+i;break;case l:r=i*u+(w-t);break;case h:r=t*v+(b-i);break;default:r=i*u+t}f(p,r,[i,t])}return p};$JssorSlideshowFormations$.$FormationSwirl=function(n){var g=n.$Cols,nt=n.$Rows,ft=n.$Assembly,tt=n.$Count,it=[],rt=[],k=0,v=0,y=0,w=g-1,b=nt-1,et=tt-1,d,p,ut=0;switch(ft){case e:v=w;y=0;p=[r,i,u,t];break;case a:v=0;y=b;p=[t,u,i,r];break;case s:v=w;y=b;p=[u,i,r,t];break;case c:v=w;y=b;p=[i,u,t,r];break;case o:v=0;y=0;p=[r,t,u,i];break;case l:v=w;y=0;p=[i,r,t,u];break;case h:v=0;y=b;p=[u,t,r,i];break;default:v=0;y=0;p=[t,r,i,u]}for(k=0;k<tt;){if(d=y+","+v,v>=0&&v<g&&y>=0&&y<nt&&!rt[d])rt[d]=!0,f(it,k++,[y,v]);else switch(p[ut++%p.length]){case t:v--;break;case r:y--;break;case i:v++;break;case u:y++}switch(p[ut%p.length]){case t:v++;break;case r:y++;break;case i:v--;break;case u:y--}}return it};$JssorSlideshowFormations$.$FormationZigZag=function(n){var nt=n.$Cols,tt=n.$Rows,ut=n.$Assembly,it=n.$Count,k=[],d=0,v=0,y=0,w=nt-1,b=tt-1,ft=it-1,rt,p,g=0;switch(ut){case e:v=w;y=0;p=[r,i,u,i];break;case a:v=0;y=b;p=[t,u,i,u];break;case s:v=w;y=b;p=[u,i,r,i];break;case c:v=w;y=b;p=[i,u,t,u];break;case o:v=0;y=0;p=[r,t,u,t];break;case l:v=w;y=0;p=[i,r,t,r];break;case h:v=0;y=b;p=[u,t,r,t];break;default:v=0;y=0;p=[t,r,i,r]}for(d=0;d<it;)if(rt=y+","+v,v>=0&&v<nt&&y>=0&&y<tt&&typeof k[rt]=="undefined"){f(k,d++,[y,v]);switch(p[g%p.length]){case t:v++;break;case r:y++;break;case i:v--;break;case u:y--}}else{switch(p[g++%p.length]){case t:v--;break;case r:y--;break;case i:v++;break;case u:y++}switch(p[g++%p.length]){case t:v++;break;case r:y++;break;case i:v--;break;case u:y--}}return k};$JssorSlideshowFormations$.$FormationStraightStairs=function(n){var g=n.$Cols,nt=n.$Rows,y=n.$Assembly,d=n.$Count,b=[],k=0,r=0,u=0,p=g-1,w=nt-1,tt=d-1,it,t,i;switch(y){case e:case h:case s:case o:t=0;i=0;break;case l:case a:case c:case v:t=p;i=0;break;default:y=v;t=p;i=0}for(r=t,u=i;k<d;){it=u+","+r;ft(y)||ut(y)?f(b,tt-k++,[u,r]):f(b,k++,[u,r]);switch(y){case e:case h:r--;u++;break;case s:case o:r++;u--;break;case l:case a:r--;u--;break;case v:case c:default:r++;u++}if(r<0||u<0||r>p||u>w){switch(y){case e:case h:t++;break;case l:case a:case s:case o:i++;break;case v:case c:default:t--}if(t<0||i<0||t>p||i>w){switch(y){case e:case h:t=p;i++;break;case s:case o:i=w;t++;break;case l:case a:i=w;t--;break;case v:case c:default:t=0;i++}i>w?i=w:i<0?i=0:t>p?t=p:t<0&&(t=0)}u=i;r=t}}return b};$JssorSlideshowFormations$.$FormationSquare=function(n){var t=n.$Cols||1,i=n.$Rows||1,s=[],r,u,e,o,h;for(e=t<i?(i-t)/2:0,o=t>i?(t-i)/2:0,h=Math.round(Math.max(t/2,i/2))+1,r=0;r<t;r++)for(u=0;u<i;u++)f(s,h-Math.min(r+1+e,u+1+o,t-r+e,i-u+o),[u,r]);return s};$JssorSlideshowFormations$.$FormationRectangle=function(n){for(var r=n.$Cols||1,u=n.$Rows||1,e=[],i,o=Math.round(Math.min(r/2,u/2))+1,t=0;t<r;t++)for(i=0;i<u;i++)f(e,o-Math.min(t+1,i+1,r-t,u-i),[i,t]);return e};$JssorSlideshowFormations$.$FormationRandom=function(n){for(var r=[],i,t=0;t<n.$Rows;t++)for(i=0;i<n.$Cols;i++)f(r,Math.ceil(1e5*Math.random())%13,[t,i]);return r};$JssorSlideshowFormations$.$FormationCircle=function(n){for(var r=n.$Cols||1,u=n.$Rows||1,e=[],i,o=r/2-.5,s=u/2-.5,t=0;t<r;t++)for(i=0;i<u;i++)f(e,Math.round(Math.sqrt(Math.pow(t-o,2)+Math.pow(i-s,2))),[i,t]);return e};$JssorSlideshowFormations$.$FormationCross=function(n){for(var r=n.$Cols||1,u=n.$Rows||1,e=[],i,o=r/2-.5,s=u/2-.5,t=0;t<r;t++)for(i=0;i<u;i++)f(e,Math.round(Math.min(Math.abs(t-o),Math.abs(i-s))),[i,t]);return e};$JssorSlideshowFormations$.$FormationRectangleCross=function(n){for(var e=n.$Cols||1,o=n.$Rows||1,s=[],i,r=e/2-.5,u=o/2-.5,h=Math.max(r,u)+1,t=0;t<e;t++)for(i=0;i<o;i++)f(s,Math.round(h-Math.max(r-Math.abs(t-r),u-Math.abs(i-u)))-1,[i,t]);return s};rt=1;$JssorSlideshowRunner$=window.$JssorSlideshowRunner$=function(n,t,i,r,u){function p(){var n=this,t=0;$JssorAnimator$.call(n,0,h);n.$OnPositionChange=function(n,i){i-t>s&&(t=i,o&&o.$ShowFrame(i),e&&e.$ShowFrame(i))};n.$Transition=c}var f=this,h,e,o,l,a,v=0,y=r.$TransitionsOrder,c,s=8;f.$GetTransition=function(){var n=0,t=r.$Transitions,i=t.length;return n=y?v++%i:Math.floor(Math.random()*i),t[n]&&(t[n].$Index=n),t[n]};f.$Initialize=function(r,u,v,y,p){var w,b,g;$JssorDebug$.$Execute(function(){e&&$JssorDebug$.$Fail("slideshow runner has not been cleared.")});c=p;p=k(p,s);a=v;l=y;w=y.$Item;b=v.$Item;w["no-image"]=!y.$Image;b["no-image"]=!v.$Image;var nt=w,tt=b,rt=p,d=p.$Brother||k({},s);p.$SlideOut||(nt=b,tt=w);g=d.$Shift||0;e=new it(n,tt,d,Math.max(g-d.$Interval,0),t,i);o=new it(n,nt,rt,Math.max(d.$Interval-g,0),t,i);e.$ShowFrame(0);o.$ShowFrame(0);h=Math.max(e.$EndTime,o.$EndTime);f.$Index=r};f.$Clear=function(){n.$Clear();e=null;o=null};f.$GetProcessor=function(){var n=null;return o&&(n=new p),n};($Jssor$.$IsBrowserIe9Earlier()||$Jssor$.$IsBrowserOpera()||u&&$Jssor$.$WebKitVersion()<537)&&(s=16);$JssorObject$.call(f);$JssorAnimator$.call(f,-1e7,1e7);$JssorDebug$.$LiveStamp(f,"slideshow_runner_"+rt++)};n.$EVT_CLICK=21;n.$EVT_DRAG_START=22;n.$EVT_DRAG_END=23;n.$EVT_SWIPE_START=24;n.$EVT_SWIPE_END=25;n.$EVT_LOAD_START=26;n.$EVT_LOAD_END=27;n.$EVT_FREEZE=28;n.$EVT_POSITION_CHANGE=202;n.$EVT_PARK=203;n.$EVT_SLIDESHOW_START=206;n.$EVT_SLIDESHOW_END=207;n.$EVT_PROGRESS_CHANGE=208;n.$EVT_STATE_CHANGE=209;n.$EVT_ROLLBACK_START=210;n.$EVT_ROLLBACK_END=211;window.$JssorSlider$=$JssorSlider$=n};var $JssorNavigatorEvents$={$NAVIGATIONREQUEST:1,$INDEXCHANGE:2,$RESET:3},$JssorBulletNavigator$=window.$JssorBulletNavigator$=function(n,t){function k(n){n!=-1&&b[n].$Activate(n==o)}function d(n){r.$TriggerEvent($JssorNavigatorEvents$.$NAVIGATIONREQUEST,n*s)}var r=this,g,nt;$JssorObject$.call(r);n=$Jssor$.$GetElement(n);var h,tt,c,l,a,o=0,i,s,f,p,w,e,u,v,y,it=[],b=[];r.$Elmt=n;r.$GetCurrentIndex=function(){return a};r.$SetCurrentIndex=function(n){if(n!=a){var i=o,t=Math.floor(n/s);o=t;a=n;k(i);k(t)}};r.$Show=function(t){$Jssor$.$ShowElement(n,t)};r.$Relocate=function(t,r){g&&i.$Scale!=!1||(i.$AutoCenter&1&&$Jssor$.$CssLeft(n,(t-c)/2),i.$AutoCenter&2&&$Jssor$.$CssTop(n,(r-l)/2),g=!0)};r.$Reset=function(t){var r,ut,a,ft;if(!nt){tt=t;h=Math.ceil(t/s);o=0;var g=v+p,rt=y+w,k=Math.ceil(h/f)-1;for(c=v+g*(e?f-1:k),l=y+rt*(e?k:f-1),$Jssor$.$CssWidth(n,c),$Jssor$.$CssHeight(n,l),r=0;r<h;r++)ut=$Jssor$.$CreateSpan(),$Jssor$.$InnerText(ut,r+1),a=$Jssor$.$BuildElement(u,"numbertemplate",ut,!0),$Jssor$.$CssPosition(a,"absolute"),ft=r%(k+1),$Jssor$.$CssLeft(a,e?r%f*g:g*ft),$Jssor$.$CssTop(a,e?rt*ft:Math.floor(r/(k+1))*rt),$Jssor$.$AppendChild(n,a),it[r]=a,i.$ActionMode&1&&$Jssor$.$AddEvent(a,"click",$Jssor$.$CreateCallback(null,d,r)),i.$ActionMode&2&&$Jssor$.$AddEvent(a,"mouseover",$Jssor$.$MouseOverOutFilter($Jssor$.$CreateCallback(null,d,r),a)),b[r]=$Jssor$.$Buttonize(a);nt=!0}};r.$Options=i=$Jssor$.$Extend({$SpacingX:0,$SpacingY:0,$Orientation:1,$ActionMode:1},t);$JssorDebug$.$Execute(function(){i=$Jssor$.$Extend({$Steps:undefined,$Lanes:undefined},i)});u=$Jssor$.$FindChild(n,"prototype");$JssorDebug$.$Execute(function(){u||$JssorDebug$.$Fail("Navigator item prototype not defined.");isNaN($Jssor$.$CssWidth(u))&&$JssorDebug$.$Fail("Width of 'navigator item prototype' not specified.");isNaN($Jssor$.$CssHeight(u))&&$JssorDebug$.$Fail("Height of 'navigator item prototype' not specified.")});v=$Jssor$.$CssWidth(u);y=$Jssor$.$CssHeight(u);$Jssor$.$RemoveChild(n,u);s=i.$Steps||1;f=i.$Lanes||1;p=i.$SpacingX;w=i.$SpacingY;e=i.$Orientation-1},$JssorArrowNavigator$=window.$JssorArrowNavigator$=function(n,t,i,r){function c(n){u.$TriggerEvent($JssorNavigatorEvents$.$NAVIGATIONREQUEST,n,!0)}var u=this,v,e,f,o,s,h,l,a;$JssorObject$.call(u);$JssorDebug$.$Execute(function(){n||$JssorDebug$.$Fail("Option '$ArrowNavigatorOptions' spepcified, but UI 'arrowleft' not defined. Define 'arrowleft' to enable direct navigation, or remove option '$ArrowNavigatorOptions' to disable direct navigation.");t||$JssorDebug$.$Fail("Option '$ArrowNavigatorOptions' spepcified, but UI 'arrowright' not defined. Define 'arrowright' to enable direct navigation, or remove option '$ArrowNavigatorOptions' to disable direct navigation.");isNaN($Jssor$.$CssWidth(n))&&$JssorDebug$.$Fail("Width of 'arrow left' not specified.");isNaN($Jssor$.$CssWidth(t))&&$JssorDebug$.$Fail("Width of 'arrow right' not specified.");isNaN($Jssor$.$CssHeight(n))&&$JssorDebug$.$Fail("Height of 'arrow left' not specified.");isNaN($Jssor$.$CssHeight(t))&&$JssorDebug$.$Fail("Height of 'arrow right' not specified.")});s=$Jssor$.$CssWidth(n);h=$Jssor$.$CssHeight(n);u.$GetCurrentIndex=function(){return e};u.$SetCurrentIndex=function(n,t,i){e=i?t:n};u.$Show=function(i){$Jssor$.$ShowElement(n,i);$Jssor$.$ShowElement(t,i)};u.$Relocate=function(i,u){l&&f.$Scale!=!1||(f.$AutoCenter&1&&($Jssor$.$CssLeft(n,(r-s)/2),$Jssor$.$CssLeft(t,(r-s)/2)),f.$AutoCenter&2&&($Jssor$.$CssTop(n,(u-h)/2),$Jssor$.$CssTop(t,(u-h)/2)),l=!0)};u.$Reset=function(i){v=i;e=0;a||($Jssor$.$AddEvent(n,"click",$Jssor$.$CreateCallback(null,c,-o)),$Jssor$.$AddEvent(t,"click",$Jssor$.$CreateCallback(null,c,o)),$Jssor$.$Buttonize(n),$Jssor$.$Buttonize(t),a=!0)};u.$Options=f=$Jssor$.$Extend({$Steps:1},i);o=f.$Steps},$JssorThumbnailNavigator$=window.$JssorThumbnailNavigator$=function(n,t){function g(n,t){function v(){h.$Activate(o==t)}function a(){if(!l.$LastDragSucceded()){var n=r-t%r,i=l.$GetVirtualIndex((t+n)/r-1),u=i*r+r-n;f.$TriggerEvent($JssorNavigatorEvents$.$NAVIGATIONREQUEST,u)}}var s=this,u,h,c;$JssorDebug$.$Execute(function(){s.$Wrapper=undefined});s.$Index=t;s.$Highlight=v;c=n.$Thumb||n.$Image||$Jssor$.$CreateDiv();s.$Wrapper=u=$Jssor$.$BuildElement(e,"thumbnailtemplate",c,!0);h=$Jssor$.$Buttonize(u);i.$ActionMode&1&&$Jssor$.$AddEvent(u,"click",a);i.$ActionMode&2&&$Jssor$.$AddEvent(u,"mouseover",$Jssor$.$MouseOverOutFilter(a,u))}var f=this,b,d,o,i,y=[],p,w,r,s,h,a,v,c,l,u,e,k;$JssorObject$.call(f);n=$Jssor$.$GetElement(n);f.$GetCurrentIndex=function(){return o};f.$SetCurrentIndex=function(n,t,i){var u=o;o=n;u!=-1&&y[u].$Highlight();y[n].$Highlight();i||l.$PlayTo(l.$GetVirtualIndex(Math.floor(t/r)))};f.$Show=function(t){$Jssor$.$ShowElement(n,t)};f.$Relocate=$Jssor$.$EmptyFunction;f.$Reset=function(t,f){var nt,ft;if(!k){b=t;d=Math.ceil(b/r);o=-1;c=Math.min(c,f.length);var e=i.$Orientation&1,tt=a+(a+s)*(r-1)*(1-e),it=v+(v+h)*(r-1)*e,rt=tt+(tt+s)*(c-1)*e,ut=it+(it+h)*(c-1)*(1-e);$Jssor$.$CssPosition(u,"absolute");$Jssor$.$CssOverflow(u,"hidden");i.$AutoCenter&1&&$Jssor$.$CssLeft(u,(p-rt)/2);i.$AutoCenter&2&&$Jssor$.$CssTop(u,(w-ut)/2);$Jssor$.$CssWidth(u,rt);$Jssor$.$CssHeight(u,ut);nt=[];$Jssor$.$Each(f,function(n,t){var o=new g(n,t),f=o.$Wrapper,i=Math.floor(t/r),c=t%r;$Jssor$.$CssLeft(f,(a+s)*c*(1-e));$Jssor$.$CssTop(f,(v+h)*c*e);nt[i]||(nt[i]=$Jssor$.$CreateDiv(),$Jssor$.$AppendChild(u,nt[i]));$Jssor$.$AppendChild(nt[i],f);y.push(o)});ft=$Jssor$.$Extend({$HWA:!1,$AutoPlay:!1,$NaviQuitDrag:!1,$SlideWidth:tt,$SlideHeight:it,$SlideSpacing:s*e+h*(1-e),$MinDragOffsetToSlide:12,$SlideDuration:200,$PauseOnHover:1,$PlayOrientation:i.$Orientation,$DragOrientation:i.$DisableDrag?0:i.$Orientation},i);l=new $JssorSlider$(n,ft);k=!0}};f.$Options=i=$Jssor$.$Extend({$SpacingX:3,$SpacingY:3,$DisplayPieces:1,$Orientation:1,$AutoCenter:3,$ActionMode:1},t);$JssorDebug$.$Execute(function(){i=$Jssor$.$Extend({$Lanes:undefined,$Width:undefined,$Height:undefined},i)});p=$Jssor$.$CssWidth(n);w=$Jssor$.$CssHeight(n);$JssorDebug$.$Execute(function(){p||$JssorDebug$.$Fail("width of 'thumbnavigator' container not specified.");w||$JssorDebug$.$Fail("height of 'thumbnavigator' container not specified.")});u=$Jssor$.$FindChild(n,"slides",!0);e=$Jssor$.$FindChild(u,"prototype");$JssorDebug$.$Execute(function(){e||$JssorDebug$.$Fail("prototype of 'thumbnavigator' not defined.")});a=$Jssor$.$CssWidth(e);v=$Jssor$.$CssHeight(e);$Jssor$.$RemoveChild(u,e);r=i.$Lanes||1;s=i.$SpacingX;h=i.$SpacingY;c=i.$DisplayPieces};if($JssorCaptionSlider$=window.$JssorCaptionSlider$=function(n,t,i){function s(n,t){function a(n,t){var i={};return $Jssor$.$Each(l,function(r,u){var f=$Jssor$.$AttributeEx(n,r+(t||"")),e;f&&(e={},r=="t"?e.$Value=f:f.indexOf("%")+1?e.$Percent=$Jssor$.$ParseFloat(f)/100:e.$Value=$Jssor$.$ParseFloat(f),i[u]=e)}),i}function y(){return f[Math.floor(Math.random()*f.length)]}function v(n){var i,t;return n=="*"?i=y():n&&(t=f[$Jssor$.$ParseInt(n)]||f[n],$Jssor$.$IsArray(t)&&(n!=h?(h=n,r[n]=0,c[n]=t[Math.floor(Math.random()*t.length)]):r[n]++,t=c[n],$Jssor$.$IsArray(t)&&(t=t.length&&t[r[n]%t.length],$Jssor$.$IsArray(t)&&(t=t[Math.floor(Math.random()*t.length)]))),i=t,$Jssor$.$IsString(i)&&(i=v(i))),i}var e=[],h,c=[],r=[],p=$Jssor$.$Children(n);return $Jssor$.$Each(p,function(n){var r=[],f;r.$Elmt=n;f=$Jssor$.$AttributeEx(n,"u")=="caption";$Jssor$.$Each(i?[0,3]:[2],function(i,e){var l,h,c;f&&(i==2&&$Jssor$.$AttributeEx(n,"t3")||(h=a(n,i),i!=2||h.$Transition||(h.$Delay=h.$Delay||{$Value:0},h=$Jssor$.$Extend(a(n,0),h))),h&&h.$Transition&&(l=v(h.$Transition.$Value),l&&(c=$Jssor$.$Extend({$Delay:0},l),$Jssor$.$Each(h,function(n,t){var i=(u[t]||u.$Default).apply(u,[c[t],h[t]]);isNaN(i)||(c[t]=i)}),e||(h.$BeginTime?c.$BeginTime=h.$BeginTime.$Value||0:o&2&&(c.$BeginTime=0)))),r.push(c));t%2&&!e&&(r.$Children=s(n,t+1))});e.push(r)}),e}function h(n,t,r){var e={$Easing:t.$Easing,$Round:t.$Round,$During:t.$During,$Reverse:i&&!r,$Optimize:!0},p,a,v,tt;$JssorDebug$.$Execute(function(){e.$CaptionAnimator=!0});var o=n,y=$Jssor$.$ParentNode(n),c=$Jssor$.$CssWidth(o),l=$Jssor$.$CssHeight(o),it=$Jssor$.$CssWidth(y),rt=$Jssor$.$CssHeight(y),u={},s={},h=t.$ScaleClip||1;if(t.$Opacity&&(u.$Opacity=2-t.$Opacity),e.$OriginalWidth=c,e.$OriginalHeight=l,t.$Zoom||t.$Rotate)u.$Zoom=t.$Zoom?t.$Zoom-1:1,($Jssor$.$IsBrowserIe9Earlier()||$Jssor$.$IsBrowserOpera())&&(u.$Zoom=Math.min(u.$Zoom,2)),s.$Zoom=1,p=t.$Rotate||0,u.$Rotate=p*360,s.$Rotate=0;else if(t.$Clip){var w={$Top:0,$Right:c,$Bottom:l,$Left:0},b=$Jssor$.$Extend({},w),f=b.$Offset={},k=t.$Clip&4,d=t.$Clip&8,g=t.$Clip&1,nt=t.$Clip&2;k&&d?(f.$Top=l/2*h,f.$Bottom=-f.$Top):k?f.$Bottom=-l*h:d&&(f.$Top=l*h);g&&nt?(f.$Left=c/2*h,f.$Right=-f.$Left):g?f.$Right=-c*h:nt&&(f.$Left=c*h);e.$Move=t.$Move;u.$Clip=b;s.$Clip=w}return a=0,v=0,t.x&&(a-=it*t.x),t.y&&(v-=rt*t.y),(a||v||e.$Move)&&(u.$Left=a+$Jssor$.$CssLeft(o),u.$Top=v+$Jssor$.$CssTop(o)),tt=t.$Duration,s=$Jssor$.$Extend(s,$Jssor$.$GetStyles(o,u)),e.$Setter=$Jssor$.$StyleSetterEx(),new $JssorAnimator$(t.$Delay,tt,e,o,s,u)}function c(n,t){return $Jssor$.$Each(t,function(t,i){var o;$JssorDebug$.$Execute(function(){if(t.length){var r=$Jssor$.$CssTop(t.$Elmt),u=$Jssor$.$CssLeft(t.$Elmt),f=$Jssor$.$CssWidth(t.$Elmt),e=$Jssor$.$CssHeight(t.$Elmt),n=null;isNaN(r)?n="Style 'top' for caption not specified. Please always specify caption like 'position: absolute; top: ...px; left: ...px; width: ...px; height: ...px;'.":isNaN(u)?n="Style 'left' not specified. Please always specify caption like 'position: absolute; top: ...px; left: ...px; width: ...px; height: ...px;'.":isNaN(f)?n="Style 'width' not specified. Please always specify caption like 'position: absolute; top: ...px; left: ...px; width: ...px; height: ...px;'.":isNaN(e)&&(n="Style 'height' not specified. Please always specify caption like 'position: absolute; top: ...px; left: ...px; width: ...px; height: ...px;'.");n&&$JssorDebug$.$Error("Caption "+(i+1)+" definition error, \r\n"+n+"\r\n"+t.$Elmt.outerHTML)}});var u,s=t.$Elmt,f=t[0],l=t[1];f&&(u=h(s,f),n=u.$Locate(f.$BeginTime==undefined?n:f.$BeginTime,1));n=c(n,t.$Children);l&&(o=h(s,l,1),o.$Locate(n,1),r.$Combine(o),e.$Combine(o));u&&r.$Combine(u)}),n}$JssorDebug$.$Execute(function(){t.$CaptionTransitions||$JssorDebug$.$Error("'$CaptionSliderOptions' option error, '$CaptionSliderOptions.$CaptionTransitions' not specified.")});var r=this,e,o=i?t.$PlayInMode:t.$PlayOutMode,f=t.$CaptionTransitions,l={$Transition:"t",$Delay:"d",$Duration:"du",x:"x",y:"y",$Rotate:"r",$Zoom:"z",$Opacity:"f",$BeginTime:"b"},u={$Default:function(n,t){return isNaN(t.$Value)?n*=t.$Percent:n=t.$Value,n},$Opacity:function(n,t){return this.$Default(n-1,t)}};u.$Zoom=u.$Opacity;$JssorAnimator$.call(r,0,0);r.$Revert=function(){r.$GoToPosition(r.$GetPosition_OuterEnd()*(i||0));e.$GoToBegin()};e=new $JssorAnimator$(0,0);c(0,o?s(n,1):[])},function(){(function(n){var r=this||eval("this"),i=r.document,f=r.navigator,t=r.jQuery,u=r.JSON;(function(n){"function"==typeof require&&"object"==typeof exports&&"object"==typeof module?n(module.exports||exports):"function"==typeof define&&define.amd?define(["exports"],n):n(r.ko={})})(function(e){function l(n,t){return null===n||typeof n in p?n===t:!1}function a(n,t,i,r){o.d[n]={init:function(n){return o.a.f.set(n,y,{}),{controlsDescendantBindings:!0}},update:function(n,u,f,e,s){f=o.a.f.get(n,y);u=o.a.c(u());e=!i!=!u;var h=!f.ob;(h||t||e!==f.Db)&&(h&&(f.ob=o.a.Ya(o.e.childNodes(n),!0)),e?(h||o.e.S(n,o.a.Ya(f.ob)),o.Ta(r?r(s,u):s,n)):o.e.Z(n),f.Db=e)}};o.g.Y[n]=!1;o.e.P[n]=!0}var o="undefined"!=typeof e?e:{},p,h,s,c,v,y;o.b=function(n,t){for(var i=n.split("."),r=o,u=0;u<i.length-1;u++)r=r[i[u]];r[i[i.length-1]]=t};o.s=function(n,t,i){n[t]=i};o.version="3.0.0";o.b("version",o.version);o.a=function(){function s(n,t){for(var i in n)n.hasOwnProperty(i)&&t(i,n[i])}function h(n,t){if("input"!==o.a.v(n)||!n.type||"click"!=t.toLowerCase())return!1;var i=n.type;return"checkbox"==i||"radio"==i}var c={},l={},a,e;return c[f&&/Firefox\/2/i.test(f.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"],c.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "),s(c,function(n,t){if(t.length)for(var i=0,r=t.length;i<r;i++)l[t[i]]=n}),a={propertychange:!0},e=i&&function(){for(var t=3,r=i.createElement("div"),u=r.getElementsByTagName("i");r.innerHTML="<!--[if gt IE "+ ++t+"]><i><\/i><![endif]-->",u[0];);return 4<t?t:n}(),{$a:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],n:function(n,t){for(var i=0,r=n.length;i<r;i++)t(n[i])},l:function(n,t){if("function"==typeof Array.prototype.indexOf)return Array.prototype.indexOf.call(n,t);for(var i=0,r=n.length;i<r;i++)if(n[i]===t)return i;return-1},Ua:function(n,t,i){for(var r=0,u=n.length;r<u;r++)if(t.call(i,n[r]))return n[r];return null},ia:function(n,t){var i=o.a.l(n,t);0<=i&&n.splice(i,1)},Va:function(n){n=n||[];for(var i=[],t=0,r=n.length;t<r;t++)0>o.a.l(i,n[t])&&i.push(n[t]);return i},ha:function(n,t){n=n||[];for(var r=[],i=0,u=n.length;i<u;i++)r.push(t(n[i]));return r},ga:function(n,t){n=n||[];for(var r=[],i=0,u=n.length;i<u;i++)t(n[i])&&r.push(n[i]);return r},X:function(n,t){if(t instanceof Array)n.push.apply(n,t);else for(var i=0,r=t.length;i<r;i++)n.push(t[i]);return n},V:function(n,t,i){var r=o.a.l(o.a.Ha(n),t);0>r?i&&n.push(t):i||n.splice(r,1)},extend:function(n,t){if(t)for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);return n},K:s,Da:function(n,t){if(!n)return n;var r={},i;for(i in n)n.hasOwnProperty(i)&&(r[i]=t(n[i],i,n));return r},wa:function(n){for(;n.firstChild;)o.removeNode(n.firstChild)},Vb:function(n){n=o.a.Q(n);for(var r=i.createElement("div"),t=0,u=n.length;t<u;t++)r.appendChild(o.L(n[t]));return r},Ya:function(n,t){for(var r,i=0,f=n.length,u=[];i<f;i++)r=n[i].cloneNode(!0),u.push(t?o.L(r):r);return u},S:function(n,t){if(o.a.wa(n),t)for(var i=0,r=t.length;i<r;i++)n.appendChild(t[i])},nb:function(n,t){var r=n.nodeType?[n]:n;if(0<r.length){for(var f=r[0],e=f.parentNode,i=0,u=t.length;i<u;i++)e.insertBefore(t[i],f);for(i=0,u=r.length;i<u;i++)o.removeNode(r[i])}},$:function(n,t){if(n.length){for(t=8===t.nodeType&&t.parentNode||t;n.length&&n[0].parentNode!==t;)n.splice(0,1);if(1<n.length){var i=n[0],r=n[n.length-1];for(n.length=0;i!==r;)if(n.push(i),i=i.nextSibling,!i)return;n.push(r)}}return n},qb:function(n,t){7>e?n.setAttribute("selected",t):n.selected=t},la:function(t){return null===t||t===n?"":t.trim?t.trim():t.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},ec:function(n,t){for(var r,u=[],f=(n||"").split(t),i=0,e=f.length;i<e;i++)r=o.a.la(f[i]),""!==r&&u.push(r);return u},ac:function(n,t){return n=n||"",t.length>n.length?!1:n.substring(0,t.length)===t},Gb:function(n,t){if(n===t)return!0;if(11===n.nodeType)return!1;if(t.contains)return t.contains(3===n.nodeType?n.parentNode:n);if(t.compareDocumentPosition)return 16==(t.compareDocumentPosition(n)&16);for(;n&&n!=t;)n=n.parentNode;return!!n},va:function(n){return o.a.Gb(n,n.ownerDocument.documentElement)},Ra:function(n){return!!o.a.Ua(n,o.a.va)},v:function(n){return n&&n.tagName&&n.tagName.toLowerCase()},r:function(n,i,r){var s=e&&a[i],u,f,c;if(s||"undefined"==typeof t)if(s||"function"!=typeof n.addEventListener)if("undefined"!=typeof n.attachEvent)u=function(t){r.call(n,t)},f="on"+i,n.attachEvent(f,u),o.a.C.ea(n,function(){n.detachEvent(f,u)});else throw Error("Browser doesn't support addEventListener or attachEvent");else n.addEventListener(i,r,!1);else h(n,i)&&(c=r,r=function(n,t){var i=this.checked;t&&(this.checked=!0!==t.Ab);c.call(this,n);this.checked=i}),t(n).bind(i,r)},da:function(n,u){if(!n||!n.nodeType)throw Error("element must be a DOM node when calling triggerEvent");if("undefined"!=typeof t){var f=[];h(n,u)&&f.push({Ab:n.checked});t(n).trigger(u,f)}else if("function"==typeof i.createEvent)if("function"==typeof n.dispatchEvent)f=i.createEvent(l[u]||"HTMLEvents"),f.initEvent(u,!0,!0,r,0,0,0,0,0,!1,!1,!1,!1,0,n),n.dispatchEvent(f);else throw Error("The supplied element doesn't support dispatchEvent");else if("undefined"!=typeof n.fireEvent)h(n,u)&&(n.checked=!0!==n.checked),n.fireEvent("on"+u);else throw Error("Browser doesn't support triggering events");},c:function(n){return o.M(n)?n():n},Ha:function(n){return o.M(n)?n.t():n},ma:function(n,t,i){if(t){var r=/\S+/g,u=n.className.match(r)||[];o.a.n(t.match(r),function(n){o.a.V(u,n,i)});n.className=u.join(" ")}},Ma:function(t,r){var u=o.a.c(r),f;(null===u||u===n)&&(u="");f=o.e.firstChild(t);!f||3!=f.nodeType||o.e.nextSibling(f)?o.e.S(t,[i.createTextNode(u)]):f.data=u;o.a.Jb(t)},pb:function(n,t){if(n.name=t,7>=e)try{n.mergeAttributes(i.createElement("<input name='"+n.name+"'/>"),!1)}catch(r){}},Jb:function(n){9<=e&&(n=1==n.nodeType?n:n.parentNode,n.style&&(n.style.zoom=n.style.zoom))},Hb:function(n){if(e){var t=n.style.width;n.style.width=0;n.style.width=t}},Zb:function(n,t){n=o.a.c(n);t=o.a.c(t);for(var r=[],i=n;i<=t;i++)r.push(i);return r},Q:function(n){for(var i=[],t=0,r=n.length;t<r;t++)i.push(n[t]);return i},cc:6===e,dc:7===e,ja:e,ab:function(n,t){for(var r=o.a.Q(n.getElementsByTagName("input")).concat(o.a.Q(n.getElementsByTagName("textarea"))),f="string"==typeof t?function(n){return n.name===t}:function(n){return t.test(n.name)},u=[],i=r.length-1;0<=i;i--)f(r[i])&&u.push(r[i]);return u},Wb:function(n){return"string"==typeof n&&(n=o.a.la(n))?u&&u.parse?u.parse(n):new Function("return "+n)():null},Na:function(n,t,i){if(!u||!u.stringify)throw Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js");return u.stringify(o.a.c(n),t,i)},Xb:function(n,t,r){var c,e,h,f,u,l;r=r||{};var a=r.params||{},v=r.includeFields||this.$a,c=n;if("object"==typeof n&&"form"===o.a.v(n))for(c=n.action,e=v.length-1;0<=e;e--)for(h=o.a.ab(n,v[e]),f=h.length-1;0<=f;f--)a[h[f].name]=h[f].value;t=o.a.c(t);u=i.createElement("form");u.style.display="none";u.action=c;u.method="post";for(l in t)n=i.createElement("input"),n.name=l,n.value=o.a.Na(o.a.c(t[l])),u.appendChild(n);s(a,function(n,t){var r=i.createElement("input");r.name=n;r.value=t;u.appendChild(r)});i.body.appendChild(u);r.submitter?r.submitter(u):u.submit();setTimeout(function(){u.parentNode.removeChild(u)},0)}}}();o.b("utils",o.a);o.b("utils.arrayForEach",o.a.n);o.b("utils.arrayFirst",o.a.Ua);o.b("utils.arrayFilter",o.a.ga);o.b("utils.arrayGetDistinctValues",o.a.Va);o.b("utils.arrayIndexOf",o.a.l);o.b("utils.arrayMap",o.a.ha);o.b("utils.arrayPushAll",o.a.X);o.b("utils.arrayRemoveItem",o.a.ia);o.b("utils.extend",o.a.extend);o.b("utils.fieldsIncludedWithJsonPost",o.a.$a);o.b("utils.getFormFields",o.a.ab);o.b("utils.peekObservable",o.a.Ha);o.b("utils.postJson",o.a.Xb);o.b("utils.parseJson",o.a.Wb);o.b("utils.registerEventHandler",o.a.r);o.b("utils.stringifyJson",o.a.Na);o.b("utils.range",o.a.Zb);o.b("utils.toggleDomNodeCssClass",o.a.ma);o.b("utils.triggerEvent",o.a.da);o.b("utils.unwrapObservable",o.a.c);o.b("utils.objectForEach",o.a.K);o.b("utils.addOrRemoveItem",o.a.V);o.b("unwrap",o.a.c);Function.prototype.bind||(Function.prototype.bind=function(n){var i=this,t=Array.prototype.slice.call(arguments);return n=t.shift(),function(){return i.apply(n,t.concat(Array.prototype.slice.call(arguments)))}});o.a.f=new function(){function r(r,f){var e=r[t];if(!e||"null"===e||!i[e]){if(!f)return n;e=r[t]="ko"+u++;i[e]={}}return i[e]}var u=0,t="__ko__"+(new Date).getTime(),i={};return{get:function(t,i){var u=r(t,!1);return u===n?n:u[i]},set:function(t,i,u){(u!==n||r(t,!1)!==n)&&(r(t,!0)[i]=u)},clear:function(n){var r=n[t];return r?(delete i[r],n[t]=null,!0):!1},D:function(){return u+++t}}};o.b("utils.domData",o.a.f);o.b("utils.domData.clear",o.a.f.clear);o.a.C=new function(){function i(t,i){var r=o.a.f.get(t,u);return r===n&&i&&(r=[],o.a.f.set(t,u,r)),r}function r(n){var u=i(n,!1),e;if(u)for(u=u.slice(0),e=0;e<u.length;e++)u[e](n);if(o.a.f.clear(n),"function"==typeof t&&"function"==typeof t.cleanData&&t.cleanData([n]),f[n.nodeType])for(u=n.firstChild;n=u;)u=n.nextSibling,8===n.nodeType&&r(n)}var u=o.a.f.D(),e={1:!0,8:!0,9:!0},f={1:!0,9:!0};return{ea:function(n,t){if("function"!=typeof t)throw Error("Callback must be a function");i(n,!0).push(t)},mb:function(t,r){var f=i(t,!1);f&&(o.a.ia(f,r),0==f.length&&o.a.f.set(t,u,n))},L:function(n){var t,i,u;if(e[n.nodeType]&&(r(n),f[n.nodeType]))for(t=[],o.a.X(t,n.getElementsByTagName("*")),i=0,u=t.length;i<u;i++)r(t[i]);return n},removeNode:function(n){o.L(n);n.parentNode&&n.parentNode.removeChild(n)}}};o.L=o.a.C.L;o.removeNode=o.a.C.removeNode;o.b("cleanNode",o.L);o.b("removeNode",o.removeNode);o.b("utils.domNodeDisposal",o.a.C);o.b("utils.domNodeDisposal.addDisposeCallback",o.a.C.ea);o.b("utils.domNodeDisposal.removeDisposeCallback",o.a.C.mb),function(){o.a.Fa=function(n){var u,f;if("undefined"!=typeof t){if(t.parseHTML)u=t.parseHTML(n)||[];else if((u=t.clean([n]))&&u[0]){for(n=u[0];n.parentNode&&11!==n.parentNode.nodeType;)n=n.parentNode;n.parentNode&&n.parentNode.removeChild(n)}}else{for(f=o.a.la(n).toLowerCase(),u=i.createElement("div"),f=f.match(/^<(thead|tbody|tfoot)/)&&[1,"<table>","<\/table>"]||!f.indexOf("<tr")&&[2,"<table><tbody>","<\/tbody><\/table>"]||(!f.indexOf("<td")||!f.indexOf("<th"))&&[3,"<table><tbody><tr>","<\/tr><\/tbody><\/table>"]||[0,"",""],n="ignored<div>"+f[1]+n+f[2]+"<\/div>","function"==typeof r.innerShiv?u.appendChild(r.innerShiv(n)):u.innerHTML=n;f[0]--;)u=u.lastChild;u=o.a.Q(u.lastChild.childNodes)}return u};o.a.Ka=function(i,r){if(o.a.wa(i),r=o.a.c(r),null!==r&&r!==n)if("string"!=typeof r&&(r=r.toString()),"undefined"!=typeof t)t(i).html(r);else for(var f=o.a.Fa(r),u=0;u<f.length;u++)i.appendChild(f[u])}}();o.b("utils.parseHtmlFragment",o.a.Fa);o.b("utils.setHtml",o.a.Ka);o.u=function(){function i(n,t){var r;if(n)if(8==n.nodeType)r=o.u.jb(n.nodeValue),null!=r&&t.push({Fb:n,Tb:r});else if(1==n.nodeType)for(var r=0,u=n.childNodes,f=u.length;r<f;r++)i(u[r],t)}var t={};return{Ca:function(n){if("function"!=typeof n)throw Error("You can only pass a function to ko.memoization.memoize()");var i=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);return t[i]=n,"<!--[ko_memo:"+i+"]-->"},ub:function(i,r){var u=t[i];if(u===n)throw Error("Couldn't find any memo with ID "+i+". Perhaps it's already been unmemoized.");try{return u.apply(null,r||[]),!0}finally{delete t[i]}},vb:function(n,t){var f=[],u,s,r,e;for(i(n,f),u=0,s=f.length;u<s;u++)r=f[u].Fb,e=[r],t&&o.a.X(e,t),o.u.ub(f[u].Tb,e),r.nodeValue="",r.parentNode&&r.parentNode.removeChild(r)},jb:function(n){return(n=n.match(/^\[ko_memo\:(.*?)\]$/))?n[1]:null}}}();o.b("memoization",o.u);o.b("memoization.memoize",o.u.Ca);o.b("memoization.unmemoize",o.u.ub);o.b("memoization.parseMemoText",o.u.jb);o.b("memoization.unmemoizeDomNodeAndDescendants",o.u.vb);o.xa={throttle:function(n,t){n.throttleEvaluation=t;var i=null;return o.h({read:n,write:function(r){clearTimeout(i);i=setTimeout(function(){n(r)},t)}})},notify:function(n,t){n.equalityComparer="always"==t?null:l}};p={undefined:1,boolean:1,number:1,string:1};o.b("extenders",o.xa);o.sb=function(n,t,i){this.target=n;this.qa=t;this.Eb=i;o.s(this,"dispose",this.B)};o.sb.prototype.B=function(){this.Qb=!0;this.Eb()};o.ca=function(){this.F={};o.a.extend(this,o.ca.fn);o.s(this,"subscribe",this.T);o.s(this,"extend",this.extend);o.s(this,"getSubscriptionsCount",this.Lb)};h="change";o.ca.fn={T:function(n,t,i){i=i||h;var r=new o.sb(this,t?n.bind(t):n,function(){o.a.ia(this.F[i],r)}.bind(this));return this.F[i]||(this.F[i]=[]),this.F[i].push(r),r},notifySubscribers:function(n,t){if(t=t||h,this.cb(t))try{o.i.Wa();for(var u=this.F[t].slice(0),r=0,i;i=u[r];++r)i&&!0!==i.Qb&&i.qa(n)}finally{o.i.end()}},cb:function(n){return this.F[n]&&this.F[n].length},Lb:function(){var n=0;return o.a.K(this.F,function(t,i){n+=i.length}),n},extend:function(n){var t=this;return n&&o.a.K(n,function(n,i){var r=o.xa[n];"function"==typeof r&&(t=r(t,i)||t)}),t}};o.fb=function(n){return null!=n&&"function"==typeof n.T&&"function"==typeof n.notifySubscribers};o.b("subscribable",o.ca);o.b("isSubscribable",o.fb);o.i=function(){var n=[];return{Wa:function(t){n.push(t&&{qa:t,Za:[]})},end:function(){n.pop()},lb:function(t){if(!o.fb(t))throw Error("Only subscribable things can act as dependencies");if(0<n.length){var i=n[n.length-1];!i||0<=o.a.l(i.Za,t)||(i.Za.push(t),i.qa(t))}},p:function(t,i,r){try{return n.push(null),t.apply(i,r||[])}finally{n.pop()}}}}();o.q=function(n){function t(){return 0<arguments.length?(t.equalityComparer&&t.equalityComparer(i,arguments[0])||(t.O(),i=arguments[0],t.N()),this):(o.i.lb(t),i)}var i=n;return o.ca.call(t),t.t=function(){return i},t.N=function(){t.notifySubscribers(i)},t.O=function(){t.notifySubscribers(i,"beforeChange")},o.a.extend(t,o.q.fn),o.s(t,"peek",t.t),o.s(t,"valueHasMutated",t.N),o.s(t,"valueWillMutate",t.O),t};o.q.fn={equalityComparer:l};s=o.q.Yb="__ko_proto__";o.q.fn[s]=o.q;o.ya=function(t,i){return null===t||t===n||t[s]===n?!1:t[s]===i?!0:o.ya(t[s],i)};o.M=function(n){return o.ya(n,o.q)};o.gb=function(n){return"function"==typeof n&&n[s]===o.q||"function"==typeof n&&n[s]===o.h&&n.Nb?!0:!1};o.b("observable",o.q);o.b("isObservable",o.M);o.b("isWriteableObservable",o.gb);o.ba=function(n){if(n=n||[],"object"!=typeof n||!("length"in n))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");return n=o.q(n),o.a.extend(n,o.ba.fn),n.extend({trackArrayChanges:!0})};o.ba.fn={remove:function(n){for(var u,r=this.t(),i=[],f="function"!=typeof n||o.M(n)?function(t){return t===n}:n,t=0;t<r.length;t++)u=r[t],f(u)&&(0===i.length&&this.O(),i.push(u),r.splice(t,1),t--);return i.length&&this.N(),i},removeAll:function(t){if(t===n){var i=this.t(),r=i.slice(0);return this.O(),i.splice(0,i.length),this.N(),r}return t?this.remove(function(n){return 0<=o.a.l(t,n)}):[]},destroy:function(n){var i=this.t(),r="function"!=typeof n||o.M(n)?function(t){return t===n}:n,t;for(this.O(),t=i.length-1;0<=t;t--)r(i[t])&&(i[t]._destroy=!0);this.N()},destroyAll:function(t){return t===n?this.destroy(function(){return!0}):t?this.destroy(function(n){return 0<=o.a.l(t,n)}):[]},indexOf:function(n){var t=this();return o.a.l(t,n)},replace:function(n,t){var i=this.indexOf(n);0<=i&&(this.O(),this.t()[i]=t,this.N())}};o.a.n("pop push reverse shift sort splice unshift".split(" "),function(n){o.ba.fn[n]=function(){var t=this.t();return this.O(),this.Xa(t,n,arguments),t=t[n].apply(t,arguments),this.N(),t}});o.a.n(["slice"],function(n){o.ba.fn[n]=function(){var t=this();return t[n].apply(t,arguments)}});o.b("observableArray",o.ba);c="arrayChange";o.xa.trackArrayChanges=function(n){function u(){var f,u;r||(r=!0,f=n.notifySubscribers,n.notifySubscribers=function(n,t){return t&&t!==h||++i,f.apply(this,arguments)},u=[].concat(n.t()||[]),t=null,n.T(function(r){if(r=[].concat(r||[]),n.cb(c)){var f;(!t||1<i)&&(t=o.a.ra(u,r,{sparse:!0}));f=t;f.length&&n.notifySubscribers(f,c)}u=r;t=null;i=0}))}if(!n.Xa){var r=!1,t=null,i=0,f=n.T;n.T=n.subscribe=function(n,t,i){return i===c&&u(),f.apply(this,arguments)};n.Xa=function(n,u,f){function h(n,t,i){c.push({status:n,value:t,index:i})}if(r&&!i){var c=[],e=n.length,s=f.length,o=0;switch(u){case"push":o=e;case"unshift":for(u=0;u<s;u++)h("added",f[u],o+u);break;case"pop":o=e-1;case"shift":e&&h("deleted",n[o],o);break;case"splice":u=Math.min(Math.max(0,0>f[0]?e+f[0]:f[0]),e);for(var e=1===s?e:Math.min(u+(f[1]||0),e),s=u+s-2,o=Math.max(e,s),l=2;u<o;++u,++l)u<e&&h("deleted",n[u],u),u<s&&h("added",f[l],u);break;default:return}t=c}}}};o.h=function(t,i,r){function b(){o.a.n(e,function(n){n.B()});e=[]}function nt(){var n=u.throttleEvaluation;n&&0<=n?(clearTimeout(g),g=setTimeout(l,n)):l()}function l(){var t,h,r;if(!v){if(w&&w()){if(!y){c();a=!0;return}}else y=!1;v=!0;try{for(t=o.a.ha(e,function(n){return n.target}),o.i.Wa(function(i){var r;0<=(r=o.a.l(t,i))?t[r]=n:e.push(i.T(nt))}),h=i?f.call(i):f(),r=t.length-1;0<=r;r--)t[r]&&e.splice(r,1)[0].B();a=!0;u.equalityComparer&&u.equalityComparer(s,h)||(u.notifySubscribers(s,"beforeChange"),s=h,u.notifySubscribers(s))}finally{o.i.end();v=!1}e.length||c()}}function u(){if(0<arguments.length){if("function"==typeof d)d.apply(i,arguments);else throw Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.");return this}return a||l(),o.i.lb(u),s}function k(){return!a||0<e.length}var s,a=!1,v=!1,y=!1,f=t;if(f&&"object"==typeof f?(r=f,f=r.read):(r=r||{},f||(f=r.read)),"function"!=typeof f)throw Error("Pass a function that returns the value of the ko.computed");var d=r.write,h=r.disposeWhenNodeIsRemoved||r.I||null,p=r.disposeWhen||r.ua,w=p,c=b,e=[],g=null;return i||(i=r.owner),u.t=function(){return a||l(),s},u.Kb=function(){return e.length},u.Nb="function"==typeof r.write,u.B=function(){c()},u.aa=k,o.ca.call(u),o.a.extend(u,o.h.fn),o.s(u,"peek",u.t),o.s(u,"dispose",u.B),o.s(u,"isActive",u.aa),o.s(u,"getDependenciesCount",u.Kb),h&&(y=!0,h.nodeType&&(w=function(){return!o.a.va(h)||p&&p()})),!0!==r.deferEvaluation&&l(),h&&k()&&(c=function(){o.a.C.mb(h,c);b()},o.a.C.ea(h,c)),u};o.Pb=function(n){return o.ya(n,o.h)};e=o.q.Yb;o.h[e]=o.q;o.h.fn={equalityComparer:l};o.h.fn[e]=o.h;o.b("dependentObservable",o.h);o.b("computed",o.h);o.b("isComputed",o.Pb),function(){function t(u,f,e){if(e=e||new i,u=f(u),"object"!=typeof u||null===u||u===n||u instanceof Date||u instanceof String||u instanceof Number||u instanceof Boolean)return u;var o=u instanceof Array?[]:{};return e.save(u,o),r(u,function(i){var r=f(u[i]),s;switch(typeof r){case"boolean":case"number":case"string":case"function":o[i]=r;break;case"object":case"undefined":s=e.get(r);o[i]=s!==n?s:t(r,f,e)}}),o}function r(n,t){if(n instanceof Array){for(var i=0;i<n.length;i++)t(i);"function"==typeof n.toJSON&&t("toJSON")}else for(i in n)t(i)}function i(){this.keys=[];this.Qa=[]}o.tb=function(n){if(0==arguments.length)throw Error("When calling ko.toJS, pass the object you want to convert.");return t(n,function(n){for(var t=0;o.M(n)&&10>t;t++)n=n();return n})};o.toJSON=function(n,t,i){return n=o.tb(n),o.a.Na(n,t,i)};i.prototype={save:function(n,t){var i=o.a.l(this.keys,n);0<=i?this.Qa[i]=t:(this.keys.push(n),this.Qa.push(t))},get:function(t){return t=o.a.l(this.keys,t),0<=t?this.Qa[t]:n}}}();o.b("toJS",o.tb);o.b("toJSON",o.toJSON),function(){o.k={o:function(t){switch(o.a.v(t)){case"option":return!0===t.__ko__hasDomDataOptionValue__?o.a.f.get(t,o.d.options.Ea):7>=o.a.ja?t.getAttributeNode("value")&&t.getAttributeNode("value").specified?t.value:t.text:t.value;case"select":return 0<=t.selectedIndex?o.k.o(t.options[t.selectedIndex]):n;default:return t.value}},na:function(t,i){switch(o.a.v(t)){case"option":switch(typeof i){case"string":o.a.f.set(t,o.d.options.Ea,n);"__ko__hasDomDataOptionValue__"in t&&delete t.__ko__hasDomDataOptionValue__;t.value=i;break;default:o.a.f.set(t,o.d.options.Ea,i);t.__ko__hasDomDataOptionValue__=!0;t.value="number"==typeof i?i:""}break;case"select":""===i&&(i=n);(null===i||i===n)&&(t.selectedIndex=-1);for(var r=t.options.length-1;0<=r;r--)if(o.k.o(t.options[r])==i){t.selectedIndex=r;break}1<t.size||-1!==t.selectedIndex||(t.selectedIndex=0);break;default:(null===i||i===n)&&(i="");t.value=i}}}}();o.b("selectExtensions",o.k);o.b("selectExtensions.readValue",o.k.o);o.b("selectExtensions.writeValue",o.k.na);o.g=function(){function n(n){var c,r,i;n=o.a.la(n);123===n.charCodeAt(0)&&(n=n.slice(1,-1));var a=[],s=n.match(t),h,u,l=0;if(s)for(s.push(","),c=0;r=s[c];++c){if(i=r.charCodeAt(0),44===i){if(0>=l){h&&a.push(u?{key:h,value:u.join("")}:{unknown:h});h=u=l=0;continue}}else if(58===i){if(!u)continue}else if(47===i&&c&&1<r.length)(i=s[c-1].match(f))&&!e[i[0]]&&(n=n.substr(n.indexOf(r)+1),s=n.match(t),s.push(","),c=-1,r="/");else if(40===i||123===i||91===i)++l;else if(41===i||125===i||93===i)--l;else if(!h&&!u){h=34===i||39===i?r.slice(1,-1):r;continue}u?u.push(r):u=[r]}return a}var r=["true","false","null","undefined"],u=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,t=RegExp("\"(?:[^\"\\\\]|\\\\.)*\"|'(?:[^'\\\\]|\\\\.)*'|/(?:[^/\\\\]|\\\\.)*/w*|[^\\s:,/][^,\"'{}()/:[\\]]*[^\\s,\"'{}()/:[\\]]|[^\\s]","g"),f=/[\])"'A-Za-z0-9_$]+$/,e={"in":1,"return":1,"typeof":1},i={};return{Y:[],U:i,Ga:n,ka:function(t,f){function e(n,t){var l,f=o.getBindingHandler(n);(f&&f.preprocess?t=f.preprocess(t,n,e):1)&&((f=i[n])&&(l=t,0<=o.a.l(r,l)?l=!1:(f=l.match(u),l=null===f?!1:f[1]?"Object("+f[1]+")"+f[2]:l),f=l),f&&s.push("'"+n+"':function(_z){"+l+"=_z}"),c&&(t="function(){return "+t+" }"),h.push("'"+n+"':"+t))}f=f||{};var h=[],s=[],c=f.valueAccessors,l="string"==typeof t?n(t):t;return o.a.n(l,function(n){e(n.key||n.unknown,n.value)}),s.length&&e("_ko_property_writers","{"+s.join(",")+"}"),h.join(",")},Sb:function(n,t){for(var i=0;i<n.length;i++)if(n[i].key==t)return!0;return!1},oa:function(n,t,i,r,u){n&&o.M(n)?!o.gb(n)||u&&n.t()===r||n(r):(n=t.get("_ko_property_writers"))&&n[i]&&n[i](r)}}}();o.b("expressionRewriting",o.g);o.b("expressionRewriting.bindingRewriteValidators",o.g.Y);o.b("expressionRewriting.parseObjectLiteral",o.g.Ga);o.b("expressionRewriting.preProcessBindings",o.g.ka);o.b("expressionRewriting._twoWayBindings",o.g.U);o.b("jsonExpressionRewriting",o.g);o.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",o.g.ka),function(){function n(n){return 8==n.nodeType&&e.test(t?n.text:n.nodeValue)}function r(n){return 8==n.nodeType&&s.test(t?n.text:n.nodeValue)}function u(t,i){for(var u=t,f=1,e=[];u=u.nextSibling;){if(r(u)&&(f--,0===f))return e;e.push(u);n(u)&&f++}if(!i)throw Error("Cannot find closing comment tag to match: "+t.nodeValue);return null}function f(n,t){var i=u(n,t);return i?0<i.length?i[i.length-1].nextSibling:n.nextSibling:null}var t=i&&"<!--test-->"===i.createComment("test").text,e=t?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,s=t?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,h={ul:!0,ol:!0};o.e={P:{},childNodes:function(t){return n(t)?u(t):t.childNodes},Z:function(t){if(n(t)){t=o.e.childNodes(t);for(var i=0,r=t.length;i<r;i++)o.removeNode(t[i])}else o.a.wa(t)},S:function(t,i){if(n(t)){o.e.Z(t);for(var u=t.nextSibling,r=0,f=i.length;r<f;r++)u.parentNode.insertBefore(i[r],u)}else o.a.S(t,i)},kb:function(t,i){n(t)?t.parentNode.insertBefore(i,t.nextSibling):t.firstChild?t.insertBefore(i,t.firstChild):t.appendChild(i)},eb:function(t,i,r){r?n(t)?t.parentNode.insertBefore(i,r.nextSibling):r.nextSibling?t.insertBefore(i,r.nextSibling):t.appendChild(i):o.e.kb(t,i)},firstChild:function(t){return n(t)?!t.nextSibling||r(t.nextSibling)?null:t.nextSibling:t.firstChild},nextSibling:function(t){return n(t)&&(t=f(t)),t.nextSibling&&r(t.nextSibling)?null:t.nextSibling},Mb:n,bc:function(n){return(n=(t?n.text:n.nodeValue).match(e))?n[1]:null},ib:function(t){var s,i,u,e;if(h[o.a.v(t)]&&(s=t.firstChild,s))do if(1===s.nodeType){if(i=s.firstChild,u=null,i)do u?u.push(i):n(i)?(e=f(i,!0),e?i=e:u=[i]):r(i)&&(u=[i]);while(i=i.nextSibling);if(i=u)for(u=s.nextSibling,e=0;e<i.length;e++)u?t.insertBefore(i[e],u):t.appendChild(i[e])}while(s=s.nextSibling)}}}();o.b("virtualElements",o.e);o.b("virtualElements.allowedBindings",o.e.P);o.b("virtualElements.emptyNode",o.e.Z);o.b("virtualElements.insertAfter",o.e.eb);o.b("virtualElements.prepend",o.e.kb);o.b("virtualElements.setDomNodeChildren",o.e.S),function(){o.H=function(){this.zb={}};o.a.extend(o.H.prototype,{nodeHasBindings:function(n){switch(n.nodeType){case 1:return null!=n.getAttribute("data-bind");case 8:return o.e.Mb(n);default:return!1}},getBindings:function(n,t){var i=this.getBindingsString(n,t);return i?this.parseBindingsString(i,t,n):null},getBindingAccessors:function(n,t){var i=this.getBindingsString(n,t);return i?this.parseBindingsString(i,t,n,{valueAccessors:!0}):null},getBindingsString:function(n){switch(n.nodeType){case 1:return n.getAttribute("data-bind");case 8:return o.e.bc(n);default:return null}},parseBindingsString:function(n,t,i,r){var u,f,e,h,c;try{return u=this.zb,f=n+(r&&r.valueAccessors||""),(e=u[f])||(c="with($context){with($data||{}){return{"+o.g.ka(n,r)+"}}}",h=new Function("$context","$element",c),e=u[f]=h),e(t,i)}catch(s){throw s.message="Unable to parse bindings.\nBindings value: "+n+"\nMessage: "+s.message,s;}}});o.H.instance=new o.H}();o.b("bindingProvider",o.H),function(){function a(n){return function(){return n}}function i(n){return n()}function e(n){return o.a.Da(o.i.p(n),function(t,i){return function(){return n()[i]}})}function v(n,t){return e(this.getBindings.bind(this,n,t))}function s(n,t,i){var r,u=o.e.firstChild(t),f=o.H.instance,e=f.preprocessNode;if(e){for(;r=u;)u=o.e.nextSibling(r),e.call(f,r);u=o.e.firstChild(t)}for(;r=u;)u=o.e.nextSibling(r),h(n,r,i)}function h(n,t,i){var u=!0,r=1===t.nodeType;r&&o.e.ib(t);(r&&i||o.H.instance.nodeHasBindings(t))&&(u=c(t,null,n,i).shouldBindDescendants);u&&!l[o.a.v(t)]&&s(n,t,!r)}function y(n){var i=[],r={},t=[];return o.a.K(n,function u(f){if(!r[f]){var e=o.getBindingHandler(f);e&&(e.after&&(t.push(f),o.a.n(e.after,function(i){if(n[i]){if(-1!==o.a.l(t,i))throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+t.join(", "));u(i)}}),t.pop()),i.push({key:f,bb:e}));r[f]=!0}}),i}function c(t,r,f,e){var b=o.a.f.get(t,u),s,l,w,h,a,p,c;if(!r){if(b)throw Error("You cannot apply bindings multiple times to the same element.");o.a.f.set(t,u,!0)}return!b&&e&&o.rb(t,f),r&&"function"!=typeof r?s=r:(l=o.H.instance,w=l.getBindingAccessors||v,r||f.A?(h=o.h(function(){return(s=r?r(f,t):w.call(l,t,f))&&f.A&&f.A(),s},null,{I:t}),s&&h.aa()||(h=null)):s=o.i.p(w,l,[t,f])),s&&(p=h?function(n){return function(){return i(h()[n])}}:function(n){return s[n]},c=function(){return o.a.Da(h?h():s,i)},c.get=function(n){return s[n]&&i(p(n))},c.has=function(n){return n in s},e=y(s),o.a.n(e,function(i){var e=i.bb.init,h=i.bb.update,r=i.key;if(8===t.nodeType&&!o.e.P[r])throw Error("The binding '"+r+"' cannot be used with virtual elements");try{"function"==typeof e&&o.i.p(function(){var i=e(t,p(r),c,f.$data,f);if(i&&i.controlsDescendantBindings){if(a!==n)throw Error("Multiple bindings ("+a+" and "+r+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");a=r}});"function"==typeof h&&o.h(function(){h(t,p(r),c,f.$data,f)},null,{I:t})}catch(u){throw u.message='Unable to process binding "'+r+": "+s[r]+'"\nMessage: '+u.message,u;}})),{shouldBindDescendants:a===n}}function t(n){return n&&n instanceof o.G?n:new o.G(n)}var l,u,f;o.d={};l={script:!0};o.getBindingHandler=function(n){return o.d[n]};o.G=function(t,i,r,u){var f=this,h="function"==typeof t,s,e=o.h(function(){var n=h?t():t;return i?(i.A&&i.A(),o.a.extend(f,i),e&&(f.A=e)):(f.$parents=[],f.$root=n,f.ko=o),f.$rawData=t,f.$data=n,r&&(f[r]=n),u&&u(f,i,n),f.$data},null,{ua:function(){return s&&!o.a.Ra(s)},I:!0});e.aa()&&(f.A=e,e.equalityComparer=null,s=[],e.wb=function(t){s.push(t);o.a.C.ea(t,function(t){o.a.ia(s,t);s.length||(e.B(),f.A=e=n)})})};o.G.prototype.createChildContext=function(n,t,i){return new o.G(n,this,t,function(n,t){n.$parentContext=t;n.$parent=t.$data;n.$parents=(t.$parents||[]).slice(0);n.$parents.unshift(n.$parent);i&&i(n)})};o.G.prototype.extend=function(n){return new o.G(this.$rawData,this,null,function(t){o.a.extend(t,"function"==typeof n?n():n)})};u=o.a.f.D();f=o.a.f.D();o.rb=function(n,t){if(2==arguments.length)o.a.f.set(n,f,t),t.A&&t.A.wb(n);else return o.a.f.get(n,f)};o.pa=function(n,i,r){return 1===n.nodeType&&o.e.ib(n),c(n,i,t(r),!0)};o.xb=function(n,i,r){return r=t(r),o.pa(n,"function"==typeof i?e(i.bind(null,r,n)):o.a.Da(i,a),r)};o.Ta=function(n,i){1!==i.nodeType&&8!==i.nodeType||s(t(n),i,!0)};o.Sa=function(n,i){if(i&&1!==i.nodeType&&8!==i.nodeType)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");i=i||r.document.body;h(t(n),i,!0)};o.ta=function(t){switch(t.nodeType){case 1:case 8:var i=o.rb(t);if(i)return i;if(t.parentNode)return o.ta(t.parentNode)}return n};o.Cb=function(t){return(t=o.ta(t))?t.$data:n};o.b("bindingHandlers",o.d);o.b("applyBindings",o.Sa);o.b("applyBindingsToDescendants",o.Ta);o.b("applyBindingAccessorsToNode",o.pa);o.b("applyBindingsToNode",o.xb);o.b("contextFor",o.ta);o.b("dataFor",o.Cb)}();v={"class":"className","for":"htmlFor"};o.d.attr={update:function(t,i){var r=o.a.c(i())||{};o.a.K(r,function(i,r){r=o.a.c(r);var u=!1===r||null===r||r===n;u&&t.removeAttribute(i);8>=o.a.ja&&i in v?(i=v[i],u?t.removeAttribute(i):t[i]=r):u||t.setAttribute(i,r.toString());"name"===i&&o.a.pb(t,u?"":r.toString())})}},function(){o.d.checked={after:["value","attr"],init:function(t,i,r){function u(){return r.has("checkedValue")?o.a.c(r.get("checkedValue")):t.value}function c(){var c=t.checked,n=v?u():c,s;l&&(!f||c)&&(s=o.i.p(i),e?h!==n?(c&&(o.a.V(s,n,!0),o.a.V(s,h,!1)),h=n):o.a.V(s,n,c):o.g.oa(s,r,"checked",n,!0))}function a(){var n=o.a.c(i());t.checked=e?0<=o.a.l(n,u()):s?n:u()===n}var s="checkbox"==t.type,f="radio"==t.type;if(s||f){var e=s&&o.a.c(i())instanceof Array,h=e?u():n,v=f||e,l=!1;f&&!t.name&&o.d.uniqueName.init(t,function(){return!0});o.h(c,null,{I:t});o.a.r(t,"click",c);o.h(a,null,{I:t});l=!0}}};o.g.U.checked=!0;o.d.checkedValue={update:function(n,t){n.value=o.a.c(t())}}}();o.d.css={update:function(n,t){var i=o.a.c(t());"object"==typeof i?o.a.K(i,function(t,i){i=o.a.c(i);o.a.ma(n,t,i)}):(i=String(i||""),o.a.ma(n,n.__ko__cssValue,!1),n.__ko__cssValue=i,o.a.ma(n,i,!0))}};o.d.enable={update:function(n,t){var i=o.a.c(t());i&&n.disabled?n.removeAttribute("disabled"):i||n.disabled||(n.disabled=!0)}};o.d.disable={update:function(n,t){o.d.enable.update(n,function(){return!o.a.c(t())})}};o.d.event={init:function(n,t,i,r,u){var f=t()||{};o.a.K(f,function(f){"string"==typeof f&&o.a.r(n,f,function(n){var s,h=t()[f],e;if(h){try{e=o.a.Q(arguments);r=u.$data;e.unshift(r);s=h.apply(r,e)}finally{!0!==s&&(n.preventDefault?n.preventDefault():n.returnValue=!1)}!1===i.get(f+"Bubble")&&(n.cancelBubble=!0,n.stopPropagation&&n.stopPropagation())}})})}};o.d.foreach={hb:function(n){return function(){var i=n(),t=o.a.Ha(i);return!t||"number"==typeof t.length?{foreach:i,templateEngine:o.J.Aa}:(o.a.c(i),{foreach:t.data,as:t.as,includeDestroyed:t.includeDestroyed,afterAdd:t.afterAdd,beforeRemove:t.beforeRemove,afterRender:t.afterRender,beforeMove:t.beforeMove,afterMove:t.afterMove,templateEngine:o.J.Aa})}},init:function(n,t){return o.d.template.init(n,o.d.foreach.hb(t))},update:function(n,t,i,r,u){return o.d.template.update(n,o.d.foreach.hb(t),i,r,u)}};o.g.Y.foreach=!1;o.e.P.foreach=!0;o.d.hasfocus={init:function(n,t,i){function r(r){var u,f;if(n.__ko_hasfocusUpdating=!0,u=n.ownerDocument,"activeElement"in u){try{f=u.activeElement}catch(e){f=u.body}r=f===n}u=t();o.g.oa(u,i,"hasfocus",r,!0);n.__ko_hasfocusLastValue=r;n.__ko_hasfocusUpdating=!1}var u=r.bind(null,!0),f=r.bind(null,!1);o.a.r(n,"focus",u);o.a.r(n,"focusin",u);o.a.r(n,"blur",f);o.a.r(n,"focusout",f)},update:function(n,t){var i=!!o.a.c(t());n.__ko_hasfocusUpdating||n.__ko_hasfocusLastValue===i||(i?n.focus():n.blur(),o.i.p(o.a.da,null,[n,i?"focusin":"focusout"]))}};o.g.U.hasfocus=!0;o.d.hasFocus=o.d.hasfocus;o.g.U.hasFocus=!0;o.d.html={init:function(){return{controlsDescendantBindings:!0}},update:function(n,t){o.a.Ka(n,t())}};y=o.a.f.D();a("if");a("ifnot",!1,!0);a("with",!0,!1,function(n,t){return n.createChildContext(t)});o.d.options={init:function(n){if("select"!==o.a.v(n))throw Error("options binding applies only to SELECT elements");for(;0<n.length;)n.remove(0);return{controlsDescendantBindings:!0}},update:function(t,r,u){function l(){return o.a.ga(t.options,function(n){return n.selected})}function a(n,t,i){var r=typeof t;return"function"==r?t(n):"string"==r?n[t]:i}function v(n,i){if(f.length){var r=0<=o.a.l(f,o.k.o(i[0]));o.a.qb(i[0],r);c&&!r&&o.i.p(o.a.da,null,[t,"change"])}}var s=0!=t.length&&t.multiple?t.scrollTop:null,y,e,f,h,c;r=o.a.c(r());y=u.get("optionsIncludeDestroyed");e={};f=t.multiple?o.a.ha(l(),o.k.o):0<=t.selectedIndex?[o.k.o(t.options[t.selectedIndex])]:[];r?("undefined"==typeof r.length&&(r=[r]),h=o.a.ga(r,function(t){return y||t===n||null===t||!o.a.c(t._destroy)}),u.has("optionsCaption")&&(r=o.a.c(u.get("optionsCaption")),null!==r&&r!==n&&h.unshift(e))):r=[];c=!1;r=v;u.has("optionsAfterRender")&&(r=function(t,i){v(0,i);o.i.p(u.get("optionsAfterRender"),null,[i[0],t!==e?t:n])});o.a.Ja(t,h,function(t,r,s){return s.length&&(f=s[0].selected?[o.k.o(s[0])]:[],c=!0),r=i.createElement("option"),t===e?(o.a.Ma(r,u.get("optionsCaption")),o.k.na(r,n)):(s=a(t,u.get("optionsValue"),t),o.k.na(r,o.a.c(s)),t=a(t,u.get("optionsText"),s),o.a.Ma(r,t)),[r]},null,r);(t.multiple?f.length&&l().length<f.length:f.length&&0<=t.selectedIndex?o.k.o(t.options[t.selectedIndex])!==f[0]:f.length||0<=t.selectedIndex)&&o.i.p(o.a.da,null,[t,"change"]);o.a.Hb(t);s&&20<Math.abs(s-t.scrollTop)&&(t.scrollTop=s)}};o.d.options.Ea=o.a.f.D();o.d.selectedOptions={after:["options","foreach"],init:function(n,t,i){o.a.r(n,"change",function(){var u=t(),r=[];o.a.n(n.getElementsByTagName("option"),function(n){n.selected&&r.push(o.k.o(n))});o.g.oa(u,i,"selectedOptions",r)})},update:function(n,t){if("select"!=o.a.v(n))throw Error("values binding applies only to SELECT elements");var i=o.a.c(t());i&&"number"==typeof i.length&&o.a.n(n.getElementsByTagName("option"),function(n){var t=0<=o.a.l(i,o.k.o(n));o.a.qb(n,t)})}};o.g.U.selectedOptions=!0;o.d.style={update:function(n,t){var i=o.a.c(t()||{});o.a.K(i,function(t,i){i=o.a.c(i);n.style[t]=i||""})}};o.d.submit={init:function(n,t,i,r,u){if("function"!=typeof t())throw Error("The value for a submit binding must be a function");o.a.r(n,"submit",function(i){var r,f=t();try{r=f.call(u.$data,n)}finally{!0!==r&&(i.preventDefault?i.preventDefault():i.returnValue=!1)}})}};o.d.text={init:function(){return{controlsDescendantBindings:!0}},update:function(n,t){o.a.Ma(n,t())}};o.e.P.text=!0;o.d.uniqueName={init:function(n,t){if(t()){var i="ko_unique_"+ ++o.d.uniqueName.Bb;o.a.pb(n,i)}}};o.d.uniqueName.Bb=0;o.d.value={after:["options","foreach"],init:function(n,t,i){function f(){e=!1;var r=t(),u=o.k.o(n);o.g.oa(r,i,"value",u)}var r=["change"],u=i.get("valueUpdate"),e=!1;u&&("string"==typeof u&&(u=[u]),o.a.X(r,u),r=o.a.Va(r));!o.a.ja||"input"!=n.tagName.toLowerCase()||"text"!=n.type||"off"==n.autocomplete||n.form&&"off"==n.form.autocomplete||-1!=o.a.l(r,"propertychange")||(o.a.r(n,"propertychange",function(){e=!0}),o.a.r(n,"blur",function(){e&&f()}));o.a.n(r,function(t){var i=f;o.a.ac(t,"after")&&(i=function(){setTimeout(f,0)},t=t.substring(5));o.a.r(n,t,i)})},update:function(n,t){var u="select"===o.a.v(n),r=o.a.c(t()),i=o.k.o(n);r!==i&&(i=function(){o.k.na(n,r)},i(),u&&(r!==o.k.o(n)?o.i.p(o.a.da,null,[n,"change"]):setTimeout(i,0)))}};o.g.U.value=!0;o.d.visible={update:function(n,t){var i=o.a.c(t()),r="none"!=n.style.display;i&&!r?n.style.display="":!i&&r&&(n.style.display="none")}},function(n){o.d[n]={init:function(t,i,r,u,f){return o.d.event.init.call(this,t,function(){var t={};return t[n]=i(),t},r,u,f)}}}("click");o.w=function(){};o.w.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource");};o.w.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock");};o.w.prototype.makeTemplateSource=function(n,t){if("string"==typeof n){t=t||i;var r=t.getElementById(n);if(!r)throw Error("Cannot find template with ID "+n);return new o.m.j(r)}if(1==n.nodeType||8==n.nodeType)return new o.m.W(n);throw Error("Unknown template type: "+n);};o.w.prototype.renderTemplate=function(n,t,i,r){return n=this.makeTemplateSource(n,r),this.renderTemplateSource(n,t,i)};o.w.prototype.isTemplateRewritten=function(n,t){return!1===this.allowTemplateRewriting?!0:this.makeTemplateSource(n,t).data("isRewritten")};o.w.prototype.rewriteTemplate=function(n,t,i){n=this.makeTemplateSource(n,i);t=t(n.text());n.text(t);n.data("isRewritten",!0)};o.b("templateEngine",o.w);o.Oa=function(){function n(n,t,i,r){var s,f,u,e;for(n=o.g.Ga(n),s=o.g.Y,f=0;f<n.length;f++)if(u=n[f].key,s.hasOwnProperty(u))if(e=s[u],"function"==typeof e){if(u=e(n[f].value))throw Error(u);}else if(!e)throw Error("This template engine does not support the '"+u+"' binding within its templates");return i="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+o.g.ka(n,{valueAccessors:!0})+" } })()},'"+i.toLowerCase()+"')",r.createJavaScriptEvaluatorBlock(i)+t}var t=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,i=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{Ib:function(n,t,i){t.isTemplateRewritten(n,i)||t.rewriteTemplate(n,function(n){return o.Oa.Ub(n,t)},i)},Ub:function(r,u){return r.replace(t,function(t,i,r,f,e){return n(e,i,r,u)}).replace(i,function(t,i){return n(i,"<!-- ko -->","#comment",u)})},yb:function(n,t){return o.u.Ca(function(i,r){var u=i.nextSibling;u&&u.nodeName.toLowerCase()===t&&o.pa(u,n,r)})}}}();o.b("__tr_ambtns",o.Oa.yb),function(){var i,t;o.m={};o.m.j=function(n){this.j=n};o.m.j.prototype.text=function(){var n=o.a.v(this.j),n="script"===n?"text":"textarea"===n?"value":"innerHTML",t;if(0==arguments.length)return this.j[n];t=arguments[0];"innerHTML"===n?o.a.Ka(this.j,t):this.j[n]=t};i=o.a.f.D()+"_";o.m.j.prototype.data=function(n){if(1===arguments.length)return o.a.f.get(this.j,i+n);o.a.f.set(this.j,i+n,arguments[1])};t=o.a.f.D();o.m.W=function(n){this.j=n};o.m.W.prototype=new o.m.j;o.m.W.prototype.text=function(){if(0==arguments.length){var i=o.a.f.get(this.j,t)||{};return i.Pa===n&&i.sa&&(i.Pa=i.sa.innerHTML),i.Pa}o.a.f.set(this.j,t,{Pa:arguments[0]})};o.m.j.prototype.nodes=function(){if(0==arguments.length)return(o.a.f.get(this.j,t)||{}).sa;o.a.f.set(this.j,t,{sa:arguments[0]})};o.b("templateSources",o.m);o.b("templateSources.domElement",o.m.j);o.b("templateSources.anonymousTemplate",o.m.W)}(),function(){function t(n,t,i){var r;for(t=o.e.nextSibling(t);n&&(r=n)!==t;)n=o.e.nextSibling(r),i(r,n)}function f(n,i){if(n.length){var r=n[0],u=n[n.length-1],f=r.parentNode,e=o.H.instance,s=e.preprocessNode;if(s){if(t(r,u,function(n,t){var f=n.previousSibling,i=s.call(e,n);i&&(n===r&&(r=i[0]||t),n===u&&(u=i[i.length-1]||f))}),n.length=0,!r)return;r===u?n.push(r):(n.push(r,u),o.a.$(n,f))}t(r,u,function(n){1!==n.nodeType&&8!==n.nodeType||o.Sa(i,n)});t(r,u,function(n){1!==n.nodeType&&8!==n.nodeType||o.u.vb(n,[i])});o.a.$(n,f)}}function i(n){return n.nodeType?n:0<n.length?n[0]:null}function e(n,t,u,e,s){s=s||{};var h=n&&i(n),h=h&&h.ownerDocument,c=s.templateEngine||r;if(o.Oa.Ib(u,c,h),u=c.renderTemplate(u,e,s,h),"number"!=typeof u.length||0<u.length&&"number"!=typeof u[0].nodeType)throw Error("Template engine must return an array of DOM nodes");h=!1;switch(t){case"replaceChildren":o.e.S(n,u);h=!0;break;case"replaceNode":o.a.nb(n,u);h=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+t);}return h&&(f(u,e),s.afterRender&&o.i.p(s.afterRender,null,[u,e.$data])),u}var r,u;o.La=function(t){if(t!=n&&!(t instanceof o.w))throw Error("templateEngine must inherit from ko.templateEngine");r=t};o.Ia=function(t,u,f,s,h){if(f=f||{},(f.templateEngine||r)==n)throw Error("Set a template engine before calling renderTemplate");if(h=h||"replaceChildren",s){var c=i(s);return o.h(function(){var n=u&&u instanceof o.G?u:new o.G(o.a.c(u)),r="function"==typeof t?t(n.$data,n):t,n=e(s,h,r,n,f);"replaceNode"==h&&(s=n,c=i(s))},null,{ua:function(){return!c||!o.a.va(c)},I:c&&"replaceNode"==h?c.parentNode:c})}return o.u.Ca(function(n){o.Ia(t,u,f,n,"replaceNode")})};o.$b=function(t,i,r,u,s){function c(n,t){f(t,h);r.afterRender&&r.afterRender(t,n)}function l(n,i){h=s.createChildContext(n,r.as,function(n){n.$index=i});var u="function"==typeof t?t(n,h):t;return e(null,"ignoreTargetNode",u,h,r)}var h;return o.h(function(){var t=o.a.c(i)||[];"undefined"==typeof t.length&&(t=[t]);t=o.a.ga(t,function(t){return r.includeDestroyed||t===n||null===t||!o.a.c(t._destroy)});o.i.p(o.a.Ja,null,[u,t,l,r,c])},null,{I:u})};u=o.a.f.D();o.d.template={init:function(n,t){var i=o.a.c(t());return"string"==typeof i||i.name?o.e.Z(n):(i=o.e.childNodes(n),i=o.a.Vb(i),new o.m.W(n).nodes(i)),{controlsDescendantBindings:!0}},update:function(t,i,r,f,e){i=o.a.c(i());r={};f=!0;var s,h=null;"string"!=typeof i&&(r=i,i=o.a.c(r.name),"if"in r&&(f=o.a.c(r["if"])),f&&"ifnot"in r&&(f=!o.a.c(r.ifnot)),s=o.a.c(r.data));"foreach"in r?h=o.$b(i||t,f&&r.foreach||[],r,t,e):f?(e="data"in r?e.createChildContext(s,r.as):e,h=o.Ia(i||t,e,r,t)):o.e.Z(t);e=h;(s=o.a.f.get(t,u))&&"function"==typeof s.B&&s.B();o.a.f.set(t,u,e&&e.aa()?e:n)}};o.g.Y.template=function(n){return n=o.g.Ga(n),1==n.length&&n[0].unknown||o.g.Sb(n,"name")?null:"This template engine does not support anonymous templates nested within its templates"};o.e.P.template=!0}();o.b("setTemplateEngine",o.La);o.b("renderTemplate",o.Ia);o.a.ra=function(){function n(n,t,i,r,u){for(var o=Math.min,l=Math.max,s=[],a=n.length,f,h=t.length,c=h-a||1,w=a+h+1,v,p,b,y,e=0;e<=a;e++)for(p=v,s.push(v=[]),b=o(h,e+c),f=l(0,e-1);f<=b;f++)v[f]=f?e?n[e-1]===t[f-1]?p[f-1]:o(p[f]||w,v[f-1]||w)+1:f+1:e+1;for(o=[],l=[],c=[],e=a,f=h;e||f;)h=s[e][f]-1,f&&h===s[e][f-1]?l.push(o[o.length]={status:i,value:t[--f],index:f}):e&&h===s[e-1][f]?c.push(o[o.length]={status:r,value:n[--e],index:e}):(--f,--e,u.sparse||o.push({status:"retained",value:t[f]}));if(l.length&&c.length)for(n=10*a,t=i=0;(u.dontLimitMoves||t<n)&&(y=l[i]);i++){for(r=0;s=c[r];r++)if(y.value===s.value){y.moved=s.index;s.moved=y.index;c.splice(r,1);t=r=0;break}t+=r}return o.reverse()}return function(t,i,r){return r="boolean"==typeof r?{dontLimitMoves:r}:r||{},t=t||[],i=i||[],t.length<=i.length?n(t,i,"added","deleted",r):n(i,t,"deleted","added",r)}}();o.b("utils.compareArrays",o.a.ra),function(){function i(t,i,r,u,f){var e=[],s=o.h(function(){var n=i(r,f,o.a.$(e,t))||[];0<e.length&&(o.a.nb(e,n),u&&o.i.p(u,null,[r,n,f]));e.splice(0,e.length);o.a.X(e,n)},null,{I:t,ua:function(){return!o.a.Ra(e)}});return{R:e,h:s.aa()?s:n}}var t=o.a.f.D();o.a.Ja=function(r,u,f,e,s){function rt(n,t){h=d[t];nt!==t&&(it[n]=h);h.za(nt++);o.a.$(h.R,r);g.push(h);w.push(h)}function y(n,t){if(n)for(var i=0,r=t.length;i<r;i++)t[i]&&o.a.n(t[i].R,function(r){n(r,i,t[i].fa)})}var c,v,ut;u=u||[];e=e||{};var v=o.a.f.get(r,t)===n,d=o.a.f.get(r,t)||[],p=o.a.ha(d,function(n){return n.fa}),l=o.a.ra(p,u,e.dontLimitMoves),g=[],a=0,nt=0,tt=[],w=[];u=[];for(var it=[],p=[],h,c=0,b,k;b=l[c];c++)switch(k=b.moved,b.status){case"deleted":k===n&&(h=d[a],h.h&&h.h.B(),tt.push.apply(tt,o.a.$(h.R,r)),e.beforeRemove&&(u[c]=h,w.push(h)));a++;break;case"retained":rt(c,a++);break;case"added":k!==n?rt(c,k):(h={fa:b.value,za:o.q(nt++)},g.push(h),w.push(h),v||(p[c]=h))}for(y(e.beforeMove,it),o.a.n(tt,e.beforeRemove?o.L:o.removeNode),c=0,v=o.e.firstChild(r);h=w[c];c++){for(h.R||o.a.extend(h,i(r,f,h.fa,s,h.za)),a=0;l=h.R[a];v=l.nextSibling,ut=l,a++)l!==v&&o.e.eb(r,l,ut);!h.Ob&&s&&(s(h.fa,h.R,h.za),h.Ob=!0)}y(e.beforeRemove,u);y(e.afterMove,it);y(e.afterAdd,p);o.a.f.set(r,t,g)}}();o.b("utils.setDomNodeChildrenFromArrayMapping",o.a.Ja);o.J=function(){this.allowTemplateRewriting=!1};o.J.prototype=new o.w;o.J.prototype.renderTemplateSource=function(n){var t=(9>o.a.ja?0:n.nodes)?n.nodes():null;return t?o.a.Q(t.cloneNode(!0).childNodes):(n=n.text(),o.a.Fa(n))};o.J.Aa=new o.J;o.La(o.J.Aa);o.b("nativeTemplateEngine",o.J),function(){o.Ba=function(){var n=this.Rb=function(){if("undefined"==typeof t||!t.tmpl)return 0;try{if(0<=t.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch(n){}return 1}();this.renderTemplateSource=function(r,u,f){if(f=f||{},2>n)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var e=r.data("precompiled");return e||(e=r.text()||"",e=t.template(null,"{{ko_with $item.koBindingContext}}"+e+"{{/ko_with}}"),r.data("precompiled",e)),r=[u.$data],u=t.extend({koBindingContext:u},f.templateOptions),u=t.tmpl(e,r,u),u.appendTo(i.createElement("div")),t.fragments={},u};this.createJavaScriptEvaluatorBlock=function(n){return"{{ko_code ((function() { return "+n+" })()) }}"};this.addTemplate=function(n,t){i.write("<script type='text/html' id='"+n+"'>"+t+"<\/script>")};0<n&&(t.tmpl.tag.ko_code={open:"__.push($1 || '');"},t.tmpl.tag.ko_with={open:"with($1) {",close:"} "})};o.Ba.prototype=new o.w;var n=new o.Ba;0<n.Rb&&o.La(n);o.b("jqueryTmplTemplateEngine",o.Ba)}()})})()}(),function(n,t){typeof module=="object"&&module.exports?module.exports=t():typeof define=="function"&&define.amd?define(t):n.Spinner=t()}(this,function(){"use strict";function i(n,t){var r=document.createElement(n||"div"),i;for(i in t)r[i]=t[i];return r}function t(n){for(var t=1,i=arguments.length;t<i;t++)n.appendChild(arguments[t]);return n}function a(n,t,i,r){var e=["opacity",t,~~(n*100),i,r].join("-"),o=.01+i/r*100,s=Math.max(1-(1-n)/t*(100-o),n),c=u.substring(0,u.indexOf("Animation")).toLowerCase(),l=c&&"-"+c+"-"||"";return h[e]||(f.insertRule("@"+l+"keyframes "+e+"{0%{opacity:"+s+"}"+o+"%{opacity:"+n+"}"+(o+.01)+"%{opacity:1}"+(o+t)%100+"%{opacity:"+n+"}100%{opacity:"+s+"}}",f.cssRules.length),h[e]=1),e}function o(n,t){var u=n.style,r,i;if(t=t.charAt(0).toUpperCase()+t.slice(1),u[t]!==undefined)return t;for(i=0;i<s.length;i++)if(r=s[i]+t,u[r]!==undefined)return r}function n(n,t){for(var i in t)n.style[o(n,i)||i]=t[i];return n}function c(n){for(var r,i,t=1;t<arguments.length;t++){r=arguments[t];for(i in r)n[i]===undefined&&(n[i]=r[i])}return n}function l(n,t){return typeof n=="string"?n:n[t%n.length]}function r(n){this.opts=c(n||{},r.defaults,v)}function y(){function u(n,t){return i("<"+n+' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">',t)}f.addRule(".spin-vml","behavior:url(#default#VML)");r.prototype.lines=function(i,r){function s(){return n(u("group",{coordsize:o+" "+o,coordorigin:-e+" "+-e}),{width:o,height:o})}function a(i,f,o){t(c,t(n(s(),{rotation:360/r.lines*i+"deg",left:~~f}),t(n(u("roundrect",{arcsize:r.corners}),{width:e,height:r.scale*r.width,left:r.scale*r.radius,top:-r.scale*r.width>>1,filter:o}),u("fill",{color:l(r.color,i),opacity:r.opacity}),u("stroke",{opacity:0}))))}var e=r.scale*(r.length+r.width),o=r.scale*2*e,h=-(r.width+r.length)*r.scale*2+"px",c=n(s(),{position:"absolute",top:h,left:h}),f;if(r.shadow)for(f=1;f<=r.lines;f++)a(f,-2,"progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)");for(f=1;f<=r.lines;f++)a(f);return t(i,c)};r.prototype.opacity=function(n,t,i,r){var u=n.firstChild;r=r.shadow&&r.lines||0;u&&t+r<u.childNodes.length&&(u=u.childNodes[t+r],u=u&&u.firstChild,u=u&&u.firstChild,u&&(u.opacity=i))}}var s=["webkit","Moz","ms","O"],h={},u,f,v={lines:12,length:7,width:5,radius:10,scale:1,corners:1,color:"#000",opacity:1/4,rotate:0,direction:1,speed:1,trail:100,fps:20,zIndex:2e9,className:"spinner",top:"50%",left:"50%",shadow:!1,hwaccel:!1,position:"absolute"},e;return r.defaults={},c(r.prototype,{spin:function(t){this.stop();var f=this,r=f.opts,e=f.el=i(null,{className:r.className});if(n(e,{position:r.position,width:0,zIndex:r.zIndex,left:r.left,top:r.top}),t&&t.insertBefore(e,t.firstChild||null),e.setAttribute("role","progressbar"),f.lines(e,f.opts),!u){var s=0,l=(r.lines-1)*(1-r.direction)/2,h,c=r.fps,o=c/r.speed,a=(1-r.opacity)/(o*r.trail/100),v=o/r.lines;(function y(){s++;for(var n=0;n<r.lines;n++)h=Math.max(1-(s+(r.lines-n)*v)%o*a,r.opacity),f.opacity(e,n*r.direction+l,h,r);f.timeout=f.el&&setTimeout(y,~~(1e3/c))})()}return f},stop:function(){var n=this.el;return n&&(clearTimeout(this.timeout),n.parentNode&&n.parentNode.removeChild(n),this.el=undefined),this},lines:function(r,f){function s(t,r){return n(i(),{position:"absolute",width:f.scale*(f.length+f.width)+"px",height:f.scale*f.width+"px",background:t,boxShadow:r,transformOrigin:"left",transform:"rotate("+~~(360/f.lines*e+f.rotate)+"deg) translate("+f.scale*f.radius+"px,0)",borderRadius:(f.corners*f.scale*f.width>>1)+"px"})}for(var e=0,h=(f.lines-1)*(1-f.direction)/2,o;e<f.lines;e++)o=n(i(),{position:"absolute",top:1+~(f.scale*f.width/2)+"px",transform:f.hwaccel?"translate3d(0,0,0)":"",opacity:f.opacity,animation:u&&a(f.opacity,f.trail,h+e*f.direction,f.lines)+" "+1/f.speed+"s linear infinite"}),f.shadow&&t(o,n(s("#000","0 0 4px #000"),{top:"2px"})),t(r,t(o,s(l(f.color,e),"0 0 1px rgba(0,0,0,.1)")));return r},opacity:function(n,t,i){t<n.childNodes.length&&(n.childNodes[t].style.opacity=i)}}),typeof document!="undefined"&&(f=function(){var n=i("style",{type:"text/css"});return t(document.getElementsByTagName("head")[0],n),n.sheet||n.styleSheet}(),e=n(i("group"),{behavior:"url(#default#VML)"}),!o(e,"transform")&&e.adj?y():u=o(e,"animation")),r}),function(n){typeof define=="function"&&define.amd?define(["knockout"],n):n(ko)}(function(n){function r(n,t){return l(d(n),"preprocess",t)}function d(t){return typeof t=="object"?t:n.getBindingHandler(t)||(n.bindingHandlers[t]={})}function l(n,t,i){if(n[t]){var r=n[t];n[t]=function(n,t,u){return n=r.call(this,n,t,u),n?i.call(this,n,t,u):void 0}}else n[t]=i;return n}function o(t){var i=n.bindingProvider.instance,r;i.preprocessNode?(r=i.preprocessNode,i.preprocessNode=function(n){var i=r.call(this,n);return i||(i=t.call(this,n)),i}):i.preprocessNode=t}function g(t,i){var r=n.getBindingHandler;n.getBindingHandler=function(n){var u;return r(n)||(u=n.match(t))&&i(u,n)}}function a(n){var t,f,r,u,e,i;if(n.indexOf("|")===-1)return n;if(t=n.match(/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'|\|\||[|:]|[^\s|:"'][^|:"']*[^\s|:"']|[^\s|:"']/g),t&&t.length>1)for(t.push("|"),n=t[0],r=!1,u=!1,e=1;i=t[e];++e)i==="|"?(r&&(f===":"&&(n+="undefined"),n+=")"),u=!0,r=!0):(u?n="ko.filters['"+i+"']("+n:r&&i===":"?(f===":"&&(n+="undefined"),n+=","):n+=i,u=!1),f=i;return n}function v(n){r(n,a)}function p(t,i,r){function f(r){u[r]&&(u[r]=function(u,f){function o(){var n={};return n[t]=f(),n}var e=Array.prototype.slice.call(arguments,0);return e[1]=o,n.bindingHandlers[i][r].apply(this,e)})}var u=n.utils.extend({},this);return f("init"),f("update"),u.preprocess&&(u.preprocess=null),n.virtualElements.allowedBindings[i]&&(n.virtualElements.allowedBindings[r]=!0),u}function w(t,i){var u=n.getBindingHandler(t),f;u&&(f=u.getNamespacedHandler||p,u.getNamespacedHandler=function(){return r(f.apply(this,arguments),i)})}function tt(t,i,r){if(t.charAt(0)!=="{")return t;var u=n.expressionRewriting.parseObjectLiteral(t);n.utils.arrayForEach(u,function(n){r(i+y+n.key,n.value)})}function e(n){r(n,tt)}function f(n){return/^([$_a-z][$\w]*|.+(\.\s*[$_a-z][$\w]*|\[.+\]))$/i.test(n)?"function(_x,_y,_z){return("+n+")(_x,_y,_z);}":n}function s(n){r(n,f)}function h(n,t,i){var r=d(n);r._propertyPreprocessors||(l(r,"preprocess",at),r._propertyPreprocessors={});l(r._propertyPreprocessors,t,i)}function at(t,i,r){if(t.charAt(0)!=="{")return t;var e=n.expressionRewriting.parseObjectLiteral(t),u=[],f=this._propertyPreprocessors||{};return n.utils.arrayForEach(e,function(n){var t=n.key,i=n.value;f[t]&&(i=f[t](i,t,r));i&&u.push("'"+t+"':"+i)}),"{"+u.join(",")+"}"}function b(n){return function(t){return"function("+n+"){return("+t+");}"}}function vt(n,t){var t=Array.prototype.slice.call(arguments,1).join();r(n,b(t))}function it(n,t,i){function u(n){var r=n.match(/^([\s\S]*)}}([\s\S]*?)\{\{([\s\S]*)$/);r?(u(r[1]),t(r[2]),i(r[3])):i(n)}var r=n.match(/^([\s\S]*?)\{\{([\s\S]*)}}([\s\S]*)$/);r&&(t(r[1]),u(r[2]),t(r[3]))}function rt(n){return n==null?"":n.trim?n.trim():n.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")}function ut(n){var t;if(n.nodeType===3&&n.nodeValue&&n.nodeValue.indexOf("{{")!==-1&&(n.parentNode||{}).nodeName!="TEXTAREA"){t=[];function u(n){n&&t.push(document.createTextNode(n))}function f(i){i&&t.push.apply(t,ot.wrapExpression(rt(i),n))}if(it(n.nodeValue,u,f),t.length){if(n.parentNode){for(var i=0,e=t.length,r=n.parentNode;i<e;++i)r.insertBefore(t[i],n);r.removeChild(n)}return t}}}function yt(n,t){var i=t?t.ownerDocument:document,r=i.createComment("/ko"),u=n[0];return u==="#"?[i.createComment("ko "+n.slice(1))]:u==="/"?[r]:u==="{"&&n[n.length-1]==="}"?[i.createComment("ko html:"+n.slice(1,-1)),r]:[i.createComment("ko text:"+n),r]}function et(){o(ut)}function st(t){var u,i,f,r,o,s;if(t.nodeType===1&&t.attributes.length){u=t.getAttribute(c);for(var h=n.utils.arrayPushAll([],t.attributes),l=h.length,e=0;e<l;++e)if(i=h[e],i.specified&&i.name!=c&&i.value.indexOf("{{")!==-1){f=[];r="";function a(n){n&&f.push('"'+n.replace(/"/g,'\\"')+'"')}function v(n){n&&(r=n,f.push("ko.unwrap("+n+")"))}it(i.value,a,v);f.length>1&&(r='""+'+f.join("+"));r&&(o=i.name.toLowerCase(),s=lt.attributeBinding(o,r,t)||ht(o,r,t),u?u+=","+s:u=s,t.setAttribute(c,u),t.removeAttribute(i.name))}}}function ht(t,i){return n.getBindingHandler(t)?t+":"+i:"attr."+t+":"+i}function ct(){o(st)}var u=n.unwrap,t=n.punches={utils:{addBindingPreprocessor:r,addNodePreprocessor:o,addBindingHandlerCreator:g,setBindingPreprocessor:r,setNodePreprocessor:o}},i,nt,y,k,ft,ot,c,lt;return t.enableAll=function(){et();ct();e("attr");e("css");e("event");e("style");v("text");v("html");w("attr",a);s("click");s("submit");s("optionsAfterRender");w("event",f);h("template","beforeRemove",f);h("template","afterAdd",f);h("template","afterRender",f)},i={},i.uppercase=function(n){return String.prototype.toUpperCase.call(u(n))},i.lowercase=function(n){return String.prototype.toLowerCase.call(u(n))},i["default"]=function(n,t){return(n=u(n),typeof n=="function")?n:typeof n=="string"?rt(n)===""?t:n:n==null||n.length==0?t:n},i.replace=function(n,t,i){return String.prototype.replace.call(u(n),t,i)},i.fit=function(n,t,i,r){if(n=u(n),t&&(""+n).length>t){i=""+(i||"...");t=t-i.length;n=""+n;switch(r){case"left":return i+n.slice(-t);case"middle":var f=Math.ceil(t/2);return n.substr(0,f)+i+n.slice(f-t);default:return n.substr(0,t)+i}}else return n},i.json=function(t,i,r){return n.toJSON(t,r,i)},i.number=function(n){return(+u(n)).toLocaleString()},n.filters=i,t.textFilter={preprocessor:a,enableForBinding:v},nt=/([^\.]+)\.(.+)/,y=".",g(nt,function(t,i){var u=t[1],r=n.bindingHandlers[u];if(r){var e=t[2],o=r.getNamespacedHandler||p,f=o.call(r,e,u,i);return n.bindingHandlers[i]=f,f}}),t.namespacedBinding={defaultGetHandler:p,setDefaultBindingPreprocessor:w,preprocessor:tt,enableForBinding:e},t.wrappedCallback={preprocessor:f,enableForBinding:s},t.preprocessBindingProperty={setPreprocessor:h},k=b("$data,$event"),t.expressionCallback={makePreprocessor:b,eventPreprocessor:k,enableForBinding:vt},n.bindingHandlers.on={getNamespacedHandler:function(t){var i=n.getBindingHandler("event"+y+t);return r(i,k)}},n.virtualElements.allowedBindings.html||(ft=n.bindingHandlers.html.update,n.bindingHandlers.html.update=function(t,i){var r,f;t.nodeType===8?(r=u(i()),r!=null?(f=n.utils.parseHtmlFragment(""+r),n.virtualElements.setDomNodeChildren(t,f)):n.virtualElements.emptyNode(t)):ft(t,i)},n.virtualElements.allowedBindings.html=!0),ot=t.interpolationMarkup={preprocessor:ut,enable:et,wrapExpression:yt},c="data-bind",lt=t.attributeInterpolationMarkup={preprocessor:st,enable:ct,attributeBinding:ht},t}),typeof jQuery=="undefined")throw new Error("Bootstrap's JavaScript requires jQuery");+function(n){"use strict";function r(i){return this.each(function(){var u=n(this),r=u.data("bs.tooltip"),f=typeof i=="object"&&i;(r||i!="destroy")&&(r||u.data("bs.tooltip",r=new t(this,f)),typeof i=="string"&&r[i]())})}var t=function(n,t){this.type=this.options=this.enabled=this.timeout=this.hoverState=this.$element=null;this.init("tooltip",n,t)},i;t.VERSION="3.2.0";t.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"><\/div><div class="tooltip-inner"><\/div><\/div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}};t.prototype.init=function(t,i,r){var f,e,u,o,s;for(this.enabled=!0,this.type=t,this.$element=n(i),this.options=this.getOptions(r),this.$viewport=this.options.viewport&&n(this.options.viewport.selector||this.options.viewport),f=this.options.trigger.split(" "),e=f.length;e--;)if(u=f[e],u=="click")this.$element.on("click."+this.type,this.options.selector,n.proxy(this.toggle,this));else if(u!="manual"){o=u=="hover"?"mouseenter":"focusin";s=u=="hover"?"mouseleave":"focusout";this.$element.on(o+"."+this.type,this.options.selector,n.proxy(this.enter,this));this.$element.on(s+"."+this.type,this.options.selector,n.proxy(this.leave,this))}this.options.selector?this._options=n.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()};t.prototype.getDefaults=function(){return t.DEFAULTS};t.prototype.getOptions=function(t){return t=n.extend({},this.getDefaults(),this.$element.data(),t),t.delay&&typeof t.delay=="number"&&(t.delay={show:t.delay,hide:t.delay}),t};t.prototype.getDelegateOptions=function(){var t={},i=this.getDefaults();return this._options&&n.each(this._options,function(n,r){i[n]!=r&&(t[n]=r)}),t};t.prototype.enter=function(t){var i=t instanceof this.constructor?t:n(t.currentTarget).data("bs."+this.type);if(i||(i=new this.constructor(t.currentTarget,this.getDelegateOptions()),n(t.currentTarget).data("bs."+this.type,i)),clearTimeout(i.timeout),i.hoverState="in",!i.options.delay||!i.options.delay.show)return i.show();i.timeout=setTimeout(function(){i.hoverState=="in"&&i.show()},i.options.delay.show)};t.prototype.leave=function(t){var i=t instanceof this.constructor?t:n(t.currentTarget).data("bs."+this.type);if(i||(i=new this.constructor(t.currentTarget,this.getDelegateOptions()),n(t.currentTarget).data("bs."+this.type,i)),clearTimeout(i.timeout),i.hoverState="out",!i.options.delay||!i.options.delay.hide)return i.hide();i.timeout=setTimeout(function(){i.hoverState=="out"&&i.hide()},i.options.delay.hide)};t.prototype.show=function(){var h=n.Event("show.bs."+this.type),c,y,s;if(this.hasContent()&&this.enabled){if(this.$element.trigger(h),c=n.contains(document.documentElement,this.$element[0]),h.isDefaultPrevented()||!c)return;var f=this,i=this.tip(),l=this.getUID(this.type);this.setContent();i.attr("id",l);this.$element.attr("aria-describedby",l);this.options.animation&&i.addClass("fade");var t=typeof this.options.placement=="function"?this.options.placement.call(this,i[0],this.$element[0]):this.options.placement,a=/\s?auto?\s?/i,v=a.test(t);v&&(t=t.replace(a,"")||"top");i.detach().css({top:0,left:0,display:"block"}).addClass(t).data("bs."+this.type,this);this.options.container?i.appendTo(this.options.container):i.insertAfter(this.$element);var r=this.getPosition(),e=i[0].offsetWidth,o=i[0].offsetHeight;if(v){var p=t,w=this.$element.parent(),u=this.getPosition(w);t=t=="bottom"&&r.top+r.height+o-u.scroll>u.height?"top":t=="top"&&r.top-u.scroll-o<0?"bottom":t=="right"&&r.right+e>u.width?"left":t=="left"&&r.left-e<u.left?"right":t;i.removeClass(p).addClass(t)}y=this.getCalculatedOffset(t,r,e,o);this.applyPlacement(y,t);s=function(){f.$element.trigger("shown.bs."+f.type);f.hoverState=null};n.support.transition&&this.$tip.hasClass("fade")?i.one("bsTransitionEnd",s).emulateTransitionEnd(150):s()}};t.prototype.applyPlacement=function(t,i){var r=this.tip(),c=r[0].offsetWidth,e=r[0].offsetHeight,o=parseInt(r.css("margin-top"),10),s=parseInt(r.css("margin-left"),10),h,f,u;isNaN(o)&&(o=0);isNaN(s)&&(s=0);t.top=t.top+o;t.left=t.left+s;n.offset.setOffset(r[0],n.extend({using:function(n){r.css({top:Math.round(n.top),left:Math.round(n.left)})}},t),0);r.addClass("in");h=r[0].offsetWidth;f=r[0].offsetHeight;i=="top"&&f!=e&&(t.top=t.top+e-f);u=this.getViewportAdjustedDelta(i,t,h,f);u.left?t.left+=u.left:t.top+=u.top;var l=u.left?u.left*2-c+h:u.top*2-e+f,a=u.left?"left":"top",v=u.left?"offsetWidth":"offsetHeight";r.offset(t);this.replaceArrow(l,r[0][v],a)};t.prototype.replaceArrow=function(n,t,i){this.arrow().css(i,"")};t.prototype.setContent=function(){var n=this.tip(),t=this.getTitle();n.find(".tooltip-inner")[this.options.html?"html":"text"](t);n.removeClass("fade in top bottom left right")};t.prototype.hide=function(){function u(){t.hoverState!="in"&&i.detach();t.$element.trigger("hidden.bs."+t.type)}var t=this,i=this.tip(),r=n.Event("hide.bs."+this.type);if(this.$element.removeAttr("aria-describedby"),this.$element.trigger(r),!r.isDefaultPrevented())return i.removeClass("in"),n.support.transition&&this.$tip.hasClass("fade")?i.one("bsTransitionEnd",u).emulateTransitionEnd(150):u(),this.hoverState=null,this};t.prototype.fixTitle=function(){var n=this.$element;(n.attr("title")||typeof n.attr("data-original-title")!="string")&&n.attr("data-original-title",n.attr("title")||"").attr("title","")};t.prototype.hasContent=function(){return this.getTitle()};t.prototype.getPosition=function(t){t=t||this.$element;var r=t[0],i=r.tagName=="BODY";return n.extend({},typeof r.getBoundingClientRect=="function"?r.getBoundingClientRect():null,{scroll:i?document.documentElement.scrollTop||document.body.scrollTop:t.scrollTop(),width:i?n(window).width():t.outerWidth(),height:i?n(window).height():t.outerHeight()},i?{top:0,left:0}:t.offset())};t.prototype.getCalculatedOffset=function(n,t,i,r){return n=="bottom"?{top:t.top+t.height,left:t.left+t.width/2-i/2}:n=="top"?{top:t.top-r,left:t.left+t.width/2-i/2}:n=="left"?{top:t.top,left:t.left-i}:{top:t.top,left:t.left+t.width}};t.prototype.getViewportAdjustedDelta=function(n,t,i,r){var f={top:0,left:0},e,u,o,s,h,c;return this.$viewport?(e=this.options.viewport&&this.options.viewport.padding||0,u=this.getPosition(this.$viewport),/right|left/.test(n)?(o=t.top-e-u.scroll,s=t.top+e-u.scroll+r,o<u.top?f.top=u.top-o:s>u.top+u.height&&(f.top=u.top+u.height-s)):(h=t.left-e,c=t.left+e+i,h<u.left?f.left=u.left-h:c>u.width&&(f.left=u.left+u.width-c)),f):f};t.prototype.getTitle=function(){var t=this.$element,n=this.options;return t.attr("data-original-title")||(typeof n.title=="function"?n.title.call(t[0]):n.title)};t.prototype.getUID=function(n){do n+=~~(Math.random()*1e6);while(document.getElementById(n));return n};t.prototype.tip=function(){return this.$tip=this.$tip||n(this.options.template)};t.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")};t.prototype.validate=function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)};t.prototype.enable=function(){this.enabled=!0};t.prototype.disable=function(){this.enabled=!1};t.prototype.toggleEnabled=function(){this.enabled=!this.enabled};t.prototype.toggle=function(t){var i=this;t&&(i=n(t.currentTarget).data("bs."+this.type),i||(i=new this.constructor(t.currentTarget,this.getDelegateOptions()),n(t.currentTarget).data("bs."+this.type,i)));i.tip().hasClass("in")?i.leave(i):i.enter(i)};t.prototype.destroy=function(){clearTimeout(this.timeout);this.hide().$element.off("."+this.type).removeData("bs."+this.type)};i=n.fn.tooltip;n.fn.tooltip=r;n.fn.tooltip.Constructor=t;n.fn.tooltip.noConflict=function(){return n.fn.tooltip=i,this}}(jQuery);+function(n){"use strict";function r(i){return this.each(function(){var u=n(this),r=u.data("bs.popover"),f=typeof i=="object"&&i;(r||i!="destroy")&&(r||u.data("bs.popover",r=new t(this,f)),typeof i=="string"&&r[i]())})}var t=function(n,t){this.init("popover",n,t)},i;if(!n.fn.tooltip)throw new Error("Popover requires tooltip.js");t.VERSION="3.2.0";t.DEFAULTS=n.extend({},n.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"><\/div><h3 class="popover-title"><\/h3><div class="popover-content"><\/div><\/div>'});t.prototype=n.extend({},n.fn.tooltip.Constructor.prototype);t.prototype.constructor=t;t.prototype.getDefaults=function(){return t.DEFAULTS};t.prototype.setContent=function(){var n=this.tip(),i=this.getTitle(),t=this.getContent();n.find(".popover-title")[this.options.html?"html":"text"](i);n.find(".popover-content").empty()[this.options.html?typeof t=="string"?"html":"append":"text"](t);n.removeClass("fade top bottom left right in");n.find(".popover-title").html()||n.find(".popover-title").hide()};t.prototype.hasContent=function(){return this.getTitle()||this.getContent()};t.prototype.getContent=function(){var t=this.$element,n=this.options;return t.attr("data-content")||(typeof n.content=="function"?n.content.call(t[0]):n.content)};t.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};t.prototype.tip=function(){return this.$tip||(this.$tip=n(this.options.template)),this.$tip};i=n.fn.popover;n.fn.popover=r;n.fn.popover.Constructor=t;n.fn.popover.noConflict=function(){return n.fn.popover=i,this}}(jQuery);+function(n){"use strict";function t(){var i=document.createElement("bootstrap"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},n;for(n in t)if(i.style[n]!==undefined)return{end:t[n]};return!1}n.fn.emulateTransitionEnd=function(t){var i=!1,u=this,r;n(this).one("bsTransitionEnd",function(){i=!0});return r=function(){i||n(u).trigger(n.support.transition.end)},setTimeout(r,t),this};n(function(){(n.support.transition=t(),n.support.transition)&&(n.event.special.bsTransitionEnd={bindType:n.support.transition.end,delegateType:n.support.transition.end,handle:function(t){if(n(t.target).is(this))return t.handleObj.handler.apply(this,arguments)}})})}(jQuery),function(n){function t(n,r){if(n=n?n:"",r=r||{},n instanceof t)return n;if(!(this instanceof t))return new t(n,r);var u=ut(n);this._originalInput=n;this._r=u.r;this._g=u.g;this._b=u.b;this._a=u.a;this._roundA=i(100*this._a)/100;this._format=r.format||u.format;this._gradientType=r.gradientType;this._r<1&&(this._r=i(this._r));this._g<1&&(this._g=i(this._g));this._b<1&&(this._b=i(this._b));this._ok=u.ok;this._tc_id=rt++}function ut(n){var t={r:0,g:0,b:0},i=1,r=null,e=null,l=null,u=!1,f=!1;return typeof n=="string"&&(n=ui(n)),typeof n=="object"&&(h(n.r)&&h(n.g)&&h(n.b)?(t=ft(n.r,n.g,n.b),u=!0,f=String(n.r).substr(-1)==="%"?"prgb":"rgb"):h(n.h)&&h(n.s)&&h(n.v)?(r=c(n.s),e=c(n.v),t=ot(n.h,r,e),u=!0,f="hsv"):h(n.h)&&h(n.s)&&h(n.l)&&(r=c(n.s),l=c(n.l),t=et(n.h,r,l),u=!0,f="hsl"),n.hasOwnProperty("a")&&(i=n.a)),i=d(i),{ok:u,format:n.format||f,r:o(255,s(t.r,0)),g:o(255,s(t.g,0)),b:o(255,s(t.b,0)),a:i}}function ft(n,t,i){return{r:r(n,255)*255,g:r(t,255)*255,b:r(i,255)*255}}function y(n,t,i){var e;n=r(n,255);t=r(t,255);i=r(i,255);var u=s(n,t,i),h=o(n,t,i),f,c,l=(u+h)/2;if(u==h)f=c=0;else{e=u-h;c=l>.5?e/(2-u-h):e/(u+h);switch(u){case n:f=(t-i)/e+(t<i?6:0);break;case t:f=(i-n)/e+2;break;case i:f=(n-t)/e+4}f/=6}return{h:f,s:c,l:l}}function et(n,t,i){function h(n,t,i){return(i<0&&(i+=1),i>1&&(i-=1),i<1/6)?n+(t-n)*6*i:i<1/2?t:i<2/3?n+(t-n)*(2/3-i)*6:n}var e,o,s,u,f;return n=r(n,360),t=r(t,100),i=r(i,100),t===0?e=o=s=i:(u=i<.5?i*(1+t):i+t-i*t,f=2*i-u,e=h(f,u,n+1/3),o=h(f,u,n),s=h(f,u,n-1/3)),{r:e*255,g:o*255,b:s*255}}function p(n,t,i){n=r(n,255);t=r(t,255);i=r(i,255);var u=s(n,t,i),h=o(n,t,i),f,c,l=u,e=u-h;if(c=u===0?0:e/u,u==h)f=0;else{switch(u){case n:f=(t-i)/e+(t<i?6:0);break;case t:f=(i-n)/e+2;break;case i:f=(n-t)/e+4}f/=6}return{h:f,s:c,v:l}}function ot(t,i,u){t=r(t,360)*6;i=r(i,100);u=r(u,100);var h=n.floor(t),c=t-h,f=u*(1-i),e=u*(1-c*i),o=u*(1-(1-c)*i),s=h%6,l=[u,e,f,f,o,u][s],a=[o,u,u,e,f,f][s],v=[f,f,o,u,u,e][s];return{r:l*255,g:a*255,b:v*255}}function w(n,t,r,u){var f=[e(i(n).toString(16)),e(i(t).toString(16)),e(i(r).toString(16))];return u&&f[0].charAt(0)==f[0].charAt(1)&&f[1].charAt(0)==f[1].charAt(1)&&f[2].charAt(0)==f[2].charAt(1)?f[0].charAt(0)+f[1].charAt(0)+f[2].charAt(0):f.join("")}function st(n,t,r,u,f){var o=[e(i(n).toString(16)),e(i(t).toString(16)),e(i(r).toString(16)),e(g(u))];return f&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}function b(n,t,r,u){var f=[e(g(u)),e(i(n).toString(16)),e(i(t).toString(16)),e(i(r).toString(16))];return f.join("")}function ht(n,i){i=i===0?0:i||10;var r=t(n).toHsl();return r.s-=i/100,r.s=a(r.s),t(r)}function ct(n,i){i=i===0?0:i||10;var r=t(n).toHsl();return r.s+=i/100,r.s=a(r.s),t(r)}function lt(n){return t(n).desaturate(100)}function at(n,i){i=i===0?0:i||10;var r=t(n).toHsl();return r.l+=i/100,r.l=a(r.l),t(r)}function vt(n,r){r=r===0?0:r||10;var u=t(n).toRgb();return u.r=s(0,o(255,u.r-i(255*-(r/100)))),u.g=s(0,o(255,u.g-i(255*-(r/100)))),u.b=s(0,o(255,u.b-i(255*-(r/100)))),t(u)}function yt(n,i){i=i===0?0:i||10;var r=t(n).toHsl();return r.l-=i/100,r.l=a(r.l),t(r)}function pt(n,i){var r=t(n).toHsl(),u=(r.h+i)%360;return r.h=u<0?360+u:u,t(r)}function wt(n){var i=t(n).toHsl();return i.h=(i.h+180)%360,t(i)}function bt(n){var i=t(n).toHsl(),r=i.h;return[t(n),t({h:(r+120)%360,s:i.s,l:i.l}),t({h:(r+240)%360,s:i.s,l:i.l})]}function kt(n){var i=t(n).toHsl(),r=i.h;return[t(n),t({h:(r+90)%360,s:i.s,l:i.l}),t({h:(r+180)%360,s:i.s,l:i.l}),t({h:(r+270)%360,s:i.s,l:i.l})]}function dt(n){var i=t(n).toHsl(),r=i.h;return[t(n),t({h:(r+72)%360,s:i.s,l:i.l}),t({h:(r+216)%360,s:i.s,l:i.l})]}function gt(n,i,r){i=i||6;r=r||30;var u=t(n).toHsl(),f=360/r,e=[t(n)];for(u.h=(u.h-(f*i>>1)+720)%360;--i;)u.h=(u.h+f)%360,e.push(t(u));return e}function ni(n,i){i=i||6;for(var r=t(n).toHsv(),e=r.h,o=r.s,u=r.v,f=[],s=1/i;i--;)f.push(t({h:e,s:o,v:u})),u=(u+s)%1;return f}function ti(n){var i={},t;for(t in n)n.hasOwnProperty(t)&&(i[n[t]]=t);return i}function d(n){return n=parseFloat(n),(isNaN(n)||n<0||n>1)&&(n=1),n}function r(t,i){ii(t)&&(t="100%");var r=ri(t);return(t=o(i,s(0,parseFloat(t))),r&&(t=parseInt(t*i,10)/100),n.abs(t-i)<1e-6)?1:t%i/parseFloat(i)}function a(n){return o(1,s(0,n))}function u(n){return parseInt(n,16)}function ii(n){return typeof n=="string"&&n.indexOf(".")!=-1&&parseFloat(n)===1}function ri(n){return typeof n=="string"&&n.indexOf("%")!=-1}function e(n){return n.length==1?"0"+n:""+n}function c(n){return n<=1&&(n=n*100+"%"),n}function g(t){return n.round(parseFloat(t)*255).toString(16)}function nt(n){return u(n)/255}function h(n){return!!f.CSS_UNIT.exec(n)}function ui(n){var i,t;if(n=n.replace(tt,"").replace(it,"").toLowerCase(),i=!1,l[n])n=l[n],i=!0;else if(n=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};return(t=f.rgb.exec(n))?{r:t[1],g:t[2],b:t[3]}:(t=f.rgba.exec(n))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=f.hsl.exec(n))?{h:t[1],s:t[2],l:t[3]}:(t=f.hsla.exec(n))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=f.hsv.exec(n))?{h:t[1],s:t[2],v:t[3]}:(t=f.hsva.exec(n))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=f.hex8.exec(n))?{r:u(t[1]),g:u(t[2]),b:u(t[3]),a:nt(t[4]),format:i?"name":"hex8"}:(t=f.hex6.exec(n))?{r:u(t[1]),g:u(t[2]),b:u(t[3]),format:i?"name":"hex"}:(t=f.hex4.exec(n))?{r:u(t[1]+""+t[1]),g:u(t[2]+""+t[2]),b:u(t[3]+""+t[3]),a:nt(t[4]+""+t[4]),format:i?"name":"hex8"}:(t=f.hex3.exec(n))?{r:u(t[1]+""+t[1]),g:u(t[2]+""+t[2]),b:u(t[3]+""+t[3]),format:i?"name":"hex"}:!1}function fi(n){var t,i;return n=n||{level:"AA",size:"small"},t=(n.level||"AA").toUpperCase(),i=(n.size||"small").toLowerCase(),t!=="AA"&&t!=="AAA"&&(t="AA"),i!=="small"&&i!=="large"&&(i="small"),{level:t,size:i}}var tt=/^\s+/,it=/\s+$/,rt=0,i=n.round,o=n.min,s=n.max,v=n.random,l,k,f;t.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var n=this.toRgb();return(n.r*299+n.g*587+n.b*114)/1e3},getLuminance:function(){var u=this.toRgb(),t,i,r,f,e,o;return t=u.r/255,i=u.g/255,r=u.b/255,f=t<=.03928?t/12.92:n.pow((t+.055)/1.055,2.4),e=i<=.03928?i/12.92:n.pow((i+.055)/1.055,2.4),o=r<=.03928?r/12.92:n.pow((r+.055)/1.055,2.4),.2126*f+.7152*e+.0722*o},setAlpha:function(n){return this._a=d(n),this._roundA=i(100*this._a)/100,this},toHsv:function(){var n=p(this._r,this._g,this._b);return{h:n.h*360,s:n.s,v:n.v,a:this._a}},toHsvString:function(){var n=p(this._r,this._g,this._b),t=i(n.h*360),r=i(n.s*100),u=i(n.v*100);return this._a==1?"hsv("+t+", "+r+"%, "+u+"%)":"hsva("+t+", "+r+"%, "+u+"%, "+this._roundA+")"},toHsl:function(){var n=y(this._r,this._g,this._b);return{h:n.h*360,s:n.s,l:n.l,a:this._a}},toHslString:function(){var n=y(this._r,this._g,this._b),t=i(n.h*360),r=i(n.s*100),u=i(n.l*100);return this._a==1?"hsl("+t+", "+r+"%, "+u+"%)":"hsla("+t+", "+r+"%, "+u+"%, "+this._roundA+")"},toHex:function(n){return w(this._r,this._g,this._b,n)},toHexString:function(n){return"#"+this.toHex(n)},toHex8:function(n){return st(this._r,this._g,this._b,this._a,n)},toHex8String:function(n){return"#"+this.toHex8(n)},toRgb:function(){return{r:i(this._r),g:i(this._g),b:i(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+i(this._r)+", "+i(this._g)+", "+i(this._b)+")":"rgba("+i(this._r)+", "+i(this._g)+", "+i(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:i(r(this._r,255)*100)+"%",g:i(r(this._g,255)*100)+"%",b:i(r(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+i(r(this._r,255)*100)+"%, "+i(r(this._g,255)*100)+"%, "+i(r(this._b,255)*100)+"%)":"rgba("+i(r(this._r,255)*100)+"%, "+i(r(this._g,255)*100)+"%, "+i(r(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:k[w(this._r,this._g,this._b,!0)]||!1},toFilter:function(n){var r="#"+b(this._r,this._g,this._b,this._a),u=r,f=this._gradientType?"GradientType = 1, ":"",i;return n&&(i=t(n),u="#"+b(i._r,i._g,i._b,i._a)),"progid:DXImageTransform.Microsoft.gradient("+f+"startColorstr="+r+",endColorstr="+u+")"},toString:function(n){var i=!!n;n=n||this._format;var t=!1,r=this._a<1&&this._a>=0,u=!i&&r&&(n==="hex"||n==="hex6"||n==="hex3"||n==="hex4"||n==="hex8"||n==="name");return u?n==="name"&&this._a===0?this.toName():this.toRgbString():(n==="rgb"&&(t=this.toRgbString()),n==="prgb"&&(t=this.toPercentageRgbString()),(n==="hex"||n==="hex6")&&(t=this.toHexString()),n==="hex3"&&(t=this.toHexString(!0)),n==="hex4"&&(t=this.toHex8String(!0)),n==="hex8"&&(t=this.toHex8String()),n==="name"&&(t=this.toName()),n==="hsl"&&(t=this.toHslString()),n==="hsv"&&(t=this.toHsvString()),t||this.toHexString())},clone:function(){return t(this.toString())},_applyModification:function(n,t){var i=n.apply(null,[this].concat([].slice.call(t)));return this._r=i._r,this._g=i._g,this._b=i._b,this.setAlpha(i._a),this},lighten:function(){return this._applyModification(at,arguments)},brighten:function(){return this._applyModification(vt,arguments)},darken:function(){return this._applyModification(yt,arguments)},desaturate:function(){return this._applyModification(ht,arguments)},saturate:function(){return this._applyModification(ct,arguments)},greyscale:function(){return this._applyModification(lt,arguments)},spin:function(){return this._applyModification(pt,arguments)},_applyCombination:function(n,t){return n.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(gt,arguments)},complement:function(){return this._applyCombination(wt,arguments)},monochromatic:function(){return this._applyCombination(ni,arguments)},splitcomplement:function(){return this._applyCombination(dt,arguments)},triad:function(){return this._applyCombination(bt,arguments)},tetrad:function(){return this._applyCombination(kt,arguments)}};t.fromRatio=function(n,i){var u,r;if(typeof n=="object"){u={};for(r in n)n.hasOwnProperty(r)&&(u[r]=r==="a"?n[r]:c(n[r]));n=u}return t(n,i)};t.equals=function(n,i){return!n||!i?!1:t(n).toRgbString()==t(i).toRgbString()};t.random=function(){return t.fromRatio({r:v(),g:v(),b:v()})};t.mix=function(n,i,r){r=r===0?0:r||50;var u=t(n).toRgb(),f=t(i).toRgb(),e=r/100,o={r:(f.r-u.r)*e+u.r,g:(f.g-u.g)*e+u.g,b:(f.b-u.b)*e+u.b,a:(f.a-u.a)*e+u.a};return t(o)};t.readability=function(i,r){var u=t(i),f=t(r);return(n.max(u.getLuminance(),f.getLuminance())+.05)/(n.min(u.getLuminance(),f.getLuminance())+.05)};t.isReadable=function(n,i,r){var f=t.readability(n,i),e,u;u=!1;e=fi(r);switch(e.level+e.size){case"AAsmall":case"AAAlarge":u=f>=4.5;break;case"AAlarge":u=f>=3;break;case"AAAsmall":u=f>=7}return u};t.mostReadable=function(n,i,r){var f=null,o=0,e,s,h,c,u;for(r=r||{},s=r.includeFallbackColors,h=r.level,c=r.size,u=0;u<i.length;u++)e=t.readability(n,i[u]),e>o&&(o=e,f=t(i[u]));return t.isReadable(n,f,{level:h,size:c})||!s?f:(r.includeFallbackColors=!1,t.mostReadable(n,["#fff","#000"],r))};l=t.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",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",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",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:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"};k=t.hexNames=ti(l);f=function(){var n="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",t="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?",i="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?";return{CSS_UNIT:new RegExp(n),rgb:new RegExp("rgb"+t),rgba:new RegExp("rgba"+i),hsl:new RegExp("hsl"+t),hsla:new RegExp("hsla"+i),hsv:new RegExp("hsv"+t),hsva:new RegExp("hsva"+i),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();typeof module!="undefined"&&module.exports?module.exports=t:typeof define=="function"&&define.amd?define(function(){return t}):window.tinycolor=t}(Math),function(n){"use strict";typeof define=="function"&&define.amd?define(["jquery"],n):typeof exports=="object"&&typeof module=="object"?module.exports=n(require("jquery")):n(jQuery)}(function(n,t){"use strict";function s(t,i,r,u){for(var s=[],o,f,h,c,a,v,e=0;e<t.length;e++)o=t[e],o?(f=tinycolor(o),h=f.toHsl().l<.5?"sp-thumb-el sp-thumb-dark":"sp-thumb-el sp-thumb-light",h+=tinycolor.equals(i,o)?" sp-thumb-active":"",c=f.toString(u.preferredFormat||"rgb"),a=l?"background-color:"+f.toRgbString():"filter:"+f.toFilter(),s.push('<span title="'+c+'" data-color="'+f.toRgbString()+'" class="'+h+'"><span class="sp-thumb-inner" style="'+a+';" /><\/span>')):(v="sp-clear-display",s.push(n("<div />").append(n('<span data-color="" style="background-color:transparent;" class="'+v+'"><\/span>').attr("title",u.noColorSelectedText)).html()));return"<div class='sp-cf "+r+"'>"+s.join("")+"<\/div>"}function y(){for(var n=0;n<i.length;n++)i[n]&&i[n].hide()}function p(t,i){var r=n.extend({},c,t);return r.callbacks={move:f(r.move,i),change:f(r.change,i),show:f(r.show,i),hide:f(r.hide,i),beforeShow:f(r.beforeShow,i)},r}function w(u,f){function fr(){var t,i,r;if(h.showPaletteOnly&&(h.showPalette=!0),rr.text(h.showPaletteOnly?h.togglePaletteMoreText:h.togglePaletteLessText),h.palette)for(ai=h.palette.slice(0),ei=n.isArray(ai[0])?ai:[ai],vi={},t=0;t<ei.length;t++)for(i=0;i<ei[t].length;i++)r=tinycolor(ei[t][i]).toRgbString(),vi[r]=!0;c.toggleClass("sp-flat",ut);c.toggleClass("sp-input-disabled",!h.showInput);c.toggleClass("sp-alpha-enabled",h.showAlpha);c.toggleClass("sp-clear-enabled",ht);c.toggleClass("sp-buttons-disabled",!h.showButtons);c.toggleClass("sp-palette-buttons-disabled",!h.togglePaletteOnly);c.toggleClass("sp-palette-disabled",!h.showPalette);c.toggleClass("sp-palette-only",h.showPaletteOnly);c.toggleClass("sp-initial-disabled",!h.showInitial);c.addClass(h.className).addClass(h.containerClassName);at()}function pu(){function u(t){return t.data&&t.data.ignore?(ct(n(t.target).closest(".sp-thumb-el").data("color")),ni()):(ct(n(t.target).closest(".sp-thumb-el").data("color")),ni(),lt(!0),h.hideAfterPaletteSelect&&ot()),!1}var t,i;r&&c.find("*:not(input)").attr("unselectable","on");fr();ur&&w.after(bt).hide();ht||ir.hide();ut?w.after(c).hide():(t=h.appendTo==="parent"?w.parent():n(h.appendTo),t.length!==1&&(t=n("body")),t.append(c));nu();si.bind("click.spectrum touchstart.spectrum",function(t){nr||ru();t.stopPropagation();n(t.target).is("input")||t.preventDefault()});(w.is(":disabled")||h.disabled===!0)&&su();c.click(k);it.change(hr);it.bind("paste",function(){setTimeout(hr,1)});it.keydown(function(n){n.keyCode==13&&hr()});dr.text(h.cancelText);dr.bind("click.spectrum",function(n){n.stopPropagation();n.preventDefault();eu();ot()});ir.attr("title",h.clearText);ir.bind("click.spectrum",function(n){n.stopPropagation();n.preventDefault();et=!0;ni();ut&&lt(!0)});gr.text(h.chooseText);gr.bind("click.spectrum",function(n){n.stopPropagation();n.preventDefault();r&&it.is(":focus")&&it.trigger("change");bu()&&(lt(!0),ot())});rr.text(h.showPaletteOnly?h.togglePaletteMoreText:h.togglePaletteLessText);rr.bind("click.spectrum",function(n){n.stopPropagation();n.preventDefault();h.showPaletteOnly=!h.showPaletteOnly;h.showPaletteOnly||ut||c.css("left","-="+(au.outerWidth(!0)+5));fr()});o(wr,function(n,t,i){nt=n/gi;et=!1;i.shiftKey&&(nt=Math.round(nt*10)/10);ni()},or,sr);o(tr,function(n,t){ri=parseFloat(t/li);et=!1;h.showAlpha||(nt=1);ni()},or,sr);o(yi,function(n,t,i){var r,u;if(i.shiftKey){if(!ft){var f=ui*pt,e=rt-fi*rt,o=Math.abs(n-f)>Math.abs(t-e);ft=o?"x":"y"}}else ft=null;r=!ft||ft==="x";u=!ft||ft==="y";r&&(ui=parseFloat(n/pt));u&&(fi=parseFloat((rt-t)/rt));et=!1;h.showAlpha||(nt=1);ni()},or,sr);hi?(ct(hi),ti(),gt=h.preferredFormat||tinycolor(hi).format,er(hi)):ti();ut&&cr();i=r?"mousedown.spectrum":"click.spectrum touchstart.spectrum";br.delegate(".sp-thumb-el",i,u);kr.delegate(".sp-thumb-el:nth-child(1)",i,{ignore:!0},u)}function nu(){if(vt&&window.localStorage){try{var t=window.localStorage[vt].split(",#");t.length>1&&(delete window.localStorage[vt],n.each(t,function(n,t){er(t)}))}catch(i){}try{tt=window.localStorage[vt].split(";")}catch(i){}}}function er(t){if(hu){var i=tinycolor(t).toRgbString();if(!vi[i]&&n.inArray(i,tt)===-1)for(tt.push(i);tt.length>lu;)tt.shift();if(vt&&window.localStorage)try{window.localStorage[vt]=tt.join(";")}catch(r){}}}function wu(){var t=[],n,i;if(h.showPalette)for(n=0;n<tt.length;n++)i=tinycolor(tt[n]).toRgbString(),vi[i]||t.push(tt[n]);return t.reverse().slice(0,h.maxSelectionSize)}function tu(){var t=g(),i=n.map(ei,function(n,i){return s(n,t,"sp-palette-row sp-palette-row-"+i,h)});nu();tt&&i.push(s(wu(),t,"sp-palette-row sp-palette-row-selection",h));br.html(i.join(""))}function iu(){if(h.showInitial){var t=dt,n=g();kr.html(s([t,n],n,"sp-palette-row-initial",h))}}function or(){(rt<=0||pt<=0||li<=0)&&at();di=!0;c.addClass(pr);ft=null;w.trigger("dragstart.spectrum",[g()])}function sr(){di=!1;c.removeClass(pr);w.trigger("dragstop.spectrum",[g()])}function hr(){var n=it.val(),t;(n===null||n==="")&&ht?(ct(null),lt(!0)):(t=tinycolor(n),t.isValid()?(ct(t),lt(!0)):it.addClass("sp-validation-error"))}function ru(){yt?ot():cr()}function cr(){var t=n.Event("beforeShow.spectrum");if(yt){at();return}(w.trigger(t,[g()]),ii.beforeShow(g())===!1||t.isDefaultPrevented())||(y(),yt=!0,n(wt).bind("keydown.spectrum",uu),n(wt).bind("click.spectrum",fu),n(window).bind("resize.spectrum",ar),bt.addClass("sp-active"),c.removeClass("sp-hidden"),at(),ti(),dt=g(),iu(),ii.show(dt),w.trigger("show.spectrum",[dt]))}function uu(n){n.keyCode===27&&ot()}function fu(n){n.button!=2&&(di||(yu?lt(!0):eu(),ot()))}function ot(){yt&&!ut&&(yt=!1,n(wt).unbind("keydown.spectrum",uu),n(wt).unbind("click.spectrum",fu),n(window).unbind("resize.spectrum",ar),bt.removeClass("sp-active"),c.addClass("sp-hidden"),ii.hide(g()),w.trigger("hide.spectrum",[g()]))}function eu(){ct(dt,!0)}function ct(n,t){if(tinycolor.equals(n,g())){ti();return}var i,r;!n&&ht?et=!0:(et=!1,i=tinycolor(n),r=i.toHsv(),ri=r.h%360/360,ui=r.s,fi=r.v,nt=r.a);ti();i&&i.isValid()&&!t&&(gt=h.preferredFormat||i.getFormat())}function g(n){return(n=n||{},ht&&et)?null:tinycolor.fromRatio({h:ri,s:ui,v:fi,a:Math.round(nt*100)/100},{format:n.format||gt})}function bu(){return!it.hasClass("sp-validation-error")}function ni(){ti();ii.move(g());w.trigger("move.spectrum",[g()])}function ti(){var s,n,t,e,i,c,o,u,f;it.removeClass("sp-validation-error");ou();s=tinycolor.fromRatio({h:ri,s:1,v:1});yi.css("background-color",s.toHexString());n=gt;nt<1&&!(nt===0&&n==="name")&&(n==="hex"||n==="hex3"||n==="hex6"||n==="name")&&(n="rgb");t=g({format:n});e="";kt.removeClass("sp-clear-display");kt.css("background-color","transparent");!t&&ht?kt.addClass("sp-clear-display"):(i=t.toHexString(),c=t.toRgbString(),l||t.alpha===1?kt.css("background-color",c):(kt.css("background-color","transparent"),kt.css("filter",t.toFilter())),h.showAlpha&&(o=t.toRgb(),o.a=0,u=tinycolor(o).toRgbString(),f="linear-gradient(left, "+u+", "+i+")",r?oi.css("filter",tinycolor(u).toFilter({gradientType:1},i)):(oi.css("background","-webkit-"+f),oi.css("background","-moz-"+f),oi.css("background","-ms-"+f),oi.css("background","linear-gradient(to right, "+u+", "+i+")"))),e=t.toString(n));h.showInput&&it.val(e);h.showPalette&&tu();iu()}function ou(){var u=ui,f=fi,n,t,i,r;ht&&et?(bi.hide(),wi.hide(),pi.hide()):(bi.show(),wi.show(),pi.show(),n=u*pt,t=rt-f*rt,n=Math.max(-st,Math.min(pt-st,n-st)),t=Math.max(-st,Math.min(rt-st,t-st)),pi.css({top:t+"px",left:n+"px"}),i=nt*gi,bi.css({left:i-vr/2+"px"}),r=ri*li,wi.css({top:r-yr+"px"}))}function lt(n){var t=g(),i="",r=!tinycolor.equals(t,dt);t&&(i=t.toString(gt),er(t));ki&&w.val(i);n&&r&&(ii.change(t),w.trigger("change",[t]))}function at(){yt&&(pt=yi.width(),rt=yi.height(),st=pi.height(),cu=tr.width(),li=tr.height(),yr=wi.height(),gi=wr.width(),vr=bi.width(),ut||(c.css("position","absolute"),h.offset?c.offset(h.offset):c.offset(b(c,si))),ou(),h.showPalette&&tu(),w.trigger("reflow.spectrum"))}function ku(){w.show();si.unbind("click.spectrum touchstart.spectrum");c.remove();bt.remove();i[ci.id]=null}function du(i,r){if(i===t)return n.extend({},h);if(r===t)return h[i];h[i]=r;i==="preferredFormat"&&(gt=h.preferredFormat);fr()}function gu(){nr=!1;w.attr("disabled",!1);si.removeClass("sp-disabled")}function su(){ot();nr=!0;w.attr("disabled",!0);si.addClass("sp-disabled")}function nf(n){h.offset=n;at()}var h=p(f,u),ut=h.flat,hu=h.showSelectionPalette,vt=h.localStorageKey,lr=h.theme,ii=h.callbacks,ar=d(at,10),yt=!1,di=!1,pt=0,rt=0,st=0,li=0,cu=0,gi=0,vr=0,yr=0,ri=0,ui=0,fi=0,nt=1,ai=[],ei=[],vi={},tt=h.selectionPalette.slice(0),lu=h.maxSelectionSize,pr="sp-dragging",ft=null,wt=u.ownerDocument,tf=wt.body,w=n(u),nr=!1,c=n(v,wt).addClass(lr),au=c.find(".sp-picker-container"),yi=c.find(".sp-color"),pi=c.find(".sp-dragger"),tr=c.find(".sp-hue"),wi=c.find(".sp-slider"),oi=c.find(".sp-alpha-inner"),wr=c.find(".sp-alpha"),bi=c.find(".sp-alpha-handle"),it=c.find(".sp-input"),br=c.find(".sp-palette"),kr=c.find(".sp-initial"),dr=c.find(".sp-cancel"),ir=c.find(".sp-clear"),gr=c.find(".sp-choose"),rr=c.find(".sp-palette-toggle"),ki=w.is("input"),vu=ki&&w.attr("type")==="color"&&e(),ur=ki&&!ut,bt=ur?n(a).addClass(lr).addClass(h.className).addClass(h.replacerClassName):n([]),si=ur?bt:w,kt=bt.find(".sp-preview-inner"),hi=h.color||ki&&w.val(),dt=!1,gt=h.preferredFormat,yu=!h.showButtons||h.clickoutFiresChange,et=!hi,ht=h.allowEmpty&&!vu,ci;return pu(),ci={show:cr,hide:ot,toggle:ru,reflow:at,option:du,enable:gu,disable:su,offset:nf,set:function(n){ct(n);lt()},get:g,destroy:ku,container:c},ci.id=i.push(ci)-1,ci}function b(t,i){var s=0,u=t.outerWidth(),f=t.outerHeight(),h=i.outerHeight(),e=t[0].ownerDocument,c=e.documentElement,o=c.clientWidth+n(e).scrollLeft(),l=c.clientHeight+n(e).scrollTop(),r=i.offset();return r.top+=h,r.left-=Math.min(r.left,r.left+u>o&&o>u?Math.abs(r.left+u-o):0),r.top-=Math.min(r.top,r.top+f>l&&l>f?Math.abs(f+h-s):s),r}function u(){}function k(n){n.stopPropagation()}function f(n,t){var i=Array.prototype.slice,r=i.call(arguments,2);return function(){return n.apply(t,r.concat(i.call(arguments)))}}function o(t,i,u,f){function h(n){n.stopPropagation&&n.stopPropagation();n.preventDefault&&n.preventDefault();n.returnValue=!1}function v(n){if(s){if(r&&o.documentMode<9&&!n.button)return y();var u=n.originalEvent&&n.originalEvent.touches&&n.originalEvent.touches[0],f=u&&u.pageX||n.pageX,e=u&&u.pageY||n.pageY,v=Math.max(0,Math.min(f-c.left,a)),w=Math.max(0,Math.min(e-c.top,l));p&&h(n);i.apply(t,[v,w,n])}}function w(i){var r=i.which?i.which==3:i.button==2;r||s||u.apply(t,arguments)!==!1&&(s=!0,l=n(t).height(),a=n(t).width(),c=n(t).offset(),n(o).bind(e),n(o.body).addClass("sp-dragging"),v(i),h(i))}function y(){s&&(n(o).unbind(e),n(o.body).removeClass("sp-dragging"),setTimeout(function(){f.apply(t,arguments)},0));s=!1}i=i||function(){};u=u||function(){};f=f||function(){};var o=document,s=!1,c={},l=0,a=0,p="ontouchstart"in window,e={};e.selectstart=h;e.dragstart=h;e["touchmove mousemove"]=v;e["touchend mouseup"]=y;n(t).bind("touchstart mousedown",w)}function d(n,t,i){var r;return function(){var u=this,f=arguments,e=function(){r=null;n.apply(u,f)};i&&clearTimeout(r);(i||!r)&&(r=setTimeout(e,t))}}function e(){return n.fn.spectrum.inputTypeColorSupport()}var c={beforeShow:u,move:u,change:u,show:u,hide:u,color:!1,flat:!1,showInput:!1,allowEmpty:!1,showButtons:!0,clickoutFiresChange:!0,showInitial:!1,showPalette:!1,showPaletteOnly:!1,hideAfterPaletteSelect:!1,togglePaletteOnly:!1,showSelectionPalette:!0,localStorageKey:!1,appendTo:"body",maxSelectionSize:7,cancelText:"cancel",chooseText:"choose",togglePaletteMoreText:"more",togglePaletteLessText:"less",clearText:"Clear Color Selection",noColorSelectedText:"No Color Selected",preferredFormat:!1,className:"",containerClassName:"",replacerClassName:"",showAlpha:!1,theme:"sp-light",palette:[["#ffffff","#000000","#ff0000","#ff8000","#ffff00","#008000","#0000ff","#4b0082","#9400d3"]],selectionPalette:[],disabled:!1,offset:null},i=[],r=!!/msie/i.exec(window.navigator.userAgent),l=function(){function t(n,t){return!!~(""+n).indexOf(t)}var i=document.createElement("div"),n=i.style;return n.cssText="background-color:rgba(0,0,0,.5)",t(n.backgroundColor,"rgba")||t(n.backgroundColor,"hsla")}(),a="<div class='sp-replacer'><div class='sp-preview'><div class='sp-preview-inner'><\/div><\/div><div class='sp-dd'>&#9660;<\/div><\/div>",v=function(){var t="",n;if(r)for(n=1;n<=6;n++)t+="<div class='sp-"+n+"'><\/div>";return["<div class='sp-container sp-hidden'>","<div class='sp-palette-container'>","<div class='sp-palette sp-thumb sp-cf'><\/div>","<div class='sp-palette-button-container sp-cf'>","<button type='button' class='sp-palette-toggle'><\/button>","<\/div>","<\/div>","<div class='sp-picker-container'>","<div class='sp-top sp-cf'>","<div class='sp-fill'><\/div>","<div class='sp-top-inner'>","<div class='sp-color'>","<div class='sp-sat'>","<div class='sp-val'>","<div class='sp-dragger'><\/div>","<\/div>","<\/div>","<\/div>","<div class='sp-clear sp-clear-display'>","<\/div>","<div class='sp-hue'>","<div class='sp-slider'><\/div>",t,"<\/div>","<\/div>","<div class='sp-alpha'><div class='sp-alpha-inner'><div class='sp-alpha-handle'><\/div><\/div><\/div>","<\/div>","<div class='sp-input-container sp-cf'>","<input class='sp-input' type='text' spellcheck='false'  />","<\/div>","<div class='sp-initial sp-thumb sp-cf'><\/div>","<div class='sp-button-container sp-cf'>","<a class='sp-cancel' href='#'><\/a>","<button type='button' class='sp-choose'><\/button>","<\/div>","<\/div>","<\/div>"].join("")}(),h="spectrum.id";n.fn.spectrum=function(t){if(typeof t=="string"){var r=this,u=Array.prototype.slice.call(arguments,1);return this.each(function(){var f=i[n(this).data(h)],e;if(f){if(e=f[t],!e)throw new Error("Spectrum: no such method: '"+t+"'");t=="get"?r=f.get():t=="container"?r=f.container:t=="option"?r=f.option.apply(f,u):t=="destroy"?(f.destroy(),n(this).removeData(h)):e.apply(f,u)}}),r}return this.spectrum("destroy").each(function(){var i=n.extend({},t,n(this).data()),r=w(this,i);n(this).data(h,r.id)})};n.fn.spectrum.load=!0;n.fn.spectrum.loadOpts={};n.fn.spectrum.draggable=o;n.fn.spectrum.defaults=c;n.fn.spectrum.inputTypeColorSupport=function e(){if(typeof e._cachedResult=="undefined"){var t=n("<input type='color'/>")[0];e._cachedResult=t.type==="color"&&t.value!==""}return e._cachedResult};n.spectrum={};n.spectrum.localization={};n.spectrum.palettes={};n.fn.spectrum.processNativeColorInputs=function(){var t=n("input[type=color]");t.length&&!e()&&t.spectrum({preferredFormat:"hex6"})},function(){function tt(n){var t={r:0,g:0,b:0},i=1,f=!1,e=!1;return typeof n=="string"&&(n=ii(n)),typeof n=="object"&&(n.hasOwnProperty("r")&&n.hasOwnProperty("g")&&n.hasOwnProperty("b")?(t=it(n.r,n.g,n.b),f=!0,e=String(n.r).substr(-1)==="%"?"prgb":"rgb"):n.hasOwnProperty("h")&&n.hasOwnProperty("s")&&n.hasOwnProperty("v")?(n.s=h(n.s),n.v=h(n.v),t=ut(n.h,n.s,n.v),f=!0,e="hsv"):n.hasOwnProperty("h")&&n.hasOwnProperty("s")&&n.hasOwnProperty("l")&&(n.s=h(n.s),n.l=h(n.l),t=rt(n.h,n.s,n.l),f=!0,e="hsl"),n.hasOwnProperty("a")&&(i=n.a)),i=k(i),{ok:f,format:n.format||e,r:r(255,u(t.r,0)),g:r(255,u(t.g,0)),b:r(255,u(t.b,0)),a:i}}function it(n,t,r){return{r:i(n,255)*255,g:i(t,255)*255,b:i(r,255)*255}}function v(n,t,f){var s;n=i(n,255);t=i(t,255);f=i(f,255);var e=u(n,t,f),h=r(n,t,f),o,c,l=(e+h)/2;if(e==h)o=c=0;else{s=e-h;c=l>.5?s/(2-e-h):s/(e+h);switch(e){case n:o=(t-f)/s+(t<f?6:0);break;case t:o=(f-n)/s+2;break;case f:o=(n-t)/s+4}o/=6}return{h:o,s:c,l:l}}function rt(n,t,r){function h(n,t,i){return(i<0&&(i+=1),i>1&&(i-=1),i<1/6)?n+(t-n)*6*i:i<1/2?t:i<2/3?n+(t-n)*(2/3-i)*6:n}var e,o,s,u,f;return n=i(n,360),t=i(t,100),r=i(r,100),t===0?e=o=s=r:(u=r<.5?r*(1+t):r+t-r*t,f=2*r-u,e=h(f,u,n+1/3),o=h(f,u,n),s=h(f,u,n-1/3)),{r:e*255,g:o*255,b:s*255}}function y(n,t,f){n=i(n,255);t=i(t,255);f=i(f,255);var e=u(n,t,f),h=r(n,t,f),o,c,l=e,s=e-h;if(c=e===0?0:s/e,e==h)o=0;else{switch(e){case n:o=(t-f)/s+(t<f?6:0);break;case t:o=(f-n)/s+2;break;case f:o=(n-t)/s+4}o/=6}return{h:o,s:c,v:l}}function ut(n,t,r){n=i(n,360)*6;t=i(t,100);r=i(r,100);var h=s.floor(n),c=n-h,u=r*(1-t),f=r*(1-c*t),e=r*(1-(1-c)*t),o=h%6,l=[r,f,u,u,e,r][o],a=[e,r,r,f,u,u][o],v=[u,u,e,r,r,f][o];return{r:l*255,g:a*255,b:v*255}}function p(n,i,r,u){var f=[o(t(n).toString(16)),o(t(i).toString(16)),o(t(r).toString(16))];return u&&f[0].charAt(0)==f[0].charAt(1)&&f[1].charAt(0)==f[1].charAt(1)&&f[2].charAt(0)==f[2].charAt(1)?f[0].charAt(0)+f[1].charAt(0)+f[2].charAt(0):f.join("")}function w(n,i,r,u){var f=[o(ni(u)),o(t(n).toString(16)),o(t(i).toString(16)),o(t(r).toString(16))];return f.join("")}function ft(t,i){i=i===0?0:i||10;var r=n(t).toHsl();return r.s-=i/100,r.s=l(r.s),n(r)}function et(t,i){i=i===0?0:i||10;var r=n(t).toHsl();return r.s+=i/100,r.s=l(r.s),n(r)}function ot(t){return n(t).desaturate(100)}function st(t,i){i=i===0?0:i||10;var r=n(t).toHsl();return r.l+=i/100,r.l=l(r.l),n(r)}function ht(i,f){f=f===0?0:f||10;var e=n(i).toRgb();return e.r=u(0,r(255,e.r-t(255*-(f/100)))),e.g=u(0,r(255,e.g-t(255*-(f/100)))),e.b=u(0,r(255,e.b-t(255*-(f/100)))),n(e)}function ct(t,i){i=i===0?0:i||10;var r=n(t).toHsl();return r.l-=i/100,r.l=l(r.l),n(r)}function lt(i,r){var u=n(i).toHsl(),f=(t(u.h)+r)%360;return u.h=f<0?360+f:f,n(u)}function at(t){var i=n(t).toHsl();return i.h=(i.h+180)%360,n(i)}function vt(t){var i=n(t).toHsl(),r=i.h;return[n(t),n({h:(r+120)%360,s:i.s,l:i.l}),n({h:(r+240)%360,s:i.s,l:i.l})]}function yt(t){var i=n(t).toHsl(),r=i.h;return[n(t),n({h:(r+90)%360,s:i.s,l:i.l}),n({h:(r+180)%360,s:i.s,l:i.l}),n({h:(r+270)%360,s:i.s,l:i.l})]}function pt(t){var i=n(t).toHsl(),r=i.h;return[n(t),n({h:(r+72)%360,s:i.s,l:i.l}),n({h:(r+216)%360,s:i.s,l:i.l})]}function wt(t,i,r){i=i||6;r=r||30;var u=n(t).toHsl(),f=360/r,e=[n(t)];for(u.h=(u.h-(f*i>>1)+720)%360;--i;)u.h=(u.h+f)%360,e.push(n(u));return e}function bt(t,i){i=i||6;for(var r=n(t).toHsv(),e=r.h,o=r.s,u=r.v,f=[],s=1/i;i--;)f.push(n({h:e,s:o,v:u})),u=(u+s)%1;return f}function kt(n){var i={},t;for(t in n)n.hasOwnProperty(t)&&(i[n[t]]=t);return i}function k(n){return n=parseFloat(n),(isNaN(n)||n<0||n>1)&&(n=1),n}function i(n,t){dt(n)&&(n="100%");var i=gt(n);return(n=r(t,u(0,parseFloat(n))),i&&(n=parseInt(n*t,10)/100),s.abs(n-t)<1e-6)?1:n%t/parseFloat(t)}function l(n){return r(1,u(0,n))}function f(n){return parseInt(n,16)}function dt(n){return typeof n=="string"&&n.indexOf(".")!=-1&&parseFloat(n)===1}function gt(n){return typeof n=="string"&&n.indexOf("%")!=-1}function o(n){return n.length==1?"0"+n:""+n}function h(n){return n<=1&&(n=n*100+"%"),n}function ni(n){return Math.round(parseFloat(n)*255).toString(16)}function ti(n){return f(n)/255}function ii(n){var i,t;if(n=n.replace(d,"").replace(g,"").toLowerCase(),i=!1,c[n])n=c[n],i=!0;else if(n=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};return(t=e.rgb.exec(n))?{r:t[1],g:t[2],b:t[3]}:(t=e.rgba.exec(n))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=e.hsl.exec(n))?{h:t[1],s:t[2],l:t[3]}:(t=e.hsla.exec(n))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=e.hsv.exec(n))?{h:t[1],s:t[2],v:t[3]}:(t=e.hsva.exec(n))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=e.hex8.exec(n))?{a:ti(t[1]),r:f(t[2]),g:f(t[3]),b:f(t[4]),format:i?"name":"hex8"}:(t=e.hex6.exec(n))?{r:f(t[1]),g:f(t[2]),b:f(t[3]),format:i?"name":"hex"}:(t=e.hex3.exec(n))?{r:f(t[1]+""+t[1]),g:f(t[2]+""+t[2]),b:f(t[3]+""+t[3]),format:i?"name":"hex"}:!1}var d=/^[\s,#]+/,g=/\s+$/,nt=0,s=Math,t=s.round,r=s.min,u=s.max,a=s.random,n=function(i,r){if(i=i?i:"",r=r||{},i instanceof n)return i;if(!(this instanceof n))return new n(i,r);var u=tt(i);this._originalInput=i;this._r=u.r;this._g=u.g;this._b=u.b;this._a=u.a;this._roundA=t(100*this._a)/100;this._format=r.format||u.format;this._gradientType=r.gradientType;this._r<1&&(this._r=t(this._r));this._g<1&&(this._g=t(this._g));this._b<1&&(this._b=t(this._b));this._ok=u.ok;this._tc_id=nt++},c,b,e;n.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var n=this.toRgb();return(n.r*299+n.g*587+n.b*114)/1e3},setAlpha:function(n){return this._a=k(n),this._roundA=t(100*this._a)/100,this},toHsv:function(){var n=y(this._r,this._g,this._b);return{h:n.h*360,s:n.s,v:n.v,a:this._a}},toHsvString:function(){var n=y(this._r,this._g,this._b),i=t(n.h*360),r=t(n.s*100),u=t(n.v*100);return this._a==1?"hsv("+i+", "+r+"%, "+u+"%)":"hsva("+i+", "+r+"%, "+u+"%, "+this._roundA+")"},toHsl:function(){var n=v(this._r,this._g,this._b);return{h:n.h*360,s:n.s,l:n.l,a:this._a}},toHslString:function(){var n=v(this._r,this._g,this._b),i=t(n.h*360),r=t(n.s*100),u=t(n.l*100);return this._a==1?"hsl("+i+", "+r+"%, "+u+"%)":"hsla("+i+", "+r+"%, "+u+"%, "+this._roundA+")"},toHex:function(n){return p(this._r,this._g,this._b,n)},toHexString:function(n){return"#"+this.toHex(n)},toHex8:function(){return w(this._r,this._g,this._b,this._a)},toHex8String:function(){return"#"+this.toHex8()},toRgb:function(){return{r:t(this._r),g:t(this._g),b:t(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+t(this._r)+", "+t(this._g)+", "+t(this._b)+")":"rgba("+t(this._r)+", "+t(this._g)+", "+t(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:t(i(this._r,255)*100)+"%",g:t(i(this._g,255)*100)+"%",b:t(i(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+t(i(this._r,255)*100)+"%, "+t(i(this._g,255)*100)+"%, "+t(i(this._b,255)*100)+"%)":"rgba("+t(i(this._r,255)*100)+"%, "+t(i(this._g,255)*100)+"%, "+t(i(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:b[p(this._r,this._g,this._b,!0)]||!1},toFilter:function(t){var i="#"+w(this._r,this._g,this._b,this._a),r=i,f=this._gradientType?"GradientType = 1, ":"",u;return t&&(u=n(t),r=u.toHex8String()),"progid:DXImageTransform.Microsoft.gradient("+f+"startColorstr="+i+",endColorstr="+r+")"},toString:function(n){var i=!!n;n=n||this._format;var t=!1,r=this._a<1&&this._a>=0,u=!i&&r&&(n==="hex"||n==="hex6"||n==="hex3"||n==="name");return u?n==="name"&&this._a===0?this.toName():this.toRgbString():(n==="rgb"&&(t=this.toRgbString()),n==="prgb"&&(t=this.toPercentageRgbString()),(n==="hex"||n==="hex6")&&(t=this.toHexString()),n==="hex3"&&(t=this.toHexString(!0)),n==="hex8"&&(t=this.toHex8String()),n==="name"&&(t=this.toName()),n==="hsl"&&(t=this.toHslString()),n==="hsv"&&(t=this.toHsvString()),t||this.toHexString())},_applyModification:function(n,t){var i=n.apply(null,[this].concat([].slice.call(t)));return this._r=i._r,this._g=i._g,this._b=i._b,this.setAlpha(i._a),this},lighten:function(){return this._applyModification(st,arguments)},brighten:function(){return this._applyModification(ht,arguments)},darken:function(){return this._applyModification(ct,arguments)},desaturate:function(){return this._applyModification(ft,arguments)},saturate:function(){return this._applyModification(et,arguments)},greyscale:function(){return this._applyModification(ot,arguments)},spin:function(){return this._applyModification(lt,arguments)},_applyCombination:function(n,t){return n.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(wt,arguments)},complement:function(){return this._applyCombination(at,arguments)},monochromatic:function(){return this._applyCombination(bt,arguments)},splitcomplement:function(){return this._applyCombination(pt,arguments)},triad:function(){return this._applyCombination(vt,arguments)},tetrad:function(){return this._applyCombination(yt,arguments)}};n.fromRatio=function(t,i){var u,r;if(typeof t=="object"){u={};for(r in t)t.hasOwnProperty(r)&&(u[r]=r==="a"?t[r]:h(t[r]));t=u}return n(t,i)};n.equals=function(t,i){return!t||!i?!1:n(t).toRgbString()==n(i).toRgbString()};n.random=function(){return n.fromRatio({r:a(),g:a(),b:a()})};n.mix=function(t,i,r){var s,l;r=r===0?0:r||50;var f=n(t).toRgb(),e=n(i).toRgb(),h=r/100,o=h*2-1,c=e.a-f.a,u;return u=o*c==-1?o:(o+c)/(1+o*c),u=(u+1)/2,s=1-u,l={r:e.r*u+f.r*s,g:e.g*u+f.g*s,b:e.b*u+f.b*s,a:e.a*h+f.a*(1-h)},n(l)};n.readability=function(t,i){var f=n(t),e=n(i),r=f.toRgb(),u=e.toRgb(),o=f.getBrightness(),s=e.getBrightness(),h=Math.max(r.r,u.r)-Math.min(r.r,u.r)+Math.max(r.g,u.g)-Math.min(r.g,u.g)+Math.max(r.b,u.b)-Math.min(r.b,u.b);return{brightness:Math.abs(o-s),color:h}};n.isReadable=function(t,i){var r=n.readability(t,i);return r.brightness>125&&r.color>500};n.mostReadable=function(t,i){for(var h=null,o=0,u=!1,r=0;r<i.length;r++){var f=n.readability(t,i[r]),e=f.brightness>125&&f.color>500,s=3*(f.brightness/125)+f.color/500;(e&&!u||e&&u&&s>o||!e&&!u&&s>o)&&(u=e,o=s,h=n(i[r]))}return h};c=n.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",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",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",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:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"};b=n.hexNames=kt(c);e=function(){var n="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",t="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?",i="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?";return{rgb:new RegExp("rgb"+t),rgba:new RegExp("rgba"+i),hsl:new RegExp("hsl"+t),hsla:new RegExp("hsla"+i),hsv:new RegExp("hsv"+t),hsva:new RegExp("hsva"+i),hex3:/^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex8:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();window.tinycolor=n}();n(function(){n.fn.spectrum.load&&n.fn.spectrum.processNativeColorInputs()})}),function(){function l(n,t,i){for(var r=(i||0)-1,u=n?n.length:0;++r<u;)if(n[r]===t)return r;return-1}function it(n,t){var i=typeof t,r;return(n=n.cache,i=="boolean"||t==null)?n[t]?0:-1:(i!="number"&&i!="string"&&(i="object"),r=i=="number"?t:ft+t,n=(n=n[i])&&n[r],i=="object"?n&&l(n,t)>-1?0:-1:n?0:-1)}function hi(n){var u=this.cache,t=typeof n,i,r;t=="boolean"||n==null?u[n]=!0:(t!="number"&&t!="string"&&(t="object"),i=t=="number"?n:ft+n,r=u[t]||(u[t]={}),t=="object"?(r[i]||(r[i]=[])).push(n):r[i]=!0)}function wt(n){return n.charCodeAt(0)}function ci(n,t){for(var f=n.criteria,e=t.criteria,u=-1,o=f.length,i,r;++u<o;)if(i=f[u],r=e[u],i!==r){if(i>r||typeof i=="undefined")return 1;if(i<r||typeof r=="undefined")return-1}return n.index-t.index}function ot(n){var u=-1,r=n.length,f=n[0],e=n[r/2|0],o=n[r-1],t,i;if(f&&typeof f=="object"&&e&&typeof e=="object"&&o&&typeof o=="object")return!1;for(t=st(),t["false"]=t["null"]=t["true"]=t.undefined=!1,i=st(),i.array=n,i.cache=t,i.push=hi;++u<r;)i.push(n[u]);return i}function li(n){return"\\"+oi[n]}function u(){return rt.pop()||[]}function st(){return ut.pop()||{array:null,cache:null,criteria:null,"false":!1,index:0,"null":!1,number:null,object:null,push:null,string:null,"true":!1,undefined:!1,value:null}}function i(n){n.length=0;rt.length<ct&&rt.push(n)}function k(n){var t=n.cache;t&&k(t);n.array=n.cache=n.criteria=n.object=n.number=n.string=n.value=null;ut.length<ct&&ut.push(n)}function n(n,t,i){t||(t=0);typeof i=="undefined"&&(i=n?n.length:0);for(var r=-1,u=i-t||0,f=Array(u<0?0:u);++r<u;)f[r]=n[t+r];return f}function ht(c){function nt(n){return n&&typeof n=="object"&&!ut(n)&&oi.call(n,"__wrapped__")?n:new rr(n)}function rr(n,t){this.__chain__=!!t;this.__wrapped__=n}function eo(t){function r(){var t,e,o;return(u&&(t=n(u),lr.apply(t,arguments)),this instanceof r)?(e=yr(i.prototype),o=i.apply(e,t||arguments),hi(o)?o:e):i.apply(f,t||arguments)}var i=t[0],u=t[2],f=t[4];return ru(r,t),r}function pu(t,f,e,o,h){var c,d,v,l,a,g,k;if(e&&(c=e(t),typeof c!="undefined"))return c;if(d=hi(t),d){if(v=ct.call(t),!r[v])return t;l=di[v];switch(v){case y:case p:return new l(+t);case w:case s:return new l(t);case b:return c=l(t.source,ti.exec(t)),c.lastIndex=t.lastIndex,c}}else return t;if(a=ut(t),f){for(g=!o,o||(o=u()),h||(h=u()),k=o.length;k--;)if(o[k]==t)return h[k];c=a?l(t.length):{}}else c=a?n(t):fu({},t);return(a&&(oi.call(t,"index")&&(c.index=t.index),oi.call(t,"input")&&(c.input=t.input)),!f)?c:(o.push(t),h.push(c),(a?ai:tt)(t,function(n,t){c[t]=pu(n,f,e,o,h)}),g&&(i(o),i(h)),c)}function yr(n){return hi(n)?nu(n):{}}function vi(n,t,i){var r,u;if(typeof n!="function")return uf;if(typeof t=="undefined"||!("prototype"in n)||(r=n.__bindData__,typeof r=="undefined"&&(or.funcNames&&(r=!n.name),r=r||!or.funcDecomp,r||(u=io.call(n),or.funcNames||(r=!ii.test(u)),r||(r=vt.test(u),ru(n,r)))),r===!1||r!==!0&&r[1]&1))return n;switch(i){case 1:return function(i){return n.call(t,i)};case 2:return function(i,r){return n.call(t,i,r)};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 le(n,t)}function cf(t){function f(){var y=c?o:this,t,p;return(e&&(t=n(e),lr.apply(t,arguments)),(u||h)&&(t||(t=n(arguments)),u&&lr.apply(t,u),h&&t.length<s))?(i|=16,cf([r,a?i:i&-4,t,null,o,s])):(t||(t=arguments),l&&(r=y[v]),this instanceof f)?(y=yr(r.prototype),p=r.apply(y,t),hi(p)?p:y):r.apply(y,t)}var r=t[0],i=t[1],e=t[2],u=t[3],o=t[4],s=t[5],c=i&1,l=i&2,h=i&4,a=i&8,v=r;return ru(f,t),f}function pr(n,t){var e=-1,i=iu(),o=n?n.length:0,r=o>=et&&i===l,s=[],u,f;for(r&&(u=ot(t),u?(i=it,t=u):r=!1);++e<o;)f=n[e],i(t,f)<0&&s.push(f);return r&&k(t),s}function nr(n,t,i,r){for(var e=(r||0)-1,h=n?n.length:0,f=[],u;++e<h;)if(u=n[e],u&&typeof u=="object"&&typeof u.length=="number"&&(ut(u)||uu(u))){t||(u=nr(u,t,i));var o=-1,s=u.length,c=f.length;for(f.length+=s;++o<s;)f[c++]=u[o]}else i||f.push(u);return f}function sr(n,r,f,e,h,c){var l,ht,lt,d,it,ut,ft,et,nt,tt,at,g,k,ot,st;if(f&&(l=f(n,r),typeof l!="undefined"))return!!l;if(n===r)return n!==0||1/n==1/r;if(ht=typeof n,lt=typeof r,n===n&&!(n&&t[ht])&&!(r&&t[lt]))return!1;if(n==null||r==null)return n===r;if(d=ct.call(n),it=ct.call(r),d==a&&(d=o),it==a&&(it=o),d!=it)return!1;switch(d){case y:case p:return+n==+r;case w:return n!=+n?r!=+r:n==0?1/n==1/r:n==+r;case b:case s:return n==gi(r)}if(ut=d==v,!ut){if(ft=oi.call(n,"__wrapped__"),et=oi.call(r,"__wrapped__"),ft||et)return sr(ft?n.__wrapped__:n,et?r.__wrapped__:r,f,e,h,c);if(d!=o||(nt=n.constructor,tt=r.constructor,nt!=tt&&!(rt(nt)&&nt instanceof nt&&rt(tt)&&tt instanceof tt)&&"constructor"in n&&"constructor"in r))return!1}for(at=!h,h||(h=u()),c||(c=u()),g=h.length;g--;)if(h[g]==n)return c[g]==r;if(k=0,l=!0,h.push(n),c.push(r),ut){if(g=n.length,k=r.length,l=k==g,l||e)while(k--)if(ot=g,st=r[k],e){while(ot--)if(l=sr(n[ot],st,f,e,h,c))break}else if(!(l=sr(n[k],st,f,e,h,c)))break}else bi(r,function(t,i,r){if(oi.call(r,i))return k++,l=oi.call(n,i)&&sr(n[i],t,f,e,h,c)}),l&&!e&&bi(n,function(n,t,i){if(oi.call(i,t))return l=--k>-1});return h.pop(),c.pop(),at&&(i(h),i(c)),l}function lf(n,t,i,r,u){(ut(t)?ai:tt)(t,function(t,f){var c,l,o=t,e=n[f],s,h;if(t&&((l=ut(t))||ou(t))){for(s=r.length;s--;)if(c=r[s]==t){e=u[s];break}c||(i&&(o=i(e,t),(h=typeof o!="undefined")&&(e=o)),h||(e=l?ut(e)?e:[]:ou(e)?e:{}),r.push(t),u.push(e),h||lf(e,t,i,r,u))}else i&&(o=i(e,t),typeof o=="undefined"&&(o=t)),typeof o!="undefined"&&(e=o);n[f]=e})}function wu(n,t){return n+to(hf()*(t-n+1))}function bu(n,t,r){var e=-1,c=iu(),v=n?n.length:0,a=[],o=!t&&v>=et&&c===l,f=r||o?u():a,y,s,h;for(o&&(y=ot(f),c=it,f=y);++e<v;)s=n[e],h=r?r(s,e,n):s,(t?!e||f[f.length-1]!==h:c(f,h)<0)&&((r||o)&&f.push(h),a.push(s));return o?(i(f.array),k(f)):r&&i(f),a}function ku(n){return function(t,i,r){var f={},u,e,o;if(i=nt.createCallback(i,r,3),u=-1,e=t?t.length:0,typeof e=="number")while(++u<e)o=t[u],n(f,o,i(o,u,t),t);else tt(t,function(t,r,u){n(f,t,i(t,r,u),u)});return f}}function wi(t,i,r,u,f,e){var c=i&1,a=i&2,v=i&4,y=i&8,s=i&16,h=i&32,o,l;if(!a&&!rt(t))throw new ki;return(s&&!r.length&&(i&=-17,s=r=!1),h&&!u.length&&(i&=-33,h=u=!1),o=t&&t.__bindData__,o&&o!==!0)?(o=n(o),o[2]&&(o[2]=n(o[2])),o[3]&&(o[3]=n(o[3])),!c||o[1]&1||(o[4]=f),!c&&o[1]&1&&(i|=8),!v||o[1]&4||(o[5]=e),s&&lr.apply(o[2]||(o[2]=[]),r),h&&ro.apply(o[3]||(o[3]=[]),u),o[1]|=i,wi.apply(null,o)):(l=i==1||i===17?eo:cf,l([t,i,r,u,f,e]))}function oo(n){return du[n]}function iu(){var n=(n=nt.indexOf)===ee?l:n;return n}function tr(n){return typeof n=="function"&&ge.test(n)}function af(n){var t,i;return!(n&&ct.call(n)==o)||(t=n.constructor,rt(t)&&!(t instanceof t))?!1:(bi(n,function(n,t){i=t}),typeof i=="undefined"||oi.call(n,i))}function so(n){return vf[n]}function uu(n){return n&&typeof n=="object"&&typeof n.length=="number"&&ct.call(n)==a||!1}function ao(n,t,i,r){return typeof t!="boolean"&&t!=null&&(r=i,i=t,t=!1),pu(n,t,typeof i=="function"&&vi(i,r,1))}function vo(n,t,i){return pu(n,!0,typeof t=="function"&&vi(t,i,1))}function yo(n,t){var i=yr(n);return t?fu(i,t):i}function po(n,t,i){var r;return t=nt.createCallback(t,i,3),tt(n,function(n,i,u){if(t(n,i,u))return r=i,!1}),r}function wo(n,t,i){var r;return t=nt.createCallback(t,i,3),yf(n,function(n,i,u){if(t(n,i,u))return r=i,!1}),r}function bo(n,t,i){var r=[],u;for(bi(n,function(n,t){r.push(t,n)}),u=r.length,t=vi(t,i,3);u--;)if(t(r[u--],r[u],n)===!1)break;return n}function yf(n,t,i){var u=si(n),f=u.length,r;for(t=vi(t,i,3);f--;)if(r=u[f],t(n[r],r,n)===!1)break;return n}function wr(n){var t=[];return bi(n,function(n,i){rt(n)&&t.push(i)}),t.sort()}function ko(n,t){return n?oi.call(n,t):!1}function pf(n){for(var i=-1,r=si(n),f=r.length,u={},t;++i<f;)t=r[i],u[n[t]]=t;return u}function go(n){return n===!0||n===!1||n&&typeof n=="object"&&ct.call(n)==y||!1}function ns(n){return n&&typeof n=="object"&&ct.call(n)==p||!1}function ts(n){return n&&n.nodeType===1||!1}function is(n){var i=!0,t,r;return n?(t=ct.call(n),r=n.length,t==v||t==s||t==a||t==o&&typeof r=="number"&&rt(n.splice))?!r:(tt(n,function(){return i=!1}),i):i}function rs(n,t,i,r){return sr(n,t,typeof i=="function"&&vi(i,r,2))}function us(n){return uo(n)&&!fo(parseFloat(n))}function rt(n){return typeof n=="function"}function hi(n){return!!(n&&t[typeof n])}function fs(n){return wf(n)&&n!=+n}function es(n){return n===null}function wf(n){return typeof n=="number"||n&&typeof n=="object"&&ct.call(n)==w||!1}function os(n){return n&&typeof n=="object"&&ct.call(n)==b||!1}function br(n){return typeof n=="string"||n&&typeof n=="object"&&ct.call(n)==s||!1}function ss(n){return typeof n=="undefined"}function hs(n,t,i){var r={};return t=nt.createCallback(t,i,3),tt(n,function(n,i,u){r[i]=t(n,i,u)}),r}function cs(t){var f=arguments,r=2,e;if(!hi(t))return t;typeof f[2]!="number"&&(r=f.length);r>3&&typeof f[r-2]=="function"?e=vi(f[--r-1],f[r--],2):r>2&&typeof f[r-1]=="function"&&(e=f[--r]);for(var c=n(arguments,1,r),o=-1,s=u(),h=u();++o<r;)lf(t,c[o],e,s,h);return i(s),i(h),t}function ls(n,t,i){var u={},r,f,o,e;if(typeof t!="function")for(r=[],bi(n,function(n,t){r.push(t)}),r=pr(r,nr(arguments,!0,!1,1)),f=-1,o=r.length;++f<o;)e=r[f],u[e]=n[e];else t=nt.createCallback(t,i,3),bi(n,function(n,i,r){t(n,i,r)||(u[i]=n)});return u}function as(n){for(var t=-1,r=si(n),u=r.length,f=yi(u),i;++t<u;)i=r[t],f[t]=[i,n[i]];return f}function vs(n,t,i){var u={},r;if(typeof t!="function")for(var f=-1,e=nr(arguments,!0,!1,1),o=hi(n)?e.length:0;++f<o;)r=e[f],r in n&&(u[r]=n[r]);else t=nt.createCallback(t,i,3),bi(n,function(n,i,r){t(n,i,r)&&(u[i]=n)});return u}function ys(n,t,i,r){var f=ut(n),u,e;return i==null&&(f?i=[]:(u=n&&n.constructor,e=u&&u.prototype,i=yr(e))),t&&(t=nt.createCallback(t,r,4),(f?ai:tt)(n,function(n,r,u){return t(i,n,r,u)})),i}function su(n){for(var t=-1,i=si(n),r=i.length,u=yi(r);++t<r;)u[t]=n[i[t]];return u}function ps(n){for(var t=arguments,i=-1,r=nr(t,!0,!1,1),u=t[2]&&t[2][t[1]]===n?1:r.length,f=yi(u);++i<u;)f[i]=n[r[i]];return f}function bf(n,t,i){var e=-1,u=iu(),f=n?n.length:0,r=!1;return i=(i<0?pi(0,f+i):i)||0,ut(n)?r=u(n,t,i)>-1:typeof f=="number"?r=(br(n)?n.indexOf(t,i):u(n,t,i))>-1:tt(n,function(n){if(++e>=i)return!(r=n===t)}),r}function df(n,t,i){var u=!0,r,f;if(t=nt.createCallback(t,i,3),r=-1,f=n?n.length:0,typeof f=="number"){while(++r<f)if(!(u=!!t(n[r],r,n)))break}else tt(n,function(n,i,r){return u=!!t(n,i,r)});return u}function hu(n,t,i){var u=[],r,f,e;if(t=nt.createCallback(t,i,3),r=-1,f=n?n.length:0,typeof f=="number")while(++r<f)e=n[r],t(e,r,n)&&u.push(e);else tt(n,function(n,i,r){t(n,i,r)&&u.push(n)});return u}function gu(n,t,i){var r,u,f,e;if(t=nt.createCallback(t,i,3),r=-1,u=n?n.length:0,typeof u=="number"){while(++r<u)if(f=n[r],t(f,r,n))return f}else return tt(n,function(n,i,r){if(t(n,i,r))return e=n,!1}),e}function ws(n,t,i){var r;return t=nt.createCallback(t,i,3),cu(n,function(n,i,u){if(t(n,i,u))return r=n,!1}),r}function ai(n,t,i){var r=-1,u=n?n.length:0;if(t=t&&typeof i=="undefined"?t:vi(t,i,3),typeof u=="number"){while(++r<u)if(t(n[r],r,n)===!1)break}else tt(n,t);return n}function cu(n,t,i){var r=n?n.length:0,u;if(t=t&&typeof i=="undefined"?t:vi(t,i,3),typeof r=="number"){while(r--)if(t(n[r],r,n)===!1)break}else u=si(n),r=u.length,tt(n,function(n,i,f){return i=u?u[--r]:--r,t(f[i],i,f)});return n}function bs(t,i){var f=n(arguments,2),e=-1,o=typeof i=="function",r=t?t.length:0,u=yi(typeof r=="number"?r:0);return ai(t,function(n){u[++e]=(o?i:n[i]).apply(n,f)}),u}function kr(n,t,i){var r=-1,f=n?n.length:0,u;if(t=nt.createCallback(t,i,3),typeof f=="number")for(u=yi(f);++r<f;)u[r]=t(n[r],r,n);else u=[],tt(n,function(n,i,f){u[++r]=t(n,i,f)});return u}function te(n,t,i){var u=-Infinity,r=u,f,o,e;if(typeof t!="function"&&i&&i[t]===n&&(t=null),t==null&&ut(n))for(f=-1,o=n.length;++f<o;)e=n[f],e>r&&(r=e);else t=t==null&&br(n)?wt:nt.createCallback(t,i,3),ai(n,function(n,i,f){var e=t(n,i,f);e>u&&(u=e,r=n)});return r}function ks(n,t,i){var u=Infinity,r=u,f,o,e;if(typeof t!="function"&&i&&i[t]===n&&(t=null),t==null&&ut(n))for(f=-1,o=n.length;++f<o;)e=n[f],e<r&&(r=e);else t=t==null&&br(n)?wt:nt.createCallback(t,i,3),ai(n,function(n,i,f){var e=t(n,i,f);e<u&&(u=e,r=n)});return r}function nf(n,t,i,r){var f,u,e;if(!n)return i;if(f=arguments.length<3,t=nt.createCallback(t,r,4),u=-1,e=n.length,typeof e=="number")for(f&&(i=n[++u]);++u<e;)i=t(i,n[u],u,n);else tt(n,function(n,r,u){i=f?(f=!1,n):t(i,n,r,u)});return i}function ie(n,t,i,r){var u=arguments.length<3;return t=nt.createCallback(t,r,4),cu(n,function(n,r,f){i=u?(u=!1,n):t(i,n,r,f)}),i}function ds(n,t,i){return t=nt.createCallback(t,i,3),hu(n,function(n,i,r){return!t(n,i,r)})}function gs(n,t,i){if(n&&typeof n.length!="number"&&(n=su(n)),t==null||i)return n?n[wu(0,n.length-1)]:e;var r=re(n);return r.length=vr(pi(0,t),r.length),r}function re(n){var i=-1,r=n?n.length:0,t=yi(typeof r=="number"?r:0);return ai(n,function(n){var r=wu(0,++i);t[i]=t[r];t[r]=n}),t}function nh(n){var t=n?n.length:0;return typeof t=="number"?t:si(n).length}function ue(n,t,i){var u,r,f;if(t=nt.createCallback(t,i,3),r=-1,f=n?n.length:0,typeof f=="number"){while(++r<f)if(u=t(n[r],r,n))break}else tt(n,function(n,i,r){return!(u=t(n,i,r))});return!!u}function th(n,t,r){var h=-1,s=ut(t),f=n?n.length:0,e=yi(typeof f=="number"?f:0),o;for(s||(t=nt.createCallback(t,r,3)),ai(n,function(n,i,r){var f=e[++h]=st();s?f.criteria=kr(t,function(t){return n[t]}):(f.criteria=u())[0]=t(n,i,r);f.index=h;f.value=n}),f=e.length,e.sort(ci);f--;)o=e[f],e[f]=o.value,s||i(o.criteria),k(o);return e}function ih(t){return t&&typeof t.length=="number"?n(t):su(t)}function rh(n){for(var i=-1,u=n?n.length:0,r=[],t;++i<u;)t=n[i],t&&r.push(t);return r}function uh(n){return pr(n,nr(arguments,!0,!0,1))}function fh(n,t,i){var r=-1,u=n?n.length:0;for(t=nt.createCallback(t,i,3);++r<u;)if(t(n[r],r,n))return r;return-1}function eh(n,t,i){var r=n?n.length:0;for(t=nt.createCallback(t,i,3);r--;)if(t(n[r],r,n))return r;return-1}function tf(t,i,r){var u=0,o=t?t.length:0,f;if(typeof i!="number"&&i!=null)for(f=-1,i=nt.createCallback(i,r,3);++f<o&&i(t[f],f,t);)u++;else if(u=i,u==null||r)return t?t[0]:e;return n(t,0,vr(pi(0,u),o))}function oh(n,t,i,r){return typeof t!="boolean"&&t!=null&&(r=i,i=typeof t!="function"&&r&&r[t]===n?null:t,t=!1),i!=null&&(n=kr(n,i,r)),nr(n,t)}function ee(n,t,i){var u,r;if(typeof i=="number")u=n?n.length:0,i=i<0?pi(0,u+i):i||0;else if(i)return r=oe(n,t),n[r]===t?r:-1;return l(n,t,i)}function sh(t,i,r){var u=0,e=t?t.length:0,f;if(typeof i!="number"&&i!=null)for(f=e,i=nt.createCallback(i,r,3);f--&&i(t[f],f,t);)u++;else u=i==null||r?1:i||u;return n(t,0,vr(pi(0,e-u),e))}function hh(){for(var e=[],r=-1,o=arguments.length,f=u(),h=iu(),y=h===l,s=u(),n,t;++r<o;)n=arguments[r],(ut(n)||uu(n))&&(e.push(n),f.push(y&&n.length>=et&&ot(r?e[r]:s)));var c=e[0],a=-1,p=c?c.length:0,v=[];n:while(++a<p)if(t=f[0],n=c[a],(t?it(t,n):h(s,n))<0){for(r=o,(t||s).push(n);--r;)if(t=f[r],(t?it(t,n):h(e[r],n))<0)continue n;v.push(n)}while(o--)t=f[o],t&&k(t);return i(f),i(s),v}function ch(t,i,r){var u=0,o=t?t.length:0,f;if(typeof i!="number"&&i!=null)for(f=o,i=nt.createCallback(i,r,3);f--&&i(t[f],f,t);)u++;else if(u=i,u==null||r)return t?t[o-1]:e;return n(t,pi(0,o-u))}function lh(n,t,i){var r=n?n.length:0;for(typeof i=="number"&&(r=(i<0?pi(0,r+i):vr(i,r-1))+1);r--;)if(n[r]===t)return r;return-1}function ah(n){for(var i=arguments,r=0,e=i.length,u=n?n.length:0,t,f;++r<e;)for(t=-1,f=i[r];++t<u;)n[t]===f&&(of.call(n,t--,1),u--);return n}function vh(n,t,i){n=+n||0;i=typeof i=="number"?i:+i||1;t==null&&(t=n,n=0);for(var r=-1,u=pi(0,no((t-n)/(i||1))),f=yi(u);++r<u;)f[r]=n,n+=i;return f}function yh(n,t,i){var r=-1,f=n?n.length:0,e=[],u;for(t=nt.createCallback(t,i,3);++r<f;)u=n[r],t(u,r,n)&&(e.push(u),of.call(n,r--,1),f--);return e}function rf(t,i,r){if(typeof i!="number"&&i!=null){var u=0,f=-1,e=t?t.length:0;for(i=nt.createCallback(i,r,3);++f<e&&i(t[f],f,t);)u++}else u=i==null||r?1:pi(0,i);return n(t,u)}function oe(n,t,i,r){var u=0,e=n?n.length:u,f;for(i=i?nt.createCallback(i,r,1):uf,t=i(t);u<e;)f=u+e>>>1,i(n[f])<t?u=f+1:e=f;return u}function ph(){return bu(nr(arguments,!0,!0))}function se(n,t,i,r){return typeof t!="boolean"&&t!=null&&(r=i,i=typeof t!="function"&&r&&r[t]===n?null:t,t=!1),i!=null&&(i=nt.createCallback(i,r,3)),bu(n,t,i)}function wh(t){return pr(t,n(arguments,1))}function bh(){for(var i=-1,r=arguments.length,n,t;++i<r;)n=arguments[i],(ut(n)||uu(n))&&(t=t?bu(pr(t,n).concat(pr(n,t))):n);return t||[]}function he(){for(var n=arguments.length>1?arguments:arguments[0],t=-1,i=n?te(lu(n,"length")):0,r=yi(i<0?0:i);++t<i;)r[t]=lu(n,t);return r}function ce(n,t){var r=-1,f=n?n.length:0,u={},i;for(t||!f||ut(n[0])||(t=[]);++r<f;)i=n[r],t?u[i]=t[r]:i&&(u[i[0]]=i[1]);return u}function kh(n,t){if(!rt(t))throw new ki;return function(){if(--n<1)return t.apply(this,arguments)}}function le(t,i){return arguments.length>2?wi(t,17,n(arguments,2),null,i):wi(t,1,null,null,i)}function dh(n){for(var i=arguments.length>1?nr(arguments,!0,!1,1):wr(n),r=-1,u=i.length,t;++r<u;)t=i[r],n[t]=wi(n[t],1,null,null,n);return n}function gh(t,i){return arguments.length>2?wi(i,19,n(arguments,2),null,t):wi(i,3,null,null,t)}function nc(){for(var n=arguments,t=n.length;t--;)if(!rt(n[t]))throw new ki;return function(){for(var t=arguments,i=n.length;i--;)t=[n[i].apply(this,t)];return t[0]}}function tc(n,t){return t=typeof t=="number"?t:+t||n.length,wi(n,4,null,null,null,t)}function ae(n,t,i){var f,u,s,h,o,r,y,c=0,l=!1,a=!0,v,p,w;if(!rt(n))throw new ki;return t=pi(0,t)||0,i===!0?(v=!0,a=!1):hi(i)&&(v=i.leading,l="maxWait"in i&&(pi(t,i.maxWait)||0),a="trailing"in i?i.trailing:a),p=function(){var i=t-(ir()-h),l;i<=0?(u&&gr(u),l=y,u=r=y=e,l&&(c=ir(),s=n.apply(o,f),r||u||(f=o=null))):r=ar(p,i)},w=function(){r&&gr(r);u=r=y=e;(a||l!==t)&&(c=ir(),s=n.apply(o,f),r||u||(f=o=null))},function(){var b,e,i;return f=arguments,h=ir(),o=this,y=a&&(r||!v),l===!1?b=v&&!r:(u||v||(c=h),e=l-(h-c),i=e<=0,i?(u&&(u=gr(u)),c=h,s=n.apply(o,f)):u||(u=ar(w,e))),i&&r?r=gr(r):r||t===l||(r=ar(p,t)),b&&(i=!0,s=n.apply(o,f)),!i||r||u||(f=o=null),s}}function ic(t){if(!rt(t))throw new ki;var i=n(arguments,1);return ar(function(){t.apply(e,i)},1)}function rc(t,i){if(!rt(t))throw new ki;var r=n(arguments,2);return ar(function(){t.apply(e,r)},i)}function uc(n,t){if(!rt(n))throw new ki;var i=function(){var r=i.cache,u=t?t.apply(this,arguments):ft+arguments[0];return oi.call(r,u)?r[u]:r[u]=n.apply(this,arguments)};return i.cache={},i}function fc(n){var i,t;if(!rt(n))throw new ki;return function(){return i?t:(i=!0,t=n.apply(this,arguments),n=null,t)}}function ec(t){return wi(t,16,n(arguments,1))}function oc(t){return wi(t,32,null,n(arguments,1))}function sc(n,t,i){var r=!0,u=!0;if(!rt(n))throw new ki;return i===!1?r=!1:hi(i)&&(r="leading"in i?i.leading:r,u="trailing"in i?i.trailing:u),g.leading=r,g.maxWait=t,g.trailing=u,ae(n,t,g)}function hc(n,t){return wi(t,16,[n])}function cc(n){return function(){return n}}function lc(n,t,i){var f=typeof n;if(n==null||f=="function")return vi(n,t,i);if(f!="object")return pe(n);var u=si(n),e=u[0],r=n[e];return u.length==1&&r===r&&!hi(r)?function(n){var t=n[e];return r===t&&(r!==0||1/r==1/t)}:function(t){for(var i=u.length,r=!1;i--;)if(!(r=sr(t[u[i]],n[u[i]],null,!0)))break;return r}}function ac(n){return n==null?"":gi(n).replace(lo,oo)}function uf(n){return n}function ff(n,t,i){var u=!0,f=t&&wr(t),r,e;t&&(i||f.length)||(i==null&&(i=t),r=rr,t=n,n=nt,f=wr(t));i===!1?u=!1:hi(i)&&"chain"in i&&(u=i.chain);r=n;e=rt(r);ai(f,function(i){var f=n[i]=t[i];e&&(r.prototype[i]=function(){var i=this.__chain__,e=this.__wrapped__,o=[e],t;if(lr.apply(o,arguments),t=f.apply(n,o),u||i){if(e===t&&hi(t))return this;t=new r(t);t.__chain__=i}return t})})}function vc(){return c._=de,this}function ve(){}function pe(n){return function(t){return t[n]}}function yc(n,t,i){var f=n==null,r=t==null,u;return(i==null&&(typeof n=="boolean"&&r?(i=n,n=1):r||typeof t!="boolean"||(i=t,r=!0)),f&&r&&(t=1),n=+n||0,r?(t=n,n=0):t=+t||0,i||n%1||t%1)?(u=hf(),vr(n+u*(t-n+parseFloat("1e-"+((u+"").length-1))),t)):wu(n,t)}function pc(n,t){if(n){var i=n[t];return rt(i)?n[t]():i}}function wc(n,t,i){var h=nt.templateSettings,u,s,v,f;n=gi(n||"");i=eu({},i,h);var c=eu({},i.imports,h.imports),p=si(c),w=su(c),o,l=0,a=i.interpolate||d,r="__p += '",b=cr((i.escape||d).source+"|"+a.source+"|"+(a===at?ni:d).source+"|"+(i.evaluate||d).source+"|$","g");n.replace(b,function(t,i,u,f,e,s){return u||(u=f),r+=n.slice(l,s).replace(ui,li),i&&(r+="' +\n__e("+i+") +\n'"),e&&(o=!0,r+="';\n"+e+";\n__p += '"),u&&(r+="' +\n((__t = ("+u+")) == null ? '' : __t) +\n'"),l=s+t.length,t});r+="';\n";u=i.variable;s=u;s||(u="obj",r="with ("+u+") {\n"+r+"\n}\n");r=(o?r.replace(kt,""):r).replace(dt,"$1").replace(gt,"$1;");r="function("+u+") {\n"+(s?"":u+" || ("+u+" = {});\n")+"var __t, __p = '', __e = _.escape"+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+r+"return __p\n}";v="\n/*\n//# sourceURL="+(i.sourceURL||"/lodash/template/source["+ei+++"]")+"\n*/";try{f=dr(p,"return "+r+v).apply(e,w)}catch(y){y.source=r;throw y;}return t?f(t):(f.source=r,f)}function bc(n,t,i){n=(n=+n)>-1?n:0;var r=-1,u=yi(n);for(t=vi(t,i,1);++r<n;)u[r]=t(r);return u}function kc(n){return n==null?"":gi(n).replace(co,so)}function dc(n){var t=++bt;return gi(n==null?"":n)+t}function gc(n){return n=new rr(n),n.__chain__=!0,n}function nl(n,t){return t(n),n}function tl(){return this.__chain__=!0,this}function il(){return gi(this.__wrapped__)}function we(){return this.__wrapped__}var or,ru,eu,bi,tt,ou,kf,gf,ne,lu,fe,ir,ye;c=c?f.defaults(h.Object(),c,f.pick(h,fi)):h;var yi=c.Array,be=c.Boolean,au=c.Date,dr=c.Function,hr=c.Math,ke=c.Number,ur=c.Object,cr=c.RegExp,gi=c.String,ki=c.TypeError,fr=[],ef=ur.prototype,de=c._,ct=ef.toString,ge=cr("^"+gi(ct).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),no=hr.ceil,gr=c.clearTimeout,to=hr.floor,io=dr.prototype.toString,er=tr(er=ur.getPrototypeOf)&&er,oi=ef.hasOwnProperty,lr=fr.push,ar=c.setTimeout,of=fr.splice,ro=fr.unshift,sf=function(){try{var t={},n=tr(n=ur.defineProperty)&&n,i=n(t,t,t)&&n}catch(r){}return i}(),nu=tr(nu=ur.create)&&nu,vu=tr(vu=yi.isArray)&&vu,uo=c.isFinite,fo=c.isNaN,tu=tr(tu=ur.keys)&&tu,pi=hr.max,vr=hr.min,yu=c.parseInt,hf=hr.random,di={};di[v]=yi;di[y]=be;di[p]=au;di[yt]=dr;di[o]=ur;di[w]=ke;di[b]=cr;di[s]=gi;rr.prototype=nt.prototype;or=nt.support={};or.funcDecomp=!tr(c.WinRTError)&&vt.test(ht);or.funcNames=typeof dr.name=="string";nt.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:at,variable:"",imports:{_:nt}};nu||(yr=function(){function n(){}return function(t){if(hi(t)){n.prototype=t;n.prototype=null}return{}||c.Object()}}());ru=sf?function(n,t){pt.value=t;sf(n,"__bindData__",pt)}:ve;var ut=vu||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&ct.call(n)==v||!1},ho=function(n){var i,r=n,u=[];if(!r||!t[typeof n])return u;for(i in r)oi.call(r,i)&&u.push(i);return u},si=tu?function(n){return hi(n)?tu(n):[]}:ho,du={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},vf=pf(du),co=cr("("+si(vf).join("|")+")","g"),lo=cr("["+si(du).join("")+"]","g"),fu=function(n,i,r){var o,u=n,s=u,h;if(!u)return s;var e=arguments,l=0,f=typeof r=="number"?2:e.length;for(f>3&&typeof e[f-2]=="function"?h=vi(e[--f-1],e[f--],2):f>2&&typeof e[f-1]=="function"&&(h=e[--f]);++l<f;)if(u=e[l],u&&t[typeof u])for(var a=-1,c=t[typeof u]&&si(u),v=c?c.length:0;++a<v;)o=c[a],s[o]=h?h(s[o],u[o]):u[o];return s};return eu=function(n,i,r){var f,u=n,e=u;if(!u)return e;for(var s=arguments,h=0,l=typeof r=="number"?2:s.length;++h<l;)if(u=s[h],u&&t[typeof u])for(var c=-1,o=t[typeof u]&&si(u),a=o?o.length:0;++c<a;)f=o[c],typeof e[f]=="undefined"&&(e[f]=u[f]);return e},bi=function(n,i,r){var f,u=n,e=u;if(!u||!t[typeof u])return e;i=i&&typeof r=="undefined"?i:vi(i,r,3);for(f in u)if(i(u[f],f,n)===!1)return e;return e},tt=function(n,i,r){var f,u=n,e=u;if(!u||!t[typeof u])return e;i=i&&typeof r=="undefined"?i:vi(i,r,3);for(var s=-1,o=t[typeof u]&&si(u),h=o?o.length:0;++s<h;)if(f=o[s],i(u[f],f,n)===!1)return e;return e},ou=er?function(n){if(!(n&&ct.call(n)==o))return!1;var i=n.valueOf,t=tr(i)&&(t=er(i))&&er(t);return t?n==t||er(n)==t:af(n)}:af,kf=ku(function(n,t,i){oi.call(n,i)?n[i]++:n[i]=1}),gf=ku(function(n,t,i){(oi.call(n,i)?n[i]:n[i]=[]).push(t)}),ne=ku(function(n,t,i){n[i]=t}),lu=kr,fe=hu,ir=tr(ir=au.now)&&ir||function(){return(new au).getTime()},ye=yu(lt+"08")==8?yu:function(n,t){return yu(br(n)?n.replace(ri,""):n,t||0)},nt.after=kh,nt.assign=fu,nt.at=ps,nt.bind=le,nt.bindAll=dh,nt.bindKey=gh,nt.chain=gc,nt.compact=rh,nt.compose=nc,nt.constant=cc,nt.countBy=kf,nt.create=yo,nt.createCallback=lc,nt.curry=tc,nt.debounce=ae,nt.defaults=eu,nt.defer=ic,nt.delay=rc,nt.difference=uh,nt.filter=hu,nt.flatten=oh,nt.forEach=ai,nt.forEachRight=cu,nt.forIn=bi,nt.forInRight=bo,nt.forOwn=tt,nt.forOwnRight=yf,nt.functions=wr,nt.groupBy=gf,nt.indexBy=ne,nt.initial=sh,nt.intersection=hh,nt.invert=pf,nt.invoke=bs,nt.keys=si,nt.map=kr,nt.mapValues=hs,nt.max=te,nt.memoize=uc,nt.merge=cs,nt.min=ks,nt.omit=ls,nt.once=fc,nt.pairs=as,nt.partial=ec,nt.partialRight=oc,nt.pick=vs,nt.pluck=lu,nt.property=pe,nt.pull=ah,nt.range=vh,nt.reject=ds,nt.remove=yh,nt.rest=rf,nt.shuffle=re,nt.sortBy=th,nt.tap=nl,nt.throttle=sc,nt.times=bc,nt.toArray=ih,nt.transform=ys,nt.union=ph,nt.uniq=se,nt.values=su,nt.where=fe,nt.without=wh,nt.wrap=hc,nt.xor=bh,nt.zip=he,nt.zipObject=ce,nt.collect=kr,nt.drop=rf,nt.each=ai,nt.eachRight=cu,nt.extend=fu,nt.methods=wr,nt.object=ce,nt.select=hu,nt.tail=rf,nt.unique=se,nt.unzip=he,ff(nt),nt.clone=ao,nt.cloneDeep=vo,nt.contains=bf,nt.escape=ac,nt.every=df,nt.find=gu,nt.findIndex=fh,nt.findKey=po,nt.findLast=ws,nt.findLastIndex=eh,nt.findLastKey=wo,nt.has=ko,nt.identity=uf,nt.indexOf=ee,nt.isArguments=uu,nt.isArray=ut,nt.isBoolean=go,nt.isDate=ns,nt.isElement=ts,nt.isEmpty=is,nt.isEqual=rs,nt.isFinite=us,nt.isFunction=rt,nt.isNaN=fs,nt.isNull=es,nt.isNumber=wf,nt.isObject=hi,nt.isPlainObject=ou,nt.isRegExp=os,nt.isString=br,nt.isUndefined=ss,nt.lastIndexOf=lh,nt.mixin=ff,nt.noConflict=vc,nt.noop=ve,nt.now=ir,nt.parseInt=ye,nt.random=yc,nt.reduce=nf,nt.reduceRight=ie,nt.result=pc,nt.runInContext=ht,nt.size=nh,nt.some=ue,nt.sortedIndex=oe,nt.template=wc,nt.unescape=kc,nt.uniqueId=dc,nt.all=df,nt.any=ue,nt.detect=gu,nt.findWhere=gu,nt.foldl=nf,nt.foldr=ie,nt.include=bf,nt.inject=nf,ff(function(){var n={};return tt(nt,function(t,i){nt.prototype[i]||(n[i]=t)}),n}(),!1),nt.first=tf,nt.last=ch,nt.sample=gs,nt.take=tf,nt.head=tf,tt(nt,function(n,t){var i=t!=="sample";nt.prototype[t]||(nt.prototype[t]=function(t,r){var u=this.__chain__,f=n(this.__wrapped__,t,r);return!u&&(t==null||r&&!(i&&typeof t=="function"))?f:new rr(f,u)})}),nt.VERSION="2.4.1",nt.prototype.chain=tl,nt.prototype.toString=il,nt.prototype.value=we,nt.prototype.valueOf=we,ai(["join","pop","shift"],function(n){var t=fr[n];nt.prototype[n]=function(){var n=this.__chain__,i=t.apply(this.__wrapped__,arguments);return n?new rr(i,n):i}}),ai(["push","reverse","sort","unshift"],function(n){var t=fr[n];nt.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),ai(["concat","slice","splice"],function(n){var t=fr[n];nt.prototype[n]=function(){return new rr(t.apply(this.__wrapped__,arguments),this.__chain__)}}),nt}var e,rt=[],ut=[],bt=0,ft=+new Date+"",et=75,ct=40,lt=" \t\x0b\f ﻿\n\r\u2028\u2029 ᠎             　",kt=/\b__p \+= '';/g,dt=/\b(__p \+=) '' \+/g,gt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ni=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ti=/\w*$/,ii=/^\s*function[ \n\r\t]+\w/,at=/<%=([\s\S]+?)%>/g,ri=RegExp("^["+lt+"]*0+(?=.$)"),d=/($^)/,vt=/\bthis\b/,ui=/['\n\r\t\u2028\u2029\\]/g,fi=["Array","Boolean","Date","Function","Math","Number","Object","RegExp","String","_","attachEvent","clearTimeout","isFinite","isNaN","parseInt","setTimeout"],ei=0,a="[object Arguments]",v="[object Array]",y="[object Boolean]",p="[object Date]",yt="[object Function]",w="[object Number]",o="[object Object]",b="[object RegExp]",s="[object String]",r={},f;r[yt]=!1;r[a]=r[v]=r[y]=r[p]=r[w]=r[o]=r[b]=r[s]=!0;var g={leading:!1,maxWait:0,trailing:!1},pt={configurable:!1,enumerable:!1,value:null,writable:!1},t={boolean:!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},oi={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},h=t[typeof window]&&window||this,nt=t[typeof exports]&&exports&&!exports.nodeType&&exports,tt=t[typeof module]&&module&&!module.nodeType&&module,si=tt&&tt.exports===nt&&nt,c=t[typeof global]&&global;c&&(c.global===c||c.window===c)&&(h=c);f=ht();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(h._=f,define(function(){return f})):nt&&tt?si?(tt.exports=f)._=f:nt._=f:h._=f}.call(this),function(n,t,i,r){"use strict";var h=0,u,f=function(){var t=r.userAgent,i=/msie\s\d+/i,n;return t.search(i)>0&&(n=i.exec(t).toString(),n=n.split(" ")[1],n<9)?!0:!1}(),o="ontouchstart"in i||r.msMaxTouchPoints>0,e=function(n){return typeof n=="number"?isNaN(n)?null:n:(n=parseFloat(n),isNaN(n)?null:n)},s={init:function(r){var s='<span class="irs"><span class="irs-line"><span class="irs-line-left"><\/span><span class="irs-line-mid"><\/span><span class="irs-line-right"><\/span><\/span><span class="irs-min">0<\/span><span class="irs-max">1<\/span><span class="irs-from">0<\/span><span class="irs-to">0<\/span><span class="irs-single">0<\/span><\/span><span class="irs-grid"><\/span>',c='<span class="irs-slider single"><\/span>',l='<span class="irs-diapason"><\/span><span class="irs-slider from"><\/span><span class="irs-slider to"><\/span>',a='<span class="irs-disable-mask"><\/span>';return this.each(function(){var v=n.extend({min:null,max:null,from:null,to:null,type:"single",step:null,prefix:"",postfix:"",maxPostfix:"",hasGrid:!1,gridMargin:0,hideMinMax:!1,hideFromTo:!1,prettify:!0,disable:!1,values:null,onLoad:null,onChange:null,onFinish:null},r),y=n(this),w=this,wt=!1,b=null,ot,li;if(!y.data("isActive")){y.data("isActive",!0);h+=1;this.plugin_count=h;y.prop("value")&&(b=y.prop("value").split(";"));v.type==="single"?b&&b.length>1?(typeof v.min!="number"?v.min=parseFloat(b[0]):typeof v.from!="number"&&(v.from=parseFloat(b[0])),typeof v.max!="number"&&(v.max=parseFloat(b[1]))):b&&b.length===1&&typeof v.from!="number"&&(v.from=parseFloat(b[0])):v.type==="double"&&(b&&b.length>1?(typeof v.min!="number"?v.min=parseFloat(b[0]):typeof v.from!="number"&&(v.from=parseFloat(b[0])),typeof v.max!="number"?v.max=parseFloat(b[1]):typeof v.to!="number"&&(v.to=parseFloat(b[1]))):b&&b.length===1&&(typeof v.min!="number"?v.min=parseFloat(b[0]):typeof v.from!="number"&&(v.from=parseFloat(b[0]))));typeof y.data("min")=="number"&&(v.min=parseFloat(y.data("min")));typeof y.data("max")=="number"&&(v.max=parseFloat(y.data("max")));typeof y.data("from")=="number"&&(v.from=parseFloat(y.data("from")));typeof y.data("to")=="number"&&(v.to=parseFloat(y.data("to")));y.data("step")&&(v.step=parseFloat(y.data("step")));y.data("type")&&(v.type=y.data("type"));y.data("prefix")&&(v.prefix=y.data("prefix"));y.data("postfix")&&(v.postfix=y.data("postfix"));y.data("maxpostfix")&&(v.maxPostfix=y.data("maxpostfix"));y.data("hasgrid")&&(v.hasGrid=y.data("hasgrid"));y.data("gridmargin")&&(v.gridMargin=+y.data("gridmargin"));y.data("hideminmax")&&(v.hideMinMax=y.data("hideminmax"));y.data("hidefromto")&&(v.hideFromTo=y.data("hidefromto"));y.data("prettify")&&(v.prettify=y.data("prettify"));y.data("disable")&&(v.disable=y.data("disable"));y.data("values")&&(v.values=y.data("values").split(","));v.min=e(v.min);v.min||v.min===0||(v.min=10);v.max=e(v.max);v.max||v.max===0||(v.max=100);Object.prototype.toString.call(v.values)!=="[object Array]"&&(v.values=null);v.values&&v.values.length>0&&(v.min=0,v.max=v.values.length-1,v.step=1,wt=!0);v.from=e(v.from);v.from||v.from===0||(v.from=v.min);v.to=e(v.to);v.to||v.to===0||(v.to=v.max);v.step=e(v.step);v.step||(v.step=1);v.from<v.min&&(v.from=v.min);v.from>v.max&&(v.from=v.min);v.to<v.min&&(v.to=v.max);v.to>v.max&&(v.to=v.max);v.type==="double"&&(v.from>v.to&&(v.from=v.to),v.to<v.from&&(v.to=v.from));ot=function(n){var t=n.toString();return v.prettify&&(t=t.replace(/(\d{1,3}(?=(?:\d\d\d)+(?!\d)))/g,"$1 ")),t};li='<span class="irs" id="irs-'+this.plugin_count+'"><\/span>';y[0].style.display="none";y.before(li);var d=y.prev(),vt=n(t.body),gt=n(i),g,st,ht,lt,at,ft,et,k,tt,nt,oi,si,ut=!1,ct=!1,bt=!0,p={},ui=0,ni=0,ti=0,it=0,pt=0,yt=0,fi=0,ii=0,ri=0,hi=0,rt=0;parseInt(v.step,10)!==parseFloat(v.step)&&(rt=v.step.toString().split(".")[1],rt=Math.pow(10,rt.length));this.updateData=function(t){n.extend(v,t);pi()};this.removeSlider=function(){d.find("*").off();gt.off("mouseup.irs"+w.plugin_count);vt.off("mouseup.irs"+w.plugin_count);vt.off("mouseleave.irs"+w.plugin_count);vt.off("mousemove.irs"+w.plugin_count);d.html("").remove();y.data("isActive",!1);y.show()};var pi=function(){d.find("*").off();gt.off("mouseup.irs"+w.plugin_count);vt.off("mouseup.irs"+w.plugin_count);vt.off("mouseleave.irs"+w.plugin_count);vt.off("mousemove.irs"+w.plugin_count);d.html("");ai()},ai=function(){d.html(s);g=d.find(".irs");st=g.find(".irs-min");ht=g.find(".irs-max");lt=g.find(".irs-from");at=g.find(".irs-to");ft=g.find(".irs-single");si=d.find(".irs-grid");v.hideFromTo&&(lt[0].style.visibility="hidden",at[0].style.visibility="hidden",ft[0].style.visibility="hidden");v.hideFromTo||(lt[0].style.visibility="visible",at[0].style.visibility="visible",ft[0].style.visibility="visible");v.hideMinMax&&(st[0].style.visibility="hidden",ht[0].style.visibility="hidden",ni=0,ti=0);v.hideMinMax||(st[0].style.visibility="visible",ht[0].style.visibility="visible",v.values?(st.html(v.prefix+v.values[0]+v.postfix),ht.html(v.prefix+v.values[v.values.length-1]+v.maxPostfix+v.postfix)):(st.html(v.prefix+ot(v.min)+v.postfix),ht.html(v.prefix+ot(v.max)+v.maxPostfix+v.postfix)),ni=st.outerWidth(!1),ti=ht.outerWidth(!1));wi()},wi=function(){if(v.type==="single"){g.append(c);et=g.find(".single");et.on("mousedown",function(t){t.preventDefault();t.stopPropagation();kt(t,n(this),null);ut=!0;ct=!0;u=w.plugin_count;f&&n("*").prop("unselectable",!0)});if(o)et.on("touchstart",function(t){t.preventDefault();t.stopPropagation();kt(t.originalEvent.touches[0],n(this),null);ut=!0;ct=!0;u=w.plugin_count})}else if(v.type==="double"){g.append(l);k=g.find(".from");tt=g.find(".to");oi=g.find(".irs-diapason");dt();k.on("mousedown",function(t){t.preventDefault();t.stopPropagation();n(this).addClass("last");tt.removeClass("last");kt(t,n(this),"from");ut=!0;ct=!0;u=w.plugin_count;f&&n("*").prop("unselectable",!0)});tt.on("mousedown",function(t){t.preventDefault();t.stopPropagation();n(this).addClass("last");k.removeClass("last");kt(t,n(this),"to");ut=!0;ct=!0;u=w.plugin_count;f&&n("*").prop("unselectable",!0)});if(o){k.on("touchstart",function(t){t.preventDefault();t.stopPropagation();n(this).addClass("last");tt.removeClass("last");kt(t.originalEvent.touches[0],n(this),"from");ut=!0;ct=!0;u=w.plugin_count});tt.on("touchstart",function(t){t.preventDefault();t.stopPropagation();n(this).addClass("last");k.removeClass("last");kt(t.originalEvent.touches[0],n(this),"to");ut=!0;ct=!0;u=w.plugin_count})}v.to===v.max&&k.addClass("last")}var t=function(){u===w.plugin_count&&ut&&(ct=!1,ut=!1,nt.removeAttr("id"),nt=null,v.type==="double"&&dt(),ci(),f&&n("*").prop("unselectable",!1))};gt.on("mouseup.irs"+w.plugin_count,function(){t()});if(f)vt.on("mouseleave.irs"+w.plugin_count,function(){t()});vt.on("mousemove.irs"+w.plugin_count,function(n){ut&&(ui=n.pageX,ei())});d.on("mousedown",function(){u=w.plugin_count});d.on("mouseup",function(n){u===w.plugin_count&&(ut||v.disable||ki(n.pageX))});if(o){gt.on("touchend",function(){ut&&(ct=!1,ut=!1,nt.removeAttr("id"),nt=null,v.type==="double"&&dt(),ci())});gt.on("touchmove",function(n){ut&&(ui=n.originalEvent.touches[0].pageX,ei())})}vi();bi();v.hasGrid&&gi();v.disable?nr():tr()},vi=function(){it=g.width();yt=et?et.width():k.width();pt=it-yt},kt=function(n,t,i){vi();bt=!1;nt=t;nt.prop("id","irs-active-slider");var r=nt.offset().left,u=n.pageX-r;hi=r+u-nt.position().left;v.type==="single"?fi=g.width()-yt:v.type==="double"&&(i==="from"?(ii=0,ri=parseInt(tt.css("left"),10)):(ii=parseInt(k.css("left"),10),ri=g.width()-yt))},dt=function(){var i=k.width(),t=n.data(k[0],"x")||parseInt(k[0].style.left,10)||k.position().left,r=n.data(tt[0],"x")||parseInt(tt[0].style.left,10)||tt.position().left,u=t+i/2,f=r-t;oi[0].style.left=u+"px";oi[0].style.width=f+"px"},ei=function(t){var i=ui-hi,r;i=t?t:ui-hi;v.type==="single"?(i<0&&(i=0),i>fi&&(i=fi)):v.type==="double"&&(i<ii&&(i=ii),i>ri&&(i=ri),dt());n.data(nt[0],"x",i);ci();r=Math.round(i);nt[0].style.left=r+"px"},ci=function(){var t={input:y,slider:d,min:v.min,max:v.max,fromNumber:0,toNumber:0,fromPers:0,toPers:0,fromX:0,fromX_pure:0,toX:0,toX_pure:0},r=v.max-v.min,i,u;v.type==="single"?(t.fromX=n.data(et[0],"x")||parseInt(et[0].style.left,10)||et.position().left,t.fromPers=t.fromX/pt*100,i=r/100*t.fromPers+v.min,t.fromNumber=Math.round(i/v.step)*v.step,t.fromNumber<v.min&&(t.fromNumber=v.min),t.fromNumber>v.max&&(t.fromNumber=v.max),rt&&(t.fromNumber=parseInt(t.fromNumber*rt,10)/rt),wt&&(t.fromValue=v.values[t.fromNumber])):v.type==="double"&&(t.fromX=n.data(k[0],"x")||parseInt(k[0].style.left,10)||k.position().left,t.fromPers=t.fromX/pt*100,i=r/100*t.fromPers+v.min,t.fromNumber=Math.round(i/v.step)*v.step,t.fromNumber<v.min&&(t.fromNumber=v.min),t.toX=n.data(tt[0],"x")||parseInt(tt[0].style.left,10)||tt.position().left,t.toPers=t.toX/pt*100,u=r/100*t.toPers+v.min,t.toNumber=Math.round(u/v.step)*v.step,t.toNumber>v.max&&(t.toNumber=v.max),rt&&(t.fromNumber=parseInt(t.fromNumber*rt,10)/rt,t.toNumber=parseInt(t.toNumber*rt,10)/rt),wt&&(t.fromValue=v.values[t.fromNumber],t.toValue=v.values[t.toNumber]));p=t;yi()},bi=function(){var t={input:y,slider:d,min:v.min,max:v.max,fromNumber:v.from,toNumber:v.to,fromPers:0,toPers:0,fromX:0,fromX_pure:0,toX:0,toX_pure:0},i=v.max-v.min;v.type==="single"?(t.fromPers=i!==0?(t.fromNumber-v.min)/i*100:0,t.fromX_pure=pt/100*t.fromPers,t.fromX=Math.round(t.fromX_pure),et[0].style.left=t.fromX+"px",n.data(et[0],"x",t.fromX_pure)):v.type==="double"&&(t.fromPers=i!==0?(t.fromNumber-v.min)/i*100:0,t.fromX_pure=pt/100*t.fromPers,t.fromX=Math.round(t.fromX_pure),k[0].style.left=t.fromX+"px",n.data(k[0],"x",t.fromX_pure),t.toPers=i!==0?(t.toNumber-v.min)/i*100:1,t.toX_pure=pt/100*t.toPers,t.toX=Math.round(t.toX_pure),tt[0].style.left=t.toX+"px",n.data(tt[0],"x",t.toX_pure),dt());p=t;yi()},ki=function(n){bt=!1;var t=n-d.offset().left,i=p.toX-p.fromX,r=p.fromX+i/2;ii=0;fi=g.width()-yt;ri=g.width()-yt;v.type==="single"?(nt=et,nt.prop("id","irs-active-slider"),ei(t)):v.type==="double"&&(nt=t<=r?k:tt,nt.prop("id","irs-active-slider"),ei(t),dt());nt.removeAttr("id");nt=null},yi=function(){var h,f,r,c,e,u,o,i,n,s=yt/2,t="";v.type==="single"?(t=p.fromNumber===v.max?v.maxPostfix:"",lt[0].style.display="none",at[0].style.display="none",o=wt?v.prefix+v.values[p.fromNumber]+t+v.postfix:v.prefix+ot(p.fromNumber)+t+v.postfix,ft.html(o),i=ft.outerWidth(!1),n=p.fromX-i/2+s,n<0&&(n=0),n>it-i&&(n=it-i),ft[0].style.left=n+"px",v.hideMinMax||v.hideFromTo||(st[0].style.display=n<ni?"none":"block",ht[0].style.display=n+i>it-ti?"none":"block"),y.prop("value",parseFloat(p.fromNumber))):v.type==="double"&&(t=p.fromNumber===v.max?v.maxPostfix:"",t=p.toNumber===v.max?v.maxPostfix:"",wt?(h=v.prefix+v.values[p.fromNumber]+v.postfix,c=v.prefix+v.values[p.toNumber]+t+v.postfix,o=p.fromNumber!==p.toNumber?v.prefix+v.values[p.fromNumber]+" — "+v.prefix+v.values[p.toNumber]+t+v.postfix:v.prefix+v.values[p.fromNumber]+t+v.postfix):(h=v.prefix+ot(p.fromNumber)+v.postfix,c=v.prefix+ot(p.toNumber)+t+v.postfix,o=p.fromNumber!==p.toNumber?v.prefix+ot(p.fromNumber)+" — "+v.prefix+ot(p.toNumber)+t+v.postfix:v.prefix+ot(p.fromNumber)+t+v.postfix),lt.html(h),at.html(c),ft.html(o),f=lt.outerWidth(!1),r=p.fromX-f/2+s,r<0&&(r=0),r>it-f&&(r=it-f),lt[0].style.left=r+"px",e=at.outerWidth(!1),u=p.toX-e/2+s,u<0&&(u=0),u>it-e&&(u=it-e),at[0].style.left=u+"px",i=ft.outerWidth(!1),n=p.fromX+(p.toX-p.fromX)/2-i/2+s,n<0&&(n=0),n>it-i&&(n=it-i),ft[0].style.left=n+"px",r+f<u?(ft[0].style.display="none",lt[0].style.display="block",at[0].style.display="block"):(ft[0].style.display="block",lt[0].style.display="none",at[0].style.display="none"),v.hideMinMax||v.hideFromTo||(st[0].style.display=n<ni||r<ni?"none":"block",ht[0].style.display=n+i>it-ti||u+e>it-ti?"none":"block"),y.prop("value",parseFloat(p.fromNumber)+";"+parseFloat(p.toNumber)));v.from=p.fromNumber;v.to=p.toNumber;di()},di=function(){typeof v.onFinish!="function"||ct||bt||v.onFinish.call(this,p);typeof v.onChange!="function"||bt||v.onChange.call(this,p);typeof v.onLoad=="function"&&!ct&&bt&&(v.onLoad.call(this,p),bt=!1)},gi=function(){d.addClass("irs-with-grid");for(var n="",i=0,u=0,f="",o=20,r=4,e=it-v.gridMargin*2,t=0;t<=o;t+=1)i=Math.floor(e/o*t),i>=e&&(i=e-1),f+='<span class="irs-grid-pol small" style="left: '+i+'px;"><\/span>';for(t=0;t<=r;t+=1)i=Math.floor(e/r*t),i>=e&&(i=e-1),f+='<span class="irs-grid-pol" style="left: '+i+'px;"><\/span>',rt?(n=v.min+(v.max-v.min)/r*t,n=n/v.step*v.step,n=parseInt(n*rt,10)/rt):(n=Math.round(v.min+(v.max-v.min)/r*t),n=Math.round(n/v.step)*v.step,n=ot(n)),wt&&(v.hideMinMax?(n=Math.round(v.min+(v.max-v.min)/r*t),n=Math.round(n/v.step)*v.step,n=t===0||t===r?v.values[n]:""):n=""),t===0?(u=i,f+='<span class="irs-grid-text" style="left: '+u+'px; text-align: left;">'+n+"<\/span>"):t===r?(u=i-100,f+='<span class="irs-grid-text" style="left: '+u+'px; text-align: right;">'+n+"<\/span>"):(u=i-50,f+='<span class="irs-grid-text" style="left: '+u+'px;">'+n+"<\/span>");si.html(f);si[0].style.left=v.gridMargin+"px"},nr=function(){d.addClass("irs-disabled");d.append(a)},tr=function(){d.removeClass("irs-disabled");d.find(".irs-disable-mask").remove()};ai()}})},update:function(n){return this.each(function(){this.updateData(n)})},remove:function(){return this.each(function(){this.removeSlider()})}};n.fn.ionRangeSlider=function(t){if(s[t])return s[t].apply(this,Array.prototype.slice.call(arguments,1));if(typeof t!="object"&&t)n.error("Method "+t+" does not exist for jQuery.ionRangeSlider");else return s.init.apply(this,arguments)}}(jQuery,document,window,navigator);PointerEventsPolyfill.initialize=function(n){return PointerEventsPolyfill.singleton==null&&(PointerEventsPolyfill.singleton=new PointerEventsPolyfill(n)),PointerEventsPolyfill.singleton};PointerEventsPolyfill.prototype.register_mouse_events=function(){$(document).on(this.options.mouseEvents.join(" "),this.options.selector,function(n){var t,i;return $(this).css("pointer-events")=="none"?(t=$(this).css("display"),$(this).css("display","none"),i=document.elementFromPoint(n.clientX,n.clientY),t?$(this).css("display",t):$(this).css("display",""),n.target=i,$(i).trigger(n),!1):!0})},function(n,t,i,r){"use strict";var p=i("html"),e=i(n),o=i(t),u=i.fancybox=function(){u.open.apply(this,arguments)},y=navigator.userAgent.match(/msie/i),v=null,s=t.createTouch!==r,a=function(n){return n&&n.hasOwnProperty&&n instanceof i},c=function(n){return n&&i.type(n)==="string"},l=function(n){return c(n)&&n.indexOf("%")>0},w=function(n){return n&&!(n.style.overflow&&n.style.overflow==="hidden")&&(n.clientWidth&&n.scrollWidth>n.clientWidth||n.clientHeight&&n.scrollHeight>n.clientHeight)},f=function(n,t){var i=parseInt(n,10)||0;return t&&l(n)&&(i=u.getViewport()[t]/100*i),Math.ceil(i)},h=function(n,t){return f(n,t)+"px"};i.extend(u,{version:"2.1.5",defaults:{padding:15,margin:20,width:800,height:600,minWidth:100,minHeight:100,maxWidth:9999,maxHeight:9999,pixelRatio:1,autoSize:!0,autoHeight:!1,autoWidth:!1,autoResize:!0,autoCenter:!s,fitToView:!0,aspectRatio:!1,topRatio:.5,leftRatio:.5,scrolling:"auto",wrapCSS:"",arrows:!0,closeBtn:!0,closeClick:!1,nextClick:!1,mouseWheel:!0,autoPlay:!1,playSpeed:3e3,preload:3,modal:!1,loop:!0,ajax:{dataType:"html",headers:{"X-fancyBox":!0}},iframe:{scrolling:"auto",preload:!0},swf:{wmode:"transparent",allowfullscreen:"true",allowscriptaccess:"always"},keys:{next:{13:"left",34:"up",39:"left",40:"up"},prev:{8:"right",33:"down",37:"right",38:"down"},close:[27],play:[32],toggle:[70]},direction:{next:"left",prev:"right"},scrollOutside:!0,index:0,type:null,href:null,content:null,title:null,tpl:{wrap:'<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inner"><\/div><\/div><\/div><\/div>',image:'<img class="fancybox-image" src="{href}" alt="" />',iframe:'<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" frameborder="0" vspace="0" hspace="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen'+(y?' allowtransparency="true"':"")+"><\/iframe>",error:'<p class="fancybox-error">The requested content cannot be loaded.<br/>Please try again later.<\/p>',closeBtn:'<a title="Close" class="fancybox-item fancybox-close" href="javascript:;"><\/a>',next:'<a title="Next" class="fancybox-nav fancybox-next" href="javascript:;"><span><\/span><\/a>',prev:'<a title="Previous" class="fancybox-nav fancybox-prev" href="javascript:;"><span><\/span><\/a>'},openEffect:"fade",openSpeed:250,openEasing:"swing",openOpacity:!0,openMethod:"zoomIn",closeEffect:"fade",closeSpeed:250,closeEasing:"swing",closeOpacity:!0,closeMethod:"zoomOut",nextEffect:"elastic",nextSpeed:250,nextEasing:"swing",nextMethod:"changeIn",prevEffect:"elastic",prevSpeed:250,prevEasing:"swing",prevMethod:"changeOut",helpers:{overlay:!0,title:!0},onCancel:i.noop,beforeLoad:i.noop,afterLoad:i.noop,beforeShow:i.noop,afterShow:i.noop,beforeChange:i.noop,beforeClose:i.noop,afterClose:i.noop},group:{},opts:{},previous:null,coming:null,current:null,isActive:!1,isOpen:!1,isOpened:!1,wrap:null,skin:null,outer:null,inner:null,player:{timer:null,isActive:!1},ajaxLoad:null,imgPreload:null,transitions:{},helpers:{},open:function(n,t){if(n)return(i.isPlainObject(t)||(t={}),!1===u.close(!0))?void 0:(i.isArray(n)||(n=a(n)?i(n).get():[n]),i.each(n,function(f,e){var h={},s,p,l,o,v,y,w;i.type(e)==="object"&&(e.nodeType&&(e=i(e)),a(e)?(h={href:e.data("fancybox-href")||e.attr("href"),title:e.data("fancybox-title")||e.attr("title"),isDom:!0,element:e},i.metadata&&i.extend(!0,h,e.metadata())):h=e);s=t.href||h.href||(c(e)?e:null);p=t.title!==r?t.title:h.title||"";l=t.content||h.content;o=l?"html":t.type||h.type;!o&&h.isDom&&(o=e.data("fancybox-type"),o||(v=e.prop("class").match(/fancybox\.(\w+)/),o=v?v[1]:null));c(s)&&(o||(u.isImage(s)?o="image":u.isSWF(s)?o="swf":s.charAt(0)==="#"?o="inline":c(e)&&(o="html",l=e)),o==="ajax"&&(y=s.split(/\s+/,2),s=y.shift(),w=y.shift()));l||(o==="inline"?s?l=i(c(s)?s.replace(/.*(?=#[^\s]+$)/,""):s):h.isDom&&(l=e):o==="html"?l=s:o||s||!h.isDom||(o="inline",l=e));i.extend(h,{href:s,type:o,content:l,title:p,selector:w});n[f]=h}),u.opts=i.extend(!0,{},u.defaults,t),t.keys!==r&&(u.opts.keys=t.keys?i.extend({},u.defaults.keys,t.keys):!1),u.group=n,u._start(u.opts.index))},cancel:function(){var n=u.coming;n&&!1!==u.trigger("onCancel")&&(u.hideLoading(),u.ajaxLoad&&u.ajaxLoad.abort(),u.ajaxLoad=null,u.imgPreload&&(u.imgPreload.onload=u.imgPreload.onerror=null),n.wrap&&n.wrap.stop(!0,!0).trigger("onReset").remove(),u.coming=null,u.current||u._afterZoomOut(n))},close:function(n){(u.cancel(),!1!==u.trigger("beforeClose"))&&(u.unbindEvents(),u.isActive)&&(u.isOpen&&n!==!0?(u.isOpen=u.isOpened=!1,u.isClosing=!0,i(".fancybox-item, .fancybox-nav").remove(),u.wrap.stop(!0,!0).removeClass("fancybox-opened"),u.transitions[u.current.closeMethod]()):(i(".fancybox-wrap").stop(!0).trigger("onReset").remove(),u._afterZoomOut()))},play:function(n){var t=function(){clearTimeout(u.player.timer)},i=function(){t();u.current&&u.player.isActive&&(u.player.timer=setTimeout(u.next,u.current.playSpeed))},r=function(){t();o.unbind(".player");u.player.isActive=!1;u.trigger("onPlayEnd")},f=function(){u.current&&(u.current.loop||u.current.index<u.group.length-1)&&(u.player.isActive=!0,o.bind({"onCancel.player beforeClose.player":r,"onUpdate.player":i,"beforeLoad.player":t}),i(),u.trigger("onPlayStart"))};n!==!0&&(u.player.isActive||n===!1)?r():f()},next:function(n){var t=u.current;t&&(c(n)||(n=t.direction.next),u.jumpto(t.index+1,n,"next"))},prev:function(n){var t=u.current;t&&(c(n)||(n=t.direction.prev),u.jumpto(t.index-1,n,"prev"))},jumpto:function(n,t,i){var e=u.current;e&&(n=f(n),u.direction=t||e.direction[n>=e.index?"next":"prev"],u.router=i||"jumpto",e.loop&&(n<0&&(n=e.group.length+n%e.group.length),n=n%e.group.length),e.group[n]!==r&&(u.cancel(),u._start(n)))},reposition:function(n,t){var f=u.current,e=f?f.wrap:null,r;e&&(r=u._getPosition(t),n&&n.type==="scroll"?(delete r.position,e.stop(!0,!0).animate(r,200)):(e.css(r),f.pos=i.extend({},f.dim,r)))},update:function(n){var t=n&&n.type,i=!t||t==="orientationchange";(i&&(clearTimeout(v),v=null),u.isOpen&&!v)&&(v=setTimeout(function(){var r=u.current;r&&!u.isClosing&&(u.wrap.removeClass("fancybox-tmp"),(i||t==="load"||t==="resize"&&r.autoResize)&&u._setDimension(),t==="scroll"&&r.canShrink||u.reposition(n),u.trigger("onUpdate"),v=null)},i&&!s?0:300))},toggle:function(n){u.isOpen&&(u.current.fitToView=i.type(n)==="boolean"?n:!u.current.fitToView,s&&(u.wrap.removeAttr("style").addClass("fancybox-tmp"),u.trigger("onUpdate")),u.update())},hideLoading:function(){o.unbind(".loading");i("#fancybox-loading").remove()},showLoading:function(){var t,n;u.hideLoading();t=i('<div id="fancybox-loading"><div><\/div><\/div>').click(u.cancel).appendTo("body");o.bind("keydown.loading",function(n){(n.which||n.keyCode)===27&&(n.preventDefault(),u.cancel())});u.defaults.fixed||(n=u.getViewport(),t.css({position:"absolute",top:n.h*.5+n.y,left:n.w*.5+n.x}))},getViewport:function(){var i=u.current&&u.current.locked||!1,t={x:e.scrollLeft(),y:e.scrollTop()};return i?(t.w=i[0].clientWidth,t.h=i[0].clientHeight):(t.w=s&&n.innerWidth?n.innerWidth:e.width(),t.h=s&&n.innerHeight?n.innerHeight:e.height()),t},unbindEvents:function(){u.wrap&&a(u.wrap)&&u.wrap.unbind(".fb");o.unbind(".fb");e.unbind(".fb")},bindEvents:function(){var n=u.current,t;n&&(e.bind("orientationchange.fb"+(s?"":" resize.fb")+(n.autoCenter&&!n.locked?" scroll.fb":""),u.update),t=n.keys,t&&o.bind("keydown.fb",function(f){var e=f.which||f.keyCode,o=f.target||f.srcElement;if(e===27&&u.coming)return!1;f.ctrlKey||f.altKey||f.shiftKey||f.metaKey||o&&(o.type||i(o).is("[contenteditable]"))||i.each(t,function(t,o){return n.group.length>1&&o[e]!==r?(u[t](o[e]),f.preventDefault(),!1):i.inArray(e,o)>-1?(u[t](),f.preventDefault(),!1):void 0})}),i.fn.mousewheel&&n.mouseWheel&&u.wrap.bind("mousewheel.fb",function(t,r,f,e){for(var h=t.target||null,o=i(h),s=!1;o.length;){if(s||o.is(".fancybox-skin")||o.is(".fancybox-wrap"))break;s=w(o[0]);o=i(o).parent()}r===0||s||u.group.length>1&&!n.canShrink&&(e>0||f>0?u.prev(e>0?"down":"left"):(e<0||f<0)&&u.next(e<0?"up":"right"),t.preventDefault())}))},trigger:function(n,t){var f,r=t||u.coming||u.current;if(r){if(i.isFunction(r[n])&&(f=r[n].apply(r,Array.prototype.slice.call(arguments,1))),f===!1)return!1;r.helpers&&i.each(r.helpers,function(t,f){f&&u.helpers[t]&&i.isFunction(u.helpers[t][n])&&u.helpers[t][n](i.extend(!0,{},u.helpers[t].defaults,f),r)});o.trigger(n)}},isImage:function(n){return c(n)&&n.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i)},isSWF:function(n){return c(n)&&n.match(/\.(swf)((\?|#).*)?$/i)},_start:function(n){var t={},c,l,r,e,o;if(n=f(n),c=u.group[n]||null,!c)return!1;if(t=i.extend(!0,{},u.opts,c),e=t.margin,o=t.padding,i.type(e)==="number"&&(t.margin=[e,e,e,e]),i.type(o)==="number"&&(t.padding=[o,o,o,o]),t.modal&&i.extend(!0,t,{closeBtn:!1,closeClick:!1,nextClick:!1,arrows:!1,mouseWheel:!1,keys:null,helpers:{overlay:{closeClick:!1}}}),t.autoSize&&(t.autoWidth=t.autoHeight=!0),t.width==="auto"&&(t.autoWidth=!0),t.height==="auto"&&(t.autoHeight=!0),t.group=u.group,t.index=n,u.coming=t,!1===u.trigger("beforeLoad")){u.coming=null;return}if(r=t.type,l=t.href,!r)return(u.coming=null,u.current&&u.router&&u.router!=="jumpto")?(u.current.index=n,u[u.router](u.direction)):!1;if(u.isActive=!0,(r==="image"||r==="swf")&&(t.autoHeight=t.autoWidth=!1,t.scrolling="visible"),r==="image"&&(t.aspectRatio=!0),r==="iframe"&&s&&(t.scrolling="scroll"),t.wrap=i(t.tpl.wrap).addClass("fancybox-"+(s?"mobile":"desktop")+" fancybox-type-"+r+" fancybox-tmp "+t.wrapCSS).appendTo(t.parent||"body"),i.extend(t,{skin:i(".fancybox-skin",t.wrap),outer:i(".fancybox-outer",t.wrap),inner:i(".fancybox-inner",t.wrap)}),i.each(["Top","Right","Bottom","Left"],function(n,i){t.skin.css("padding"+i,h(t.padding[n]))}),u.trigger("onReady"),r==="inline"||r==="html"){if(!t.content||!t.content.length)return u._error("content")}else if(!l)return u._error("href");r==="image"?u._loadImage():r==="ajax"?u._loadAjax():r==="iframe"?u._loadIframe():u._afterLoad()},_error:function(n){i.extend(u.coming,{type:"html",autoWidth:!0,autoHeight:!0,minWidth:0,minHeight:0,scrolling:"no",hasError:n,content:u.coming.tpl.error});u._afterLoad()},_loadImage:function(){var n=u.imgPreload=new Image;n.onload=function(){this.onload=this.onerror=null;u.coming.width=this.width/u.opts.pixelRatio;u.coming.height=this.height/u.opts.pixelRatio;u._afterLoad()};n.onerror=function(){this.onload=this.onerror=null;u._error("image")};n.src=u.coming.href;n.complete!==!0&&u.showLoading()},_loadAjax:function(){var n=u.coming;u.showLoading();u.ajaxLoad=i.ajax(i.extend({},n.ajax,{url:n.href,error:function(n,t){u.coming&&t!=="abort"?u._error("ajax",n):u.hideLoading()},success:function(t,i){i==="success"&&(n.content=t,u._afterLoad())}}))},_loadIframe:function(){var n=u.coming,t=i(n.tpl.iframe.replace(/\{rnd\}/g,(new Date).getTime())).attr("scrolling",s?"auto":n.iframe.scrolling).attr("src",n.href);if(i(n.wrap).bind("onReset",function(){try{i(this).find("iframe").hide().attr("src","//about:blank").end().empty()}catch(n){}}),n.iframe.preload){u.showLoading();t.one("load",function(){i(this).data("ready",1);s||i(this).bind("load.fb",u.update);i(this).parents(".fancybox-wrap").width("100%").removeClass("fancybox-tmp").show();u._afterLoad()})}n.content=t.appendTo(n.inner);n.iframe.preload||u._afterLoad()},_preloadImages:function(){for(var r=u.group,i=u.current,f=r.length,e=i.preload?Math.min(i.preload,f-1):0,n,t=1;t<=e;t+=1)n=r[(i.index+t)%f],n.type==="image"&&n.href&&((new Image).src=n.href)},_afterLoad:function(){var r=u.coming,f=u.current,e="fancybox-placeholder",t,n,c,o,s,h;if(u.hideLoading(),r&&u.isActive!==!1){if(!1===u.trigger("afterLoad",r,f)){r.wrap.stop(!0).trigger("onReset").remove();u.coming=null;return}f&&(u.trigger("beforeChange",f),f.wrap.stop(!0).removeClass("fancybox-opened").find(".fancybox-item, .fancybox-nav").remove());u.unbindEvents();t=r;n=r.content;c=r.type;o=r.scrolling;i.extend(u,{wrap:t.wrap,skin:t.skin,outer:t.outer,inner:t.inner,current:t,previous:f});s=t.href;switch(c){case"inline":case"ajax":case"html":t.selector?n=i("<div>").html(n).find(t.selector):a(n)&&(n.data(e)||n.data(e,i('<div class="'+e+'"><\/div>').insertAfter(n).hide()),n=n.show().detach(),t.wrap.bind("onReset",function(){i(this).find(n).length&&n.hide().replaceAll(n.data(e)).data(e,!1)}));break;case"image":n=t.tpl.image.replace("{href}",s);break;case"swf":n='<object id="fancybox-swf" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%"><param name="movie" value="'+s+'"><\/param>';h="";i.each(t.swf,function(t,i){n+='<param name="'+t+'" value="'+i+'"><\/param>';h+=" "+t+'="'+i+'"'});n+='<embed src="'+s+'" type="application/x-shockwave-flash" width="100%" height="100%"'+h+"><\/embed><\/object>"}a(n)&&n.parent().is(t.inner)||t.inner.append(n);u.trigger("beforeShow");t.inner.css("overflow",o==="yes"?"scroll":o==="no"?"hidden":o);u._setDimension();u.reposition();u.isOpen=!1;u.coming=null;u.bindEvents();u.isOpened?f.prevMethod&&u.transitions[f.prevMethod]():i(".fancybox-wrap").not(t.wrap).stop(!0).trigger("onReset").remove();u.transitions[u.isOpened?t.nextMethod:t.openMethod]();u._preloadImages()}},_setDimension:function(){var nt=u.getViewport(),wt=0,vt=!1,st=!1,v=u.wrap,k=u.skin,e=u.inner,r=u.current,n=r.width,t=r.height,o=r.minWidth,s=r.minHeight,c=r.maxWidth,a=r.maxHeight,bt=r.scrolling,ft=r.scrollOutside?r.scrollbarWidth:0,et=r.margin,yt=f(et[1]+et[3]),pt=f(et[0]+et[2]),d,ht,tt,it,p,y,ct,lt,w,g,b,rt,ot,ut,at;if(v.add(k).add(e).width("auto").height("auto").removeClass("fancybox-tmp"),d=f(k.outerWidth(!0)-k.width()),ht=f(k.outerHeight(!0)-k.height()),tt=yt+d,it=pt+ht,p=l(n)?(nt.w-tt)*f(n)/100:n,y=l(t)?(nt.h-it)*f(t)/100:t,r.type==="iframe"){if(ut=r.content,r.autoHeight&&ut.data("ready")===1)try{ut[0].contentWindow.document.location&&(e.width(p).height(9999),at=ut.contents().find("body"),ft&&at.css("overflow-x","hidden"),y=at.outerHeight(!0))}catch(kt){}}else(r.autoWidth||r.autoHeight)&&(e.addClass("fancybox-tmp"),r.autoWidth||e.width(p),r.autoHeight||e.height(y),r.autoWidth&&(p=e.width()),r.autoHeight&&(y=e.height()),e.removeClass("fancybox-tmp"));if(n=f(p),t=f(y),w=p/y,o=f(l(o)?f(o,"w")-tt:o),c=f(l(c)?f(c,"w")-tt:c),s=f(l(s)?f(s,"h")-it:s),a=f(l(a)?f(a,"h")-it:a),ct=c,lt=a,r.fitToView&&(c=Math.min(nt.w-tt,c),a=Math.min(nt.h-it,a)),rt=nt.w-yt,ot=nt.h-pt,r.aspectRatio?(n>c&&(n=c,t=f(n/w)),t>a&&(t=a,n=f(t*w)),n<o&&(n=o,t=f(n/w)),t<s&&(t=s,n=f(t*w))):(n=Math.max(o,Math.min(n,c)),r.autoHeight&&r.type!=="iframe"&&(e.width(n),t=e.height()),t=Math.max(s,Math.min(t,a))),r.fitToView)if(e.width(n).height(t),v.width(n+d),g=v.width(),b=v.height(),r.aspectRatio)while((g>rt||b>ot)&&n>o&&t>s){if(wt++>19)break;t=Math.max(s,Math.min(a,t-10));n=f(t*w);n<o&&(n=o,t=f(n/w));n>c&&(n=c,t=f(n/w));e.width(n).height(t);v.width(n+d);g=v.width();b=v.height()}else n=Math.max(o,Math.min(n,n-(g-rt))),t=Math.max(s,Math.min(t,t-(b-ot)));ft&&bt==="auto"&&t<y&&n+d+ft<rt&&(n+=ft);e.width(n).height(t);v.width(n+d);g=v.width();b=v.height();vt=(g>rt||b>ot)&&n>o&&t>s;st=r.aspectRatio?n<ct&&t<lt&&n<p&&t<y:(n<ct||t<lt)&&(n<p||t<y);i.extend(r,{dim:{width:h(g),height:h(b)},origWidth:p,origHeight:y,canShrink:vt,canExpand:st,wPadding:d,hPadding:ht,wrapSpace:b-k.outerHeight(!0),skinSpace:k.height()-t});!ut&&r.autoHeight&&t>s&&t<a&&!st&&e.height("auto")},_getPosition:function(n){var i=u.current,r=u.getViewport(),f=i.margin,e=u.wrap.width()+f[1]+f[3],o=u.wrap.height()+f[0]+f[2],t={position:"absolute",top:f[0],left:f[3]};return i.autoCenter&&i.fixed&&!n&&o<=r.h&&e<=r.w?t.position="fixed":i.locked||(t.top+=r.y,t.left+=r.x),t.top=h(Math.max(t.top,t.top+(r.h-o)*i.topRatio)),t.left=h(Math.max(t.left,t.left+(r.w-e)*i.leftRatio)),t},_afterZoomIn:function(){var n=u.current;n&&(u.isOpen=u.isOpened=!0,u.wrap.css("overflow","visible").addClass("fancybox-opened"),u.update(),(n.closeClick||n.nextClick&&u.group.length>1)&&u.inner.css("cursor","pointer").bind("click.fb",function(t){i(t.target).is("a")||i(t.target).parent().is("a")||(t.preventDefault(),u[n.closeClick?"close":"next"]())}),n.closeBtn&&i(n.tpl.closeBtn).appendTo(u.skin).bind("click.fb",function(n){n.preventDefault();u.close()}),n.arrows&&u.group.length>1&&((n.loop||n.index>0)&&i(n.tpl.prev).appendTo(u.outer).bind("click.fb",u.prev),(n.loop||n.index<u.group.length-1)&&i(n.tpl.next).appendTo(u.outer).bind("click.fb",u.next)),u.trigger("afterShow"),n.loop||n.index!==n.group.length-1?u.opts.autoPlay&&!u.player.isActive&&(u.opts.autoPlay=!1,u.play()):u.play(!1))},_afterZoomOut:function(n){n=n||u.current;i(".fancybox-wrap").trigger("onReset").remove();i.extend(u,{group:{},opts:{},router:!1,current:null,isActive:!1,isOpened:!1,isOpen:!1,isClosing:!1,wrap:null,skin:null,outer:null,inner:null});u.trigger("afterClose",n)}});u.transitions={getOrigPosition:function(){var n=u.current,f=n.element,t=n.orig,i={},e=50,o=50,s=n.hPadding,c=n.wPadding,r=u.getViewport();return!t&&n.isDom&&f.is(":visible")&&(t=f.find("img:first"),t.length||(t=f)),a(t)?(i=t.offset(),t.is("img")&&(e=t.outerWidth(),o=t.outerHeight())):(i.top=r.y+(r.h-o)*n.topRatio,i.left=r.x+(r.w-e)*n.leftRatio),(u.wrap.css("position")==="fixed"||n.locked)&&(i.top-=r.y,i.left-=r.x),{top:h(i.top-s*n.topRatio),left:h(i.left-c*n.leftRatio),width:h(e+c),height:h(o+s)}},step:function(n,t){var r,s,e,i=t.prop,o=u.current,h=o.wrapSpace,c=o.skinSpace;(i==="width"||i==="height")&&(r=t.end===t.start?1:(n-t.start)/(t.end-t.start),u.isClosing&&(r=1-r),s=i==="width"?o.wPadding:o.hPadding,e=n-s,u.skin[i](f(i==="width"?e:e-h*r)),u.inner[i](f(i==="width"?e:e-h*r-c*r)))},zoomIn:function(){var n=u.current,t=n.pos,r=n.openEffect,f=r==="elastic",e=i.extend({opacity:1},t);delete e.position;f?(t=this.getOrigPosition(),n.openOpacity&&(t.opacity=.1)):r==="fade"&&(t.opacity=.1);u.wrap.css(t).animate(e,{duration:r==="none"?0:n.openSpeed,easing:n.openEasing,step:f?this.step:null,complete:u._afterZoomIn})},zoomOut:function(){var n=u.current,i=n.closeEffect,r=i==="elastic",t={opacity:.1};r&&(t=this.getOrigPosition(),n.closeOpacity&&(t.opacity=.1));u.wrap.animate(t,{duration:i==="none"?0:n.closeSpeed,easing:n.closeEasing,step:r?this.step:null,complete:u._afterZoomOut})},changeIn:function(){var i=u.current,s=i.nextEffect,t=i.pos,o={opacity:1},r=u.direction,e=200,n;t.opacity=.1;s==="elastic"&&(n=r==="down"||r==="up"?"top":"left",r==="down"||r==="right"?(t[n]=h(f(t[n])-e),o[n]="+="+e+"px"):(t[n]=h(f(t[n])+e),o[n]="-="+e+"px"));s==="none"?u._afterZoomIn():u.wrap.css(t).animate(o,{duration:i.nextSpeed,easing:i.nextEasing,complete:u._afterZoomIn})},changeOut:function(){var n=u.previous,r=n.prevEffect,f={opacity:.1},t=u.direction;r==="elastic"&&(f[t==="down"||t==="up"?"top":"left"]=(t==="up"||t==="left"?"-":"+")+"=200px");n.wrap.animate(f,{duration:r==="none"?0:n.prevSpeed,easing:n.prevEasing,complete:function(){i(this).trigger("onReset").remove()}})}};u.helpers.overlay={defaults:{closeClick:!0,speedOut:200,showEarly:!0,css:{},locked:!s,fixed:!0},overlay:null,fixed:!1,el:i("html"),create:function(n){n=i.extend({},this.defaults,n);this.overlay&&this.close();this.overlay=i('<div class="fancybox-overlay"><\/div>').appendTo(u.coming?u.coming.parent:n.parent);this.fixed=!1;n.fixed&&u.defaults.fixed&&(this.overlay.addClass("fancybox-overlay-fixed"),this.fixed=!0)},open:function(n){var t=this;n=i.extend({},this.defaults,n);this.overlay?this.overlay.unbind(".overlay").width("auto").height("auto"):this.create(n);this.fixed||(e.bind("resize.overlay",i.proxy(this.update,this)),this.update());n.closeClick&&this.overlay.bind("click.overlay",function(n){if(i(n.target).hasClass("fancybox-overlay"))return u.isActive?u.close():t.close(),!1});this.overlay.css(n.css).show()},close:function(){var n,t;e.unbind("resize.overlay");this.el.hasClass("fancybox-lock")&&(i(".fancybox-margin").removeClass("fancybox-margin"),n=e.scrollTop(),t=e.scrollLeft(),this.el.removeClass("fancybox-lock"),e.scrollTop(n).scrollLeft(t));i(".fancybox-overlay").remove().hide();i.extend(this,{overlay:null,fixed:!1})},update:function(){var n="100%",i;this.overlay.width(n).height("100%");y?(i=Math.max(t.documentElement.offsetWidth,t.body.offsetWidth),o.width()>i&&(n=o.width())):o.width()>e.width()&&(n=o.width());this.overlay.width(n).height(o.height())},onReady:function(n,t){var r=this.overlay;i(".fancybox-overlay").stop(!0,!0);r||this.create(n);n.locked&&this.fixed&&t.fixed&&(r||(this.margin=o.height()>e.height()?i("html").css("margin-right").replace("px",""):!1),t.locked=this.overlay.append(t.wrap),t.fixed=!1);n.showEarly===!0&&this.beforeShow.apply(this,arguments)},beforeShow:function(n,t){var r,u;t.locked&&(this.margin!==!1&&(i("*").filter(function(){return i(this).css("position")==="fixed"&&!i(this).hasClass("fancybox-overlay")&&!i(this).hasClass("fancybox-wrap")}).addClass("fancybox-margin"),this.el.addClass("fancybox-margin")),r=e.scrollTop(),u=e.scrollLeft(),this.el.addClass("fancybox-lock"),e.scrollTop(r).scrollLeft(u));this.open(n)},onUpdate:function(){this.fixed||this.update()},afterClose:function(n){this.overlay&&!u.coming&&this.overlay.fadeOut(n.speedOut,i.proxy(this.close,this))}};u.helpers.title={defaults:{type:"float",position:"bottom"},beforeShow:function(n){var o=u.current,r=o.title,s=n.type,t,e;if(i.isFunction(r)&&(r=r.call(o.element,o)),c(r)&&i.trim(r)!==""){t=i('<div class="fancybox-title fancybox-title-'+s+'-wrap">'+r+"<\/div>");switch(s){case"inside":e=u.skin;break;case"outside":e=u.wrap;break;case"over":e=u.inner;break;default:e=u.skin;t.appendTo("body");y&&t.width(t.width());t.wrapInner('<span class="child"><\/span>');u.current.margin[2]+=Math.abs(f(t.css("margin-bottom")))}t[n.position==="top"?"prependTo":"appendTo"](e)}}};i.fn.fancybox=function(n){var r,f=i(this),t=this.selector||"",e=function(e){var o=i(this).blur(),c=r,h,s;e.ctrlKey||e.altKey||e.shiftKey||e.metaKey||o.is(".fancybox-wrap")||(h=n.groupAttr||"data-fancybox-group",s=o.attr(h),s||(h="rel",s=o.get(0)[h]),s&&s!==""&&s!=="nofollow"&&(o=t.length?i(t):f,o=o.filter("["+h+'="'+s+'"]'),c=o.index(this)),n.index=c,u.open(o,n)!==!1&&e.preventDefault())};return n=n||{},r=n.index||0,t&&n.live!==!1?o.undelegate(t,"click.fb-start").delegate(t+":not('.fancybox-item, .fancybox-nav')","click.fb-start",e):f.unbind("click.fb-start").bind("click.fb-start",e),this.filter("[data-fancybox-start=1]").trigger("click"),this};o.ready(function(){var t,f;i.scrollbarWidth===r&&(i.scrollbarWidth=function(){var n=i('<div style="width:50px;height:50px;overflow:auto"><div/><\/div>').appendTo("body"),t=n.children(),r=t.innerWidth()-t.height(99).innerWidth();return n.remove(),r});i.support.fixedPosition===r&&(i.support.fixedPosition=function(){var n=i('<div style="position:fixed;top:20px;"><\/div>').appendTo("body"),t=n[0].offsetTop===20||n[0].offsetTop===15;return n.remove(),t}());i.extend(u.defaults,{scrollbarWidth:i.scrollbarWidth(),fixed:i.support.fixedPosition,parent:i("body")});t=i(n).width();p.addClass("fancybox-lock-test");f=i(n).width();p.removeClass("fancybox-lock-test");i("<style type='text/css'>.fancybox-margin{margin-right:"+(f-t)+"px;}<\/style>").appendTo("head")})}(window,document,jQuery),function(){"use strict";function e(n){n.fn.swiper=function(i){var r;return n(this).each(function(){var n=new t(this,i);r||(r=n)}),r}}var n,t=function(i,u){function d(n){return Math.floor(n)}function et(){var n=f.params.autoplay,t=f.slides.eq(f.activeIndex);t.attr("data-swiper-autoplay")&&(n=t.attr("data-swiper-autoplay")||f.params.autoplay);f.autoplayTimeoutId=setTimeout(function(){f.params.loop?(f.fixLoop(),f._slideNext(),f.emit("onAutoplay",f)):f.isEnd?u.autoplayStopOnLast?f.stopAutoplay():(f._slideTo(0),f.emit("onAutoplay",f)):(f._slideNext(),f.emit("onAutoplay",f))},n)}function ot(t,i){var r=n(t.target),u;if(!r.is(i))if(typeof i=="string")r=r.parents(i);else if(i.nodeType)return r.parents().each(function(n,t){t===i&&(u=i)}),u?i:undefined;return r.length===0?undefined:r[0]}function ct(n,t){t=t||{};var r=window.MutationObserver||window.WebkitMutationObserver,i=new r(function(n){n.forEach(function(n){f.onResize(!0);f.emit("onObserverUpdate",f,n)})});i.observe(n,{attributes:typeof t.attributes=="undefined"?!0:t.attributes,childList:typeof t.childList=="undefined"?!0:t.childList,characterData:typeof t.characterData=="undefined"?!0:t.characterData});f.observers.push(i)}function pt(n){var t,o,s,e,r;if((n.originalEvent&&(n=n.originalEvent),t=n.keyCode||n.charCode,!f.params.allowSwipeToNext&&(f.isHorizontal()&&t===39||!f.isHorizontal()&&t===40))||!f.params.allowSwipeToPrev&&(f.isHorizontal()&&t===37||!f.isHorizontal()&&t===38))return!1;if(!n.shiftKey&&!n.altKey&&!n.ctrlKey&&!n.metaKey&&(!document.activeElement||!document.activeElement.nodeName||document.activeElement.nodeName.toLowerCase()!=="input"&&document.activeElement.nodeName.toLowerCase()!=="textarea")){if(t===37||t===39||t===38||t===40){if(o=!1,f.container.parents("."+f.params.slideClass).length>0&&f.container.parents("."+f.params.slideActiveClass).length===0)return;var u={left:window.pageXOffset,top:window.pageYOffset},h=window.innerWidth,c=window.innerHeight,i=f.container.offset();for(f.rtl&&(i.left=i.left-f.container[0].scrollLeft),s=[[i.left,i.top],[i.left+f.width,i.top],[i.left,i.top+f.height],[i.left+f.width,i.top+f.height]],e=0;e<s.length;e++)r=s[e],r[0]>=u.left&&r[0]<=u.left+h&&r[1]>=u.top&&r[1]<=u.top+c&&(o=!0);if(!o)return}f.isHorizontal()?((t===37||t===39)&&(n.preventDefault?n.preventDefault():n.returnValue=!1),(t===39&&!f.rtl||t===37&&f.rtl)&&f.slideNext(),(t===37&&!f.rtl||t===39&&f.rtl)&&f.slidePrev()):((t===38||t===40)&&(n.preventDefault?n.preventDefault():n.returnValue=!1),t===40&&f.slideNext(),t===38&&f.slidePrev())}}function kt(){var t="onwheel",n=t in document,i;return n||(i=document.createElement("div"),i.setAttribute(t,"return;"),n=typeof i[t]=="function"),!n&&document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0&&(n=document.implementation.hasFeature("Events.wheel","3.0")),n}function wt(n){n.originalEvent&&(n=n.originalEvent);var i=0,u=f.rtl?-1:1,t=dt(n);if(f.params.mousewheelForceToAxis)if(f.isHorizontal())if(Math.abs(t.pixelX)>Math.abs(t.pixelY))i=t.pixelX*u;else return;else if(Math.abs(t.pixelY)>Math.abs(t.pixelX))i=t.pixelY;else return;else i=Math.abs(t.pixelX)>Math.abs(t.pixelY)?-t.pixelX*u:-t.pixelY;if(i!==0){if(f.params.mousewheelInvert&&(i=-i),f.params.freeMode){var r=f.getWrapperTranslate()+i*f.params.mousewheelSensitivity,e=f.isBeginning,o=f.isEnd;if(r>=f.minTranslate()&&(r=f.minTranslate()),r<=f.maxTranslate()&&(r=f.maxTranslate()),f.setWrapperTransition(0),f.setWrapperTranslate(r),f.updateProgress(),f.updateActiveIndex(),(!e&&f.isBeginning||!o&&f.isEnd)&&f.updateClasses(),f.params.freeModeSticky?(clearTimeout(f.mousewheel.timeout),f.mousewheel.timeout=setTimeout(function(){f.slideReset()},300)):f.params.lazyLoading&&f.lazy&&f.lazy.load(),f.emit("onScroll",f,n),f.params.autoplay&&f.params.autoplayDisableOnInteraction&&f.stopAutoplay(),r===0||r===f.maxTranslate())return}else{if((new window.Date).getTime()-f.mousewheel.lastScrollTime>60)if(i<0)if(f.isEnd&&!f.params.loop||f.animating){if(f.params.mousewheelReleaseOnEdges)return!0}else f.slideNext(),f.emit("onScroll",f,n);else if(f.isBeginning&&!f.params.loop||f.animating){if(f.params.mousewheelReleaseOnEdges)return!0}else f.slidePrev(),f.emit("onScroll",f,n);f.mousewheel.lastScrollTime=(new window.Date).getTime()}return n.preventDefault?n.preventDefault():n.returnValue=!1,!1}}function dt(n){var f=10,e=40,o=800,u=0,t=0,i=0,r=0;return"detail"in n&&(t=n.detail),"wheelDelta"in n&&(t=-n.wheelDelta/120),"wheelDeltaY"in n&&(t=-n.wheelDeltaY/120),"wheelDeltaX"in n&&(u=-n.wheelDeltaX/120),"axis"in n&&n.axis===n.HORIZONTAL_AXIS&&(u=t,t=0),i=u*f,r=t*f,"deltaY"in n&&(r=n.deltaY),"deltaX"in n&&(i=n.deltaX),(i||r)&&n.deltaMode&&(n.deltaMode===1?(i*=e,r*=e):(i*=o,r*=o)),i&&!u&&(u=i<1?-1:1),r&&!t&&(t=r<1?-1:1),{spinX:u,spinY:t,pixelX:i,pixelY:r}}function bt(t,i){t=n(t);var e,r,u,o=f.rtl?-1:1;e=t.attr("data-swiper-parallax")||"0";r=t.attr("data-swiper-parallax-x");u=t.attr("data-swiper-parallax-y");r||u?(r=r||"0",u=u||"0"):f.isHorizontal()?(r=e,u="0"):(u=e,r="0");r=r.indexOf("%")>=0?parseInt(r,10)*i*o+"%":r*i*o+"px";u=u.indexOf("%")>=0?parseInt(u,10)*i+"%":u*i+"px";t.transform("translate3d("+r+", "+u+",0px)")}function vt(n){return n.indexOf("on")!==0&&(n=n[0]!==n[0].toUpperCase()?"on"+n[0].toUpperCase()+n.substring(1):"on"+n),n}var y,yt,p,o,ut,h,k,f,ft,b,rt,lt,at;if(!(this instanceof t))return new t(i,u);y={direction:"horizontal",touchEventsTarget:"container",initialSlide:0,speed:300,autoplay:!1,autoplayDisableOnInteraction:!0,autoplayStopOnLast:!1,iOSEdgeSwipeDetection:!1,iOSEdgeSwipeThreshold:20,freeMode:!1,freeModeMomentum:!0,freeModeMomentumRatio:1,freeModeMomentumBounce:!0,freeModeMomentumBounceRatio:1,freeModeMomentumVelocityRatio:1,freeModeSticky:!1,freeModeMinimumVelocity:.02,autoHeight:!1,setWrapperSize:!1,virtualTranslate:!1,effect:"slide",coverflow:{rotate:50,stretch:0,depth:100,modifier:1,slideShadows:!0},flip:{slideShadows:!0,limitRotation:!0},cube:{slideShadows:!0,shadow:!0,shadowOffset:20,shadowScale:.94},fade:{crossFade:!1},parallax:!1,zoom:!1,zoomMax:3,zoomMin:1,zoomToggle:!0,scrollbar:null,scrollbarHide:!0,scrollbarDraggable:!1,scrollbarSnapOnRelease:!1,keyboardControl:!1,mousewheelControl:!1,mousewheelReleaseOnEdges:!1,mousewheelInvert:!1,mousewheelForceToAxis:!1,mousewheelSensitivity:1,mousewheelEventsTarged:"container",hashnav:!1,hashnavWatchState:!1,history:!1,replaceState:!1,breakpoints:undefined,spaceBetween:0,slidesPerView:1,slidesPerColumn:1,slidesPerColumnFill:"column",slidesPerGroup:1,centeredSlides:!1,slidesOffsetBefore:0,slidesOffsetAfter:0,roundLengths:!1,touchRatio:1,touchAngle:45,simulateTouch:!0,shortSwipes:!0,longSwipes:!0,longSwipesRatio:.5,longSwipesMs:300,followFinger:!0,onlyExternal:!1,threshold:0,touchMoveStopPropagation:!0,touchReleaseOnEdges:!1,uniqueNavElements:!0,pagination:null,paginationElement:"span",paginationClickable:!1,paginationHide:!1,paginationBulletRender:null,paginationProgressRender:null,paginationFractionRender:null,paginationCustomRender:null,paginationType:"bullets",resistance:!0,resistanceRatio:.85,nextButton:null,prevButton:null,watchSlidesProgress:!1,watchSlidesVisibility:!1,grabCursor:!1,preventClicks:!0,preventClicksPropagation:!0,slideToClickedSlide:!1,lazyLoading:!1,lazyLoadingInPrevNext:!1,lazyLoadingInPrevNextAmount:1,lazyLoadingOnTransitionStart:!1,preloadImages:!0,updateOnImagesReady:!0,loop:!1,loopAdditionalSlides:0,loopedSlides:null,control:undefined,controlInverse:!1,controlBy:"slide",normalizeSlideIndex:!0,allowSwipeToPrev:!0,allowSwipeToNext:!0,swipeHandler:null,noSwiping:!0,noSwipingClass:"swiper-no-swiping",passiveListeners:!0,containerModifierClass:"swiper-container-",slideClass:"swiper-slide",slideActiveClass:"swiper-slide-active",slideDuplicateActiveClass:"swiper-slide-duplicate-active",slideVisibleClass:"swiper-slide-visible",slideDuplicateClass:"swiper-slide-duplicate",slideNextClass:"swiper-slide-next",slideDuplicateNextClass:"swiper-slide-duplicate-next",slidePrevClass:"swiper-slide-prev",slideDuplicatePrevClass:"swiper-slide-duplicate-prev",wrapperClass:"swiper-wrapper",bulletClass:"swiper-pagination-bullet",bulletActiveClass:"swiper-pagination-bullet-active",buttonDisabledClass:"swiper-button-disabled",paginationCurrentClass:"swiper-pagination-current",paginationTotalClass:"swiper-pagination-total",paginationHiddenClass:"swiper-pagination-hidden",paginationProgressbarClass:"swiper-pagination-progressbar",paginationClickableClass:"swiper-pagination-clickable",paginationModifierClass:"swiper-pagination-",lazyLoadingClass:"swiper-lazy",lazyStatusLoadingClass:"swiper-lazy-loading",lazyStatusLoadedClass:"swiper-lazy-loaded",lazyPreloaderClass:"swiper-lazy-preloader",notificationClass:"swiper-notification",preloaderClass:"preloader",zoomContainerClass:"swiper-zoom-container",observer:!1,observeParents:!1,a11y:!1,prevSlideMessage:"Previous slide",nextSlideMessage:"Next slide",firstSlideMessage:"This is the first slide",lastSlideMessage:"This is the last slide",paginationBulletMessage:"Go to slide {{index}}",runCallbacksOnInit:!0};yt=u&&u.virtualTranslate;u=u||{};p={};for(o in u)if(typeof u[o]!="object"||u[o]===null||u[o].nodeType||u[o]===window||u[o]===document||typeof r!="undefined"&&u[o]instanceof r||typeof jQuery!="undefined"&&u[o]instanceof jQuery)p[o]=u[o];else{p[o]={};for(ut in u[o])p[o][ut]=u[o][ut]}for(h in y)if(typeof u[h]=="undefined")u[h]=y[h];else if(typeof u[h]=="object")for(k in y[h])typeof u[h][k]=="undefined"&&(u[h][k]=y[h][k]);if((f=this,f.params=u,f.originalParams=p,f.classNames=[],typeof n!="undefined"&&typeof r!="undefined"&&(n=r),typeof n!="undefined"||(n=typeof r=="undefined"?window.Dom7||window.Zepto||window.jQuery:r,n))&&(f.$=n,f.currentBreakpoint=undefined,f.getActiveBreakpoint=function(){var i,t,n,r;if(!f.params.breakpoints)return!1;i=!1;t=[];for(n in f.params.breakpoints)f.params.breakpoints.hasOwnProperty(n)&&t.push(n);for(t.sort(function(n,t){return parseInt(n,10)>parseInt(t,10)}),r=0;r<t.length;r++)n=t[r],n>=window.innerWidth&&!i&&(i=n);return i||"max"},f.setBreakpoint=function(){var n=f.getActiveBreakpoint(),t,r,i;if(n&&f.currentBreakpoint!==n){t=n in f.params.breakpoints?f.params.breakpoints[n]:f.originalParams;r=f.params.loop&&t.slidesPerView!==f.params.slidesPerView;for(i in t)f.params[i]=t[i];f.currentBreakpoint=n;r&&f.destroyLoop&&f.reLoop(!0)}},f.params.breakpoints&&f.setBreakpoint(),f.container=n(i),f.container.length!==0)){if(f.container.length>1)return ft=[],f.container.each(function(){var n=this;ft.push(new t(this,u))}),ft;f.container[0].swiper=f;f.container.data("swiper",f);f.classNames.push(f.params.containerModifierClass+f.params.direction);f.params.freeMode&&f.classNames.push(f.params.containerModifierClass+"free-mode");f.support.flexbox||(f.classNames.push(f.params.containerModifierClass+"no-flexbox"),f.params.slidesPerColumn=1);f.params.autoHeight&&f.classNames.push(f.params.containerModifierClass+"autoheight");(f.params.parallax||f.params.watchSlidesVisibility)&&(f.params.watchSlidesProgress=!0);f.params.touchReleaseOnEdges&&(f.params.resistanceRatio=0);["cube","coverflow","flip"].indexOf(f.params.effect)>=0&&(f.support.transforms3d?(f.params.watchSlidesProgress=!0,f.classNames.push(f.params.containerModifierClass+"3d")):f.params.effect="slide");f.params.effect!=="slide"&&f.classNames.push(f.params.containerModifierClass+f.params.effect);f.params.effect==="cube"&&(f.params.resistanceRatio=0,f.params.slidesPerView=1,f.params.slidesPerColumn=1,f.params.slidesPerGroup=1,f.params.centeredSlides=!1,f.params.spaceBetween=0,f.params.virtualTranslate=!0,f.params.setWrapperSize=!1);(f.params.effect==="fade"||f.params.effect==="flip")&&(f.params.slidesPerView=1,f.params.slidesPerColumn=1,f.params.slidesPerGroup=1,f.params.watchSlidesProgress=!0,f.params.spaceBetween=0,f.params.setWrapperSize=!1,typeof yt=="undefined"&&(f.params.virtualTranslate=!0));f.params.grabCursor&&f.support.touch&&(f.params.grabCursor=!1);f.wrapper=f.container.children("."+f.params.wrapperClass);f.params.pagination&&(f.paginationContainer=n(f.params.pagination),f.params.uniqueNavElements&&typeof f.params.pagination=="string"&&f.paginationContainer.length>1&&f.container.find(f.params.pagination).length===1&&(f.paginationContainer=f.container.find(f.params.pagination)),f.params.paginationType==="bullets"&&f.params.paginationClickable?f.paginationContainer.addClass(f.params.paginationModifierClass+"clickable"):f.params.paginationClickable=!1,f.paginationContainer.addClass(f.params.paginationModifierClass+f.params.paginationType));(f.params.nextButton||f.params.prevButton)&&(f.params.nextButton&&(f.nextButton=n(f.params.nextButton),f.params.uniqueNavElements&&typeof f.params.nextButton=="string"&&f.nextButton.length>1&&f.container.find(f.params.nextButton).length===1&&(f.nextButton=f.container.find(f.params.nextButton))),f.params.prevButton&&(f.prevButton=n(f.params.prevButton),f.params.uniqueNavElements&&typeof f.params.prevButton=="string"&&f.prevButton.length>1&&f.container.find(f.params.prevButton).length===1&&(f.prevButton=f.container.find(f.params.prevButton))));f.isHorizontal=function(){return f.params.direction==="horizontal"};f.rtl=f.isHorizontal()&&(f.container[0].dir.toLowerCase()==="rtl"||f.container.css("direction")==="rtl");f.rtl&&f.classNames.push(f.params.containerModifierClass+"rtl");f.rtl&&(f.wrongRTL=f.wrapper.css("display")==="-webkit-box");f.params.slidesPerColumn>1&&f.classNames.push(f.params.containerModifierClass+"multirow");f.device.android&&f.classNames.push(f.params.containerModifierClass+"android");f.container.addClass(f.classNames.join(" "));f.translate=0;f.progress=0;f.velocity=0;f.lockSwipeToNext=function(){f.params.allowSwipeToNext=!1;f.params.allowSwipeToPrev===!1&&f.params.grabCursor&&f.unsetGrabCursor()};f.lockSwipeToPrev=function(){f.params.allowSwipeToPrev=!1;f.params.allowSwipeToNext===!1&&f.params.grabCursor&&f.unsetGrabCursor()};f.lockSwipes=function(){f.params.allowSwipeToNext=f.params.allowSwipeToPrev=!1;f.params.grabCursor&&f.unsetGrabCursor()};f.unlockSwipeToNext=function(){f.params.allowSwipeToNext=!0;f.params.allowSwipeToPrev===!0&&f.params.grabCursor&&f.setGrabCursor()};f.unlockSwipeToPrev=function(){f.params.allowSwipeToPrev=!0;f.params.allowSwipeToNext===!0&&f.params.grabCursor&&f.setGrabCursor()};f.unlockSwipes=function(){f.params.allowSwipeToNext=f.params.allowSwipeToPrev=!0;f.params.grabCursor&&f.setGrabCursor()};f.setGrabCursor=function(n){f.container[0].style.cursor="move";f.container[0].style.cursor=n?"-webkit-grabbing":"-webkit-grab";f.container[0].style.cursor=n?"-moz-grabbin":"-moz-grab";f.container[0].style.cursor=n?"grabbing":"grab"};f.unsetGrabCursor=function(){f.container[0].style.cursor=""};f.params.grabCursor&&f.setGrabCursor();f.imagesToLoad=[];f.imagesLoaded=0;f.loadImage=function(n,t,i,r,u,f){function o(){f&&f()}var e;n.complete&&u?o():t?(e=new window.Image,e.onload=o,e.onerror=o,r&&(e.sizes=r),i&&(e.srcset=i),t&&(e.src=t)):o()};f.preloadImages=function(){function t(){typeof f!="undefined"&&f!==null&&f&&(f.imagesLoaded!==undefined&&f.imagesLoaded++,f.imagesLoaded===f.imagesToLoad.length&&(f.params.updateOnImagesReady&&f.update(),f.emit("onImagesReady",f)))}f.imagesToLoad=f.container.find("img");for(var n=0;n<f.imagesToLoad.length;n++)f.loadImage(f.imagesToLoad[n],f.imagesToLoad[n].currentSrc||f.imagesToLoad[n].getAttribute("src"),f.imagesToLoad[n].srcset||f.imagesToLoad[n].getAttribute("srcset"),f.imagesToLoad[n].sizes||f.imagesToLoad[n].getAttribute("sizes"),!0,t)};f.autoplayTimeoutId=undefined;f.autoplaying=!1;f.autoplayPaused=!1;f.startAutoplay=function(){if(typeof f.autoplayTimeoutId!="undefined"||!f.params.autoplay||f.autoplaying)return!1;f.autoplaying=!0;f.emit("onAutoplayStart",f);et()};f.stopAutoplay=function(){f.autoplayTimeoutId&&(f.autoplayTimeoutId&&clearTimeout(f.autoplayTimeoutId),f.autoplaying=!1,f.autoplayTimeoutId=undefined,f.emit("onAutoplayStop",f))};f.pauseAutoplay=function(n){f.autoplayPaused||(f.autoplayTimeoutId&&clearTimeout(f.autoplayTimeoutId),f.autoplayPaused=!0,n===0?(f.autoplayPaused=!1,et()):f.wrapper.transitionEnd(function(){f&&(f.autoplayPaused=!1,f.autoplaying?et():f.stopAutoplay())}))};f.minTranslate=function(){return-f.snapGrid[0]};f.maxTranslate=function(){return-f.snapGrid[f.snapGrid.length-1]};f.updateAutoHeight=function(){var t=[],i=0,n,r,u;if(f.params.slidesPerView!=="auto"&&f.params.slidesPerView>1)for(n=0;n<Math.ceil(f.params.slidesPerView);n++){if(r=f.activeIndex+n,r>f.slides.length)break;t.push(f.slides.eq(r)[0])}else t.push(f.slides.eq(f.activeIndex)[0]);for(n=0;n<t.length;n++)typeof t[n]!="undefined"&&(u=t[n].offsetHeight,i=u>i?u:i);i&&f.wrapper.css("height",i+"px")};f.updateContainerSize=function(){var n,t;(n=typeof f.params.width!="undefined"?f.params.width:f.container[0].clientWidth,t=typeof f.params.height!="undefined"?f.params.height:f.container[0].clientHeight,(n!==0||!f.isHorizontal())&&(t!==0||f.isHorizontal()))&&(n=n-parseInt(f.container.css("padding-left"),10)-parseInt(f.container.css("padding-right"),10),t=t-parseInt(f.container.css("padding-top"),10)-parseInt(f.container.css("padding-bottom"),10),f.width=n,f.height=t,f.size=f.isHorizontal()?f.width:f.height)};f.updateSlidesSize=function(){var o,h,c,e,u,l;f.slides=f.wrapper.children("."+f.params.slideClass);f.snapGrid=[];f.slidesGrid=[];f.slidesSizesGrid=[];var i=f.params.spaceBetween,r=-f.params.slidesOffsetBefore,n,y=0,v=0;if(typeof f.size!="undefined"){typeof i=="string"&&i.indexOf("%")>=0&&(i=parseFloat(i.replace("%",""))/100*f.size);f.virtualSize=-i;f.rtl?f.slides.css({marginLeft:"",marginTop:""}):f.slides.css({marginRight:"",marginBottom:""});f.params.slidesPerColumn>1&&(o=Math.floor(f.slides.length/f.params.slidesPerColumn)===f.slides.length/f.params.slidesPerColumn?f.slides.length:Math.ceil(f.slides.length/f.params.slidesPerColumn)*f.params.slidesPerColumn,f.params.slidesPerView!=="auto"&&f.params.slidesPerColumnFill==="row"&&(o=Math.max(o,f.params.slidesPerView*f.params.slidesPerColumn)));var t,s=f.params.slidesPerColumn,a=o/s,p=a-(f.params.slidesPerColumn*a-f.slides.length);for(n=0;n<f.slides.length;n++)(t=0,h=f.slides.eq(n),f.params.slidesPerColumn>1&&(f.params.slidesPerColumnFill==="column"?(e=Math.floor(n/s),u=n-e*s,(e>p||e===p&&u===s-1)&&++u>=s&&(u=0,e++),c=e+u*o/s,h.css({"-webkit-box-ordinal-group":c,"-moz-box-ordinal-group":c,"-ms-flex-order":c,"-webkit-order":c,order:c})):(u=Math.floor(n/a),e=n-u*a),h.css("margin-"+(f.isHorizontal()?"top":"left"),u!==0&&f.params.spaceBetween&&f.params.spaceBetween+"px").attr("data-swiper-column",e).attr("data-swiper-row",u)),h.css("display")!=="none")&&(f.params.slidesPerView==="auto"?(t=f.isHorizontal()?h.outerWidth(!0):h.outerHeight(!0),f.params.roundLengths&&(t=d(t))):(t=(f.size-(f.params.slidesPerView-1)*i)/f.params.slidesPerView,f.params.roundLengths&&(t=d(t)),f.isHorizontal()?f.slides[n].style.width=t+"px":f.slides[n].style.height=t+"px"),f.slides[n].swiperSlideSize=t,f.slidesSizesGrid.push(t),f.params.centeredSlides?(r=r+t/2+y/2+i,n===0&&(r=r-f.size/2-i),Math.abs(r)<1/1e3&&(r=0),v%f.params.slidesPerGroup==0&&f.snapGrid.push(r),f.slidesGrid.push(r)):(v%f.params.slidesPerGroup==0&&f.snapGrid.push(r),f.slidesGrid.push(r),r=r+t+i),f.virtualSize+=t+i,y=t,v++);if(f.virtualSize=Math.max(f.virtualSize,f.size)+f.params.slidesOffsetAfter,f.rtl&&f.wrongRTL&&(f.params.effect==="slide"||f.params.effect==="coverflow")&&f.wrapper.css({width:f.virtualSize+f.params.spaceBetween+"px"}),(!f.support.flexbox||f.params.setWrapperSize)&&(f.isHorizontal()?f.wrapper.css({width:f.virtualSize+f.params.spaceBetween+"px"}):f.wrapper.css({height:f.virtualSize+f.params.spaceBetween+"px"})),f.params.slidesPerColumn>1&&(f.virtualSize=(t+f.params.spaceBetween)*o,f.virtualSize=Math.ceil(f.virtualSize/f.params.slidesPerColumn)-f.params.spaceBetween,f.isHorizontal()?f.wrapper.css({width:f.virtualSize+f.params.spaceBetween+"px"}):f.wrapper.css({height:f.virtualSize+f.params.spaceBetween+"px"}),f.params.centeredSlides)){for(l=[],n=0;n<f.snapGrid.length;n++)f.snapGrid[n]<f.virtualSize+f.snapGrid[0]&&l.push(f.snapGrid[n]);f.snapGrid=l}if(!f.params.centeredSlides){for(l=[],n=0;n<f.snapGrid.length;n++)f.snapGrid[n]<=f.virtualSize-f.size&&l.push(f.snapGrid[n]);f.snapGrid=l;Math.floor(f.virtualSize-f.size)-Math.floor(f.snapGrid[f.snapGrid.length-1])>1&&f.snapGrid.push(f.virtualSize-f.size)}f.snapGrid.length===0&&(f.snapGrid=[0]);f.params.spaceBetween!==0&&(f.isHorizontal()?f.rtl?f.slides.css({marginLeft:i+"px"}):f.slides.css({marginRight:i+"px"}):f.slides.css({marginBottom:i+"px"}));f.params.watchSlidesProgress&&f.updateSlidesOffset()}};f.updateSlidesOffset=function(){for(var n=0;n<f.slides.length;n++)f.slides[n].swiperSlideOffset=f.isHorizontal()?f.slides[n].offsetLeft:f.slides[n].offsetTop};f.currentSlidesPerView=function(){var r=1,n,t,i,u;if(f.params.centeredSlides){for(i=f.slides[f.activeIndex].swiperSlideSize,n=f.activeIndex+1;n<f.slides.length;n++)f.slides[n]&&!u&&(i+=f.slides[n].swiperSlideSize,r++,i>f.size&&(u=!0));for(t=f.activeIndex-1;t>=0;t--)f.slides[t]&&!u&&(i+=f.slides[t].swiperSlideSize,r++,i>f.size&&(u=!0))}else for(n=f.activeIndex+1;n<f.slides.length;n++)f.slidesGrid[n]-f.slidesGrid[f.activeIndex]<f.size&&r++;return r};f.updateSlidesProgress=function(n){var r,t,i,e;if(typeof n=="undefined"&&(n=f.translate||0),f.slides.length!==0)for(typeof f.slides[0].swiperSlideOffset=="undefined"&&f.updateSlidesOffset(),r=-n,f.rtl&&(r=n),f.slides.removeClass(f.params.slideVisibleClass),t=0;t<f.slides.length;t++){if(i=f.slides[t],e=(r+(f.params.centeredSlides?f.minTranslate():0)-i.swiperSlideOffset)/(i.swiperSlideSize+f.params.spaceBetween),f.params.watchSlidesVisibility){var u=-(r-i.swiperSlideOffset),o=u+f.slidesSizesGrid[t],s=u>=0&&u<f.size||o>0&&o<=f.size||u<=0&&o>=f.size;s&&f.slides.eq(t).addClass(f.params.slideVisibleClass)}i.progress=f.rtl?-e:e}};f.updateProgress=function(n){typeof n=="undefined"&&(n=f.translate||0);var t=f.maxTranslate()-f.minTranslate(),i=f.isBeginning,r=f.isEnd;t===0?(f.progress=0,f.isBeginning=f.isEnd=!0):(f.progress=(n-f.minTranslate())/t,f.isBeginning=f.progress<=0,f.isEnd=f.progress>=1);f.isBeginning&&!i&&f.emit("onReachBeginning",f);f.isEnd&&!r&&f.emit("onReachEnd",f);f.params.watchSlidesProgress&&f.updateSlidesProgress(n);f.emit("onProgress",f,f.progress)};f.updateActiveIndex=function(){for(var i=f.rtl?f.translate:-f.translate,t,r,n=0;n<f.slidesGrid.length;n++)typeof f.slidesGrid[n+1]!="undefined"?i>=f.slidesGrid[n]&&i<f.slidesGrid[n+1]-(f.slidesGrid[n+1]-f.slidesGrid[n])/2?t=n:i>=f.slidesGrid[n]&&i<f.slidesGrid[n+1]&&(t=n+1):i>=f.slidesGrid[n]&&(t=n);(f.params.normalizeSlideIndex&&(t<0||typeof t=="undefined")&&(t=0),r=Math.floor(t/f.params.slidesPerGroup),r>=f.snapGrid.length&&(r=f.snapGrid.length-1),t!==f.activeIndex)&&(f.snapIndex=r,f.previousIndex=f.activeIndex,f.activeIndex=t,f.updateClasses(),f.updateRealIndex())};f.updateRealIndex=function(){f.realIndex=parseInt(f.slides.eq(f.activeIndex).attr("data-swiper-slide-index")||f.activeIndex,10)};f.updateClasses=function(){var o,i,r,t,e;if(f.slides.removeClass(f.params.slideActiveClass+" "+f.params.slideNextClass+" "+f.params.slidePrevClass+" "+f.params.slideDuplicateActiveClass+" "+f.params.slideDuplicateNextClass+" "+f.params.slideDuplicatePrevClass),o=f.slides.eq(f.activeIndex),o.addClass(f.params.slideActiveClass),u.loop&&(o.hasClass(f.params.slideDuplicateClass)?f.wrapper.children("."+f.params.slideClass+":not(."+f.params.slideDuplicateClass+')[data-swiper-slide-index="'+f.realIndex+'"]').addClass(f.params.slideDuplicateActiveClass):f.wrapper.children("."+f.params.slideClass+"."+f.params.slideDuplicateClass+'[data-swiper-slide-index="'+f.realIndex+'"]').addClass(f.params.slideDuplicateActiveClass)),i=o.next("."+f.params.slideClass).addClass(f.params.slideNextClass),f.params.loop&&i.length===0&&(i=f.slides.eq(0),i.addClass(f.params.slideNextClass)),r=o.prev("."+f.params.slideClass).addClass(f.params.slidePrevClass),f.params.loop&&r.length===0&&(r=f.slides.eq(-1),r.addClass(f.params.slidePrevClass)),u.loop&&(i.hasClass(f.params.slideDuplicateClass)?f.wrapper.children("."+f.params.slideClass+":not(."+f.params.slideDuplicateClass+')[data-swiper-slide-index="'+i.attr("data-swiper-slide-index")+'"]').addClass(f.params.slideDuplicateNextClass):f.wrapper.children("."+f.params.slideClass+"."+f.params.slideDuplicateClass+'[data-swiper-slide-index="'+i.attr("data-swiper-slide-index")+'"]').addClass(f.params.slideDuplicateNextClass),r.hasClass(f.params.slideDuplicateClass)?f.wrapper.children("."+f.params.slideClass+":not(."+f.params.slideDuplicateClass+')[data-swiper-slide-index="'+r.attr("data-swiper-slide-index")+'"]').addClass(f.params.slideDuplicatePrevClass):f.wrapper.children("."+f.params.slideClass+"."+f.params.slideDuplicateClass+'[data-swiper-slide-index="'+r.attr("data-swiper-slide-index")+'"]').addClass(f.params.slideDuplicatePrevClass)),f.paginationContainer&&f.paginationContainer.length>0){if(e=f.params.loop?Math.ceil((f.slides.length-f.loopedSlides*2)/f.params.slidesPerGroup):f.snapGrid.length,f.params.loop?(t=Math.ceil((f.activeIndex-f.loopedSlides)/f.params.slidesPerGroup),t>f.slides.length-1-f.loopedSlides*2&&(t=t-(f.slides.length-f.loopedSlides*2)),t>e-1&&(t=t-e),t<0&&f.params.paginationType!=="bullets"&&(t=e+t)):t=typeof f.snapIndex!="undefined"?f.snapIndex:f.activeIndex||0,f.params.paginationType==="bullets"&&f.bullets&&f.bullets.length>0&&(f.bullets.removeClass(f.params.bulletActiveClass),f.paginationContainer.length>1?f.bullets.each(function(){n(this).index()===t&&n(this).addClass(f.params.bulletActiveClass)}):f.bullets.eq(t).addClass(f.params.bulletActiveClass)),f.params.paginationType==="fraction"&&(f.paginationContainer.find("."+f.params.paginationCurrentClass).text(t+1),f.paginationContainer.find("."+f.params.paginationTotalClass).text(e)),f.params.paginationType==="progress"){var s=(t+1)/e,h=s,c=1;f.isHorizontal()||(c=s,h=1);f.paginationContainer.find("."+f.params.paginationProgressbarClass).transform("translate3d(0,0,0) scaleX("+h+") scaleY("+c+")").transition(f.params.speed)}f.params.paginationType==="custom"&&f.params.paginationCustomRender&&(f.paginationContainer.html(f.params.paginationCustomRender(f,t+1,e)),f.emit("onPaginationRendered",f,f.paginationContainer[0]))}f.params.loop||(f.params.prevButton&&f.prevButton&&f.prevButton.length>0&&(f.isBeginning?(f.prevButton.addClass(f.params.buttonDisabledClass),f.params.a11y&&f.a11y&&f.a11y.disable(f.prevButton)):(f.prevButton.removeClass(f.params.buttonDisabledClass),f.params.a11y&&f.a11y&&f.a11y.enable(f.prevButton))),f.params.nextButton&&f.nextButton&&f.nextButton.length>0&&(f.isEnd?(f.nextButton.addClass(f.params.buttonDisabledClass),f.params.a11y&&f.a11y&&f.a11y.disable(f.nextButton)):(f.nextButton.removeClass(f.params.buttonDisabledClass),f.params.a11y&&f.a11y&&f.a11y.enable(f.nextButton))))};f.updatePagination=function(){var n,i,t;if(f.params.pagination&&f.paginationContainer&&f.paginationContainer.length>0){if(n="",f.params.paginationType==="bullets"){for(i=f.params.loop?Math.ceil((f.slides.length-f.loopedSlides*2)/f.params.slidesPerGroup):f.snapGrid.length,t=0;t<i;t++)n+=f.params.paginationBulletRender?f.params.paginationBulletRender(f,t,f.params.bulletClass):"<"+f.params.paginationElement+' class="'+f.params.bulletClass+'"><\/'+f.params.paginationElement+">";f.paginationContainer.html(n);f.bullets=f.paginationContainer.find("."+f.params.bulletClass);f.params.paginationClickable&&f.params.a11y&&f.a11y&&f.a11y.initPagination()}f.params.paginationType==="fraction"&&(n=f.params.paginationFractionRender?f.params.paginationFractionRender(f,f.params.paginationCurrentClass,f.params.paginationTotalClass):'<span class="'+f.params.paginationCurrentClass+'"><\/span> / <span class="'+f.params.paginationTotalClass+'"><\/span>',f.paginationContainer.html(n));f.params.paginationType==="progress"&&(n=f.params.paginationProgressRender?f.params.paginationProgressRender(f,f.params.paginationProgressbarClass):'<span class="'+f.params.paginationProgressbarClass+'"><\/span>',f.paginationContainer.html(n));f.params.paginationType!=="custom"&&f.emit("onPaginationRendered",f,f.paginationContainer[0])}};f.update=function(n){function t(){var n=f.rtl?-f.translate:f.translate;r=Math.min(Math.max(f.translate,f.maxTranslate()),f.minTranslate());f.setWrapperTranslate(r);f.updateActiveIndex();f.updateClasses()}if(f)if(f.updateContainerSize(),f.updateSlidesSize(),f.updateProgress(),f.updatePagination(),f.updateClasses(),f.params.scrollbar&&f.scrollbar&&f.scrollbar.set(),n){var i,r;f.controller&&f.controller.spline&&(f.controller.spline=undefined);f.params.freeMode?(t(),f.params.autoHeight&&f.updateAutoHeight()):(i=(f.params.slidesPerView==="auto"||f.params.slidesPerView>1)&&f.isEnd&&!f.params.centeredSlides?f.slideTo(f.slides.length-1,0,!1,!0):f.slideTo(f.activeIndex,0,!1,!0),i||t())}else f.params.autoHeight&&f.updateAutoHeight()};f.onResize=function(n){var i,r,t,u;f.params.breakpoints&&f.setBreakpoint();i=f.params.allowSwipeToPrev;r=f.params.allowSwipeToNext;f.params.allowSwipeToPrev=f.params.allowSwipeToNext=!0;f.updateContainerSize();f.updateSlidesSize();(f.params.slidesPerView==="auto"||f.params.freeMode||n)&&f.updatePagination();f.params.scrollbar&&f.scrollbar&&f.scrollbar.set();f.controller&&f.controller.spline&&(f.controller.spline=undefined);t=!1;f.params.freeMode?(u=Math.min(Math.max(f.translate,f.maxTranslate()),f.minTranslate()),f.setWrapperTranslate(u),f.updateActiveIndex(),f.updateClasses(),f.params.autoHeight&&f.updateAutoHeight()):(f.updateClasses(),t=(f.params.slidesPerView==="auto"||f.params.slidesPerView>1)&&f.isEnd&&!f.params.centeredSlides?f.slideTo(f.slides.length-1,0,!1,!0):f.slideTo(f.activeIndex,0,!1,!0));f.params.lazyLoading&&!t&&f.lazy&&f.lazy.load();f.params.allowSwipeToPrev=i;f.params.allowSwipeToNext=r};f.touchEventsDesktop={start:"mousedown",move:"mousemove",end:"mouseup"};window.navigator.pointerEnabled?f.touchEventsDesktop={start:"pointerdown",move:"pointermove",end:"pointerup"}:window.navigator.msPointerEnabled&&(f.touchEventsDesktop={start:"MSPointerDown",move:"MSPointerMove",end:"MSPointerUp"});f.touchEvents={start:f.support.touch||!f.params.simulateTouch?"touchstart":f.touchEventsDesktop.start,move:f.support.touch||!f.params.simulateTouch?"touchmove":f.touchEventsDesktop.move,end:f.support.touch||!f.params.simulateTouch?"touchend":f.touchEventsDesktop.end};(window.navigator.pointerEnabled||window.navigator.msPointerEnabled)&&(f.params.touchEventsTarget==="container"?f.container:f.wrapper).addClass("swiper-wp8-"+f.params.direction);f.initEvents=function(n){var r=n?"off":"on",t=n?"removeEventListener":"addEventListener",i=f.params.touchEventsTarget==="container"?f.container[0]:f.wrapper[0],s=f.support.touch?i:document,e=f.params.nested?!0:!1,o;f.browser.ie?(i[t](f.touchEvents.start,f.onTouchStart,!1),s[t](f.touchEvents.move,f.onTouchMove,e),s[t](f.touchEvents.end,f.onTouchEnd,!1)):(f.support.touch&&(o=f.touchEvents.start==="touchstart"&&f.support.passiveListener&&f.params.passiveListeners?{passive:!0,capture:!1}:!1,i[t](f.touchEvents.start,f.onTouchStart,o),i[t](f.touchEvents.move,f.onTouchMove,e),i[t](f.touchEvents.end,f.onTouchEnd,o)),(u.simulateTouch&&!f.device.ios&&!f.device.android||u.simulateTouch&&!f.support.touch&&f.device.ios)&&(i[t]("mousedown",f.onTouchStart,!1),document[t]("mousemove",f.onTouchMove,e),document[t]("mouseup",f.onTouchEnd,!1)));window[t]("resize",f.onResize);f.params.nextButton&&f.nextButton&&f.nextButton.length>0&&(f.nextButton[r]("click",f.onClickNext),f.params.a11y&&f.a11y&&f.nextButton[r]("keydown",f.a11y.onEnterKey));f.params.prevButton&&f.prevButton&&f.prevButton.length>0&&(f.prevButton[r]("click",f.onClickPrev),f.params.a11y&&f.a11y&&f.prevButton[r]("keydown",f.a11y.onEnterKey));f.params.pagination&&f.params.paginationClickable&&(f.paginationContainer[r]("click","."+f.params.bulletClass,f.onClickIndex),f.params.a11y&&f.a11y&&f.paginationContainer[r]("keydown","."+f.params.bulletClass,f.a11y.onEnterKey));(f.params.preventClicks||f.params.preventClicksPropagation)&&i[t]("click",f.preventClicks,!0)};f.attachEvents=function(){f.initEvents()};f.detachEvents=function(){f.initEvents(!0)};f.allowClick=!0;f.preventClicks=function(n){f.allowClick||(f.params.preventClicks&&n.preventDefault(),f.params.preventClicksPropagation&&f.animating&&(n.stopPropagation(),n.stopImmediatePropagation()))};f.onClickNext=function(n){(n.preventDefault(),!f.isEnd||f.params.loop)&&f.slideNext()};f.onClickPrev=function(n){(n.preventDefault(),!f.isBeginning||f.params.loop)&&f.slidePrev()};f.onClickIndex=function(t){t.preventDefault();var i=n(this).index()*f.params.slidesPerGroup;f.params.loop&&(i=i+f.loopedSlides);f.slideTo(i)};f.updateClickedSlide=function(t){var r=ot(t,"."+f.params.slideClass),s=!1,u,i,o,e;if(r)for(u=0;u<f.slides.length;u++)f.slides[u]===r&&(s=!0);if(r&&s)f.clickedSlide=r,f.clickedIndex=n(r).index();else{f.clickedSlide=undefined;f.clickedIndex=undefined;return}if(f.params.slideToClickedSlide&&f.clickedIndex!==undefined&&f.clickedIndex!==f.activeIndex)if(i=f.clickedIndex,e=f.params.slidesPerView==="auto"?f.currentSlidesPerView():f.params.slidesPerView,f.params.loop){if(f.animating)return;o=parseInt(n(f.clickedSlide).attr("data-swiper-slide-index"),10);f.params.centeredSlides?i<f.loopedSlides-e/2||i>f.slides.length-f.loopedSlides+e/2?(f.fixLoop(),i=f.wrapper.children("."+f.params.slideClass+'[data-swiper-slide-index="'+o+'"]:not(.'+f.params.slideDuplicateClass+")").eq(0).index(),setTimeout(function(){f.slideTo(i)},0)):f.slideTo(i):i>f.slides.length-e?(f.fixLoop(),i=f.wrapper.children("."+f.params.slideClass+'[data-swiper-slide-index="'+o+'"]:not(.'+f.params.slideDuplicateClass+")").eq(0).index(),setTimeout(function(){f.slideTo(i)},0)):f.slideTo(i)}else f.slideTo(i)};var c,l,g,nt,v,e,s,tt,st="input, select, textarea, button, video",ht=Date.now(),w,a=[],it;f.animating=!1;f.touches={startX:0,startY:0,currentX:0,currentY:0,diff:0};f.onTouchStart=function(t){var i,u,r;if(t.originalEvent&&(t=t.originalEvent),b=t.type==="touchstart",b||!("which"in t)||t.which!==3){if(f.params.noSwiping&&ot(t,"."+f.params.noSwipingClass)){f.allowClick=!0;return}(!f.params.swipeHandler||ot(t,f.params.swipeHandler))&&((i=f.touches.currentX=t.type==="touchstart"?t.targetTouches[0].pageX:t.pageX,u=f.touches.currentY=t.type==="touchstart"?t.targetTouches[0].pageY:t.pageY,f.device.ios&&f.params.iOSEdgeSwipeDetection&&i<=f.params.iOSEdgeSwipeThreshold)||(c=!0,l=!1,g=!0,v=undefined,rt=undefined,f.touches.startX=i,f.touches.startY=u,nt=Date.now(),f.allowClick=!0,f.updateContainerSize(),f.swipeDirection=undefined,f.params.threshold>0&&(tt=!1),t.type!=="touchstart"&&(r=!0,n(t.target).is(st)&&(r=!1),document.activeElement&&n(document.activeElement).is(st)&&document.activeElement.blur(),r&&t.preventDefault()),f.emit("onTouchStart",f,t)))}};f.onTouchMove=function(t){var o,i,r;if(t.originalEvent&&(t=t.originalEvent),!b||t.type!=="mousemove"){if(t.preventedByNestedSwiper){f.touches.startX=t.type==="touchmove"?t.targetTouches[0].pageX:t.pageX;f.touches.startY=t.type==="touchmove"?t.targetTouches[0].pageY:t.pageY;return}if(f.params.onlyExternal){f.allowClick=!1;c&&(f.touches.startX=f.touches.currentX=t.type==="touchmove"?t.targetTouches[0].pageX:t.pageX,f.touches.startY=f.touches.currentY=t.type==="touchmove"?t.targetTouches[0].pageY:t.pageY,nt=Date.now());return}if(b&&f.params.touchReleaseOnEdges&&!f.params.loop)if(f.isHorizontal()){if(f.touches.currentX<f.touches.startX&&f.translate<=f.maxTranslate()||f.touches.currentX>f.touches.startX&&f.translate>=f.minTranslate())return}else if(f.touches.currentY<f.touches.startY&&f.translate<=f.maxTranslate()||f.touches.currentY>f.touches.startY&&f.translate>=f.minTranslate())return;if(b&&document.activeElement&&t.target===document.activeElement&&n(t.target).is(st)){l=!0;f.allowClick=!1;return}if((g&&f.emit("onTouchMove",f,t),!t.targetTouches||!(t.targetTouches.length>1))&&(f.touches.currentX=t.type==="touchmove"?t.targetTouches[0].pageX:t.pageX,f.touches.currentY=t.type==="touchmove"?t.targetTouches[0].pageY:t.pageY,typeof v=="undefined"&&(f.isHorizontal()&&f.touches.currentY===f.touches.startY||!f.isHorizontal()&&f.touches.currentX===f.touches.startX?v=!1:(o=Math.atan2(Math.abs(f.touches.currentY-f.touches.startY),Math.abs(f.touches.currentX-f.touches.startX))*180/Math.PI,v=f.isHorizontal()?o>f.params.touchAngle:90-o>f.params.touchAngle)),v&&f.emit("onTouchMoveOpposite",f,t),typeof rt=="undefined"&&f.browser.ieTouch&&(f.touches.currentX!==f.touches.startX||f.touches.currentY!==f.touches.startY)&&(rt=!0),c)){if(v){c=!1;return}if(rt||!f.browser.ieTouch){if(f.allowClick=!1,f.emit("onSliderMove",f,t),t.preventDefault(),f.params.touchMoveStopPropagation&&!f.params.nested&&t.stopPropagation(),l||(u.loop&&f.fixLoop(),s=f.getWrapperTranslate(),f.setWrapperTransition(0),f.animating&&f.wrapper.trigger("webkitTransitionEnd transitionend oTransitionEnd MSTransitionEnd msTransitionEnd"),f.params.autoplay&&f.autoplaying&&(f.params.autoplayDisableOnInteraction?f.stopAutoplay():f.pauseAutoplay()),it=!1,f.params.grabCursor&&(f.params.allowSwipeToNext===!0||f.params.allowSwipeToPrev===!0)&&f.setGrabCursor(!0)),l=!0,i=f.touches.diff=f.isHorizontal()?f.touches.currentX-f.touches.startX:f.touches.currentY-f.touches.startY,i=i*f.params.touchRatio,f.rtl&&(i=-i),f.swipeDirection=i>0?"prev":"next",e=i+s,r=!0,i>0&&e>f.minTranslate()?(r=!1,f.params.resistance&&(e=f.minTranslate()-1+Math.pow(-f.minTranslate()+s+i,f.params.resistanceRatio))):i<0&&e<f.maxTranslate()&&(r=!1,f.params.resistance&&(e=f.maxTranslate()+1-Math.pow(f.maxTranslate()-s-i,f.params.resistanceRatio))),r&&(t.preventedByNestedSwiper=!0),!f.params.allowSwipeToNext&&f.swipeDirection==="next"&&e<s&&(e=s),!f.params.allowSwipeToPrev&&f.swipeDirection==="prev"&&e>s&&(e=s),f.params.threshold>0)if(Math.abs(i)>f.params.threshold||tt){if(!tt){tt=!0;f.touches.startX=f.touches.currentX;f.touches.startY=f.touches.currentY;e=s;f.touches.diff=f.isHorizontal()?f.touches.currentX-f.touches.startX:f.touches.currentY-f.touches.startY;return}}else{e=s;return}f.params.followFinger&&((f.params.freeMode||f.params.watchSlidesProgress)&&f.updateActiveIndex(),f.params.freeMode&&(a.length===0&&a.push({position:f.touches[f.isHorizontal()?"startX":"startY"],time:nt}),a.push({position:f.touches[f.isHorizontal()?"currentX":"currentY"],time:(new window.Date).getTime()})),f.updateProgress(e),f.setWrapperTranslate(e))}}}};f.onTouchEnd=function(t){var b,v,o,d,tt,y,h,p,r,u,rt,ft;if(t.originalEvent&&(t=t.originalEvent),g&&f.emit("onTouchEnd",f,t),g=!1,c){if(f.params.grabCursor&&l&&c&&(f.params.allowSwipeToNext===!0||f.params.allowSwipeToPrev===!0)&&f.setGrabCursor(!1),b=Date.now(),v=b-nt,f.allowClick&&(f.updateClickedSlide(t),f.emit("onTap",f,t),v<300&&b-ht>300&&(w&&clearTimeout(w),w=setTimeout(function(){f&&(f.params.paginationHide&&f.paginationContainer.length>0&&!n(t.target).hasClass(f.params.bulletClass)&&f.paginationContainer.toggleClass(f.params.paginationHiddenClass),f.emit("onClick",f,t))},300)),v<300&&b-ht<300&&(w&&clearTimeout(w),f.emit("onDoubleTap",f,t))),ht=Date.now(),setTimeout(function(){f&&(f.allowClick=!0)},0),!c||!l||!f.swipeDirection||f.touches.diff===0||e===s){c=l=!1;return}if(c=l=!1,o=f.params.followFinger?f.rtl?f.translate:-f.translate:-e,f.params.freeMode){if(o<-f.minTranslate()){f.slideTo(f.activeIndex);return}if(o>-f.maxTranslate()){f.slides.length<f.snapGrid.length?f.slideTo(f.snapGrid.length-1):f.slideTo(f.slides.length-1);return}if(f.params.freeModeMomentum){if(a.length>1){var ut=a.pop(),et=a.pop(),st=ut.position-et.position,ot=ut.time-et.time;f.velocity=st/ot;f.velocity=f.velocity/2;Math.abs(f.velocity)<f.params.freeModeMinimumVelocity&&(f.velocity=0);(ot>150||(new window.Date).getTime()-ut.time>300)&&(f.velocity=0)}else f.velocity=0;f.velocity=f.velocity*f.params.freeModeMomentumVelocityRatio;a.length=0;var k=1e3*f.params.freeModeMomentumRatio,ct=f.velocity*k,i=f.translate+ct;if(f.rtl&&(i=-i),d=!1,y=Math.abs(f.velocity)*20*f.params.freeModeMomentumBounceRatio,i<f.maxTranslate())f.params.freeModeMomentumBounce?(i+f.maxTranslate()<-y&&(i=f.maxTranslate()-y),tt=f.maxTranslate(),d=!0,it=!0):i=f.maxTranslate();else if(i>f.minTranslate())f.params.freeModeMomentumBounce?(i-f.minTranslate()>y&&(i=f.minTranslate()+y),tt=f.minTranslate(),d=!0,it=!0):i=f.minTranslate();else if(f.params.freeModeSticky){for(h=0,h=0;h<f.snapGrid.length;h+=1)if(f.snapGrid[h]>-i){p=h;break}i=Math.abs(f.snapGrid[p]-i)<Math.abs(f.snapGrid[p-1]-i)||f.swipeDirection==="next"?f.snapGrid[p]:f.snapGrid[p-1];f.rtl||(i=-i)}if(f.velocity!==0)k=f.rtl?Math.abs((-i-f.translate)/f.velocity):Math.abs((i-f.translate)/f.velocity);else if(f.params.freeModeSticky){f.slideReset();return}f.params.freeModeMomentumBounce&&d?(f.updateProgress(tt),f.setWrapperTransition(k),f.setWrapperTranslate(i),f.onTransitionStart(),f.animating=!0,f.wrapper.transitionEnd(function(){f&&it&&(f.emit("onMomentumBounce",f),f.setWrapperTransition(f.params.speed),f.setWrapperTranslate(tt),f.wrapper.transitionEnd(function(){f&&f.onTransitionEnd()}))})):f.velocity?(f.updateProgress(i),f.setWrapperTransition(k),f.setWrapperTranslate(i),f.onTransitionStart(),f.animating||(f.animating=!0,f.wrapper.transitionEnd(function(){f&&f.onTransitionEnd()}))):f.updateProgress(i);f.updateActiveIndex()}(!f.params.freeModeMomentum||v>=f.params.longSwipesMs)&&(f.updateProgress(),f.updateActiveIndex());return}for(u=0,rt=f.slidesSizesGrid[0],r=0;r<f.slidesGrid.length;r+=f.params.slidesPerGroup)typeof f.slidesGrid[r+f.params.slidesPerGroup]!="undefined"?o>=f.slidesGrid[r]&&o<f.slidesGrid[r+f.params.slidesPerGroup]&&(u=r,rt=f.slidesGrid[r+f.params.slidesPerGroup]-f.slidesGrid[r]):o>=f.slidesGrid[r]&&(u=r,rt=f.slidesGrid[f.slidesGrid.length-1]-f.slidesGrid[f.slidesGrid.length-2]);if(ft=(o-f.slidesGrid[u])/rt,v>f.params.longSwipesMs){if(!f.params.longSwipes){f.slideTo(f.activeIndex);return}f.swipeDirection==="next"&&(ft>=f.params.longSwipesRatio?f.slideTo(u+f.params.slidesPerGroup):f.slideTo(u));f.swipeDirection==="prev"&&(ft>1-f.params.longSwipesRatio?f.slideTo(u+f.params.slidesPerGroup):f.slideTo(u))}else{if(!f.params.shortSwipes){f.slideTo(f.activeIndex);return}f.swipeDirection==="next"&&f.slideTo(u+f.params.slidesPerGroup);f.swipeDirection==="prev"&&f.slideTo(u)}}};f._slideTo=function(n,t){return f.slideTo(n,t,!0,!0)};f.slideTo=function(n,t,i,r){var u,e;if(typeof i=="undefined"&&(i=!0),typeof n=="undefined"&&(n=0),n<0&&(n=0),f.snapIndex=Math.floor(n/f.params.slidesPerGroup),f.snapIndex>=f.snapGrid.length&&(f.snapIndex=f.snapGrid.length-1),u=-f.snapGrid[f.snapIndex],f.params.autoplay&&f.autoplaying&&(r||!f.params.autoplayDisableOnInteraction?f.pauseAutoplay(t):f.stopAutoplay()),f.updateProgress(u),f.params.normalizeSlideIndex)for(e=0;e<f.slidesGrid.length;e++)-Math.floor(u*100)>=Math.floor(f.slidesGrid[e]*100)&&(n=e);if(!f.params.allowSwipeToNext&&u<f.translate&&u<f.minTranslate()||!f.params.allowSwipeToPrev&&u>f.translate&&u>f.maxTranslate()&&(f.activeIndex||0)!==n)return!1;if(typeof t=="undefined"&&(t=f.params.speed),f.previousIndex=f.activeIndex||0,f.activeIndex=n,f.updateRealIndex(),f.rtl&&-u===f.translate||!f.rtl&&u===f.translate)return f.params.autoHeight&&f.updateAutoHeight(),f.updateClasses(),f.params.effect!=="slide"&&f.setWrapperTranslate(u),!1;f.updateClasses();f.onTransitionStart(i);if(t===0||f.browser.lteIE9){f.setWrapperTranslate(u);f.setWrapperTransition(0);f.onTransitionEnd(i)}else f.setWrapperTranslate(u),f.setWrapperTransition(t),f.animating||(f.animating=!0,f.wrapper.transitionEnd(function(){if(f)f.onTransitionEnd(i)}));return!0};f.onTransitionStart=function(n){typeof n=="undefined"&&(n=!0);f.params.autoHeight&&f.updateAutoHeight();f.lazy&&f.lazy.onTransitionStart();n&&(f.emit("onTransitionStart",f),f.activeIndex!==f.previousIndex&&(f.emit("onSlideChangeStart",f),f.activeIndex>f.previousIndex?f.emit("onSlideNextStart",f):f.emit("onSlidePrevStart",f)))};f.onTransitionEnd=function(n){f.animating=!1;f.setWrapperTransition(0);typeof n=="undefined"&&(n=!0);f.lazy&&f.lazy.onTransitionEnd();n&&(f.emit("onTransitionEnd",f),f.activeIndex!==f.previousIndex&&(f.emit("onSlideChangeEnd",f),f.activeIndex>f.previousIndex?f.emit("onSlideNextEnd",f):f.emit("onSlidePrevEnd",f)));f.params.history&&f.history&&f.history.setHistory(f.params.history,f.activeIndex);f.params.hashnav&&f.hashnav&&f.hashnav.setHash()};f.slideNext=function(n,t,i){if(f.params.loop){if(f.animating)return!1;f.fixLoop();var r=f.container[0].clientLeft;return f.slideTo(f.activeIndex+f.params.slidesPerGroup,t,n,i)}return f.slideTo(f.activeIndex+f.params.slidesPerGroup,t,n,i)};f._slideNext=function(n){return f.slideNext(!0,n,!0)};f.slidePrev=function(n,t,i){if(f.params.loop){if(f.animating)return!1;f.fixLoop();var r=f.container[0].clientLeft;return f.slideTo(f.activeIndex-1,t,n,i)}return f.slideTo(f.activeIndex-1,t,n,i)};f._slidePrev=function(n){return f.slidePrev(!0,n,!0)};f.slideReset=function(n,t){return f.slideTo(f.activeIndex,t,n)};f.disableTouchControl=function(){return f.params.onlyExternal=!0,!0};f.enableTouchControl=function(){return f.params.onlyExternal=!1,!0};f.setWrapperTransition=function(n,t){f.wrapper.transition(n);f.params.effect!=="slide"&&f.effects[f.params.effect]&&f.effects[f.params.effect].setTransition(n);f.params.parallax&&f.parallax&&f.parallax.setTransition(n);f.params.scrollbar&&f.scrollbar&&f.scrollbar.setTransition(n);f.params.control&&f.controller&&f.controller.setTransition(n,t);f.emit("onSetTransition",f,n)};f.setWrapperTranslate=function(n,t,i){var r=0,u=0,o,e;f.isHorizontal()?r=f.rtl?-n:n:u=n;f.params.roundLengths&&(r=d(r),u=d(u));f.params.virtualTranslate||(f.support.transforms3d?f.wrapper.transform("translate3d("+r+"px, "+u+"px, 0px)"):f.wrapper.transform("translate("+r+"px, "+u+"px)"));f.translate=f.isHorizontal()?r:u;e=f.maxTranslate()-f.minTranslate();o=e===0?0:(n-f.minTranslate())/e;o!==f.progress&&f.updateProgress(n);t&&f.updateActiveIndex();f.params.effect!=="slide"&&f.effects[f.params.effect]&&f.effects[f.params.effect].setTranslate(f.translate);f.params.parallax&&f.parallax&&f.parallax.setTranslate(f.translate);f.params.scrollbar&&f.scrollbar&&f.scrollbar.setTranslate(f.translate);f.params.control&&f.controller&&f.controller.setTranslate(f.translate,i);f.emit("onSetTranslate",f,f.translate)};f.getTranslate=function(n,t){var u,i,r,e;return(typeof t=="undefined"&&(t="x"),f.params.virtualTranslate)?f.rtl?-f.translate:f.translate:(r=window.getComputedStyle(n,null),window.WebKitCSSMatrix?(i=r.transform||r.webkitTransform,i.split(",").length>6&&(i=i.split(", ").map(function(n){return n.replace(",",".")}).join(", ")),e=new window.WebKitCSSMatrix(i==="none"?"":i)):(e=r.MozTransform||r.OTransform||r.MsTransform||r.msTransform||r.transform||r.getPropertyValue("transform").replace("translate(","matrix(1, 0, 0, 1,"),u=e.toString().split(",")),t==="x"&&(i=window.WebKitCSSMatrix?e.m41:u.length===16?parseFloat(u[12]):parseFloat(u[4])),t==="y"&&(i=window.WebKitCSSMatrix?e.m42:u.length===16?parseFloat(u[13]):parseFloat(u[5])),f.rtl&&i&&(i=-i),i||0)};f.getWrapperTranslate=function(n){return typeof n=="undefined"&&(n=f.isHorizontal()?"x":"y"),f.getTranslate(f.wrapper[0],n)};f.observers=[];f.initObservers=function(){var t,n;if(f.params.observeParents)for(t=f.container.parents(),n=0;n<t.length;n++)ct(t[n]);ct(f.container[0],{childList:!1});ct(f.wrapper[0],{attributes:!1})};f.disconnectObservers=function(){for(var n=0;n<f.observers.length;n++)f.observers[n].disconnect();f.observers=[]};f.createLoop=function(){var i,r,u,t;for(f.wrapper.children("."+f.params.slideClass+"."+f.params.slideDuplicateClass).remove(),i=f.wrapper.children("."+f.params.slideClass),f.params.slidesPerView!=="auto"||f.params.loopedSlides||(f.params.loopedSlides=i.length),f.loopedSlides=parseInt(f.params.loopedSlides||f.params.slidesPerView,10),f.loopedSlides=f.loopedSlides+f.params.loopAdditionalSlides,f.loopedSlides>i.length&&(f.loopedSlides=i.length),r=[],u=[],i.each(function(t,e){var o=n(this);t<f.loopedSlides&&u.push(e);t<i.length&&t>=i.length-f.loopedSlides&&r.push(e);o.attr("data-swiper-slide-index",t)}),t=0;t<u.length;t++)f.wrapper.append(n(u[t].cloneNode(!0)).addClass(f.params.slideDuplicateClass));for(t=r.length-1;t>=0;t--)f.wrapper.prepend(n(r[t].cloneNode(!0)).addClass(f.params.slideDuplicateClass))};f.destroyLoop=function(){f.wrapper.children("."+f.params.slideClass+"."+f.params.slideDuplicateClass).remove();f.slides.removeAttr("data-swiper-slide-index")};f.reLoop=function(n){var t=f.activeIndex-f.loopedSlides;f.destroyLoop();f.createLoop();f.updateSlidesSize();n&&f.slideTo(t+f.loopedSlides,0,!1)};f.fixLoop=function(){var n;f.activeIndex<f.loopedSlides?(n=f.slides.length-f.loopedSlides*3+f.activeIndex,n=n+f.loopedSlides,f.slideTo(n,0,!1,!0)):(f.params.slidesPerView==="auto"&&f.activeIndex>=f.loopedSlides*2||f.activeIndex>f.slides.length-f.params.slidesPerView*2)&&(n=-f.slides.length+f.activeIndex+f.loopedSlides,n=n+f.loopedSlides,f.slideTo(n,0,!1,!0))};f.appendSlide=function(n){if(f.params.loop&&f.destroyLoop(),typeof n=="object"&&n.length)for(var t=0;t<n.length;t++)n[t]&&f.wrapper.append(n[t]);else f.wrapper.append(n);f.params.loop&&f.createLoop();f.params.observer&&f.support.observer||f.update(!0)};f.prependSlide=function(n){var i,t;if(f.params.loop&&f.destroyLoop(),i=f.activeIndex+1,typeof n=="object"&&n.length){for(t=0;t<n.length;t++)n[t]&&f.wrapper.prepend(n[t]);i=f.activeIndex+n.length}else f.wrapper.prepend(n);f.params.loop&&f.createLoop();f.params.observer&&f.support.observer||f.update(!0);f.slideTo(i,0,!1)};f.removeSlide=function(n){var t,i,r;if(f.params.loop&&(f.destroyLoop(),f.slides=f.wrapper.children("."+f.params.slideClass)),t=f.activeIndex,typeof n=="object"&&n.length){for(r=0;r<n.length;r++)i=n[r],f.slides[i]&&f.slides.eq(i).remove(),i<t&&t--;t=Math.max(t,0)}else i=n,f.slides[i]&&f.slides.eq(i).remove(),i<t&&t--,t=Math.max(t,0);f.params.loop&&f.createLoop();f.params.observer&&f.support.observer||f.update(!0);f.params.loop?f.slideTo(t+f.loopedSlides,0,!1):f.slideTo(t,0,!1)};f.removeAllSlides=function(){for(var t=[],n=0;n<f.slides.length;n++)t.push(n);f.removeSlide(t)};f.effects={fade:{setTranslate:function(){for(var r,u,t=0;t<f.slides.length;t++){var i=f.slides.eq(t),e=i[0].swiperSlideOffset,n=-e;f.params.virtualTranslate||(n=n-f.translate);r=0;f.isHorizontal()||(r=n,n=0);u=f.params.fade.crossFade?Math.max(1-Math.abs(i[0].progress),0):1+Math.min(Math.max(i[0].progress,-1),0);i.css({opacity:u}).transform("translate3d("+n+"px, "+r+"px, 0px)")}},setTransition:function(n){if(f.slides.transition(n),f.params.virtualTranslate&&n!==0){var t=!1;f.slides.transitionEnd(function(){var i,n;if(!t&&f)for(t=!0,f.animating=!1,i=["webkitTransitionEnd","transitionend","oTransitionEnd","MSTransitionEnd","msTransitionEnd"],n=0;n<i.length;n++)f.wrapper.trigger(i[n])})}}},flip:{setTranslate:function(){for(var t,i,r,u,o=0;o<f.slides.length;o++){t=f.slides.eq(o);i=t[0].progress;f.params.flip.limitRotation&&(i=Math.max(Math.min(t[0].progress,1),-1));var l=t[0].swiperSlideOffset,a=-180*i,e=a,h=0,s=-l,c=0;f.isHorizontal()?f.rtl&&(e=-e):(c=s,s=0,h=-e,e=0);t[0].style.zIndex=-Math.abs(Math.round(i))+f.slides.length;f.params.flip.slideShadows&&(r=f.isHorizontal()?t.find(".swiper-slide-shadow-left"):t.find(".swiper-slide-shadow-top"),u=f.isHorizontal()?t.find(".swiper-slide-shadow-right"):t.find(".swiper-slide-shadow-bottom"),r.length===0&&(r=n('<div class="swiper-slide-shadow-'+(f.isHorizontal()?"left":"top")+'"><\/div>'),t.append(r)),u.length===0&&(u=n('<div class="swiper-slide-shadow-'+(f.isHorizontal()?"right":"bottom")+'"><\/div>'),t.append(u)),r.length&&(r[0].style.opacity=Math.max(-i,0)),u.length&&(u[0].style.opacity=Math.max(i,0)));t.transform("translate3d("+s+"px, "+c+"px, 0px) rotateX("+h+"deg) rotateY("+e+"deg)")}},setTransition:function(t){if(f.slides.transition(t).find(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").transition(t),f.params.virtualTranslate&&t!==0){var i=!1;f.slides.eq(f.activeIndex).transitionEnd(function(){var r,t;if(!i&&f&&n(this).hasClass(f.params.slideActiveClass))for(i=!0,f.animating=!1,r=["webkitTransitionEnd","transitionend","oTransitionEnd","MSTransitionEnd","msTransitionEnd"],t=0;t<r.length;t++)f.wrapper.trigger(r[t])})}}},cube:{setTranslate:function(){var e=0,t,i,y,h,c,b;for(f.params.cube.shadow&&(f.isHorizontal()?(t=f.wrapper.find(".swiper-cube-shadow"),t.length===0&&(t=n('<div class="swiper-cube-shadow"><\/div>'),f.wrapper.append(t)),t.css({height:f.width+"px"})):(t=f.container.find(".swiper-cube-shadow"),t.length===0&&(t=n('<div class="swiper-cube-shadow"><\/div>'),f.container.append(t)))),i=0;i<f.slides.length;i++){var u=f.slides.eq(i),o=i*90,l=Math.floor(o/360);f.rtl&&(o=-o,l=Math.floor(-o/360));var s=Math.max(Math.min(u[0].progress,1),-1),r=0,v=0,a=0;i%4==0?(r=-l*4*f.size,a=0):(i-1)%4==0?(r=0,a=-l*4*f.size):(i-2)%4==0?(r=f.size+l*4*f.size,a=f.size):(i-3)%4==0&&(r=-f.size,a=3*f.size+f.size*4*l);f.rtl&&(r=-r);f.isHorizontal()||(v=r,r=0);y="rotateX("+(f.isHorizontal()?0:-o)+"deg) rotateY("+(f.isHorizontal()?o:0)+"deg) translate3d("+r+"px, "+v+"px, "+a+"px)";s<=1&&s>-1&&(e=i*90+s*90,f.rtl&&(e=-i*90-s*90));u.transform(y);f.params.cube.slideShadows&&(h=f.isHorizontal()?u.find(".swiper-slide-shadow-left"):u.find(".swiper-slide-shadow-top"),c=f.isHorizontal()?u.find(".swiper-slide-shadow-right"):u.find(".swiper-slide-shadow-bottom"),h.length===0&&(h=n('<div class="swiper-slide-shadow-'+(f.isHorizontal()?"left":"top")+'"><\/div>'),u.append(h)),c.length===0&&(c=n('<div class="swiper-slide-shadow-'+(f.isHorizontal()?"right":"bottom")+'"><\/div>'),u.append(c)),h.length&&(h[0].style.opacity=Math.max(-s,0)),c.length&&(c[0].style.opacity=Math.max(s,0)))}if(f.wrapper.css({"-webkit-transform-origin":"50% 50% -"+f.size/2+"px","-moz-transform-origin":"50% 50% -"+f.size/2+"px","-ms-transform-origin":"50% 50% -"+f.size/2+"px","transform-origin":"50% 50% -"+f.size/2+"px"}),f.params.cube.shadow)if(f.isHorizontal())t.transform("translate3d(0px, "+(f.width/2+f.params.cube.shadowOffset)+"px, "+-f.width/2+"px) rotateX(90deg) rotateZ(0deg) scale("+f.params.cube.shadowScale+")");else{var p=Math.abs(e)-Math.floor(Math.abs(e)/90)*90,k=1.5-(Math.sin(p*2*Math.PI/360)/2+Math.cos(p*2*Math.PI/360)/2),d=f.params.cube.shadowScale,w=f.params.cube.shadowScale/k,g=f.params.cube.shadowOffset;t.transform("scale3d("+d+", 1, "+w+") translate3d(0px, "+(f.height/2+g)+"px, "+-f.height/2/w+"px) rotateX(-90deg)")}b=f.isSafari||f.isUiWebView?-f.size/2:0;f.wrapper.transform("translate3d(0px,0,"+b+"px) rotateX("+(f.isHorizontal()?0:e)+"deg) rotateY("+(f.isHorizontal()?-e:0)+"deg)")},setTransition:function(n){f.slides.transition(n).find(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").transition(n);f.params.cube.shadow&&!f.isHorizontal()&&f.container.find(".swiper-cube-shadow").transition(n)}},coverflow:{setTranslate:function(){for(var a=f.translate,v=f.isHorizontal()?-a+f.width/2:-a+f.height/2,y=f.isHorizontal()?f.params.coverflow.rotate:-f.params.coverflow.rotate,d=f.params.coverflow.depth,b,r,u,k,e=0,p=f.slides.length;e<p;e++){var i=f.slides.eq(e),w=f.slidesSizesGrid[e],g=i[0].swiperSlideOffset,t=(v-g-w/2)/w*f.params.coverflow.modifier,o=f.isHorizontal()?y*t:0,s=f.isHorizontal()?0:y*t,h=-d*Math.abs(t),c=f.isHorizontal()?0:f.params.coverflow.stretch*t,l=f.isHorizontal()?f.params.coverflow.stretch*t:0;Math.abs(l)<.001&&(l=0);Math.abs(c)<.001&&(c=0);Math.abs(h)<.001&&(h=0);Math.abs(o)<.001&&(o=0);Math.abs(s)<.001&&(s=0);b="translate3d("+l+"px,"+c+"px,"+h+"px)  rotateX("+s+"deg) rotateY("+o+"deg)";i.transform(b);i[0].style.zIndex=-Math.abs(Math.round(t))+1;f.params.coverflow.slideShadows&&(r=f.isHorizontal()?i.find(".swiper-slide-shadow-left"):i.find(".swiper-slide-shadow-top"),u=f.isHorizontal()?i.find(".swiper-slide-shadow-right"):i.find(".swiper-slide-shadow-bottom"),r.length===0&&(r=n('<div class="swiper-slide-shadow-'+(f.isHorizontal()?"left":"top")+'"><\/div>'),i.append(r)),u.length===0&&(u=n('<div class="swiper-slide-shadow-'+(f.isHorizontal()?"right":"bottom")+'"><\/div>'),i.append(u)),r.length&&(r[0].style.opacity=t>0?t:0),u.length&&(u[0].style.opacity=-t>0?-t:0))}f.browser.ie&&(k=f.wrapper[0].style,k.perspectiveOrigin=v+"px 50%")},setTransition:function(n){f.slides.transition(n).find(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").transition(n)}}};f.lazy={initialImageLoaded:!1,loadImageInSlide:function(t,i){if(typeof t!="undefined"&&(typeof i=="undefined"&&(i=!0),f.slides.length!==0)){var r=f.slides.eq(t),u=r.find("."+f.params.lazyLoadingClass+":not(."+f.params.lazyStatusLoadedClass+"):not(."+f.params.lazyStatusLoadingClass+")");(!r.hasClass(f.params.lazyLoadingClass)||r.hasClass(f.params.lazyStatusLoadedClass)||r.hasClass(f.params.lazyStatusLoadingClass)||(u=u.add(r[0])),u.length!==0)&&u.each(function(){var t=n(this);t.addClass(f.params.lazyStatusLoadingClass);var u=t.attr("data-background"),e=t.attr("data-src"),o=t.attr("data-srcset"),s=t.attr("data-sizes");f.loadImage(t[0],e||u,o,s,!1,function(){var n,h,c;u?(t.css("background-image",'url("'+u+'")'),t.removeAttr("data-background")):(o&&(t.attr("srcset",o),t.removeAttr("data-srcset")),s&&(t.attr("sizes",s),t.removeAttr("data-sizes")),e&&(t.attr("src",e),t.removeAttr("data-src")));t.addClass(f.params.lazyStatusLoadedClass).removeClass(f.params.lazyStatusLoadingClass);r.find("."+f.params.lazyPreloaderClass+", ."+f.params.preloaderClass).remove();f.params.loop&&i&&(n=r.attr("data-swiper-slide-index"),r.hasClass(f.params.slideDuplicateClass)?(h=f.wrapper.children('[data-swiper-slide-index="'+n+'"]:not(.'+f.params.slideDuplicateClass+")"),f.lazy.loadImageInSlide(h.index(),!1)):(c=f.wrapper.children("."+f.params.slideDuplicateClass+'[data-swiper-slide-index="'+n+'"]'),f.lazy.loadImageInSlide(c.index(),!1)));f.emit("onLazyImageReady",f,r[0],t[0])});f.emit("onLazyImageLoad",f,r[0],t[0])})}},load:function(){var t,i=f.params.slidesPerView,u,e;if(i==="auto"&&(i=0),f.lazy.initialImageLoaded||(f.lazy.initialImageLoaded=!0),f.params.watchSlidesVisibility)f.wrapper.children("."+f.params.slideVisibleClass).each(function(){f.lazy.loadImageInSlide(n(this).index())});else if(i>1)for(t=f.activeIndex;t<f.activeIndex+i;t++)f.slides[t]&&f.lazy.loadImageInSlide(t);else f.lazy.loadImageInSlide(f.activeIndex);if(f.params.lazyLoadingInPrevNext)if(i>1||f.params.lazyLoadingInPrevNextAmount&&f.params.lazyLoadingInPrevNextAmount>1){var o=f.params.lazyLoadingInPrevNextAmount,r=i,s=Math.min(f.activeIndex+r+Math.max(o,r),f.slides.length),h=Math.max(f.activeIndex-Math.max(r,o),0);for(t=f.activeIndex+i;t<s;t++)f.slides[t]&&f.lazy.loadImageInSlide(t);for(t=h;t<f.activeIndex;t++)f.slides[t]&&f.lazy.loadImageInSlide(t)}else u=f.wrapper.children("."+f.params.slideNextClass),u.length>0&&f.lazy.loadImageInSlide(u.index()),e=f.wrapper.children("."+f.params.slidePrevClass),e.length>0&&f.lazy.loadImageInSlide(e.index())},onTransitionStart:function(){f.params.lazyLoading&&(!f.params.lazyLoadingOnTransitionStart&&(f.params.lazyLoadingOnTransitionStart||f.lazy.initialImageLoaded)||f.lazy.load())},onTransitionEnd:function(){f.params.lazyLoading&&!f.params.lazyLoadingOnTransitionStart&&f.lazy.load()}};f.scrollbar={isTouched:!1,setDragPosition:function(n){var i=f.scrollbar,e=f.isHorizontal()?n.type==="touchstart"||n.type==="touchmove"?n.targetTouches[0].pageX:n.pageX||n.clientX:n.type==="touchstart"||n.type==="touchmove"?n.targetTouches[0].pageY:n.pageY||n.clientY,t=e-i.track.offset()[f.isHorizontal()?"left":"top"]-i.dragSize/2,r=-f.minTranslate()*i.moveDivider,u=-f.maxTranslate()*i.moveDivider;t<r?t=r:t>u&&(t=u);t=-t/i.moveDivider;f.updateProgress(t);f.setWrapperTranslate(t,!0)},dragStart:function(n){var t=f.scrollbar;t.isTouched=!0;n.preventDefault();n.stopPropagation();t.setDragPosition(n);clearTimeout(t.dragTimeout);t.track.transition(0);f.params.scrollbarHide&&t.track.css("opacity",1);f.wrapper.transition(100);t.drag.transition(100);f.emit("onScrollbarDragStart",f)},dragMove:function(n){var t=f.scrollbar;t.isTouched&&(n.preventDefault?n.preventDefault():n.returnValue=!1,t.setDragPosition(n),f.wrapper.transition(0),t.track.transition(0),t.drag.transition(0),f.emit("onScrollbarDragMove",f))},dragEnd:function(){var n=f.scrollbar;n.isTouched&&(n.isTouched=!1,f.params.scrollbarHide&&(clearTimeout(n.dragTimeout),n.dragTimeout=setTimeout(function(){n.track.css("opacity",0);n.track.transition(400)},1e3)),f.emit("onScrollbarDragEnd",f),f.params.scrollbarSnapOnRelease&&f.slideReset())},draggableEvents:function(){return f.params.simulateTouch!==!1||f.support.touch?f.touchEvents:f.touchEventsDesktop}(),enableDraggable:function(){var t=f.scrollbar,i=f.support.touch?t.track:document;n(t.track).on(t.draggableEvents.start,t.dragStart);n(i).on(t.draggableEvents.move,t.dragMove);n(i).on(t.draggableEvents.end,t.dragEnd)},disableDraggable:function(){var t=f.scrollbar,i=f.support.touch?t.track:document;n(t.track).off(t.draggableEvents.start,t.dragStart);n(i).off(t.draggableEvents.move,t.dragMove);n(i).off(t.draggableEvents.end,t.dragEnd)},set:function(){if(f.params.scrollbar){var t=f.scrollbar;t.track=n(f.params.scrollbar);f.params.uniqueNavElements&&typeof f.params.scrollbar=="string"&&t.track.length>1&&f.container.find(f.params.scrollbar).length===1&&(t.track=f.container.find(f.params.scrollbar));t.drag=t.track.find(".swiper-scrollbar-drag");t.drag.length===0&&(t.drag=n('<div class="swiper-scrollbar-drag"><\/div>'),t.track.append(t.drag));t.drag[0].style.width="";t.drag[0].style.height="";t.trackSize=f.isHorizontal()?t.track[0].offsetWidth:t.track[0].offsetHeight;t.divider=f.size/f.virtualSize;t.moveDivider=t.divider*(t.trackSize/f.size);t.dragSize=t.trackSize*t.divider;f.isHorizontal()?t.drag[0].style.width=t.dragSize+"px":t.drag[0].style.height=t.dragSize+"px";t.track[0].style.display=t.divider>=1?"none":"";f.params.scrollbarHide&&(t.track[0].style.opacity=0)}},setTranslate:function(){if(f.params.scrollbar){var n=f.scrollbar,r=f.translate||0,t,i=n.dragSize;t=(n.trackSize-n.dragSize)*f.progress;f.rtl&&f.isHorizontal()?(t=-t,t>0?(i=n.dragSize-t,t=0):-t+n.dragSize>n.trackSize&&(i=n.trackSize+t)):t<0?(i=n.dragSize+t,t=0):t+n.dragSize>n.trackSize&&(i=n.trackSize-t);f.isHorizontal()?(f.support.transforms3d?n.drag.transform("translate3d("+t+"px, 0, 0)"):n.drag.transform("translateX("+t+"px)"),n.drag[0].style.width=i+"px"):(f.support.transforms3d?n.drag.transform("translate3d(0px, "+t+"px, 0)"):n.drag.transform("translateY("+t+"px)"),n.drag[0].style.height=i+"px");f.params.scrollbarHide&&(clearTimeout(n.timeout),n.track[0].style.opacity=1,n.timeout=setTimeout(function(){n.track[0].style.opacity=0;n.track.transition(400)},1e3))}},setTransition:function(n){f.params.scrollbar&&f.scrollbar.drag.transition(n)}};f.controller={LinearSpline:function(n,t){var i,r,f,u;this.x=n;this.y=t;this.lastIndex=n.length-1;f=this.x.length;this.interpolate=function(n){return n?(r=u(this.x,n),i=r-1,(n-this.x[i])*(this.y[r]-this.y[i])/(this.x[r]-this.x[i])+this.y[i]):0};u=function(){var n,t,i;return function(r,u){for(t=-1,n=r.length;n-t>1;)r[i=n+t>>1]<=u?t=i:n=i;return n}}()},getInterpolateFunction:function(n){f.controller.spline||(f.controller.spline=f.params.loop?new f.controller.LinearSpline(f.slidesGrid,n.slidesGrid):new f.controller.LinearSpline(f.snapGrid,n.snapGrid))},setTranslate:function(n,i){function s(t){n=t.rtl&&t.params.direction==="horizontal"?-f.translate:f.translate;f.params.controlBy==="slide"&&(f.controller.getInterpolateFunction(t),u=-f.controller.spline.interpolate(-n));u&&f.params.controlBy!=="container"||(o=(t.maxTranslate()-t.minTranslate())/(f.maxTranslate()-f.minTranslate()),u=(n-f.minTranslate())*o+t.minTranslate());f.params.controlInverse&&(u=t.maxTranslate()-u);t.updateProgress(u);t.setWrapperTranslate(u,!1,f);t.updateActiveIndex()}var r=f.params.control,o,u,e;if(f.isArray(r))for(e=0;e<r.length;e++)r[e]!==i&&r[e]instanceof t&&s(r[e]);else r instanceof t&&i!==r&&s(r)},setTransition:function(n,i){function e(t){t.setWrapperTransition(n,f);n!==0&&(t.onTransitionStart(),t.wrapper.transitionEnd(function(){r&&(t.params.loop&&f.params.controlBy==="slide"&&t.fixLoop(),t.onTransitionEnd())}))}var r=f.params.control,u;if(f.isArray(r))for(u=0;u<r.length;u++)r[u]!==i&&r[u]instanceof t&&e(r[u]);else r instanceof t&&i!==r&&e(r)}};f.hashnav={onHashCange:function(){var n=document.location.hash.replace("#",""),t=f.slides.eq(f.activeIndex).attr("data-hash");n!==t&&f.slideTo(f.wrapper.children("."+f.params.slideClass+'[data-hash="'+n+'"]').index())},attachEvents:function(t){var i=t?"off":"on";n(window)[i]("hashchange",f.hashnav.onHashCange)},setHash:function(){if(f.hashnav.initialized&&f.params.hashnav)if(f.params.replaceState&&window.history&&window.history.replaceState)window.history.replaceState(null,null,"#"+f.slides.eq(f.activeIndex).attr("data-hash")||"");else{var n=f.slides.eq(f.activeIndex),t=n.attr("data-hash")||n.attr("data-history");document.location.hash=t||""}},init:function(){var i,r,t,u,n,e,o;if(f.params.hashnav&&!f.params.history){if(f.hashnav.initialized=!0,i=document.location.hash.replace("#",""),i)for(r=0,t=0,u=f.slides.length;t<u;t++)n=f.slides.eq(t),e=n.attr("data-hash")||n.attr("data-history"),e!==i||n.hasClass(f.params.slideDuplicateClass)||(o=n.index(),f.slideTo(o,r,f.params.runCallbacksOnInit,!0));f.params.hashnavWatchState&&f.hashnav.attachEvents()}},destroy:function(){f.params.hashnavWatchState&&f.hashnav.attachEvents(!0)}};f.history={init:function(){if(f.params.history){if(!window.history||!window.history.pushState){f.params.history=!1;f.params.hashnav=!0;return}(f.history.initialized=!0,this.paths=this.getPathValues(),this.paths.key||this.paths.value)&&(this.scrollToSlide(0,this.paths.value,f.params.runCallbacksOnInit),f.params.replaceState||window.addEventListener("popstate",this.setHistoryPopState))}},setHistoryPopState:function(){f.history.paths=f.history.getPathValues();f.history.scrollToSlide(f.params.speed,f.history.paths.value,!1)},getPathValues:function(){var n=window.location.pathname.slice(1).split("/"),t=n.length,i=n[t-2],r=n[t-1];return{key:i,value:r}},setHistory:function(n,t){if(f.history.initialized&&f.params.history){var r=f.slides.eq(t),i=this.slugify(r.attr("data-history"));window.location.pathname.includes(n)||(i=n+"/"+i);f.params.replaceState?window.history.replaceState(null,null,i):window.history.pushState(null,null,i)}},slugify:function(n){return n.toString().toLowerCase().replace(/\s+/g,"-").replace(/[^\w\-]+/g,"").replace(/\-\-+/g,"-").replace(/^-+/,"").replace(/-+$/,"")},scrollToSlide:function(n,t,i){var r,e,u,o,s;if(t)for(r=0,e=f.slides.length;r<e;r++)u=f.slides.eq(r),o=this.slugify(u.attr("data-history")),o!==t||u.hasClass(f.params.slideDuplicateClass)||(s=u.index(),f.slideTo(s,n,i));else f.slideTo(0,n,i)}};f.disableKeyboardControl=function(){f.params.keyboardControl=!1;n(document).off("keydown",pt)};f.enableKeyboardControl=function(){f.params.keyboardControl=!0;n(document).on("keydown",pt)};f.mousewheel={event:!1,lastScrollTime:(new window.Date).getTime()};f.params.mousewheelControl&&(f.mousewheel.event=navigator.userAgent.indexOf("firefox")>-1?"DOMMouseScroll":kt()?"wheel":"mousewheel");f.disableMousewheelControl=function(){if(!f.mousewheel.event)return!1;var t=f.container;return f.params.mousewheelEventsTarged!=="container"&&(t=n(f.params.mousewheelEventsTarged)),t.off(f.mousewheel.event,wt),!0};f.enableMousewheelControl=function(){if(!f.mousewheel.event)return!1;var t=f.container;f.params.mousewheelEventsTarged!=="container"&&(t=n(f.params.mousewheelEventsTarged));t.on(f.mousewheel.event,wt);return!0};f.parallax={setTranslate:function(){f.container.children("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]").each(function(){bt(this,f.progress)});f.slides.each(function(){var t=n(this);t.find("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]").each(function(){var n=Math.min(Math.max(t[0].progress,-1),1);bt(this,n)})})},setTransition:function(t){typeof t=="undefined"&&(t=f.params.speed);f.container.find("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]").each(function(){var i=n(this),r=parseInt(i.attr("data-swiper-parallax-duration"),10)||t;t===0&&(r=0);i.transition(r)})}};f.zoom={scale:1,currentScale:1,isScaling:!1,gesture:{slide:undefined,slideWidth:undefined,slideHeight:undefined,image:undefined,imageWrap:undefined,zoomMax:f.params.zoomMax},image:{isTouched:undefined,isMoved:undefined,currentX:undefined,currentY:undefined,minX:undefined,minY:undefined,maxX:undefined,maxY:undefined,width:undefined,height:undefined,startX:undefined,startY:undefined,touchesStart:{},touchesCurrent:{}},velocity:{x:undefined,y:undefined,prevPositionX:undefined,prevPositionY:undefined,prevTime:undefined},getDistanceBetweenTouches:function(n){if(n.targetTouches.length<2)return 1;var t=n.targetTouches[0].pageX,i=n.targetTouches[0].pageY,r=n.targetTouches[1].pageX,u=n.targetTouches[1].pageY;return Math.sqrt(Math.pow(r-t,2)+Math.pow(u-i,2))},onGestureStart:function(t){var i=f.zoom;if(!f.support.gestures){if(t.type!=="touchstart"||t.type==="touchstart"&&t.targetTouches.length<2)return;i.gesture.scaleStart=i.getDistanceBetweenTouches(t)}if((!i.gesture.slide||!i.gesture.slide.length)&&(i.gesture.slide=n(this),i.gesture.slide.length===0&&(i.gesture.slide=f.slides.eq(f.activeIndex)),i.gesture.image=i.gesture.slide.find("img, svg, canvas"),i.gesture.imageWrap=i.gesture.image.parent("."+f.params.zoomContainerClass),i.gesture.zoomMax=i.gesture.imageWrap.attr("data-swiper-zoom")||f.params.zoomMax,i.gesture.imageWrap.length===0)){i.gesture.image=undefined;return}i.gesture.image.transition(0);i.isScaling=!0},onGestureChange:function(n){var t=f.zoom;if(!f.support.gestures){if(n.type!=="touchmove"||n.type==="touchmove"&&n.targetTouches.length<2)return;t.gesture.scaleMove=t.getDistanceBetweenTouches(n)}t.gesture.image&&t.gesture.image.length!==0&&(t.scale=f.support.gestures?n.scale*t.currentScale:t.gesture.scaleMove/t.gesture.scaleStart*t.currentScale,t.scale>t.gesture.zoomMax&&(t.scale=t.gesture.zoomMax-1+Math.pow(t.scale-t.gesture.zoomMax+1,.5)),t.scale<f.params.zoomMin&&(t.scale=f.params.zoomMin+1-Math.pow(f.params.zoomMin-t.scale+1,.5)),t.gesture.image.transform("translate3d(0,0,0) scale("+t.scale+")"))},onGestureEnd:function(n){var t=f.zoom;!f.support.gestures&&(n.type!=="touchend"||n.type==="touchend"&&n.changedTouches.length<2)||t.gesture.image&&t.gesture.image.length!==0&&(t.scale=Math.max(Math.min(t.scale,t.gesture.zoomMax),f.params.zoomMin),t.gesture.image.transition(f.params.speed).transform("translate3d(0,0,0) scale("+t.scale+")"),t.currentScale=t.scale,t.isScaling=!1,t.scale===1&&(t.gesture.slide=undefined))},onTouchStart:function(n,t){var i=n.zoom;i.gesture.image&&i.gesture.image.length!==0&&(i.image.isTouched||(n.device.os==="android"&&t.preventDefault(),i.image.isTouched=!0,i.image.touchesStart.x=t.type==="touchstart"?t.targetTouches[0].pageX:t.pageX,i.image.touchesStart.y=t.type==="touchstart"?t.targetTouches[0].pageY:t.pageY))},onTouchMove:function(n){var t=f.zoom,i,r;if(t.gesture.image&&t.gesture.image.length!==0&&(f.allowClick=!1,t.image.isTouched&&t.gesture.slide)&&(t.image.isMoved||(t.image.width=t.gesture.image[0].offsetWidth,t.image.height=t.gesture.image[0].offsetHeight,t.image.startX=f.getTranslate(t.gesture.imageWrap[0],"x")||0,t.image.startY=f.getTranslate(t.gesture.imageWrap[0],"y")||0,t.gesture.slideWidth=t.gesture.slide[0].offsetWidth,t.gesture.slideHeight=t.gesture.slide[0].offsetHeight,t.gesture.imageWrap.transition(0),f.rtl&&(t.image.startX=-t.image.startX),f.rtl&&(t.image.startY=-t.image.startY)),i=t.image.width*t.scale,r=t.image.height*t.scale,!(i<t.gesture.slideWidth)||!(r<t.gesture.slideHeight))){if(t.image.minX=Math.min(t.gesture.slideWidth/2-i/2,0),t.image.maxX=-t.image.minX,t.image.minY=Math.min(t.gesture.slideHeight/2-r/2,0),t.image.maxY=-t.image.minY,t.image.touchesCurrent.x=n.type==="touchmove"?n.targetTouches[0].pageX:n.pageX,t.image.touchesCurrent.y=n.type==="touchmove"?n.targetTouches[0].pageY:n.pageY,!t.image.isMoved&&!t.isScaling){if(f.isHorizontal()&&Math.floor(t.image.minX)===Math.floor(t.image.startX)&&t.image.touchesCurrent.x<t.image.touchesStart.x||Math.floor(t.image.maxX)===Math.floor(t.image.startX)&&t.image.touchesCurrent.x>t.image.touchesStart.x){t.image.isTouched=!1;return}if(!f.isHorizontal()&&Math.floor(t.image.minY)===Math.floor(t.image.startY)&&t.image.touchesCurrent.y<t.image.touchesStart.y||Math.floor(t.image.maxY)===Math.floor(t.image.startY)&&t.image.touchesCurrent.y>t.image.touchesStart.y){t.image.isTouched=!1;return}}n.preventDefault();n.stopPropagation();t.image.isMoved=!0;t.image.currentX=t.image.touchesCurrent.x-t.image.touchesStart.x+t.image.startX;t.image.currentY=t.image.touchesCurrent.y-t.image.touchesStart.y+t.image.startY;t.image.currentX<t.image.minX&&(t.image.currentX=t.image.minX+1-Math.pow(t.image.minX-t.image.currentX+1,.8));t.image.currentX>t.image.maxX&&(t.image.currentX=t.image.maxX-1+Math.pow(t.image.currentX-t.image.maxX+1,.8));t.image.currentY<t.image.minY&&(t.image.currentY=t.image.minY+1-Math.pow(t.image.minY-t.image.currentY+1,.8));t.image.currentY>t.image.maxY&&(t.image.currentY=t.image.maxY-1+Math.pow(t.image.currentY-t.image.maxY+1,.8));t.velocity.prevPositionX||(t.velocity.prevPositionX=t.image.touchesCurrent.x);t.velocity.prevPositionY||(t.velocity.prevPositionY=t.image.touchesCurrent.y);t.velocity.prevTime||(t.velocity.prevTime=Date.now());t.velocity.x=(t.image.touchesCurrent.x-t.velocity.prevPositionX)/(Date.now()-t.velocity.prevTime)/2;t.velocity.y=(t.image.touchesCurrent.y-t.velocity.prevPositionY)/(Date.now()-t.velocity.prevTime)/2;Math.abs(t.image.touchesCurrent.x-t.velocity.prevPositionX)<2&&(t.velocity.x=0);Math.abs(t.image.touchesCurrent.y-t.velocity.prevPositionY)<2&&(t.velocity.y=0);t.velocity.prevPositionX=t.image.touchesCurrent.x;t.velocity.prevPositionY=t.image.touchesCurrent.y;t.velocity.prevTime=Date.now();t.gesture.imageWrap.transform("translate3d("+t.image.currentX+"px, "+t.image.currentY+"px,0)")}},onTouchEnd:function(n){var t=n.zoom,e,o,s;if(t.gesture.image&&t.gesture.image.length!==0){if(!t.image.isTouched||!t.image.isMoved){t.image.isTouched=!1;t.image.isMoved=!1;return}t.image.isTouched=!1;t.image.isMoved=!1;var i=300,r=300,h=t.velocity.x*i,u=t.image.currentX+h,c=t.velocity.y*r,f=t.image.currentY+c;t.velocity.x!==0&&(i=Math.abs((u-t.image.currentX)/t.velocity.x));t.velocity.y!==0&&(r=Math.abs((f-t.image.currentY)/t.velocity.y));e=Math.max(i,r);t.image.currentX=u;t.image.currentY=f;o=t.image.width*t.scale;s=t.image.height*t.scale;t.image.minX=Math.min(t.gesture.slideWidth/2-o/2,0);t.image.maxX=-t.image.minX;t.image.minY=Math.min(t.gesture.slideHeight/2-s/2,0);t.image.maxY=-t.image.minY;t.image.currentX=Math.max(Math.min(t.image.currentX,t.image.maxX),t.image.minX);t.image.currentY=Math.max(Math.min(t.image.currentY,t.image.maxY),t.image.minY);t.gesture.imageWrap.transition(e).transform("translate3d("+t.image.currentX+"px, "+t.image.currentY+"px,0)")}},onTransitionEnd:function(n){var t=n.zoom;t.gesture.slide&&n.previousIndex!==n.activeIndex&&(t.gesture.image.transform("translate3d(0,0,0) scale(1)"),t.gesture.imageWrap.transform("translate3d(0,0,0)"),t.gesture.slide=t.gesture.image=t.gesture.imageWrap=undefined,t.scale=t.currentScale=1)},toggleZoom:function(t,i){var r=t.zoom,s,h,y,p,w,b,u,f,k,d,g,nt,e,o,c,l,a,v;(r.gesture.slide||(r.gesture.slide=t.clickedSlide?n(t.clickedSlide):t.slides.eq(t.activeIndex),r.gesture.image=r.gesture.slide.find("img, svg, canvas"),r.gesture.imageWrap=r.gesture.image.parent("."+t.params.zoomContainerClass)),r.gesture.image&&r.gesture.image.length!==0)&&(typeof r.image.touchesStart.x=="undefined"&&i?(s=i.type==="touchend"?i.changedTouches[0].pageX:i.pageX,h=i.type==="touchend"?i.changedTouches[0].pageY:i.pageY):(s=r.image.touchesStart.x,h=r.image.touchesStart.y),r.scale&&r.scale!==1?(r.scale=r.currentScale=1,r.gesture.imageWrap.transition(300).transform("translate3d(0,0,0)"),r.gesture.image.transition(300).transform("translate3d(0,0,0) scale(1)"),r.gesture.slide=undefined):(r.scale=r.currentScale=r.gesture.imageWrap.attr("data-swiper-zoom")||t.params.zoomMax,i?(a=r.gesture.slide[0].offsetWidth,v=r.gesture.slide[0].offsetHeight,y=r.gesture.slide.offset().left,p=r.gesture.slide.offset().top,w=y+a/2-s,b=p+v/2-h,k=r.gesture.image[0].offsetWidth,d=r.gesture.image[0].offsetHeight,g=k*r.scale,nt=d*r.scale,e=Math.min(a/2-g/2,0),o=Math.min(v/2-nt/2,0),c=-e,l=-o,u=w*r.scale,f=b*r.scale,u<e&&(u=e),u>c&&(u=c),f<o&&(f=o),f>l&&(f=l)):(u=0,f=0),r.gesture.imageWrap.transition(300).transform("translate3d("+u+"px, "+f+"px,0)"),r.gesture.image.transition(300).transform("translate3d(0,0,0) scale("+r.scale+")")))},attachEvents:function(t){var i=t?"off":"on",u,r;if(f.params.zoom&&(u=f.slides,r=f.touchEvents.start==="touchstart"&&f.support.passiveListener&&f.params.passiveListeners?{passive:!0,capture:!1}:!1,f.support.gestures?(f.slides[i]("gesturestart",f.zoom.onGestureStart,r),f.slides[i]("gesturechange",f.zoom.onGestureChange,r),f.slides[i]("gestureend",f.zoom.onGestureEnd,r)):f.touchEvents.start==="touchstart"&&(f.slides[i](f.touchEvents.start,f.zoom.onGestureStart,r),f.slides[i](f.touchEvents.move,f.zoom.onGestureChange,r),f.slides[i](f.touchEvents.end,f.zoom.onGestureEnd,r)),f[i]("touchStart",f.zoom.onTouchStart),f.slides.each(function(t,r){n(r).find("."+f.params.zoomContainerClass).length>0&&n(r)[i](f.touchEvents.move,f.zoom.onTouchMove)}),f[i]("touchEnd",f.zoom.onTouchEnd),f[i]("transitionEnd",f.zoom.onTransitionEnd),f.params.zoomToggle))f.on("doubleTap",f.zoom.toggleZoom)},init:function(){f.zoom.attachEvents()},destroy:function(){f.zoom.attachEvents(!0)}};f._plugins=[];for(lt in f.plugins)at=f.plugins[lt](f,f.params[lt]),at&&f._plugins.push(at);return f.callPlugins=function(n){for(var t=0;t<f._plugins.length;t++)n in f._plugins[t]&&f._plugins[t][n](arguments[1],arguments[2],arguments[3],arguments[4],arguments[5])},f.emitterEventListeners={},f.emit=function(n){f.params[n]&&f.params[n](arguments[1],arguments[2],arguments[3],arguments[4],arguments[5]);var t;if(f.emitterEventListeners[n])for(t=0;t<f.emitterEventListeners[n].length;t++)f.emitterEventListeners[n][t](arguments[1],arguments[2],arguments[3],arguments[4],arguments[5]);f.callPlugins&&f.callPlugins(n,arguments[1],arguments[2],arguments[3],arguments[4],arguments[5])},f.on=function(n,t){return n=vt(n),f.emitterEventListeners[n]||(f.emitterEventListeners[n]=[]),f.emitterEventListeners[n].push(t),f},f.off=function(n,t){var i;if(n=vt(n),typeof t=="undefined")return f.emitterEventListeners[n]=[],f;if(f.emitterEventListeners[n]&&f.emitterEventListeners[n].length!==0){for(i=0;i<f.emitterEventListeners[n].length;i++)f.emitterEventListeners[n][i]===t&&f.emitterEventListeners[n].splice(i,1);return f}},f.once=function(n,t){n=vt(n);var i=function(){t(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4]);f.off(n,i)};f.on(n,i);return f},f.a11y={makeFocusable:function(n){return n.attr("tabIndex","0"),n},addRole:function(n,t){return n.attr("role",t),n},addLabel:function(n,t){return n.attr("aria-label",t),n},disable:function(n){return n.attr("aria-disabled",!0),n},enable:function(n){return n.attr("aria-disabled",!1),n},onEnterKey:function(t){if(t.keyCode===13){if(n(t.target).is(f.params.nextButton)){f.onClickNext(t);f.isEnd?f.a11y.notify(f.params.lastSlideMessage):f.a11y.notify(f.params.nextSlideMessage)}else if(n(t.target).is(f.params.prevButton)){f.onClickPrev(t);f.isBeginning?f.a11y.notify(f.params.firstSlideMessage):f.a11y.notify(f.params.prevSlideMessage)}n(t.target).is("."+f.params.bulletClass)&&n(t.target)[0].click()}},liveRegion:n('<span class="'+f.params.notificationClass+'" aria-live="assertive" aria-atomic="true"><\/span>'),notify:function(n){var t=f.a11y.liveRegion;t.length!==0&&(t.html(""),t.html(n))},init:function(){f.params.nextButton&&f.nextButton&&f.nextButton.length>0&&(f.a11y.makeFocusable(f.nextButton),f.a11y.addRole(f.nextButton,"button"),f.a11y.addLabel(f.nextButton,f.params.nextSlideMessage));f.params.prevButton&&f.prevButton&&f.prevButton.length>0&&(f.a11y.makeFocusable(f.prevButton),f.a11y.addRole(f.prevButton,"button"),f.a11y.addLabel(f.prevButton,f.params.prevSlideMessage));n(f.container).append(f.a11y.liveRegion)},initPagination:function(){f.params.pagination&&f.params.paginationClickable&&f.bullets&&f.bullets.length&&f.bullets.each(function(){var t=n(this);f.a11y.makeFocusable(t);f.a11y.addRole(t,"button");f.a11y.addLabel(t,f.params.paginationBulletMessage.replace(/{{index}}/,t.index()+1))})},destroy:function(){f.a11y.liveRegion&&f.a11y.liveRegion.length>0&&f.a11y.liveRegion.remove()}},f.init=function(){f.params.loop&&f.createLoop();f.updateContainerSize();f.updateSlidesSize();f.updatePagination();f.params.scrollbar&&f.scrollbar&&(f.scrollbar.set(),f.params.scrollbarDraggable&&f.scrollbar.enableDraggable());f.params.effect!=="slide"&&f.effects[f.params.effect]&&(f.params.loop||f.updateProgress(),f.effects[f.params.effect].setTranslate());f.params.loop?f.slideTo(f.params.initialSlide+f.loopedSlides,0,f.params.runCallbacksOnInit):(f.slideTo(f.params.initialSlide,0,f.params.runCallbacksOnInit),f.params.initialSlide===0&&(f.parallax&&f.params.parallax&&f.parallax.setTranslate(),f.lazy&&f.params.lazyLoading&&(f.lazy.load(),f.lazy.initialImageLoaded=!0)));f.attachEvents();f.params.observer&&f.support.observer&&f.initObservers();f.params.preloadImages&&!f.params.lazyLoading&&f.preloadImages();f.params.zoom&&f.zoom&&f.zoom.init();f.params.autoplay&&f.startAutoplay();f.params.keyboardControl&&f.enableKeyboardControl&&f.enableKeyboardControl();f.params.mousewheelControl&&f.enableMousewheelControl&&f.enableMousewheelControl();f.params.hashnavReplaceState&&(f.params.replaceState=f.params.hashnavReplaceState);f.params.history&&f.history&&f.history.init();f.params.hashnav&&f.hashnav&&f.hashnav.init();f.params.a11y&&f.a11y&&f.a11y.init();f.emit("onInit",f)},f.cleanupStyles=function(){f.container.removeClass(f.classNames.join(" ")).removeAttr("style");f.wrapper.removeAttr("style");f.slides&&f.slides.length&&f.slides.removeClass([f.params.slideVisibleClass,f.params.slideActiveClass,f.params.slideNextClass,f.params.slidePrevClass].join(" ")).removeAttr("style").removeAttr("data-swiper-column").removeAttr("data-swiper-row");f.paginationContainer&&f.paginationContainer.length&&f.paginationContainer.removeClass(f.params.paginationHiddenClass);f.bullets&&f.bullets.length&&f.bullets.removeClass(f.params.bulletActiveClass);f.params.prevButton&&n(f.params.prevButton).removeClass(f.params.buttonDisabledClass);f.params.nextButton&&n(f.params.nextButton).removeClass(f.params.buttonDisabledClass);f.params.scrollbar&&f.scrollbar&&(f.scrollbar.track&&f.scrollbar.track.length&&f.scrollbar.track.removeAttr("style"),f.scrollbar.drag&&f.scrollbar.drag.length&&f.scrollbar.drag.removeAttr("style"))},f.destroy=function(n,t){f.detachEvents();f.stopAutoplay();f.params.scrollbar&&f.scrollbar&&f.params.scrollbarDraggable&&f.scrollbar.disableDraggable();f.params.loop&&f.destroyLoop();t&&f.cleanupStyles();f.disconnectObservers();f.params.zoom&&f.zoom&&f.zoom.destroy();f.params.keyboardControl&&f.disableKeyboardControl&&f.disableKeyboardControl();f.params.mousewheelControl&&f.disableMousewheelControl&&f.disableMousewheelControl();f.params.a11y&&f.a11y&&f.a11y.destroy();f.params.history&&!f.params.replaceState&&window.removeEventListener("popstate",f.history.setHistoryPopState);f.params.hashnav&&f.hashnav&&f.hashnav.destroy();f.emit("onDestroy");n!==!1&&(f=null)},f.init(),f}},r,f,u,i;for(t.prototype={isSafari:function(){var n=window.navigator.userAgent.toLowerCase();return n.indexOf("safari")>=0&&n.indexOf("chrome")<0&&n.indexOf("android")<0}(),isUiWebView:/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(window.navigator.userAgent),isArray:function(n){return Object.prototype.toString.apply(n)==="[object Array]"},browser:{ie:window.navigator.pointerEnabled||window.navigator.msPointerEnabled,ieTouch:window.navigator.msPointerEnabled&&window.navigator.msMaxTouchPoints>1||window.navigator.pointerEnabled&&window.navigator.maxTouchPoints>1,lteIE9:function(){var n=document.createElement("div");return n.innerHTML="<!--[if lte IE 9]><i><\/i><![endif]-->",n.getElementsByTagName("i").length===1}()},device:function(){var n=window.navigator.userAgent,i=n.match(/(Android);?[\s\/]+([\d.]+)?/),t=n.match(/(iPad).*OS\s([\d_]+)/),r=n.match(/(iPod)(.*OS\s([\d_]+))?/),u=!t&&n.match(/(iPhone\sOS|iOS)\s([\d_]+)/);return{ios:t||u||r,android:i}}(),support:{touch:window.Modernizr&&Modernizr.touch===!0||function(){return!!("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)}(),transforms3d:window.Modernizr&&Modernizr.csstransforms3d===!0||function(){var n=document.createElement("div").style;return"webkitPerspective"in n||"MozPerspective"in n||"OPerspective"in n||"MsPerspective"in n||"perspective"in n}(),flexbox:function(){for(var i=document.createElement("div").style,t="alignItems webkitAlignItems webkitBoxAlign msFlexAlign mozBoxAlign webkitFlexDirection msFlexDirection mozBoxDirection mozBoxOrient webkitBoxDirection webkitBoxOrient".split(" "),n=0;n<t.length;n++)if(t[n]in i)return!0}(),observer:function(){return"MutationObserver"in window||"WebkitMutationObserver"in window}(),passiveListener:function(){var n=!1,t;try{t=Object.defineProperty({},"passive",{get:function(){n=!0}});window.addEventListener("testPassiveListener",null,t)}catch(i){}return n}(),gestures:function(){return"ongesturestart"in window}()},plugins:{}},r=function(){var n=function(n){for(var i=this,t=0,t=0;t<n.length;t++)i[t]=n[t];return i.length=n.length,this},t=function(t,i){var e=[],r=0,o,s,u,f;if(t&&!i&&t instanceof n)return t;if(t)if(typeof t=="string")if(u=t.trim(),u.indexOf("<")>=0&&u.indexOf(">")>=0)for(f="div",u.indexOf("<li")===0&&(f="ul"),u.indexOf("<tr")===0&&(f="tbody"),(u.indexOf("<td")===0||u.indexOf("<th")===0)&&(f="tr"),u.indexOf("<tbody")===0&&(f="table"),u.indexOf("<option")===0&&(f="select"),s=document.createElement(f),s.innerHTML=t,r=0;r<s.childNodes.length;r++)e.push(s.childNodes[r]);else for(o=i||t[0]!=="#"||t.match(/[ .<>:~]/)?(i||document).querySelectorAll(t):[document.getElementById(t.split("#")[1])],r=0;r<o.length;r++)o[r]&&e.push(o[r]);else if(t.nodeType||t===window||t===document)e.push(t);else if(t.length>0&&t[0].nodeType)for(r=0;r<t.length;r++)e.push(t[r]);return new n(e)};return n.prototype={addClass:function(n){var r,t,i;if(typeof n=="undefined")return this;for(r=n.split(" "),t=0;t<r.length;t++)for(i=0;i<this.length;i++)this[i].classList.add(r[t]);return this},removeClass:function(n){for(var r=n.split(" "),i,t=0;t<r.length;t++)for(i=0;i<this.length;i++)this[i].classList.remove(r[t]);return this},hasClass:function(n){return this[0]?this[0].classList.contains(n):!1},toggleClass:function(n){for(var r=n.split(" "),i,t=0;t<r.length;t++)for(i=0;i<this.length;i++)this[i].classList.toggle(r[t]);return this},attr:function(n,t){var i,r;if(arguments.length===1&&typeof n=="string")return this[0]?this[0].getAttribute(n):undefined;for(i=0;i<this.length;i++)if(arguments.length===2)this[i].setAttribute(n,t);else for(r in n)this[i][r]=n[r],this[i].setAttribute(r,n[r]);return this},removeAttr:function(n){for(var t=0;t<this.length;t++)this[t].removeAttribute(n);return this},data:function(n,t){var u,i,r;if(typeof t=="undefined")return this[0]?(u=this[0].getAttribute("data-"+n),u?u:this[0].dom7ElementDataStorage&&n in this[0].dom7ElementDataStorage?this[0].dom7ElementDataStorage[n]:undefined):undefined;for(i=0;i<this.length;i++)r=this[i],r.dom7ElementDataStorage||(r.dom7ElementDataStorage={}),r.dom7ElementDataStorage[n]=t;return this},transform:function(n){for(var t,i=0;i<this.length;i++)t=this[i].style,t.webkitTransform=t.MsTransform=t.msTransform=t.MozTransform=t.OTransform=t.transform=n;return this},transition:function(n){var i,t;for(typeof n!="string"&&(n=n+"ms"),i=0;i<this.length;i++)t=this[i].style,t.webkitTransitionDuration=t.MsTransitionDuration=t.msTransitionDuration=t.MozTransitionDuration=t.OTransitionDuration=t.transitionDuration=n;return this},on:function(n,i,r,u){function s(n){var e=n.target,f,u;if(t(e).is(i))r.call(e,n);else for(f=t(e).parents(),u=0;u<f.length;u++)t(f[u]).is(i)&&r.call(f[u],n)}for(var o=n.split(" "),e,f=0;f<this.length;f++)if(typeof i=="function"||i===!1)for(typeof i=="function"&&(r=arguments[1],u=arguments[2]||!1),e=0;e<o.length;e++)this[f].addEventListener(o[e],r,u);else for(e=0;e<o.length;e++)this[f].dom7LiveListeners||(this[f].dom7LiveListeners=[]),this[f].dom7LiveListeners.push({listener:r,liveListener:s}),this[f].addEventListener(o[e],s,u);return this},off:function(n,t,i,r){for(var o=n.split(" "),u,e,f=0;f<o.length;f++)for(u=0;u<this.length;u++)if(typeof t=="function"||t===!1)typeof t=="function"&&(i=arguments[1],r=arguments[2]||!1),this[u].removeEventListener(o[f],i,r);else if(this[u].dom7LiveListeners)for(e=0;e<this[u].dom7LiveListeners.length;e++)this[u].dom7LiveListeners[e].listener===i&&this[u].removeEventListener(o[f],this[u].dom7LiveListeners[e].liveListener,r);return this},once:function(n,t,i,r){function f(e){i(e);u.off(n,t,f,r)}var u=this;typeof t=="function"&&(t=!1,i=arguments[1],r=arguments[2]);u.on(n,t,f,r)},trigger:function(n,t){for(var i,r=0;r<this.length;r++){try{i=new window.CustomEvent(n,{detail:t,bubbles:!0,cancelable:!0})}catch(u){i=document.createEvent("Event");i.initEvent(n,!0,!0);i.detail=t}this[r].dispatchEvent(i)}return this},transitionEnd:function(n){function u(f){if(f.target===this)for(n.call(this,f),t=0;t<i.length;t++)r.off(i[t],u)}var i=["webkitTransitionEnd","transitionend","oTransitionEnd","MSTransitionEnd","msTransitionEnd"],t,r=this;if(n)for(t=0;t<i.length;t++)r.on(i[t],u);return this},width:function(){return this[0]===window?window.innerWidth:this.length>0?parseFloat(this.css("width")):null},outerWidth:function(n){return this.length>0?n?this[0].offsetWidth+parseFloat(this.css("margin-right"))+parseFloat(this.css("margin-left")):this[0].offsetWidth:null},height:function(){return this[0]===window?window.innerHeight:this.length>0?parseFloat(this.css("height")):null},outerHeight:function(n){return this.length>0?n?this[0].offsetHeight+parseFloat(this.css("margin-top"))+parseFloat(this.css("margin-bottom")):this[0].offsetHeight:null},offset:function(){if(this.length>0){var n=this[0],t=n.getBoundingClientRect(),i=document.body,r=n.clientTop||i.clientTop||0,u=n.clientLeft||i.clientLeft||0,f=window.pageYOffset||n.scrollTop,e=window.pageXOffset||n.scrollLeft;return{top:t.top+f-r,left:t.left+e-u}}return null},css:function(n,t){var i,r;if(arguments.length===1)if(typeof n=="string"){if(this[0])return window.getComputedStyle(this[0],null).getPropertyValue(n)}else{for(i=0;i<this.length;i++)for(r in n)this[i].style[r]=n[r];return this}if(arguments.length===2&&typeof n=="string"){for(i=0;i<this.length;i++)this[i].style[n]=t;return this}return this},each:function(n){for(var t=0;t<this.length;t++)n.call(this[t],t,this[t]);return this},html:function(n){if(typeof n=="undefined")return this[0]?this[0].innerHTML:undefined;for(var t=0;t<this.length;t++)this[t].innerHTML=n;return this},text:function(n){if(typeof n=="undefined")return this[0]?this[0].textContent.trim():null;for(var t=0;t<this.length;t++)this[t].textContent=n;return this},is:function(i){var f,u,r;if(!this[0])return!1;if(typeof i=="string"){if(r=this[0],r===document)return i===document;if(r===window)return i===window;if(r.matches)return r.matches(i);if(r.webkitMatchesSelector)return r.webkitMatchesSelector(i);if(r.mozMatchesSelector)return r.mozMatchesSelector(i);if(r.msMatchesSelector)return r.msMatchesSelector(i);for(f=t(i),u=0;u<f.length;u++)if(f[u]===this[0])return!0;return!1}if(i===document)return this[0]===document;if(i===window)return this[0]===window;if(i.nodeType||i instanceof n){for(f=i.nodeType?[i]:i,u=0;u<f.length;u++)if(f[u]===this[0])return!0;return!1}return!1},index:function(){if(this[0]){for(var n=this[0],t=0;(n=n.previousSibling)!==null;)n.nodeType===1&&t++;return t}return undefined},eq:function(t){if(typeof t=="undefined")return this;var r=this.length,i;return t>r-1?new n([]):t<0?(i=r+t,i<0?new n([]):new n([this[i]])):new n([this[t]])},append:function(t){for(var r,u,i=0;i<this.length;i++)if(typeof t=="string")for(u=document.createElement("div"),u.innerHTML=t;u.firstChild;)this[i].appendChild(u.firstChild);else if(t instanceof n)for(r=0;r<t.length;r++)this[i].appendChild(t[r]);else this[i].appendChild(t);return this},prepend:function(t){for(var r,u,i=0;i<this.length;i++)if(typeof t=="string")for(u=document.createElement("div"),u.innerHTML=t,r=u.childNodes.length-1;r>=0;r--)this[i].insertBefore(u.childNodes[r],this[i].childNodes[0]);else if(t instanceof n)for(r=0;r<t.length;r++)this[i].insertBefore(t[r],this[i].childNodes[0]);else this[i].insertBefore(t,this[i].childNodes[0]);return this},insertBefore:function(n){for(var i=t(n),u,r=0;r<this.length;r++)if(i.length===1)i[0].parentNode.insertBefore(this[r],i[0]);else if(i.length>1)for(u=0;u<i.length;u++)i[u].parentNode.insertBefore(this[r].cloneNode(!0),i[u])},insertAfter:function(n){for(var i=t(n),u,r=0;r<this.length;r++)if(i.length===1)i[0].parentNode.insertBefore(this[r],i[0].nextSibling);else if(i.length>1)for(u=0;u<i.length;u++)i[u].parentNode.insertBefore(this[r].cloneNode(!0),i[u].nextSibling)},next:function(i){return this.length>0?i?this[0].nextElementSibling&&t(this[0].nextElementSibling).is(i)?new n([this[0].nextElementSibling]):new n([]):this[0].nextElementSibling?new n([this[0].nextElementSibling]):new n([]):new n([])},nextAll:function(i){var f=[],u=this[0],r;if(!u)return new n([]);while(u.nextElementSibling)r=u.nextElementSibling,i?t(r).is(i)&&f.push(r):f.push(r),u=r;return new n(f)},prev:function(i){return this.length>0?i?this[0].previousElementSibling&&t(this[0].previousElementSibling).is(i)?new n([this[0].previousElementSibling]):new n([]):this[0].previousElementSibling?new n([this[0].previousElementSibling]):new n([]):new n([])},prevAll:function(i){var f=[],u=this[0],r;if(!u)return new n([]);while(u.previousElementSibling)r=u.previousElementSibling,i?t(r).is(i)&&f.push(r):f.push(r),u=r;return new n(f)},parent:function(n){for(var r=[],i=0;i<this.length;i++)n?t(this[i].parentNode).is(n)&&r.push(this[i].parentNode):r.push(this[i].parentNode);return t(t.unique(r))},parents:function(n){for(var u=[],i,r=0;r<this.length;r++)for(i=this[r].parentNode;i;)n?t(i).is(n)&&u.push(i):u.push(i),i=i.parentNode;return t(t.unique(u))},find:function(t){for(var f=[],u,r,i=0;i<this.length;i++)for(u=this[i].querySelectorAll(t),r=0;r<u.length;r++)f.push(u[r]);return new n(f)},children:function(i){for(var e=[],u,r,f=0;f<this.length;f++)for(u=this[f].childNodes,r=0;r<u.length;r++)i?u[r].nodeType===1&&t(u[r]).is(i)&&e.push(u[r]):u[r].nodeType===1&&e.push(u[r]);return new n(t.unique(e))},remove:function(){for(var n=0;n<this.length;n++)this[n].parentNode&&this[n].parentNode.removeChild(this[n]);return this},add:function(){for(var n=this,r,u,i=0;i<arguments.length;i++)for(u=t(arguments[i]),r=0;r<u.length;r++)n[n.length]=u[r],n.length++;return n}},t.fn=n.prototype,t.unique=function(n){for(var i=[],t=0;t<n.length;t++)i.indexOf(n[t])===-1&&i.push(n[t]);return i},t}(),f=["jQuery","Zepto","Dom7"],u=0;u<f.length;u++)window[f[u]]&&e(window[f[u]]);i=typeof r=="undefined"?window.Dom7||window.Zepto||window.jQuery:r;i&&("transitionEnd"in i.fn||(i.fn.transitionEnd=function(n){function u(f){if(f.target===this)for(n.call(this,f),t=0;t<i.length;t++)r.off(i[t],u)}var i=["webkitTransitionEnd","transitionend","oTransitionEnd","MSTransitionEnd","msTransitionEnd"],t,r=this;if(n)for(t=0;t<i.length;t++)r.on(i[t],u);return this}),"transform"in i.fn||(i.fn.transform=function(n){for(var t,i=0;i<this.length;i++)t=this[i].style,t.webkitTransform=t.MsTransform=t.msTransform=t.MozTransform=t.OTransform=t.transform=n;return this}),"transition"in i.fn||(i.fn.transition=function(n){var i,t;for(typeof n!="string"&&(n=n+"ms"),i=0;i<this.length;i++)t=this[i].style,t.webkitTransitionDuration=t.MsTransitionDuration=t.msTransitionDuration=t.MozTransitionDuration=t.OTransitionDuration=t.transitionDuration=n;return this}),"outerWidth"in i.fn||(i.fn.outerWidth=function(n){return this.length>0?n?this[0].offsetWidth+parseFloat(this.css("margin-right"))+parseFloat(this.css("margin-left")):this[0].offsetWidth:null}));window.Swiper=t}();typeof module!="undefined"?module.exports=window.Swiper:typeof define=="function"&&define.amd&&define([],function(){"use strict";return window.Swiper});SwitchManager=function(n){var t=this,i={type:SWITCHER_DESKTOP,width:"960"};n!=undefined&&(type=n);t.correct=function(){$(".std-component, .main, .footer, .header").each(function(n,t){var i=$(t);i.css("position")=="absolute"&&(i.css("position","relative"),i.css("top","0"),i.css("left","0"),i.css("float","left"),i.css("width","100%"))})}};Grouping=function(n){this.ctrlIsPressed=!1;this.selectedItems=ko.observableArray(n||[]);this.clipboardGroup=[];this.showGroupingOptions=ko.observable(null);this.queueToSelectAfterPaste=[];this.editableGroupId=null;this.multipleSelection={isActive:!1,startX:0,startY:0,postSelectionClick:!1,mouseDown:function(n){this.postSelectionClick=!1;this.isActive||!Grouping.isAllowedRectangleSelect(n.target)||Helpers.hasInputClass(n.target)||(n=n||window.event,Grouping.fixPageXY(n),this.isActive=!0,this.startX=n.pageX,this.startY=n.pageY,console.log("Grouping mousedown X:"+this.startX+" Y:"+this.startY))},mouseMove:function(n){var t;if(this.isActive){this.clearDefaultSelection();n.preventDefault();n=n||window.event;Grouping.fixPageXY(n);t=$("#group-multiple-selection");t.css("display","block");var i=n.pageX,r=n.pageY,u=Math.abs(i-this.startX),f=Math.abs(r-this.startY);i>this.startX&&(i=this.startX);r>this.startY&&(r=this.startY);t.css("top",r+"px");t.css("left",i+"px");t.css("width",u+"px");t.css("height",f+"px")}},mouseUp:function(n){var e,i,t,r,o;if(this.isActive){n.preventDefault();n.stopPropagation();n=n||window.event;Grouping.fixPageXY(n);var u=n.pageX,f=n.pageY,s=Math.abs(u-this.startX),h=Math.abs(f-this.startY);for(u>this.startX&&(u=this.startX),f>this.startY&&(f=this.startY),e=[],i=$(".std-component"),grouping.ctrlIsPressed||Grouping.dropItems(),t=i.length-1;t>=0;t--)Grouping.elementInsideArea(u,f,s,h,i[t])&&(console.log("inside"),r=Grouping.getComponent(i[t].id).getProperty(GROUPID),r==null||r.value==""?Grouping.addItem(i[t],!0):e.indexOf(r.value)<0&&(Grouping.addItem(i[t]),e.push(r.value)));Grouping.wrap();Resizer.groupBind();this.startX=0;this.startY=0;this.isActive=!1;o=$("#group-multiple-selection");o.css("display","none");this.postSelectionClick=!0}},stop:function(){this.isActive=!1;$("#group-multiple-selection").css("display","none");this.postSelectionClick=!0},clearDefaultSelection:function(){window.getSelection?window.getSelection().removeAllRanges():document.selection&&document.selection.empty()}};this.dropEditableGroupId=function(){this.editableGroupId=null}};Grouping.init=function(){grouping.ctrlIsPressed=!1;$(document).keydown(function(n){(n.ctrlKey||n.metaKey)&&(grouping.ctrlIsPressed=!0);Grouping.isActive()&&dragDrop.dragKeys(n)});$(document).keyup(function(n){n.ctrlKey||n.metaKey||(grouping.ctrlIsPressed=!1)});$(document).mousedown(function(n){grouping.multipleSelection.mouseDown(n)});$(document).mousemove(function(n){grouping.multipleSelection.mouseMove(n)});$(document).mouseup(function(n){grouping.multipleSelection.mouseUp(n)});$("#bgsite, .wrapper").on("click",function(n){n.target.tagName!="A"&&(UI.getSetting("ispreview")||dragDrop.groupDragging||grouping.multipleSelection.isActive||(grouping.multipleSelection.postSelectionClick?grouping.multipleSelection.postSelectionClick=!1:Grouping.dropItems()))});$(".wrapper").on("click",".std-component",function(n){if(!UI.getSetting("ispreview")){if(UI.isckeditorworking)return event.stopPropagation(),!1;var t=Grouping.hasAnyGroup(this.id),i=Grouping.isSelected(this.id);if(grouping.ctrlIsPressed)return n.preventDefault(),n.stopPropagation(),Grouping.addItem(this),!1;t&&!dragDrop.groupDragging&&(n.preventDefault(),n.stopPropagation(),Grouping.dropItems(),Grouping.addItem(this))}});$(".wrapper").on("dblclick",".std-component",function(){var i,n,t;if(!UI.getSetting("ispreview")){if(UI.isckeditorworking)return event.stopPropagation(),!1;i=Grouping.isSelected(this.id);i&&!grouping.ctrlIsPressed&&(n=Grouping.getGroupId(this.id),grouping.editableGroupId=n,t=UI.siteComponentRepository.lookupData({id:this.id}),UI.callEditor(t),Grouping.dropItems(),$(this).highlightSelectedElement(t,!0),console.log("grouping dblclick: "+n))}});$(document).on("dblclick",function(n){UI.getSetting("ispreview")||Grouping.isAllowedToDropEditableGroupId(n.target)&&grouping.dropEditableGroupId()});!UI.getSetting("ispreview");console.log("Grouping initialized")};Grouping.addItem=function(n,t){var s,r,f;clipBoard.selectedItem(null);var e=Grouping.getComponent(n.id).getProperty(GROUPID),i=$(".std-component"),o=i.index(n),u=i.length-1;for(o!=u&&(s=i[o],i[o]=i[u],i[u]=s),r=i.length-1;r>=0;r--)i[r].id!=""&&(f=Grouping.getComponent(i[r].id).getProperty(GROUPID),i[r].id==n.id||f!=null&&e!=null&&f.value!=""&&e.value!=""&&f.value==e.value)&&Grouping.compareParent(i[r])&&($(i[r]).hasClass("std-component-fixed")||$(i[r]).hasClass("std-store-subcomponent")||(_.indexOf(grouping.selectedItems(),i[r])<0?(grouping.selectedItems.push(i[r]),$(i[r]).highlightGroupElement(Grouping.getComponent($(i[r]).attr("id"))),$(i[r]).mousemove(function(){var n=$(this);n.data("selected",!0);n.hasClass("std-component-fixed")||n.addClass("drag");grouping.ctrlIsPressed&&(n.data("selected",!1),n.removeClass("drag"))}),$(i[r]).mouseleave(function(){var n=$(this);n.data("selected",!1);n.removeClass("drag")}),Grouping.isActive()&&dragDrop.groupingDragKeys(),r==u&&setTimeout(function(){var t=$("#"+n.id);t.data("selected",!0);t.hasClass("std-component-fixed")||t.addClass("drag")},0)):(Grouping.dropItem(i[r]),r==u&&setTimeout(function(){$("#"+n.id).data("selected",!1);$("#"+n.id).removeClass("drag")},0))));t||(Grouping.wrap(),Resizer.groupBind());grouping.selectedItems().length>1&&grouping.showGroupingOptions(!0)};Grouping.isActive=function(){return UI.getSetting("ispreview")?!1:grouping.selectedItems().length!=0};Grouping.getComponent=function(n){return UI.siteComponentRepository.lookupData({id:n})};Grouping.dropItems=function(){for(console.log("items dropped: "+grouping.selectedItems()),Grouping.isActive()&&dragDrop.releaseElement();grouping.selectedItems().length>0;)Grouping.dropItem(grouping.selectedItems()[0]);$("."+GROUP_WRAPPER).remove()};Grouping.dropItem=function(n){grouping.selectedItems.remove(n);$(n).unbind("mousemove mouseleave");grouping.selectedItems().length==0&&grouping.showGroupingOptions(null)};Grouping.checkElementStretchedToFullWidth=function(n){var t=UI.siteComponentRepository.lookupData({id:$(n).getId()});return StretcherFactory.getCurrentStretchStatus(t)};Grouping.wrap=function(){var f;if($("."+GROUP_WRAPPER).remove(),grouping.selectedItems().length){var i=null,r=null,n=null,t=null,u=!1;ko.utils.arrayForEach(grouping.selectedItems(),function(f){var s=$(f),a,l;!u&&s.hasClass("std-component-fixed")&&(u=!0);var h=s.outerWidth()+(Grouping.checkElementStretchedToFullWidth(s)?0:2),c=s.outerHeight()+2,e=s.offset().top-1,o=s.offset().left-1;i==null||r==null||n==null||t==null?(i=e,r=o,n=h,t=c):(e<i?(i-e+t>t&&(t=i-e+t,c>t&&(t=c)),i=e):e-i+c>t&&(t=e-i+c),o<r?(r-o+n>n&&(n=r-o+n,h>n&&(n=h)),r=o):o-r+h>n&&(n=o-r+h));a=Grouping.generateGuid();l=$('<div class="'+GROUP_WRAPPER+'"><\/div>');l.css({width:h+"px",height:c+"px",pointerEvents:"none",top:e+"px",left:o+"px"});l.data("for",s.getId());l.attr("id",a);$("body").append(l)});f=$('<div class="'+GROUP_WRAPPER+" "+GROUP_WRAPPER_OUTER+(u?" "+GROUP_WRAPPER_FIXED:"")+'"><ul class="'+GROUP_WRAPPER_MENU+'"><\/ul><\/div>');f.css({width:n,height:t,left:r,top:i});$("body").append(f)}};Grouping.groupUp=function(){var n=Grouping.generateGuid();ko.utils.arrayForEach(grouping.selectedItems(),function(t){var i=Grouping.getComponent(t.id);i.setProperty(GROUPID,n,!0)})};Grouping.unGroup=function(){ko.utils.arrayForEach(grouping.selectedItems(),function(n){var t=Grouping.getComponent(n.id);t.setProperty(GROUPID,"",!0)})};Grouping.copyGroup=function(){grouping.clipboardGroup=[];ko.utils.arrayForEach(grouping.selectedItems(),function(n){var t=Grouping.getComponent(n.id);clipBoard.copyComponent(GROUP,t)})};Grouping.duplicateGroup=function(){Grouping.copyGroup();Grouping.pasteGroup()};Grouping.pasteGroup=function(n){for(var i=Grouping.generateGuid(),t=0;t<grouping.clipboardGroup.length;t++)grouping.clipboardGroup[t].getProperty(GROUPID).value==String.empty&&(i=!1),t==grouping.clipboardGroup.length-1&&n?clipBoard.pasteComponent(grouping.clipboardGroup[t],i,null,!1,!1,!0):clipBoard.pasteComponent(grouping.clipboardGroup[t],i);grouping.clipboardGroup=[];Grouping.dropItems();grouping.queueToSelectAfterPaste.forEach(function(n){var t=grouping.selectedItems().map(function(n){return n.id});t.indexOf(n.substring(1))==-1&&Grouping.addItem($(n)[0])});grouping.queueToSelectAfterPaste.splice(0)};Grouping.generateGuid=function(){function n(){return((1+Math.random())*65536|0).toString(16).substring(1)}return guid=(n()+n()+"-"+n()+"-4"+n().substr(0,3)+"-"+n()+"-"+n()+n()+n()).toLowerCase()};Grouping.getMinOffsetTopValue=function(){var n=null;return ko.utils.arrayForEach(grouping.selectedItems(),function(t){(n==null||t.offsetTop<n)&&(n=t.offsetTop)}),n};Grouping.getGroupFullOffset=function(){var n={groupHeight:0,offsetY:null},t=null;return ko.utils.arrayForEach(grouping.selectedItems(),function(i){(n.offsetY==null||i.offsetTop<n.offsetY)&&(n.offsetY=i.offsetTop);(t==null||i.offsetTop+i.offsetHeight>t)&&(t=i.offsetTop+i.offsetHeight)}),n.groupHeight=t-n.offsetY,n};Grouping.compareParent=function(n){try{return grouping.selectedItems().length==0?!0:n.parentElement.id==grouping.selectedItems()[0].parentElement.id?!0:!1}catch(t){return!1}};Grouping.fixPageXY=function(n){if(n.pageX==null&&n.clientX!=null){var t=document.documentElement,i=document.body;n.pageX=n.clientX+(t.scrollLeft||i&&i.scrollLeft||0);n.pageX-=t.clientLeft||0;n.pageY=n.clientY+(t.scrollTop||i&&i.scrollTop||0);n.pageY-=t.clientTop||0}};Grouping.elementInsideArea=function(n,t,i,r,u){var s=n+i,h=t+r,f=Grouping.cumulativeOffset(u),e=f.left,o=f.top,c=e+u.offsetWidth,l=o+u.offsetHeight;return n<=e&&t<=o&&s>c&&h>l?!0:!1};Grouping.cumulativeOffset=function(n){var t=0,i=0;do t+=n.offsetTop||0,i+=n.offsetLeft||0,n=n.offsetParent;while(n);return{top:t,left:i}};Grouping.deleteGroupSelectedComponents=function(){for(var n=_.map(grouping.selectedItems(),_.clone),t=n.length-1;t>=0;t--)if($("#"+n[t].id).attr("contenteditable")=="true")return;var i=function(n){for(var i=[],t=n.length-1;t>=0;t--){var r=n[t].id,u=Grouping.getComponent(r),f=UI.siteComponentRepository.remove({id:u.id});i.push({model:f})}return UI.removeEditor(),grouping.selectedItems([]),Grouping.wrap(),grouping.showGroupingOptions(!1),i},r=i(n),u=function(n){function i(n){var r=TemplateFactory.templateFor(n,VIEWER_TEMPLATE).compiledTemplate,t;$("#"+n.parentComponent.id).append(r);n.viewer();t="88cbc4c2-bb93-45e9-a318-57218c7c0171";n.componentId===t&&UI.renderMenus();n.isDockable&&n.children.length>0&&n.children.forEach(i)}for(var r,t=n.length-1;t>=0;t--)r=UI.siteComponentRepository.lookupData({id:n[t].model.parentComponent.id}),UI.siteComponentRepository.appendTo(n[t].model,r),i(n[t].model)};UI.undoManagerAdd({undo:function(){u(r)},redo:function(){i(n)}})};Grouping.showOrHideGroupSelectedComponents=function(n){var i,u,t,e,r,f;for(n=defined(n)?n.toBoolean():!1,i=_.map(grouping.selectedItems(),_.clone),u=[],t=i.length-1;t>=0;t--){if($("#"+i[t].id).attr("contenteditable")=="true")return;if(e=i[t].id,r=Grouping.getComponent(e),r.proto.name===SIGNIN)return;var o=r.getProperty(HIDE_COMPONENT),s=n,h=o!=null?o.value.toBoolean():!1;s!==h&&u.push({component:r,property:HIDE_COMPONENT,newvalue:s.toString(),oldvalue:h.toString()})}f=function(n,t){UI.removeEditor();grouping.selectedItems([]);grouping.showGroupingOptions(!1);Grouping.wrap();n=n.toBoolean();(n||UI.getSetting("showHidden"))&&UI.actionService.runActionForComponent(t,ACTION_REMOVE_FROM_FORM,!0);(!n||UI.getSetting("showHidden"))&&UI.actionService.runActionForComponent(t,ACTION_ADD_TO_FORM,!0)};UI.undoManagerAddSimpleArr(u,f,f,!0)};Grouping.setElementsAccess=function(){var t=document.getElementsByClassName("grouping-item"),n;for(i=0;i<t.length;i++)n=t[i],grouping.showGroupingOptions()===!0?n.classList.remove("disabled"):n.classList.add("disabled")};Grouping.isAllowedRectangleSelect=function(n){if(n===undefined||n===null)return!0;if($(n).closest(".std-component-fixed").length>0||$(n).closest(".menu-resizer").length>0)return!1;var t=$(n).parents("#bg").length,i=$(n).parents(".wrapper").length;return t+i>0};Grouping.isAllowedToDropEditableGroupId=function(n){var t,i,r;return n===undefined||n===null?!0:(t=$(n).closest(".std-component").length,t>0)?!1:$(n).is("body")?!0:(i=$(n).parents("#bg").length,r=$(n).parents(".wrapper").length,i+r>0)};Grouping.getGroupZIndexValue=function(n){n=n||!1;var t=null;return grouping.selectedItems().forEach(function(i){var r=Number($(i).css("z-index"));t==null&&(t=r);t=n?Math.min(t,r):Math.max(t,r)}),t};Grouping.getGroupItemsCountByZindex=function(n){var t=0;return grouping.selectedItems().forEach(function(i){var r=Number($(i).css("z-index"));r===n&&t++}),t};Grouping.hasAnyGroup=function(n){var t=Grouping.getComponent(n).getProperty(GROUPID);return t==null||t.value==""?!1:!0};Grouping.getGroupId=function(n){var t=Grouping.getComponent(n).getProperty(GROUPID);return t==null||t.value==""?null:t.value};Grouping.isSelected=function(n){var t=grouping.selectedItems().map(function(n){return n.id});return t.indexOf(n)!=-1};var grouping=new Grouping([]),PostLoadInit=function(){var n=this;n.execute=function(){UI.getSetting("ispreview")?InitHashChangeEvent():(InitPageResizers(),InitPositionFieldValidation(),InitMetaFieldValidation(),InitTopMenuScrolling())}},InitPageResizers=function(){$("#header-resizer").css({top:$(".header").height()});$("#header-resizer").draggable({axis:"y",start:function(){Helpers.removeSelectWrapper()},drag:function(){Resizer.resizeMenu($(this));Grouping.wrap()},stop:function(){Resizer.resizedMenuSave($(this))}});$("#page-resizer").draggable({axis:"y",start:function(){Helpers.removeSelectWrapper()},drag:function(){Resizer.resizeMenu($(this));Grouping.wrap()},stop:function(){Resizer.resizedMenuSave($(this))}});$("#bottom-body-resizer").draggable({axis:"y",start:function(){Helpers.removeSelectWrapper()},drag:function(){Resizer.resizeMenu($(this));Grouping.wrap()},stop:function(){Resizer.resizedMenuSave($(this))}})},InitTopMenuScrolling=function(){$(window).scroll(function(){n.scroll(!1)});$(window).resize(function(){n.scroll(!0)});var n={scroll:function(n){var t=$(window).scrollLeft(),i=$(".site-wrapper")[0].offsetLeft,r=$(".site-wrapper")[0].offsetWidth;$(".main-menu").css("left",this.settings.main_menu-t+"px");$(".position-add-new-com").css("left",i+this.settings.add_element_dx-t+"px");$(".component-bar").css("left",this.settings.component_bar-t+"px");$(".site-popover-custom, .design-popover-custom, .page-popover-custom").css("left",this.settings.menu_popovers-t+"px");$(".add-elements-popover-custom").css("left",i+this.settings.add_element_popover_dx-t+"px");$(".content-icons").css("left",this.settings.content_icons-t+"px");n&&eventsystem.publish("/component/stretch/");UI.RulerGuides!=undefined&&UI.RulerGuides.changeRulerGuidesOnScroll(n)},settings:{component_bar:8,main_menu:0,menu_popovers:48,right_navigation_panel_popover:11,add_element_dx:1,add_element_popover_dx:14,content_icons:500}};n.scroll()},InitPositionFieldValidation=function(){$(document).on("change","#widthInput, #heightInput, #topInput, #leftInput",function(){var n=parseInt(this.value),t=!1,i=5e3;n==NaN&&(n=0,t=!0);n>i&&(n=i,t=!0);n<-i&&(n=-i,t=!0);t&&($(this).val(n+"px"),$(this).trigger("change"))})},InitMetaFieldValidation=function(){$(document).on("keypress","#seo-title-input, #seo-descr-input, #seo-custom-date-input, #seo-words-input, #fb-title-input, #fb-descr-input, #seo-custom-title-input, #seo-custom-descr-input, #seo-custom-words-input, #site-settings-header-content",function(n){var t=n.which||n.keyCode;(t==96||t==39||t==34||t==64)&&n.preventDefault()});$(document).on("change","#seo-title-input, #seo-descr-input, #seo-custom-date-input, #seo-words-input, #fb-title-input, #fb-descr-input, #seo-custom-title-input, #seo-custom-descr-input, #seo-custom-words-input, #site-settings-header-content",function(){$(this).val($(this).val().replace(/'/g,""));$(this).val($(this).val().replace(/"/g,""));$(this).val($(this).val().replace(/`/g,""));$(this).val($(this).val().replace(/@/g,""))})};PostLoadInit.InitTextLinksToPages=function(n){$(".std-paragraph, .std-headertext, .html-container").find("a").toArray().forEach(function(t){var r=$(t).attr("href"),f=$(t).attr("target"),u=function(t,i){$(t).click(function(t){t.preventDefault();n.goToPage(i)})},i;if(r!=undefined)if(r.indexOf(location.host)!==-1&&f!=="_blank"){if(i="",r.indexOf("#")!=-1)i=r.substring(r.indexOf("#")),i=i.replace("#","").replace("!","");else try{i=Helpers.parseURL(r).pathname.replace("\\","").replace("/","").replace(/ /g,"").split("/")[0]}catch(e){i=r.split("/").pop().replace("!","")}u(t,n.getPageId(i))}else r.indexOf(CKEDITOR_PAGE)!=-1&&(i=r.substring(CKEDITOR_PAGE.length),u(t,n.getPageId(i)))})};InitHashChangeEvent=function(){if($(window).bind("hashchange",function(){var u=$.bbq.getState(),n,t,i,r;try{if(n=JSON.stringify(u).match(/"(.*?)"/)[1],n&&n[0]=="!"&&(n=n.substr(1)),!n.length)throw new Error("This is home page");for(t=0,t=0;t<UI.pager.pages.length;t+=1)i=UI.pager.pages[t],i.name.replace(/ /g,"").toLowerCase()==n.toLowerCase()&&UI.pager.goToPage(i.id)}catch(f){r=UI.pager.getHomePageId();UI.pager.goToPage(r)}}),UI.getSetting("ispublished"))$(window).on("popstate",function(){var t=document.location.pathname.replace("\\","").replace("/","").replace(/ /g,"").split("/"),u=t[0],f=document.location.hash.replace("#","").replace("!","").replace(/ /g,""),n,i,r;u?(n=UI.pager.getPageByName(u),n!=null&&(i={},(n.name==="product"||n.name==="thank-you")&&t[1]&&(i={key:n.name==="product"?"productId":"orderId",value:t[1]}),UI.pager.goToPage(n.id,!1,!0,i))):f?(r=UI.pager.getPageByName(f),r!=null&&UI.pager.goToPage(r.id)):UI.pager.goToHomePage(!0)})};HashHelper=function(){};HashHelper.set=function(n,t){if(t=defined(t)?t:{},UI.getSetting("ispublished"))try{history.pushState("",document.title,"/"+HashHelper.prepare(n)+(_.isEmpty(t)?"":"/"+t.value))}catch(i){}else _.isEmpty(t)||sessionStorage.setItem(t.key,t.value),location.hash=HashHelper.prepare(n)};HashHelper.get=function(){var n=location.hash.substring(1,location.hash.length);return n[0]=="!"?n.substring(1):n};HashHelper.clear=function(){try{UI.getSetting("ispublished")?history.replaceState("",document.title,"/"):history.replaceState("",document.title,window.location.pathname+window.location.search)}catch(n){location.hash=""}};HashHelper.prepare=function(n){return n.replace(/ /g,"")};HandlebarHelper=function(){};HandlebarHelper.compileTemplate=function(n,t){if(n!==undefined){var i=Handlebars.compile(n,{noEscape:!0});return i(t)}return""};Handlebars.registerHelper("ifEqual",function(n,t,i){return n==t?i.fn(this):i.inverse(this)});Handlebars.registerHelper("ifFunc",function(n,t,i){return n==t?i.fn(this):i.inverse(this)});Handlebars.registerHelper("unlessFunc",function(n,t){return typeof n=="function"?n()?t.inverse(this):t.fn(this):t.fn(this)});ColorPickerHelper=function(){};ColorPickerHelper.bind=function(n,t,i,r,u){if($(t).length){if(!$(t).hasClass("sp-color-input")){var f=$(t).clone().val(tinycolor(i.getProperty(r).value).toRgbString()),e=$('<div class="sp-color-input-container"><\/div>').append(f);$(t).replaceWith(e)}$(t).spectrum({preferredFormat:"rgb",showAlpha:!0,showInput:!0,showInitial:!0,showPalette:!0,hideAfterPaletteSelect:!0,showSelectionPalette:!1,beforeShow:function(){return $(this).spectrum("option","palette",[UI.getSiteColors()]),!0}});$(t).addClass("sp-color-input").show().change(function(t){var f=$(this),e,o;f.spectrum("set",t.target.value);e=_.clone(f.spectrum("get").toRgbString());o=function(t){u=u||function(){};n=$(n.selector?n.selector:n);i.setProperty(r,t);r===DIVIDER_COLOR?(n.find("hr").css(BORDER_COLOR,t),i.proto.name===STORE_THANK_YOU?n.find("th").css(BORDER_COLOR,t):i.proto.name===STORE_CART&&n.find("td").css(BORDER_COLOR,t)):n.css(r,t);UI.addSiteColor(t);u(i,n,t)};UI.undoManagerAddSimple(i,r,e,o,!0)})}};ColorPickerHelper.hide=function(){$(".sp-container").remove()};SwitcherHelper=function(){};SwitcherHelper.bind=function(n,t,i,r,u){u=u||function(){};var f=function(){};switch(r){case IS_PINED:f=function(t){if(t.toBoolean())$("#pinnedPosition").show("fast");else{if(i.getProperty(IS_PINED).value.toBoolean()){var r=[{component:i,property:FIXED_LOCATION,newvalue:"",oldvalue:i.getProperty(FIXED_LOCATION).value},{component:i,property:IS_PINED,newvalue:(!1).toString(),oldvalue:i.getProperty(IS_PINED).value}];UI.undoManagerAddSimpleArr(r,function(){},function(){},!0);UI.actionService.runActionForComponent(i,"remove-component-from-form",!0);UI.actionService.runActionForComponent(i,"add-component-to-form",!0);$(n).highlightSelectedElement(i,!0)}$("#pinnedPosition").hide("fast");$("#pinnedOffsetXY").hide("fast");$("#pinnedPosition label.elemposition-selected").removeClass("elemposition-selected")}};break;case STRETCH_TO_FULL_WIDTH:f=function(){StretcherFactory.toggleStretchToFullWidth(i)};break;case SHOW_MAP_TYPE:case SHOW_ZOOM:case MAP_INTERACTIVE:case SHOW_STREET_VIEW:case HOVER_STYLE:case IMAGE_RATIO:case CAPTION_POSITION:f=function(n){UI.undoManagerAddSimple(i,r,n,function(){},!0)};break;case LAYOUT:i.proto.name!==STORE_PRODUCT&&(f=function(n){UI.undoManagerAddSimple(i,r,n,function(){},!0)});break;case SUCCESS_PAGE_MASTER_LINK:f=function(n){var t=function(){var t=UI.siteComponentRepository.lookupDataSetByPropertyName(r),u=n?i.id:"",f=_.map(t,function(n){return{component:n,property:r,newvalue:_.clone(u),oldvalue:_.clone(n.getProperty(r).value)}});UI.undoManagerAddSimpleArr(f,function(){},function(){},!0)};t()}}$(t).children().click(function(n){n.stopPropagation();n.preventDefault();var t=$(this);t.hasClass("active")?t.siblings().length<=1&&(t.toggleClass("active"),t.siblings().toggleClass("active"),f(t.parent().find(".active").data().value),u(i,r,t.parent().find(".active").data().value)):(t.siblings().removeClass("active"),t.addClass("active"),f(t.parent().find(".active").data().value),u(i,r,t.parent().find(".active").data().value))})};SwitcherHelper.change=function(n){$($(n).children().get(0)).click()};PopoverHelper=function(){};PopoverHelper.bind=function(n,t,i,r,u){var f;i=defined(i)?i:"";r=defined(r)?r:"body";f=n.popover({content:t,container:r,html:!0,trigger:"manual",template:'<div class="popover"><div class="arrow"><\/div><div class="popover-inner"><h3 style="display:none;" class="popover-title"><\/h3><div class="popover-content"><p><\/p><\/div><\/div><\/div>',placement:function(n){return i&&$(n).addClass(i),$(n).appendTo(r).find(".accordion").accordion({heightStyle:"content"}),"auto left"},animation:!1});PopoverHelper.bindEvents(f,u).popover("show");var e=$(".site-wrapper")[0].offsetLeft+$(".site-wrapper")[0].offsetWidth,o=PopoverHelper.getUnicPositionPopovers(),s=document.getElementsByClassName("popover");ko.utils.arrayForEach(s,function(t){var i,r,u;o.indexOf(t.id)==-1&&UI.getDevice().isDesktop()&&(i=0,defined(t)&&(i=t.offsetLeft+t.offsetWidth),e<i&&(r=e-t.offsetWidth,$(t).css("left",r+"px")));$(t).hasClass("left")&&n.hasClass("std-component")&&(u=parseInt($(t).css("left"))-15,$(t).css("left",u+"px"));t.offsetTop<70&&$(t).css("top","70px");$(t).bind("click",function(n){n.stopPropagation()})})};PopoverHelper.bindEvents=function(n,t){t={show:t&&defined(t.show)?t.show:function(){Helpers.consoleLog("show.bs.popover")},shown:t&&defined(t.shown)?t.shown:function(){Helpers.consoleLog("shown.bs.popover")},hide:t&&defined(t.hide)?t.hide:function(){Helpers.consoleLog("hide.bs.popover")},hidden:t&&defined(t.hidden)?t.hidden:function(){Helpers.consoleLog("hidden.bs.popover")}};n.data("callbacks",t);return n.on("show.bs.popover",t.show).on("shown.bs.popover",t.shown).on("hide.bs.popover",t.hide).on("hidden.bs.popover",t.hidden)};PopoverHelper.getUnicPositionPopovers=function(){var n=[];return n.push($("#right-navigation-panel").attr("aria-describedby")),n.push($("#placing-on-canvas-top").attr("aria-describedby")),n.push($("#placing-on-canvas-bottom").attr("aria-describedby")),n};PopoverHelper.getNonHidedPopoversIds=function(){var n=[];return n.push($("#right-navigation-panel").attr("aria-describedby")),n.push("right-navigation-panel"),n.push("placing-on-canvas-top"),n.push("placing-on-canvas-bottom"),n};PopoverHelper.hidePopovers=function(n){var t=PopoverHelper.getNonHidedPopoversIds();$("*").each(function(){var i=$(this).attr("id"),r=$.data(this,"bs.popover"),u=n!=undefined&&$("#"+i).hasClass(n)||n==undefined;r&&t.indexOf(i)==-1&&u&&$("#"+i).popover("destroy")})};RangeSliderHelper=function(){};RangeSliderHelper.bind=function(n,t,i,r,u,f){var o,e;f=f||function(){};o={onChange:function(n){var l=_.clone(t.getProperty(r).value),o=_.clone(n.fromNumber),s,e,h,c;parseInt(l)!==o&&(s=_.clone(u),e=function(n,u){if(defined(u))switch(u){case"px":n=n+"px"}t.setProperty(r,n);i=$(i.selector?i.selector:i);var e=i.outerWidth();i.hasClass("std-list")&&RangeSliderHelper.sizeTextList(i,r,n);r!==COLUMNS&&r!==ROWS&&r!==DIVIDER_WIDTH?(i.css(r,n),t.proto.name!==STORE_GALLERY_PRODUCT_LABEL&&$(i).css("width",e)):r===DIVIDER_WIDTH&&i.find("hr").css(BORDER_WIDTH,n);f(t,i,n)},e(o,s.postfix),h=UI.undoManagerGetLatestProperty(),c=UI.undoManagerGetLatestComponentId(),h!=null&&r==h&&c!=null&&c==t.id?UI.undoManagerAddSpecific({redo:function(){e(o,"")}},"redo"):UI.undoManagerAdd({undo:function(){e(l,"")},redo:function(){e(o,s.postfix)},property:r,componentId:t.id}))},step:1};u.onChange=u.onChange||o.onChange;u.step=u.step||o.step;e={min:u.min,max:u.max,step:u.step,postfix:u.postfix};u.useOnFinish?e.onFinish=u.onChange:e.onChange=u.onChange;$(n).ionRangeSlider(e)};RangeSliderHelper.update=function(n,t){$(n).ionRangeSlider("update",t)};RangeSliderHelper.sizeTextList=function(n,t,i){$(n).find(".title, .description, .meta, .optional").css(t,i)};EditorEventsFactory=function(){};EditorEventsFactory.attachPlainEvent=function(n,t,i,r,u,f){$(n).bind(r,function(){var n=_.clone($(this).val()),r;u=="autoplay"||u=="hide"||u=="rel"||u=="loop"||u==DIVIDER||u==MAIL_HISTORY_PROPERTY||u==SHARE_TO_FACEBOOK||u==SHARE_TO_TWITTER||u==SHARE_TO_GPLUS||u==REQUIRED_FIELD||u==SHOW_OPTIMIZED||u==SHOW_OPTIMIZED_HOVER||u==SHOW_OPTIMIZED_PRESSED||u==SHOW_OPTIMIZED_PLACEHOLDER?n=$(this).is(":checked").toString():u===LAYOUT&&(n=$(this).data("type"));f=f||function(){};r=function(n){t=$(t.selector?t.selector:t);var r=$(t).parent(".page");switch(u){case"text":i.proto.name===STORE_THANK_YOU?t.find("h3").text(n):i.proto.name===STORE_CART?t.find(".empty-cart-text").text(n):t.text(n);break;case"type":case"src":case"provider":case"predefined":case"mode":case"autoplay":case"hide":case"loop":case"rel":case"vertical-align":case SHOW_OPTIMIZED:case SHOW_OPTIMIZED_HOVER:case SHOW_OPTIMIZED_PRESSED:case SHOW_OPTIMIZED_PLACEHOLDER:break;case"alt":t.find("img").attr("alt",n);break;case"top":t.css(u,n);Resizer.recalculateHeaderFooterAndPageSize(r);break;case"height":t.css(u,n);Resizer.recalculateHeaderFooterAndPageSize(r);break;case"list-type":case PAYPAL_EMAIL:case DESCRIPTION:i.proto.name===STORE_THANK_YOU&&t.find("h4").text(n);break;case TITLE:i.proto.name===STORE_THANK_YOU?t.find("h2").text(n):i.proto.name===STORE_CART&&t.find(".cart-title").text(n);break;case TEXT_ORDER_NUMBER:i.proto.name===STORE_THANK_YOU&&t.find("h5.text-order").text(n);break;case TEXT_TOTAL_COST:i.proto.name===STORE_THANK_YOU&&t.find("h5.text-total").text(n);break;case TEXT_SHIPPING_TO:i.proto.name===STORE_THANK_YOU&&t.find("h5.text-shipping").text(n);break;default:t.css(u,n)}t.highlightSelectedElement(i,!0);f(i,t,n)};UI.undoManagerAddSimple(i,u,n,r,!0)})};EditorEventsFactory.attachPlainEventNotComponent=function(n,t,i,r){$(n).bind(i,function(){t.setProperty(r,$(this).val())})};Indexer=function(){};Indexer.indexRepository=function(n){var i=function(n,t){return n.parentComponent!=null?n.parentComponent.index+"c["+t+"].":"r["+t+"]."},t=function(n,r){n.index=i(n,r);defined(n.children)&&n.children.any()&&n.children.forEach(function(n,i){t(n,i)})};n.forEach(function(n,i){t(n,i)})};Indexer.restoreIndex=function(repository,indexedValue){var childPattern="c[",childMatch="children[",repoPattern="r[",repoMatch="repository[";return indexedValue=indexedValue.replaceAll(childPattern,childMatch).replaceAll(repoPattern,repoMatch),indexedValue[indexedValue.length-1]=="."&&(indexedValue=indexedValue.slice(0,-1)),eval(indexedValue)};Positioning=function(){};Positioning.createElementCoords=function(n){var t=$(n),i=t.offset().top,r=t.offset().left,u=t.outerWidth(),f=t.outerHeight(),e=new Coord(r,i),o=new Coord(r,i+f),s=new Coord(r+u,i),h=new Coord(r+u,i+f),c=new Coord(e.x+u/2,e.y+f/2);return new ElementCoords(e,o,s,h,c)};Positioning.isAboveElement=function(n,t){var i=n.center.x>t.leftTop.x&&n.center.x<t.rightTop.x,r=n.center.y>t.leftTop.y&&n.center.y<t.leftBottom.y;return i&&r};var Coord=function(n,t){this.x=n;this.y=t},ElementCoords=function(n,t,i,r,u){this.leftTop=n;this.leftBottom=t;this.rightTop=i;this.rightBottom=r;this.center=u},Dock=function(){};Dock.unconditionalElementDocking=function(n,t,i,r,u){var c=!1,f,l,h,e,s;if(r=r||!1,u=u||null,n!=null&&(f=$(n),l=f.closest("[dockable]"),l.getId()!=t.getId())){var a=f.offset().left-t.offset().left,v=f.offset().top-t.offset().top,y=f.position().left,p=f.position().top;if(!(a-Dock.delta<=y&&a+Dock.delta>=y&&v-Dock.delta<=p&&v+Dock.delta>=p)){c=!0;var k=f.parent().getId(),w=t.getId(),o=UI.siteComponentRepository.lookupData({id:f.getId()}),d=o.getProperty(LEFT).value,g=o.getProperty(TOP).value,b=MIN_ELEMENT_HEIGHT;o.getProperty(HEIGHT)!=null&&(b=o.getProperty(HEIGHT).value);h=f.offset().left-t.offset().left+"px";e="0px";i&&(e=t[0].offsetHeight-parseInt(b),e<0&&(e=0),e+="px");u!=null&&(e=(u.moveup?t[0].offsetHeight<=u.groupHeight?0+u.offsetY:t[0].offsetHeight-u.groupHeight+u.offsetY:0+u.offsetY)+"px");s=function(n,t,i,u){var e,f,o;e=typeof i=="string"?$(i):$("#"+i[0].id);UI.siteComponentRepository.move({id:e.getId()},{id:u});f=UI.siteComponentRepository.lookupData({id:$(e).getId()});f.setProperty(LEFT,n);f.setProperty(TOP,t);TransformFactory.setNewPosition(f);UI.actionService.addToActionData(f,!0);UI.actionService.runActionForComponent(f,ACTION_ADD_TO_FORM,!0);dragDrop.draggedObject!=null&&(dragDrop.draggedObject=$(e.selector).get(0));f.proto.name===MENU&&UI.renderMenus();Resizer.recalculateSizeFooterContainer($(".footer")[0]);r?(o=_.findIndex(grouping.selectedItems(),function(n){return n.id==f.id}),grouping.selectedItems()[o]=$(e.selector).get(0),Grouping.wrap()):$(e.selector).highlightSelectedElement(f)};s(h,e,n,w);UI.undoManagerAdd({undo:function(){s(d,g,n,k)},redo:function(){s(h,e,n,w)}})}}return UI.removeDockContainer(),c};Dock.processElementDocking=function(n){var f=!1,u;if(Dock.canDock()){if(n!=null){var r=$("#"+$(UI.getConfigurationValue(DOCK_WRAPPER)).data("for")),t=$(n),p=t.closest("[dockable]");if(p.getId()!=r.getId()){var o=t.offset().left-r.offset().left,s=t.offset().top-r.offset().top,h=t.position().left,c=t.position().top;if(!(o-Dock.delta<=h&&o+Dock.delta>=h&&s-Dock.delta<=c&&s+Dock.delta>=c)){f=!0;var w=t.parent().getId(),l=r.getId(),i=UI.siteComponentRepository.lookupData({id:t.getId()}),b=i.getProperty(LEFT).value,k=i.getProperty(TOP).value,a=t.offset().left-r.offset().left+"px",v=t.offset().top-r.offset().top+"px";if(console.log("Docking:"+f),i.parentComponent!=null){var d=$(i.getUISelector()).zIndex(),y=$(i.parentComponent.getUISelector()).zIndex(),e=y>0?y:d;i.setProperty("z-index",e);$(i.getUISelector()).zIndex(parseInt(e,10));console.log("new zindex: "+parseInt(e,10))}u=function(n,t,i,r){UI.siteComponentRepository.move({id:i.getId()},{id:r});var u=UI.siteComponentRepository.lookupData({id:$(i).getId()});u.setProperty(LEFT,n);u.setProperty(TOP,t);UI.actionService.addToActionData(u,!0);UI.actionService.runActionForComponent(u,ACTION_ADD_TO_FORM,!0);dragDrop.draggedObject!=null&&(dragDrop.draggedObject=$(i.selector).get(0));u.proto.name===MENU&&UI.renderMenus();Resizer.recalculateSizeFooterContainer($(".footer")[0])};u(a,v,t,l);UI.undoManagerAdd({undo:function(){u(b,k,t,w)},redo:function(){u(a,v,t,l)}})}}}UI.removeDockContainer()}return f};Dock.canDock=function(){return $(UI.getConfigurationValue(DOCK_WRAPPER)).length>0};Dock.delta=2;Resizer=function(){};Resizer.cumulativeTopOffset=function(n){var t=0;do{if($(n).hasClass("body"))break;t+=n.offsetTop||0;n=n.offsetParent}while(n);return t};Resizer.resizeFooterContainer=function(n,t){var i=n.clientHeight+n.offsetTop,r=t.clientHeight,u=$(".footer");return i>r&&$(t).css("height",i),!1};Resizer.recalculateSizeFooterContainer=function(n){var t,u,f;if(n!=undefined){var e=UI.siteComponentRepository.lookupData({id:$(".footer").getId()}),o=parseInt(e.getProperty(HEIGHT).value),r=$(".footer"),s=$(".header").outerHeight(),h=$(".main").outerHeight(),i=Resizer.calculateContainerBottomLine($(".footer")[0],o);for(t=0;t<n.children.length;t++)u=n.children[t],f=u.offsetTop+u.offsetHeight,f>i&&(i=f);r.css("height",i+"px");$("#bottom-body-resizer").css("top",i+s+h);e.setProperty(HEIGHT,$(".footer").css("height"));Resizer.drawRulersTicks(r[0].offsetTop+r[0].offsetHeight)}return!1};Resizer.checkMinSizeHeaderContainer=function(n){var u,r=parseInt($(n).css("height")),t=$(".main"),i=$(".footer"),f,e,o,l,s,a,h,c;if(n&&t[0]&&i[0]){for(u=0;u<n.children.length;u++)f=n.children[u],e=f.offsetTop+f.offsetHeight,e>r&&(r=e);$(n).css("height",r);o=UI.siteComponentRepository.lookupData({id:$(n).getId()});o!=null&&o.setProperty(HEIGHT,$(n).css("height"));l=n.offsetTop+r;t.css("top",l);s=UI.siteComponentRepository.lookupData({id:t.getId()});s!=null&&s.setProperty(TOP,t.css("top"));a=t[0].offsetTop+t[0].offsetHeight;i.css("top",a);h=UI.siteComponentRepository.lookupData({id:i.getId()});h!=null&&h.setProperty(TOP,i.css("top"));Resizer.drawRulersTicks(i[0].offsetTop+i[0].offsetHeight);c=t[0];$("#page-resizer").css(TOP,c.offsetTop+c.offsetHeight+"px");$("#header-resizer").css(TOP,r+"px")}return!1};Resizer.checkMinSizePageContainer=function(n){var i,u=parseInt($(n).css("height")),f,e,o,r,t,h,c,s;if(n!=undefined){for(i=0;i<n.children.length;i++)f=n.children[i],e=f.offsetTop+f.offsetHeight,e>u&&(u=e);$(n).css("height",u);o=UI.siteComponentRepository.lookupData({id:$(n).getId()});o.setProperty(HEIGHT,$(n).css("height"));UI.getSetting("ispreview")||UI.undoManagerAddSimple(o,HEIGHT,$(n).css("height"),function(t){$(n).css("height",t);Resizer.recalculateHeaderFooterAndPageSize(n)},!0);r=$(".main");t=$(".footer");t[0]!=undefined&&(h=r[0].offsetTop+r[0].offsetHeight,t.css("top",h),c=UI.siteComponentRepository.lookupData({id:$(".footer").getId()}),c.setProperty(TOP,$(".footer").css("top")),Resizer.drawRulersTicks(t[0].offsetTop+t[0].offsetHeight));s=r[0];$("#page-resizer").css(TOP,s.offsetTop+s.offsetHeight+"px")}return!1};Resizer.recalculateHeaderFooterAndPageSize=function(n){Resizer.checkMinSizeHeaderContainer($(".header")[0]);n&&n[0]!=undefined&&Resizer.checkMinSizePageContainer(n[0]);Resizer.recalculateSizeFooterContainer($(".footer")[0]);UI.RulerGuides!=undefined&&UI.RulerGuides.calculateRulerGuideHeight()};Resizer.drawRulersTicks=function(n){var f,e,t,i,r,u;if($(".hRule").css("display")=="none")return!1;f=$(".hRule");e=$(".vRule");f.empty();e.empty().height(0).outerHeight(n);var s=UI.RulerGuides!=undefined?UI.RulerGuides.getSiteWidth():0,o=UI.getDevice().isDesktop()?UI.RulerGuides!=undefined?UI.RulerGuides.getRulerGuidePositionBeginningByType("vertical"):0:0;for(o=o.toFixed(),t=0,i="";t<=f.width();){if(r=t-o,r%50==0)i="<div class='tickLabel'>"+(r%100==0?"<span>"+(r>=0&&r<=s?r:"")+"<\/span>":"")+"<\/div>",u={left:t+"px"},r%100!=0&&(u.height="50%"),$(i).css(u).appendTo(f);else if(r%10==0)i="<div class='tickMajor'><\/div>",$(i).css("left",t+"px").appendTo(f);else{t=t+1;continue}t=t+10}for(t=0,i="";t<=e.height();)(+t)%50==0?t!=0&&(i="<div class='tickLabel'>"+((+t)%100==0?"<span>"+ +t+"<\/span>":"")+"<\/div>",u={top:t+"px"},(+t)%100!=0&&(u.width="50%"),$(i).css(u).appendTo(e)):(+t)%10==0&&(i="<div class='tickMajor'><\/div>",$(i).css("top",t+"px").appendTo(e)),t=t+10};Resizer.drawRulers=function(n,t,i,r){return dragDrop.drawRulers(n[0],5,0,0,!1,!0,t,i,r)};Resizer.resizeMenu=function(n){var s=n[0].id,t=n[0].offsetTop,i=n[0].offsetHeight,u=parseInt($(".main").css("height")),r=parseInt($(".header").css("height")),f=Resizer.calculateContainerBottomLine($(".header")[0],parseInt($(".header").css("min-height"))),e=Resizer.calculateContainerBottomLine($("#"+UI.pager.getCurrentPageId())[0],parseInt($(".main").css("min-height"))),o=Resizer.calculateContainerBottomLine($(".footer")[0],parseInt($(".footer").css("min-height")));switch(s){case"header-resizer":t-i/2<f&&(t=f-i/2);$(".header").css("height",t+i/2);$(".main").css("top",t+i/2);$(".footer").css("top",t+i/2+u);$(".site-wrapper").css("height",t+i);break;case"page-resizer":t+i/2-r<e&&(t=e-i/2+r);$("#"+UI.pager.getCurrentPageId()).css("height",t+i/2-r);$(".footer").css("top",t+i/2);break;case"bottom-body-resizer":t+i/2-u-r<o&&(t=u+r+o-i/2);$(".footer").css("height",t-r-u+i/2)}};Resizer.calculateContainerBottomLine=function(n,t){var i=t,r,u;for(index=0;index<n.children.length;index++)r=n.children[index],u=r.offsetTop+r.offsetHeight,u>i&&(i=u);return i};Resizer.resizedMenuSave=function(n){var l=UI.siteComponentRepository.lookupData({id:$(".header")[0].id}),h=UI.siteComponentRepository.lookupData({id:$(".main")[0].id}),f=UI.siteComponentRepository.lookupData({id:$(".footer")[0].id}),a=UI.siteComponentRepository.lookupData({id:UI.pager.getCurrentPageId()}),u=parseInt(_.clone(l.getProperty(HEIGHT).value)),k=parseInt(_.clone(h.getProperty(TOP).value)),g=parseInt(_.clone(h.getProperty(HEIGHT).value)),e=parseInt(_.clone(f.getProperty(TOP).value)),y=parseInt(_.clone(f.getProperty(HEIGHT).value)),c=parseInt(_.clone(a.getProperty(HEIGHT).value)),o=parseInt($(".main").css("height")),s=parseInt($(".footer").css("height")),d=_.clone(n[0].id),t=n[0].offsetTop,i=_.clone(n[0].offsetHeight),p=Resizer.calculateContainerBottomLine($(".header")[0],parseInt($(".header").css("min-height"))),w=Resizer.calculateContainerBottomLine($("#"+UI.pager.getCurrentPageId())[0],parseInt($(".main").css("min-height"))),b=Resizer.calculateContainerBottomLine($(".footer")[0],parseInt($(".footer").css("min-height"))),r=function(n,t,i){n.setProperty(t,i);var r=$("#"+n.id);r.css(t,i)},v;switch(d){case"header-resizer":t-i/2<p&&(t=p-i/2,$(n).css(TOP,t+i/2));r(l,HEIGHT,t+i/2+"px");r(h,TOP,t+i/2+"px");r(f,TOP,t+i/2+o+"px");$("#page-resizer").css(TOP,t+i/2+o+"px");$("#bottom-body-resizer").css(TOP,t+i/2+o+s+"px");UI.undoManagerAdd({undo:function(){r(l,HEIGHT,u);r(h,TOP,k);r(f,TOP,e);$("#header-resizer").css(TOP,u+"px");$("#page-resizer").css(TOP,u+o+"px");$("#bottom-body-resizer").css(TOP,u+o+s+"px")},redo:function(){r(l,HEIGHT,t+i/2+"px");r(h,TOP,t+i/2+"px");r(f,TOP,t+i/2+o+"px");$("#header-resizer").css(TOP,t+i/2);$("#page-resizer").css(TOP,t+i/2+o+"px");$("#bottom-body-resizer").css(TOP,t+i/2+o+s+"px")}});break;case"page-resizer":t+i/2-u<w&&(t=w-i/2+u,$(n).css(TOP,t+i/2));r(a,HEIGHT,t+i/2-u+"px");r(f,TOP,t+i/2+"px");$("#bottom-body-resizer").css(TOP,t+i/2+s+"px");UI.undoManagerAdd({undo:function(){r(a,HEIGHT,e-u);r(f,TOP,e);$("#page-resizer").css(TOP,e+"px");$("#bottom-body-resizer").css(TOP,e+s+"px")},redo:function(){r(a,HEIGHT,t+i/2-u+"px");r(f,TOP,t+i/2+"px");$("#page-resizer").css(TOP,t+i/2);$("#bottom-body-resizer").css(TOP,t+i/2+s+"px")}});break;case"bottom-body-resizer":t-i/2-u-c<b&&(t=u+c+b,$(n).css(TOP,t+i/2));r(f,HEIGHT,t+i/2-u-c+"px");UI.undoManagerAdd({undo:function(){r(f,HEIGHT,e+y-u-c);r(f,TOP,e);$("#bottom-body-resizer").css(TOP,e+"px")},redo:function(){r(f,HEIGHT,t+i/2-u-c+"px");r(f,TOP,t-i/2-s+"px");$("#bottom-body-resizer").css(TOP,t+i/2+y+"px")}})}v=$(".footer");Resizer.drawRulersTicks(v[0].offsetTop+v[0].offsetHeight);UI.RulerGuides!=undefined&&UI.RulerGuides.calculateRulerGuideHeight()};Resizer.checkMinMaxWidth=function(n,t,i){var r,f;if(n=$(n),i=defined(i)?i:!1,n.hasClass("std-list")){if(r=parseInt(n.find(".item").css("min-width")),r>t)return i?r:!1}else if(n.hasClass("std-store-gallery")){var e=n.find(".std-store-gallery-product"),u=parseInt(n.data().col),r=0;if(e&&(r=parseInt(e.css("min-width"))*u+(Math.ceil(r*u*2/(100-u*2))+16)),r>t)return i?r:!1}else{if(r=parseInt(n.css("min-width")),r>t)return i?r:!1;if(n.hasClass("std-house-photo-tour")&&(f=parseInt(n.css("max-width")),f<t))return i?f:!1}return i?t:!0};Resizer.findBasicContainer=function(n){while(n)if(n=n.offsetParent,!$(n).hasClass("std-component"))return n;return null};Resizer.additionalOffsetFromParent=function(n){var t=0;do{if(n=n.offsetParent,!$(n).hasClass("std-component"))break;t+=n.offsetTop||0}while(n);return t};Resizer.checkPositionComponent=function(n,t){var i=n.getProperty(FIXED_LOCATION);return t=="centerTop"?i==null||i.value!=="center-top"&&i.value!=="left-top"&&i.value!=="right-top":t=="topLeft"?i==null||i.value!=="center-top"&&i.value!=="left-top"&&i.value!=="left-center"&&i.value!=="left-bottom"&&i.value!=="right-top":t=="topRight"?i==null||i.value!=="center-top"&&i.value!=="right-top"&&i.value!=="center-top"&&i.value!=="right-center"&&i.value!=="right-bottom"&&i.value!=="left-top":t=="centerBottom"?i==null||i.value!=="center-bottom"&&i.value!=="left-bottom"&&i.value!=="right-bottom":t=="bottomLeft"?i==null||i.value!=="center-bottom"&&i.value!=="left-top"&&i.value!=="left-center"&&i.value!=="left-bottom"&&i.value!=="right-bottom":t=="bottomRight"?i==null||i.value!=="center-bottom"&&i.value!=="right-top"&&i.value!=="right-center"&&i.value!=="right-bottom"&&i.value!=="left-bottom":t=="centerLeft"?i==null||i.value!=="left-top"&&i.value!=="left-center"&&i.value!=="left-bottom":t=="centerRight"?i==null||i.value!=="right-top"&&i.value!=="right-center"&&i.value!=="right-bottom":!1};Resizer.bind=function(n,t,i,r){function et(n){var t=0;do{if($(n).hasClass("body"))break;t+=n.offsetTop||0;n=n.offsetParent}while(n);return t}function ht(t){t.stopPropagation();ViewerFactory.editorCanBeShown(n,t)&&(UI.callEditor(i),$(n).highlightSelectedElement(i,!0))}var l,y,p,w,b,ot,k,d;console.log("Resizer.bind");var ct=n.hasClass("std-list"),g=n.hasClass("std-anchor"),bt=n.hasClass("std-house-photo-tour"),nt=n.hasClass("std-form-checkbox"),tt=n.hasClass("std-form-captcha"),it=n.hasClass("std-sound"),o=n.hasClass("std-store-product"),a=n.hasClass("std-store-gallery"),s=n.hasClass("std-store-cart"),rt=n.hasClass("std-store-cart-link"),h=n.hasClass("std-store-thank-you"),lt=n.hasClass("std-signin"),ut=n.hasClass("std-paragraph"),ft=n.hasClass("std-headertext"),at=n.hasClass("html-container"),vt=n.hasClass("std-form"),yt=n.hasClass("std-contact-us"),pt=n.hasClass("std-evaluate-home"),wt=n.find(".std-img").length>0;ct||g||nt||it||o||s||h||rt||tt||(Resizer.checkPositionComponent(i,"centerTop")&&!a&&t.append('<div class="resizer top"><\/div>'),Resizer.checkPositionComponent(i,"topLeft")&&t.append('<div class="resizer top-left"><\/div>'),Resizer.checkPositionComponent(i,"topRight")&&t.append('<div class="resizer top-right"><\/div>'),Resizer.checkPositionComponent(i,"centerBottom")&&!a&&t.append('<div class="resizer bottom"><\/div>'),Resizer.checkPositionComponent(i,"bottomLeft")&&t.append('<div class="resizer bottom-left"><\/div>'),Resizer.checkPositionComponent(i,"bottomRight")&&t.append('<div class="resizer bottom-right"><\/div>'));g||nt||it||o||a||s||h||rt||tt||(Resizer.checkPositionComponent(i,"centerLeft")&&t.append('<div class="resizer left"><\/div>'),Resizer.checkPositionComponent(i,"centerRight")&&t.append('<div class="resizer right"><\/div>'));var e=Resizer.findBasicContainer(n[0]),v=0,c=0;e!=null&&(c=et(e),v=c+e.offsetHeight);l=et(n[0]);y=n[0].clientHeight+l;n.hasClass("std-form-subcomponent")||(!UI.getDevice().isDesktop()||o||s||h||(v+25>y&&v-25<y&&!$(e).hasClass("footer")&&($(e).hasClass("page")?t.find("."+SELECT_WRAPPER_MENU).append('<li class="move-to-footer"><i class="fa fa-lg fa-chevron-down" title="Move to Footer"><\/i><\/li>'):$(e).hasClass("header")&&t.find("."+SELECT_WRAPPER_MENU).append('<li class="move-to-page"><i class="fa fa-lg fa-chevron-down" title="Move to Page"><\/i><\/li>')),c+25>l&&c-25<l&&!$(e).hasClass("header")&&($(e).hasClass("page")?t.find("."+SELECT_WRAPPER_MENU).append('<li class="move-to-header"><i class="fa fa-lg fa-chevron-up" title="Move to Header"><\/i><\/li>'):$(e).hasClass("footer")&&t.find("."+SELECT_WRAPPER_MENU).append('<li class="move-to-page-up"><i class="fa fa-lg fa-chevron-up" title="Move to Page"><\/i><\/li>'))),o||s||h||lt||(p=i.getProperty(HIDE_COMPONENT),p!=null&&p.value.toBoolean()?t.append('<div class="resizer show-component"><i class="fa fa-lg fa-eye" title="Show component"><\/i><\/div>'):t.find("."+SELECT_WRAPPER_MENU).append('<li class="hide-component"><i class="fa fa-lg fa-eye-slash" title="Hide component"><\/i><\/li>')));r&&t.find("."+SELECT_WRAPPER_MENU).append('<li class="edit-component" title="Edit Component"><i class="fa fa-lg fa-cog"><\/i><\/li>');!UI.getDevice().isDesktop()||o||s||h||t.find("."+SELECT_WRAPPER_MENU).append('<li class="delete-component" title="Delete Component"><i class="fa fa-lg fa-ban"><\/i><\/li>');(ut||ft)&&(w=UI.devices.where({type:DEVICE_MOBILE_TYPE}).firstOrDefault(),w&&UI.getDevice().isDesktop()&&(b=!1,b=i.getProperty(TEXT).value===i.getProperty(TEXT,w.getId()).value,t.find("."+SELECT_WRAPPER_MENU).append('<li class="inherit-property-text'+(b?" disabled":"")+'" title="Copy Text to Mobile"><i class="fa fa-2x fa-mobile "><\/i><\/li>')),t.find("."+SELECT_WRAPPER_MENU).append('<li class="edit-text"><span>Edit Text<\/span><\/li>'));at&&(ot=i.getProperty(TEXT).value,new RegExp(REGEXP_CHECK_HTML_SCRIPT_AND_IFRAME_TAG).test(ot)&&(i.isPreviewEnabled?t.find("."+SELECT_WRAPPER_MENU).append('<li class="preview-disable"><span>Disable Preview<\/span><\/li>'):t.find("."+SELECT_WRAPPER_MENU).append('<li class="preview-enable"><span>Preview<\/span><\/li>')));wt&&(k=i.getProperty(IMAGE_STRETCHING),k!=null&&(k.value=="cover"?t.find("."+SELECT_WRAPPER_MENU).append('<li class="image-stretching-toggle" data-value="contain"><span>Fit frame<\/span><\/li>'):t.find("."+SELECT_WRAPPER_MENU).append('<li class="image-stretching-toggle" data-value="cover"><span>Cover frame<\/span><\/li>')));(vt||yt||pt)&&(d=i.getProperty(MAIL_HISTORY_PROPERTY),d!=null&&d.value.toBoolean()&&t.find("."+SELECT_WRAPPER_MENU).append('<li class="form-manage-mails"><i class="fa fa-lg fa-envelope-o" title="Inbox"><\/i><\/li>'));$("body").append(t);Resizer.rescaleUIElements();$(".resizer").bind("click",function(n){n.stopPropagation()});var u={initialX:0,initialY:0,initialHeight:0,initialWidth:0,initialTop:0,initialLeft:0,initialScale:0,getCurrent:function(t){t=t||window.event;this.initialX=t.clientX;this.initialY=t.clientY;this.initialHeight=n.outerHeight();this.initialWidth=n.outerWidth();this.initialTop=n.position().top;this.initialLeft=n.position().left;this.initialScale=n.outerWidth()/n.outerHeight()}},st=function(n,t,i,r,u,f){f.setProperty(LEFT,n);f.setProperty(TOP,t);f.setProperty(WIDTH,i);f.setProperty(HEIGHT,r);u.css(LEFT,n);u.css(TOP,t);u.css(WIDTH,i);u.css(HEIGHT,r);u.highlightSelectedElement(f,!0)},f={mouseDownEvent:function(){console.log("mouse down");var t=i.getProperty(LEFT).value,r=i.getProperty(TOP).value,u=i.getProperty(WIDTH).value,f=i.getProperty(HEIGHT).value;UI.undoManagerAdd({undo:function(){st(t,r,u,f,n,i)},redo:function(){}})},mouseUpEvent:function(){console.log("mouse up");n.highlightSelectedElement(i,!0);$(document).unbind("mousemove",f.mouseMove.bottomHandle);$(document).unbind("mousemove",f.mouseMove.topHandle);$(document).unbind("mousemove",f.mouseMove.rightHandle);$(document).unbind("mousemove",f.mouseMove.leftHandle);$(document).unbind("mousemove",f.mouseMove.topLeftHandle);$(document).unbind("mousemove",f.mouseMove.topRightHandle);$(document).unbind("mousemove",f.mouseMove.bottomLeftHandle);$(document).unbind("mousemove",f.mouseMove.bottomRightHandle);$(document).unbind("mouseup",f.mouseUpEvent);var t=i.getProperty(LEFT).value,r=i.getProperty(TOP).value,u=i.getProperty(WIDTH).value,e=i.getProperty(HEIGHT).value;UI.undoManagerAddSpecific({redo:function(){st(t,r,u,e,n,i)}},"redo");Resizer.recalculateSizeFooterContainer($(".footer")[0]);$(".objectx").css({display:"none"});$(".objecty").css({display:"none"});Resizer.rescaleUIElements()},processSpecificOperations:function(n,t){var i=n.proto.name;switch(i){case BUTTON:case SIGNIN:case STORE_CATEGORIES:ViewerFactory.calculateButtonLineHeight(n.getUISelector());break;case HOUSE_PHOTO_TOUR:n.children.length>0&&ViewerFactory.housePhotoTourRerender(n);break;case MENU:ViewerFactory.calculateMenuLineHeight(n,"#"+t[0].id);break;case STORE_GALLERY:EditorFactory.recalculateStoreGallerySize(n);break;case GALLERY:ViewerFactory.calculateMarginForGallery(n,"#"+t[0].id);ViewerFactory.calculateHeightForGallery(n,"#"+t[0].id);break;case LIST:ViewerFactory.calculateHeightForList(n,"#"+t[0].id);break;case FORM:ViewerFactory.calculateFormMinSize(n,t)}},rescaleSelectWrapper:function(){n.hasClass("std-component-fixed")?$(UI.getConfigurationValue(SELECT_WRAPPER)).css(ViewerFactory.getFixedLocationPosition(i,!0)):$(UI.getConfigurationValue(SELECT_WRAPPER)).css({top:n.offset().top+"px",left:n.offset().left+"px"});$(UI.getConfigurationValue(SELECT_WRAPPER)).css({width:n.outerWidth()+"px",height:n.outerHeight()+"px"});StretcherFactory.updateComponentWrapper(i);Resizer.rescaleUIElements()},checkListMinWidth:function(t){if(n.hasClass("std-list")&&n.find(".item").length!=0){var i=parseInt(n.find(".item").css("min-width"));if(t<i)return i}return t},calcLimitedDY:function(t,i){var a=i.clientX,l=i.clientY,r=l-u.initialY,o=Resizer.findBasicContainer(n[0]),f=0,e=Resizer.additionalOffsetFromParent(n[0]),s,h,c;return o!=null?f=o.offsetHeight:(s=n.offsetParent(),f=s.length?s[0].offsetHeight:0),t?(h=u.initialTop+r,h+e<0&&!n.hasClass(STD_COMPONENT_FIXED)?-(e+u.initialTop):r):(c=u.initialHeight+r,c+u.initialTop+e>f&&!$(o).hasClass("footer")?f-e-u.initialTop-u.initialHeight:r)},calcLimitedDX:function(t,i){var c=i.clientX,r=c-u.initialX,o=Resizer.findBasicContainer(n[0]),e=0,f=Resizer.additionalOffsetFromParent(n[0]),s,h;return o!=null&&(e=o.offsetWidth),t?(s=u.initialLeft+r,s+f<0?-(f+u.initialLeft):r):(h=u.initialWidth+r,h+u.initialLeft+f>e?e-f-u.initialLeft-u.initialWidth:r)},mouseMove:{topHandle:function(t){function l(){if(r>=o){if(a&&!v){var t=parseInt(r*u.initialScale);n.width(t)}n.hasClass(STD_COMPONENT_FIXED)||(n.css(TOP,s),i.setProperty(TOP,s));n.outerHeight(r);i.setProperty("height",r+"px");f.rescaleSelectWrapper();f.processSpecificOperations(i,n)}}var s,h;console.log("tophandle");Helpers.clearAllSelection();var y=t.clientX,p=t.clientY,a=n.find("img").hasClass("std-img"),w=n.hasClass("std-menu"),v=StretcherFactory.getCurrentStretchStatus(i),e=f.calcLimitedDY(!0,t),o=parseInt(n.css("min-height")),r=u.initialHeight-e,c=0;r<o&&(c=o-r,r=o);s=u.initialTop+e-c+"px";l();h=Resizer.drawRulers(n,"t",0,n[0].offsetTop);h.Top!=0&&(s=u.initialTop+e+h.Top+"px",r=u.initialHeight-e-h.Top,l())},bottomHandle:function(t){function s(){if(r>=e){if(c&&!a){var t=parseInt(r*u.initialScale);n.width(t);i.setProperty("width",t+"px")}l?n.height(r):n.outerHeight(r);i.setProperty("height",r+"px");f.rescaleSelectWrapper();f.processSpecificOperations(i,n)}$(n).parent().hasClass("footer")&&Resizer.resizeFooterContainer(n[0],$(".footer")[0])}var o;Helpers.clearAllSelection();console.log("bottomhandle");var y=t.clientX,h=t.clientY,c=n.find("img").hasClass("std-img"),l=n.hasClass("std-menu"),a=StretcherFactory.getCurrentStretchStatus(i),v=f.calcLimitedDY(!1,t),e=parseInt(n.css("min-height")),r=u.initialHeight+v;r<e&&(r=e);s();o=Resizer.drawRulers(n,"b");o.Top!=0&&(r=u.initialHeight+(h-u.initialY)+o.Top,s())},rightHandle:function(t){function h(){if(r>=e&&Resizer.checkMinMaxWidth(n[0],r)){if(l){var t=parseInt(r/u.initialScale);n.height(t);i.setProperty("height",t+"px")}r=f.checkListMinWidth(r);a?setWidthMenuComponent(r,_checkItem=!0,$(n).children().children().children()):setWidthMenuComponent(r,_checkItem=!1,$(n).children().children().children());n.outerWidth(r);i.setProperty("width",r+"px");f.rescaleSelectWrapper();f.processSpecificOperations(i,n)}}var o;Helpers.clearAllSelection();console.log("righthandle");var c=t.clientX,v=t.clientY,s=c-u.initialX,l=n.find("img").hasClass("std-img"),y=n.hasClass("std-headertext")||n.hasClass("std-paragraph"),e=parseInt(n.css("min-width")),r=u.initialWidth+s,a=$(n).children().hasClass("vertical");r<e&&(r=e);h();o=Resizer.drawRulers(n,"r",n[0].offsetLeft);o.Left!=0&&(r=u.initialWidth+s+o.Left,h())},leftHandle:function(t){function l(){if(r>=o&&Resizer.checkMinMaxWidth(n[0],r)){if(v){var t=parseInt(r/u.initialScale);n.height(t);i.setProperty("height",t+"px")}r=f.checkListMinWidth(r);n.hasClass(STD_COMPONENT_FIXED)||(n.css(LEFT,h),i.setProperty(LEFT,h));y?setWidthMenuComponent(r,_checkItem=!0,$(n).children().children().children()):setWidthMenuComponent(r,_checkItem=!1,$(n).children().children().children());n.outerWidth(r);i.setProperty("width",r+"px");f.rescaleSelectWrapper();f.processSpecificOperations(i,n)}}var s;Helpers.clearAllSelection();console.log("lefthandle");var a=t.clientX,p=t.clientY,e=a-u.initialX,o=parseInt(n.css("min-width")),r=u.initialWidth-e,c=0;r<o&&(c=o-r,r=o);var h=u.initialLeft+e-c+"px",v=n.find("img").hasClass("std-img"),w=n.hasClass("std-headertext")||n.hasClass("std-paragraph"),y=$(n).children().hasClass("vertical");l();s=Resizer.drawRulers(n,"l",n[0].offsetLeft,0);s.Left!=0&&(r=u.initialWidth-e-s.Left,h=u.initialLeft+e+s.Left+"px",l())},topLeftHandle:function(t){function w(){e>=l&&(n.hasClass(STD_COMPONENT_FIXED)||(n.css(TOP,v),i.setProperty(TOP,v)),n.outerHeight(e),i.setProperty(HEIGHT,e+"px"),f.rescaleSelectWrapper(),f.processSpecificOperations(i,n));r>=c&&Resizer.checkMinMaxWidth(n[0],r)&&(n.hasClass(STD_COMPONENT_FIXED)||(n.css("left",y),i.setProperty("left",y)),i.proto.name==MENU&&(k?setWidthMenuComponent(r,_checkItem=!0,$(n).children().children().children()):setWidthMenuComponent(r,_checkItem=!1,$(n).children().children().children())),n.outerWidth(r),i.setProperty("width",r+"px"),f.rescaleSelectWrapper(),f.processSpecificOperations(i,n))}var a,o;Helpers.clearAllSelection();console.log("toleftphandle");var b=t.clientX,d=t.clientY,s=f.calcLimitedDY(!0,t),h=b-u.initialX,g=n.find("img").hasClass("std-img"),nt=n.hasClass("std-menu"),c=parseInt(n.css("min-width")),l=parseInt(n.css("min-height")),e=u.initialHeight-s,r=u.initialWidth-h,p=0;r<c&&(p=c-r,r=c);a=0;e<l&&(a=l-e,e=l);var v=u.initialTop+s-a+"px",y=u.initialLeft+h-p+"px",k=$(n).children().hasClass("vertical");w();o=Resizer.drawRulers(n,"tl",n[0].offsetLeft,n[0].offsetTop);(o.Left!=0||o.Top!=0)&&(v=u.initialTop+s+o.Top+"px",e=u.initialHeight-s-o.Top,y=u.initialLeft+h+o.Left+"px",r=u.initialWidth-h-o.Left,w())},topRightHandle:function(t){function y(){e>=c&&(n.hasClass(STD_COMPONENT_FIXED)||(n.css(TOP,a),i.setProperty(TOP,a)),n.outerHeight(e),i.setProperty(HEIGHT,e+"px"),f.rescaleSelectWrapper(),f.processSpecificOperations(i,n));r>=h&&Resizer.checkMinMaxWidth(n[0],r)&&(i.proto.name==MENU&&(b?setWidthMenuComponent(r,_checkItem=!0,$(n).children().children().children()):setWidthMenuComponent(r,_checkItem=!1,$(n).children().children().children())),n.outerWidth(r),i.setProperty("width",r+"px"),f.rescaleSelectWrapper(),f.processSpecificOperations(i,n))}var l,o;Helpers.clearAllSelection();console.log("torightphandle");var p=t.clientX,k=t.clientY,s=f.calcLimitedDY(!0,t),v=p-u.initialX,h=parseInt(n.css("min-width")),c=parseInt(n.css("min-height")),e=u.initialHeight-s,r=u.initialWidth+v,w=0;r<h&&(w=h-r,r=h);l=0;e<c&&(l=c-e,e=c);var a=u.initialTop+s-l+"px",d=n.hasClass("std-menu"),b=$(n).children().hasClass("vertical");y();o=Resizer.drawRulers(n,"tr",n[0].offsetLeft,n[0].offsetTop);(o.Left!=0||o.Top!=0)&&(a=u.initialTop+s+o.Top+"px",e=u.initialHeight-s-o.Top,r=u.initialWidth+v+o.Left,y())},bottomRightHandle:function(t){function y(){r>=s&&Resizer.checkMinMaxWidth(n[0],r)&&(i.proto.name==MENU&&(v?setWidthMenuComponent(r,_checkItem=!0,$(n).children().children().children()):setWidthMenuComponent(r,_checkItem=!1,$(n).children().children().children())),n.outerWidth(r),i.setProperty("width",r+"px"),f.rescaleSelectWrapper(),f.processSpecificOperations(i,n));e>=h&&(n.outerHeight(e),i.setProperty("height",e+"px"),f.rescaleSelectWrapper(),f.processSpecificOperations(i,n));$(n).parent().hasClass("footer")&&Resizer.resizeFooterContainer(n[0],$(".footer")[0])}var a,v,o;Helpers.clearAllSelection();console.log("bottomrightphandle");var p=t.clientX,b=t.clientY,c=p-u.initialX,l=f.calcLimitedDY(!1,t),k=l>c,d=n.find("img").hasClass("std-img"),g=n.hasClass("std-menu"),s=parseInt(n.css("min-width")),h=parseInt(n.css("min-height")),r=u.initialWidth+c,e=u.initialHeight+l,w=0;r<s&&(w=s-r,r=s);a=0;e<h&&(a=h-e,e=h);v=$(n).children().hasClass("vertical");y();o=Resizer.drawRulers(n,"br",n[0].offsetLeft,n[0].offsetTop);(o.Left!=0||o.Top!=0)&&(r=u.initialWidth+c+o.Left,e=u.initialHeight+l+o.Top,y())},bottomLeftHandle:function(t){function y(){e>=c&&(n.outerHeight(e),k?n.height(e):n.outerHeight(e),i.setProperty("height",e+"px"),f.rescaleSelectWrapper(),f.processSpecificOperations(i,n));r>=h&&Resizer.checkMinMaxWidth(n[0],r)&&(n.hasClass(STD_COMPONENT_FIXED)||(n.css(LEFT,l),i.setProperty(LEFT,l)),i.proto.name==MENU&&(d?setWidthMenuComponent(r,_checkItem=!0,$(n).children().children().children()):setWidthMenuComponent(r,_checkItem=!1,$(n).children().children().children())),n.outerWidth(r),i.setProperty("width",r+"px"),f.rescaleSelectWrapper(),f.processSpecificOperations(i,n));$(n).parent().hasClass("footer")&&Resizer.resizeFooterContainer(n[0],$(".footer")[0])}var v,o;Helpers.clearAllSelection();console.log("bottomleftphandle");var p=t.clientX,w=t.clientY,s=p-u.initialX,b=f.calcLimitedDY(!1,t),h=parseInt(n.css("min-width")),c=parseInt(n.css("min-height")),r=u.initialWidth-s,e=u.initialHeight+b,a=0;r<h&&(a=h-r,r=h);v=0;e<c&&(v=c-e,e=c);var l=u.initialLeft+s-a+"px",k=n.hasClass("std-menu"),d=$(n).children().hasClass("vertical");y();o=Resizer.drawRulers(n,"bl",n[0].offsetLeft,n[0].offsetTop);(o.Left!=0||o.Top!=0)&&(r=u.initialWidth-s-o.Left,e=u.initialHeight+(w-u.initialY)+o.Top,l=u.initialLeft+s+o.Left+"px",y())}}};$(".resizer.bottom").bind("mousedown",function(n){console.log(".resizer.bottom");f.mouseDownEvent(n);PopoverHelper.hidePopovers();u.getCurrent(n);$(document).on("mousemove",f.mouseMove.bottomHandle);$(document).on("mouseup",f.mouseUpEvent)});$(".resizer.top").bind("mousedown",function(n){console.log(".resizer.top");f.mouseDownEvent(n);PopoverHelper.hidePopovers();u.getCurrent(n);$(document).on("mousemove",f.mouseMove.topHandle);$(document).on("mouseup",f.mouseUpEvent)});$(".resizer.right").bind("mousedown",function(n){console.log(".resizer.right");f.mouseDownEvent(n);PopoverHelper.hidePopovers();u.getCurrent(n);$(document).on("mousemove",f.mouseMove.rightHandle);$(document).on("mouseup",f.mouseUpEvent)});$(".resizer.left").bind("mousedown",function(n){console.log(".resizer.left");f.mouseDownEvent(n);PopoverHelper.hidePopovers();u.getCurrent(n);$(document).on("mousemove",f.mouseMove.leftHandle);$(document).on("mouseup",f.mouseUpEvent)});$(".resizer.top-left").bind("mousedown",function(n){console.log(".resizer.top-left");f.mouseDownEvent(n);PopoverHelper.hidePopovers();u.getCurrent(n);$(document).on("mousemove",f.mouseMove.topLeftHandle);$(document).on("mouseup",f.mouseUpEvent)});$(".resizer.top-right").bind("mousedown",function(n){console.log(".resizer.top-right");f.mouseDownEvent(n);PopoverHelper.hidePopovers();u.getCurrent(n);$(document).on("mousemove",f.mouseMove.topRightHandle);$(document).on("mouseup",f.mouseUpEvent)});$(".resizer.bottom-right").bind("mousedown",function(n){console.log(".resizer.bottom-right");f.mouseDownEvent(n);PopoverHelper.hidePopovers();u.getCurrent(n);$(document).on("mousemove",f.mouseMove.bottomRightHandle);$(document).on("mouseup",f.mouseUpEvent)});$(".resizer.bottom-left").bind("mousedown",function(n){console.log(".resizer.bottom-left");f.mouseDownEvent(n);PopoverHelper.hidePopovers();u.getCurrent(n);$(document).on("mousemove",f.mouseMove.bottomLeftHandle);$(document).on("mouseup",f.mouseUpEvent)});$("."+SELECT_WRAPPER_MENU+" .move-to-footer").bind("click",function(){Dock.unconditionalElementDocking(n,$(".footer"),!1);dragDrop.startY=dragDrop.draggedObject.offsetTop;dragDrop.dYKeys=0});$("."+SELECT_WRAPPER_MENU+" .move-to-page").bind("click",function(){Dock.unconditionalElementDocking(n,$("#"+UI.pager.getCurrentPageId()),!1);Resizer.checkMinSizePageContainer($("#"+UI.pager.getCurrentPageId())[0]);dragDrop.startY=dragDrop.draggedObject.offsetTop;dragDrop.dYKeys=0});$("."+SELECT_WRAPPER_MENU+" .move-to-page-up").bind("click",function(){Dock.unconditionalElementDocking(n,$("#"+UI.pager.getCurrentPageId()),!0);Resizer.checkMinSizePageContainer($("#"+UI.pager.getCurrentPageId())[0]);dragDrop.startY=dragDrop.draggedObject.offsetTop;dragDrop.dYKeys=0});$("."+SELECT_WRAPPER_MENU+" .move-to-header").bind("click",function(){Dock.unconditionalElementDocking(n,$(".header"),!0);Resizer.checkMinSizeHeaderContainer($(".header")[0]);dragDrop.startY=dragDrop.draggedObject.offsetTop;dragDrop.dYKeys=0});$("."+SELECT_WRAPPER_MENU+" .edit-component").bind("click",ht);!$("."+SELECT_WRAPPER_MENU+" .edit-component").length||ut||ft||($(n).off("dblclick"),$(n).bind("dblclick",ht));$("."+SELECT_WRAPPER_MENU+" .delete-component").bind("click",function(n){n.stopPropagation();clipBoard.deleteComponent()});$("."+SELECT_WRAPPER_MENU+" .inherit-property-text").bind("click",function(n){n.stopPropagation();var r=i.getProperty(TEXT),t=UI.devices.where({type:DEVICE_MOBILE_TYPE}).firstOrDefault();t&&(i.setProperty(TEXT,r.value,!0,t.getId()),$(i.getUISelector()).highlightSelectedElement(i,!0))});$("."+SELECT_WRAPPER_MENU+" .edit-text").bind("click",function(t){t.stopPropagation();var r=i.getProperty(HIDE_COMPONENT);UI.isckeditorworking==!0||r!=null&&r.value.toBoolean()||(i.isckeditorworking=!0,$(n).attr("contenteditable","true"),UI.callEditor(i),UI.isckeditorworking=!0)});$("."+SELECT_WRAPPER_MENU+" .preview-enable").bind("click",function(n){n.stopPropagation();UI.actionService.runActionForComponent(i,ACTION_REMOVE_FROM_FORM,!0);i.isPreviewEnabled=!0;UI.actionService.runActionForComponent(i,ACTION_ADD_TO_FORM,!0);$(i.getUISelector()).highlightSelectedElement(i,!0)});$("."+SELECT_WRAPPER_MENU+" .preview-disable").bind("click",function(n){n.stopPropagation();UI.actionService.runActionForComponent(i,ACTION_REMOVE_FROM_FORM,!0);i.isPreviewEnabled=!1;UI.actionService.runActionForComponent(i,ACTION_ADD_TO_FORM,!0);$(i.getUISelector()).highlightSelectedElement(i,!0)});$("."+SELECT_WRAPPER_MENU+" .form-manage-mails").bind("click",function(n){n.stopPropagation();UI.componentService.addModalContentToForm(null,MANAGE_MAILS_COMPONENT,{controlId:i.id})});$("."+SELECT_WRAPPER_MENU+" .image-stretching-toggle").bind("click",function(n){n.stopPropagation();var t=n.currentTarget.dataset.value;UI.undoManagerAddSimple(i,IMAGE_STRETCHING,t,function(n,t){UI.actionService.runActionForComponent(t,ACTION_REMOVE_FROM_FORM,!0);UI.actionService.runActionForComponent(t,ACTION_ADD_TO_FORM,!0);$(t.getUISelector()).highlightSelectedElement(t,!0)},!0)});$("."+SELECT_WRAPPER_MENU+" .hide-component").bind("click",function(n){clipBoard.toggleShowHideComponent({},n,!0)});$(".resizer.show-component").bind("click",function(n){clipBoard.toggleShowHideComponent({},n,!0)});$(".resizer.show-component").bind("mouseenter",function(){$(n).addClass("editor-blur")});$(".resizer.show-component").bind("mouseleave",function(){$(n).removeClass("editor-blur")})};Resizer.groupBind=function(){function i(){dragDrop.draggedObject!=null&&(dragDrop.startY=dragDrop.draggedObject.offsetTop);dragDrop.dYKeys=0;Resizer.groupBind();ko.utils.arrayForEach(grouping.selectedItems(),function(n){var t=$(n);t.mousemove(function(){var n=$(this);n.data("selected",!0);n.hasClass("std-component-fixed")||n.addClass("drag");grouping.ctrlIsPressed&&(n.data("selected",!1),n.removeClass("drag"))});t.mouseleave(function(){var n=$(this);n.data("selected",!1);n.removeClass("drag")})})}var t=$("."+GROUP_WRAPPER+"."+GROUP_WRAPPER_OUTER),n={footer:!1,header:!1,page:!1,pageup:!1,hideShow:!0,deleteAll:!0};ko.utils.arrayForEach(grouping.selectedItems(),function(t){var r=$(t),i=Resizer.findBasicContainer(r[0]),e=0,u=0,f,o;i!=null&&(u=Resizer.cumulativeTopOffset(i),e=u+i.offsetHeight);f=Resizer.cumulativeTopOffset(r[0]);o=r[0].clientHeight+f;e+25>o&&e-25<o&&!$(i).hasClass("footer")&&($(i).hasClass("page")?n.footer=!0:$(i).hasClass("header")&&(n.page=!0));u+25>f&&u-25<f&&!$(i).hasClass("header")&&($(i).hasClass("page")?n.header=!0:$(i).hasClass("footer")&&(n.pageup=!0));(r.hasClass("std-form-subcomponent")||r.hasClass("std-store-cart")||r.hasClass("std-store-product")||r.hasClass("std-store-thank-you"))&&(n.footer=!1,n.page=!1,n.header=!1,n.pageup=!1,n.hideShow=!1,n.deleteAll=!1)});UI.getDevice().isDesktop()&&(n.footer&&t.find("."+GROUP_WRAPPER_MENU).append('<li class="move-to-footer"><i class="fa fa-lg fa-chevron-down" title="Move group to Footer"><\/i><\/li>'),n.page&&t.find("."+GROUP_WRAPPER_MENU).append('<li class="move-to-page"><i class="fa fa-lg fa-chevron-down" title="Move group to Page"><\/i><\/li>'),n.header&&t.find("."+GROUP_WRAPPER_MENU).append('<li class="move-to-header"><i class="fa fa-lg fa-chevron-up" title="Move group to Header"><\/i><\/li>'),n.pageup&&t.find("."+GROUP_WRAPPER_MENU).append('<li class="move-to-page-up"><i class="fa fa-lg fa-chevron-up" title="Move group to Page"><\/i><\/li>'));n.hideShow&&(t.find("."+GROUP_WRAPPER_MENU).removeClass("stretched"),StretcherFactory.checkOneOfSelectedElementsStretched()&&t.find("."+GROUP_WRAPPER_MENU).addClass("stretched"),t.find("."+GROUP_WRAPPER_MENU).append('<li class="show-component"><i class="fa fa-lg fa-eye" title="Show component"><\/i><\/li>'),t.find("."+GROUP_WRAPPER_MENU).append('<li class="hide-component"><i class="fa fa-lg fa-eye-slash" title="Hide component"><\/i><\/li>'));n.deleteAll&&UI.getDevice().isDesktop()&&t.find("."+GROUP_WRAPPER_MENU).append('<li class="delete-component" title="Delete Components"><i class="fa fa-lg fa-ban"><\/i><\/li>');$("."+GROUP_WRAPPER_MENU+" .move-to-footer").bind("click",function(){var n=Grouping.getGroupFullOffset();ko.utils.arrayForEach(grouping.selectedItems(),function(t){var i=t.offsetTop-n.offsetY,r={groupHeight:n.groupHeight,offsetY:i,moveup:!1};Dock.unconditionalElementDocking($(t),$(".footer"),!1,!0,r)});i()});$("."+GROUP_WRAPPER_MENU+" .move-to-page").bind("click",function(){var n=Grouping.getGroupFullOffset();ko.utils.arrayForEach(grouping.selectedItems(),function(t){var i=t.offsetTop-n.offsetY,r={groupHeight:n.groupHeight,offsetY:i,moveup:!1};Dock.unconditionalElementDocking($(t),$("#"+UI.pager.getCurrentPageId()),!1,!0,r)});Resizer.checkMinSizePageContainer($("#"+UI.pager.getCurrentPageId())[0]);i()});$("."+GROUP_WRAPPER_MENU+" .move-to-page-up").bind("click",function(){var n=Grouping.getGroupFullOffset();ko.utils.arrayForEach(grouping.selectedItems(),function(t){var i=t.offsetTop-n.offsetY,r={groupHeight:n.groupHeight,offsetY:i,moveup:!0};Dock.unconditionalElementDocking($(t),$("#"+UI.pager.getCurrentPageId()),!0,!0,r)});Resizer.checkMinSizePageContainer($("#"+UI.pager.getCurrentPageId())[0]);i()});$("."+GROUP_WRAPPER_MENU+" .move-to-header").bind("click",function(){var n=Grouping.getGroupFullOffset();ko.utils.arrayForEach(grouping.selectedItems(),function(t){var i=t.offsetTop-n.offsetY,r={groupHeight:n.groupHeight,offsetY:i,moveup:!0};Dock.unconditionalElementDocking($(t),$(".header"),!0,!0,r)});Resizer.checkMinSizeHeaderContainer($(".header")[0]);i()});$("."+GROUP_WRAPPER_MENU+" .hide-component").bind("click",function(){Grouping.showOrHideGroupSelectedComponents(!0)});$("."+GROUP_WRAPPER_MENU+" .show-component").bind("click",function(){Grouping.showOrHideGroupSelectedComponents()});$("."+GROUP_WRAPPER_MENU+" .delete-component").bind("click",function(n){n.stopPropagation();clipBoard.deleteComponent()})};Resizer.cumulativeTopOffset=function(n){var t=0;do{if($(n).hasClass("body"))break;t+=n.offsetTop||0;n=n.offsetParent}while(n);return t};Resizer.rescaleUIElements=function(){$(".resizer.show-component i").bigText()};MediaService=function(){var n=this,t=[];n.addLeavePageEvent=function(){};n.startPlayVideoOnPage=function(i){return n.stopAllMedia(),UI.getSetting("ispreview")&&$(t).each(function(){var t=this,r,u;if((t.location==i||t.location=="header"||t.location=="footer")&&(r=$(t.element).parent().attr("data-autoplay"),(r=="True"||r=="true"||r=="1")&&t.isStdMedia))return u=100,t.pause>0&&(u=t.pause*1e3),setTimeout(function(){n.playMedia(t)},u),!1}),!1};n.getMediaThatMustPlayNext=function(){var n=null;return $(t).each(function(){if(this.location=="header"||this.location=="footer"){var t=$(this.element).parent().attr("data-autoplay");(t=="True"||t=="true"||t=="1")&&this.isStdMedia&&n==null&&(n=this)}}),n};n.getMediaCount=function(){return t.where({type:"vimeo"}).length};n.playMedia=function(t){if(t.location!=UI.pager.getCurrentPageId()&&t.location!="header"&&t.location!="footer")return console.log("media.js -> playMedia: video was stopped (page != initial page)"),!1;if(t.type=="youtube")t.player!=null&&t.player.playVideo?(console.log("playMedia executed"),t.player.playVideo()):(setTimeout(function(){n.playMedia(t)},100),console.log("media id "+t.element.id+" don't have function playVideo()"));else if(t.type=="vimeo")if(n.vimeoPlayersReadyCount>=n.getMediaCount()){var i=t.player;i.api("play")}else setTimeout(function(){n.playMedia(t)},100),console.log("vimeo media id "+t.element.id+" not ready");else t.type=="jplayer"?$("#"+t.element.id).jPlayer!==undefined&&setTimeout(function(){n.actionJPlayer(t.element,"play")},100):t.type=="soundcloud"&&(t.player!=null&&t.player.play?(console.log("soundcloud media is played"),t.player.play()):(setTimeout(function(){n.playMedia(t)},100),console.log("soundcloud media id "+t.element.id+" not ready")))};n.stopAllMedia=function(i,r){for(var f,u=0;u<t.length;u++)n.getMediaThatMustPlayNext()!=t[u]&&(t[u].type=="youtube"?(r==undefined||t[u].player.c.id!=r)&&(t[u].player&&t[u].player.stopVideo?t[u].player.stopVideo():console.log("video id "+t[u].element.id+" don't have function stopVideo()")):t[u].type=="vimeo"&&i!="vimeo"?(f=$f(t[u].element),f.api("pause")):t[u].type=="soundcloud"?(r==undefined||r!=$(t[u].element).parent().attr("id"))&&t[u].player&&t[u].player.pause():t[u].type=="jplayer"&&(r==undefined||t[u].element.id!=r)&&n.actionJPlayer(t[u].element,"pause"))};n.onVimeoIframeAPIReady=function(i){var r=i.element.offsetParent?i.element.offsetParent:i.element.parentNode;$("#"+r.id).data("isevented")!="true"&&i.addEvent("ready",function(){var i,r;for(n.vimeoPlayersReadyCount+=1,i=0;i<t.length;i++)if(t[i].type=="vimeo")try{r=$f(t[i].element);r.addEvent("play",n.onPlayVimeo)}catch(e){}});$("#"+r.id).data("isevented","true")};n.onYouTubeIframeAPIReady=function(){typeof YT=="undefined"||typeof YT.Player=="undefined"?(window.onYouTubePlayerAPIReady=function(){UI.MediaService.youTubePlayerAPIReady()},$.getScript("//www.youtube.com/player_api")):n.youTubePlayerAPIReady()};n.youTubePlayerAPIReady=function(){$(t).each(function(i){var r=t[i],u;r.type=="youtube"&&r.player==null&&(u=new YT.Player(r.element,{events:{onStateChange:n.onPlayerStateChange}}),r.player=u,t[i]=r)})};n.soundCloudWidgetReady=function(n,i){var r=t[n];r.player=i;t[n]=r};n.soundCloudPlayerAPIReady=function(){$(t).each(function(i){var r=t[i],u;r.type=="soundcloud"&&r.player==null&&(u=new SC.Widget(r.element),u.bind(SC.Widget.Events.READY,function(){n.soundCloudWidgetReady(i,u)}),u.bind(SC.Widget.Events.PLAY,function(){n.onPlaySoundCloudPlayer(r)}))})};n.onSoundCloudIframeAPIReady=function(){typeof SC=="undefined"?(window.onSoundCloudPlayerAPIReady=function(){UI.MediaService.soundCloudPlayerAPIReady()},$.getScript("https://w.soundcloud.com/player/api.js").then(function(){n.soundCloudPlayerAPIReady()})):n.soundCloudPlayerAPIReady()};n.onPlayerStateChange=function(t){if(t.data==YT.PlayerState.PAUSED,t.data==YT.PlayerState.PLAYING){var i=t.target.c.id;n.stopAllMedia("youtube",t.target.c.id)}};n.onPlayVimeo=function(){n.stopAllMedia("vimeo","0")};n.onPlaySoundCloudPlayer=function(t){var i=t.element.offsetParent.id;n.stopAllMedia("soundcloud",i)};n.actionJPlayer=function(t,i){$("#"+t.id).jPlayer!=undefined&&($("#"+t.id).data("ready")=="true"?$("#"+t.id).jPlayer(i):setTimeout(function(){n.actionJPlayer(t,i)},100))};n.getPageFromClass=function(n,t){var i,r;return $(t).closest(".header").length>0?i="header":$(t).closest(".footer").length>0?i="footer":(r=$(t).closest(".page"),r!=null&&(i=r[0].id)),i};n.pushIFrame=function(i,r,u,f){var c=t.where({element:i}),o={element:i,type:r,location:u,player:null,isStdMedia:f,pause:0},s,h,e;if(c.length==0){if(r=="vimeo"){s=$f(i);o.player=s;n.onVimeoIframeAPIReady(s)}r=="jplayer"&&(h=$("#"+i.id),o.pause=$("#"+h.data("controlid")).data("pause"),h.bind($.jPlayer.event.play,function(t){n.stopAllMedia("jplayer",t.currentTarget.id)}));t.push(o);f||(e=$(i).attr("src"),e=e.replace("autoplay=1","autoplay=0"),$(i).attr("src",e))}};n.manageMedia=function(){n.vimeoPlayersReadyCount=0;var r=$(".body").children(),i;r.each(function(){i=this;$($(this).find('iframe[src*="youtube.com"]')).each(function(){var t=$(this).parent().hasClass("std-video");n.pushIFrame(this,"youtube",n.getPageFromClass(i,this),t)});$($(this).find('iframe[src*="vimeo.com"]')).each(function(){var t=$(this).parent().hasClass("std-video");n.pushIFrame(this,"vimeo",n.getPageFromClass(i,this),t)});$($(this).find('iframe[src*="soundcloud.com"]')).each(function(){var t=$(this).parent().hasClass("std-sound");n.pushIFrame(this,"soundcloud",n.getPageFromClass(i,this),t)});$($(this).find(".jp-jplayer")).each(function(){n.pushIFrame(this,"jplayer",n.getPageFromClass(i,this),!0)})});t.sort(function(n,t){var i=[],r,u;return(i.header=1,i.footer=3,r=i[n.location]||2,u=i[t.location]||2,r<u)?-1:r>u?1:0});n.onYouTubeIframeAPIReady();n.onSoundCloudIframeAPIReady();UI.getSetting("ispreview")||n.stopAllMedia()}};dragDrop={keySpeed:1,initialMouseX:undefined,initialMouseY:undefined,startX:undefined,startY:undefined,dXKeys:undefined,dYKeys:undefined,draggedObject:undefined,groupDragging:!1,releasesCountAfterDrag:0,initElement:function(n){typeof n=="string"&&(n=document.getElementById(n));n.onmousedown=dragDrop.startDragMouse;n.onclick=dragDrop.startDragKeys;$(n).addClass("drag")},startDragMouse:function(n){if((console.log("startDragMouse"),$(this).data("focusManagerInstance")!=null)||grouping.ctrlIsPressed)return n.preventDefault(),n.stopPropagation(),!1;if(n.stopPropagation(),$(this).attr("contenteditable")!="true"){dragDrop.startDrag(this);var t=n||window.event;return dragDrop.initialMouseX=t.clientX,dragDrop.initialMouseY=t.clientY,addEventSimple(document,"mousemove",dragDrop.dragMouse),addEventSimple(document,"mouseup",dragDrop.releaseElement),!1}},groupingDragKeys:function(){Grouping.isActive()&&(ko.utils.arrayForEach(grouping.selectedItems(),function(n){return $(n).data("startx",n.style.left),$(n).data("starty",n.style.top),$(n).data("focusManagerInstance")!=null||$(n).attr("contenteditable")=="true"?(e.preventDefault(),e.stopPropagation(),!1):void 0}),addEventSimple(document,"keydown",dragDrop.dragKeys),addEventSimple(document,"keypress",dragDrop.switchKeyEvents),dragDrop.dXKeys=dragDrop.dYKeys=0)},startDragKeys:function(){return $(this).data("focusManagerInstance")!=null?(e.preventDefault(),e.stopPropagation(),!1):$(this).attr("contenteditable")!="true"?(dragDrop.startDrag(this),dragDrop.dXKeys=dragDrop.dYKeys=0,addEventSimple(document,"keydown",dragDrop.dragKeys),addEventSimple(document,"keypress",dragDrop.switchKeyEvents),this.blur(),!1):void 0},startDrag:function(n){var t,i,r,u;for(name in CKEDITOR.instances)if(CKEDITOR.instances.hasOwnProperty(name)&&(t=CKEDITOR.document.getById(name),t&&t.$.isContentEditable&&t.$.contentEditable=="true"&&(i=$(t.$).data("focusManagerInstance"),i!=null)))if(n.id!==name)i.blur();else return!1;$("#"+n.id).attr("contenteditable")!="true"&&(console.log("startDrag"),dragDrop.draggedObject||$("#"+n.id).data("selected")||UI.removeEditor(),dragDrop.draggedObject&&dragDrop.draggedObject.id!==n.id&&(dragDrop.releaseElement(),UI.removeEditor()),dragDrop.startX=n.offsetLeft,dragDrop.startY=n.offsetTop,dragDrop.draggedObject=n,r=UI.siteComponentRepository.lookupData({id:$(n).getId()}),u=StretcherFactory.getCurrentStretchStatus(r),!u,$(n).data("startx",n.style.left),$(n).data("starty",n.style.top));Grouping.isActive()&&ko.utils.arrayForEach(grouping.selectedItems(),function(n){$(n).data("startx",n.style.left);$(n).data("starty",n.style.top)})},dragMouse:function(n){var e,a,v,r,u,l;dragDrop.releasesCountAfterDrag=0;for(name in CKEDITOR.instances)if(CKEDITOR.instances.hasOwnProperty(name)&&(e=CKEDITOR.document.getById(name),e&&e.$.isContentEditable&&e.$.contentEditable=="true"&&(a=$(e.$).data("focusManagerInstance"),a!=null)))return a.focus(),n.preventDefault(),n.stopPropagation(),!1;PopoverHelper.hidePopovers();ColorPickerHelper.hide();var d=n||window.event,i=d.clientX-dragDrop.initialMouseX,t=d.clientY-dragDrop.initialMouseY;console.log("dragMouse "+i+" "+t);v=Math.sqrt(i*i+t*t);console.log("dragMouse "+i+" "+t+" ("+v+")");dragDrop.groupDragging=Grouping.isActive()&&v>1?!0:!1;r=[];Grouping.isActive()?ko.utils.arrayForEach(grouping.selectedItems(),function(n){r.push(n)}):r.push(dragDrop.draggedObject);var y=Resizer.findBasicContainer(dragDrop.draggedObject),p=0,g=0,h=Resizer.additionalOffsetFromParent(dragDrop.draggedObject);for(y!=null&&(p=y.offsetHeight,g=y.offsetWidth),u=r.length-1;u>=0;u--){var f=parseInt($(r[u]).data("starty")),c=parseInt($(r[u]).data("startx")),w=f+t+r[u].offsetHeight,nt=c+i+r[u].offsetWidth;w+h>p&&(t=t-w+p-h);f+t+h<0&&(t=-(f+h));var o=r[u].offsetParent,b=0,k=0,s=0;o!=null&&(b=o.offsetHeight,k=o.offsetWidth,s=parseInt($(o).css("border-top-width"))*2);$(o).hasClass("std-form")&&(w>b-s&&(t=b-r[u].offsetHeight-f-s),f+t<0&&(t=-f),nt>k-s&&(i=k-r[u].offsetWidth-c-s),c+i<0&&(i=-c))}return Grouping.isActive()?(ko.utils.arrayForEach(grouping.selectedItems(),function(n){dragDrop.setElementPosition(n,i,t,parseInt($(n).data("startx")),parseInt($(n).data("starty")))}),Grouping.wrap()):(dragDrop.setPosition(i,t),UI.getDevice().isDesktop()&&$(dragDrop.draggedObject).findUnderlyingDockableElement(),l=$("#"+$(UI.getConfigurationValue(DOCK_WRAPPER)).data("for")),l.selector!="#undefined"&&l.hasClass("footer")&&$(dragDrop.draggedObject.parentElement).hasClass("footer")&&Resizer.resizeFooterContainer(dragDrop.draggedObject,l[0]),dragDrop.drawRulers(dragDrop.draggedObject,4,i,t,!0,!1)),Grouping.isActive()&&UI.RulerGuides!=undefined&&UI.RulerGuides.checkAndSnapToGuides(),!1},dragKeys:function(n){var s=n||window.event,w=s.keyCode,i,u,t;if(dragDrop.draggedObject==null&&!Grouping.isActive())return console.log("dragDrop.dragKeys -> draggedObject == null"),!1;var r=[],o=null,h=null,c=null,l=null;Grouping.isActive()?ko.utils.arrayForEach(grouping.selectedItems(),function(n){r.push(n)}):r.push(dragDrop.draggedObject);switch(w){case 37:case 63234:for(dragDrop.dXKeys-=dragDrop.keySpeed,PopoverHelper.hidePopovers(),ColorPickerHelper.hide(),t=r.length-1;t>=0;t--)i=r[t],u=parseInt($(i).data("startx")),u+dragDrop.dXKeys<0&&(dragDrop.dXKeys=-u,o=dragDrop.dXKeys),o!=null&&o>dragDrop.dXKeys&&(dragDrop.dXKeys=o);break;case 38:case 63232:for(dragDrop.dYKeys-=dragDrop.keySpeed,PopoverHelper.hidePopovers(),ColorPickerHelper.hide(),t=r.length-1;t>=0;t--){var i=r[t],f=parseInt($(i).data("starty")),u=parseInt($(i).data("startx"));f+dragDrop.dYKeys<0&&(dragDrop.dYKeys=-f);h!=null&&h>dragDrop.dYKeys&&(dragDrop.dYKeys=h)}break;case 39:case 63235:for(dragDrop.dXKeys+=dragDrop.keySpeed,PopoverHelper.hidePopovers(),ColorPickerHelper.hide(),t=r.length-1;t>=0;t--){var i=r[t],e=i.offsetParent,a=e.offsetHeight,v=e.offsetWidth,f=parseInt($(i).data("starty")),u=parseInt($(i).data("startx")),y=u+dragDrop.dXKeys+i.offsetWidth;y>v&&(dragDrop.dXKeys-=i.offsetWidth<=e.offsetWidth?y-v:dragDrop.keySpeed);c!=null&&c<dragDrop.dXKeys&&(dragDrop.dXKeys=c)}break;case 40:case 63233:for(dragDrop.dYKeys+=dragDrop.keySpeed,PopoverHelper.hidePopovers(),ColorPickerHelper.hide(),t=r.length-1;t>=0;t--){var i=r[t],e=i.offsetParent,a=e.offsetHeight,v=e.offsetWidth,f=parseInt($(i).data("starty")),u=parseInt($(i).data("startx")),p=f+dragDrop.dYKeys+i.offsetHeight;p>a&&(dragDrop.dYKeys-=i.offsetHeight<=e.offsetHeight?p-a:dragDrop.keySpeed);l!=null&&l<dragDrop.dYKeys&&(dragDrop.dYKeys=l)}break;case 27:return dragDrop.releaseElement(),PopoverHelper.hidePopovers(),ColorPickerHelper.hide(),!1;default:return!0}for(t=r.length-1;t>=0;t--){var i=r[t],f=parseInt($(i).data("starty")),u=parseInt($(i).data("startx"));dragDrop.setElementPositionAndWrap(r[t],dragDrop.dXKeys,dragDrop.dYKeys,u,f)}return s.preventDefault&&s.preventDefault(),!1},drawRulers:function(n,t,i,r,u,f,e,o,s){function rt(t){for(var e,i=c.length-1;i>=0;i--)if(c[i]&&c[i].id!=n.id&&!$(c[i]).hasClass(STD_COMPONENT_FIXED)){var et=v(c[i]),r=et.left,o=r+c[i].offsetWidth,u=et.top,s=u+c[i].offsetHeight,ot=(r+o)/2,st=(u+s)/2,nt=Math.abs(r-y)<=h,rt=Math.abs(o-l)<=h,w=Math.abs(u-p)<=h,b=Math.abs(s-a)<=h,ht=Math.abs(ot-tt)<=h,ct=Math.abs(st-it)<=h,ut=Math.abs(r-l)<=h,ft=Math.abs(o-y)<=h,k=Math.abs(u-a)<=h,d=Math.abs(s-p)<=h;switch(t){case"t":d=!1;w=!1;break;case"b":b=!1;k=!1;break;case"l":nt=!1;ft=!1;break;case"r":rt=!1;ut=!1;break;case"tl":nt=!1;w=!1;ft=!1;d=!1;break;case"tr":d=!1;w=!1;rt=!1;ut=!1;break;case"bl":b=!1;k=!1;nt=!1;ft=!1;break;case"br":b=!1;k=!1;rt=!1;ut=!1}n.parentElement.id!=c[i].parentElement.id&&(ht=!1,ct=!1);g(n,c[i])&&(w=!1,b=!1,k=!1,d=!1);e=$(".siteeditor")[0].scrollHeight+"px";nt&&$(".objectx").css({left:r,display:"block",height:e});rt&&$(".objectx").css({left:o,display:"block",height:e});w&&$(".objecty").css({top:u,display:"block"});b&&$(".objecty").css({top:s,display:"block"});ut&&$(".objectx").css({left:r,display:"block",height:e});ft&&$(".objectx").css({left:o,display:"block",height:e});ht&&!f&&$(".objectx").css({left:ot,display:"block",height:e});k&&$(".objecty").css({top:u,display:"block"});d&&$(".objecty").css({top:s,display:"block"});ct&&!f&&$(".objecty").css({top:st,display:"block"})}}function v(n){var t=0,i=0;do $(n).hasClass("ruler-guide")?(t+=($(n).hasClass("vertical-guide")?0:n.offsetParent.offsetTop)||0,i+=($(n).hasClass("vertical-guide")?n.offsetParent.offsetLeft:0)||0,n=n.offsetParent.offsetParent):(t+=n.offsetTop||0,i+=n.offsetLeft||0,n=n.offsetParent);while(n);return{top:t,left:i}}function d(n){var t=0,i=0;do{if(!$(n).hasClass("std-component"))break;$(n).hasClass("ruler-guide")?(t+=($(n).hasClass("vertical-guide")?0:n.offsetParent.offsetTop)||0,i+=($(n).hasClass("vertical-guide")?n.offsetParent.offsetLeft:0)||0,n=n.offsetParent.offsetParent):(t+=n.offsetTop||0,i+=n.offsetLeft||0,n=n.offsetParent)}while(n);return{top:t,left:i}}function ut(n){do{if(!$(n).hasClass("std-component"))return n;n=n.offsetParent}while(n)}function ft(n,t){do{if(t.id==n.id)return!0;t=t.offsetParent}while(t);return!1}function g(n,t){for(var i="";n;)if(n=n.offsetParent,!$(n).hasClass("std-component")){i=$(n).attr("class");break}while(t){if($(t).hasClass("ruler-guide")){if(aligning.getCurrentArea()==undefined)return!0;t=aligning.getCurrentArea()[0]}else t=t.offsetParent;if(!$(t).hasClass("std-component")){if(i==$(t).attr("class"))return!1;break}}return!0}function nt(n,t,i,r,u,f,e,o,s){var l=i,kt=v(n),a=dragDrop.startX,y=dragDrop.startY,it=dragDrop.dXKeys,rt=dragDrop.dYKeys,h,c,bt;o!=undefined&&(a=o,it=0);s!=undefined&&(y=s,rt=0);f||(it=0,rt=0);var ut=kt.left,vt=ut+n.offsetWidth,et=kt.top,yt=et+n.offsetHeight,ii=(ut+vt)/2,ri=(et+yt)/2;for(h=t.length-1;h>=0;h--)if(t[h]&&t[h].id!=n.id&&!ft(n,t[h])&&!$(t[h]).hasClass(STD_COMPONENT_FIXED)){var dt=v(t[h]),ot=dt.left,pt=ot+t[h].offsetWidth,st=dt.top,wt=st+t[h].offsetHeight,ui=(ot+pt)/2,fi=(st+wt)/2,ht=Math.abs(ot-vt)<=l,ct=Math.abs(pt-ut)<=l,p=Math.abs(st-yt)<=l,w=Math.abs(wt-et)<=l,gt=Math.abs(ui-ii)<=l,ni=Math.abs(fi-ri)<=l,lt=Math.abs(ot-ut)<=l,at=Math.abs(pt-vt)<=l,b=Math.abs(st-et)<=l,k=Math.abs(wt-yt)<=l;switch(e){case"t":k=!1;p=!1;break;case"b":w=!1;b=!1;break;case"l":ht=!1;at=!1;break;case"r":ct=!1;lt=!1;break;case"tl":ht=!1;p=!1;at=!1;k=!1;break;case"tr":k=!1;p=!1;ct=!1;lt=!1;break;case"bl":w=!1;b=!1;ht=!1;at=!1;break;case"br":w=!1;b=!1;ct=!1;lt=!1}n.parentElement.id!=t[h].parentElement.id&&(gt=!1,ni=!1);g(n,t[h])&&(p=!1,w=!1,b=!1,k=!1);c=0;!0&&(bt=d(n.offsetParent),c-=u?bt.left:$(t[h]).hasClass("horizontal-guide")&&UI.RulerGuides!=undefined?UI.RulerGuides.getRulerGuideUnnecessaryHeightInCurrentArea():bt.top,$(n.parentElement).hasClass("footer")&&(c=0));var ti=d(t[h]),nt=ti.left,tt=ti.top;if(u){if(ht)return nt-n.offsetWidth-a+c-it;if(ct)return nt+t[h].offsetWidth-a+c;if(lt)return nt-a+c;if(at)return nt+t[h].offsetWidth-n.offsetWidth-a+c-it;if(gt&&!f)return nt+t[h].offsetWidth/2-n.offsetWidth/2-a+c}else{if(p)return tt-n.offsetHeight-y+c-rt;if(w)return tt+t[h].offsetHeight-y+c;if(b)return tt-y+c;if(k)return tt+t[h].offsetHeight-n.offsetHeight-y+c-rt;if(ni&&!f)return tt+t[h].offsetHeight/2-n.offsetHeight/2-y+c}}return r}var c=$(".std-component"),h;c.push(ut(n));h=t;$(".objectx").css({display:"none"});$(".objecty").css({display:"none"});var w=v(n),l=w.left,y=l+n.offsetWidth,a=w.top,p=a+n.offsetHeight,tt=(l+y)/2,it=(a+p)/2,b=nt(n,c,h,i,!0,f,e,o,s),k=nt(n,c,h,r,!1,f,e,o,s);return u&&dragDrop.setPosition(b,k),rt(e),{Top:k,Left:b}},setPosition:function(n,t){var r=UI.siteComponentRepository.lookupData({id:$(dragDrop.draggedObject).getId()}),u=StretcherFactory.getCurrentStretchStatus(r),i;u||(dragDrop.draggedObject.style.left=dragDrop.startX+n+"px");dragDrop.draggedObject.style.top=dragDrop.startY+t+"px";i=$(dragDrop.draggedObject);i.hasClass("std-component-fixed")?$(UI.getConfigurationValue(SELECT_WRAPPER)).css(ViewerFactory.getFixedLocationPosition(r,!0)):$(UI.getConfigurationValue(SELECT_WRAPPER)).css({top:i.offset().top-1,left:i.offset().left-1})},setElementPosition:function(n,t,i,r,u){var f=UI.siteComponentRepository.lookupData({id:$(n).getId()}),e=StretcherFactory.getCurrentStretchStatus(f);e||(n.style.left=r+t+"px");n.style.top=u+i+"px"},setElementPositionAndWrap:function(n,t,i,r,u){var e=UI.siteComponentRepository.lookupData({id:$(n).getId()}),o=StretcherFactory.getCurrentStretchStatus(e),f;o||(n.style.left=r+t+"px");n.style.top=u+i+"px";f=$(n);f.hasClass("std-component-fixed")?$(UI.getConfigurationValue(SELECT_WRAPPER)).css(ViewerFactory.getFixedLocationPosition(e,!0)):$(UI.getConfigurationValue(SELECT_WRAPPER)).css({top:f.offset().top-1,left:f.offset().left-1});Grouping.wrap()},switchKeyEvents:function(){removeEventSimple(document,"keydown",dragDrop.dragKeys);removeEventSimple(document,"keypress",dragDrop.switchKeyEvents);addEventSimple(document,"keypress",dragDrop.dragKeys)},releaseElement:function(n){var i,r,u,t,f;if($(this).data("focusManagerInstance")!=null)return n.preventDefault(),n.stopPropagation(),!1;dragDrop.releasesCountAfterDrag+=1;dragDrop.releasesCountAfterDrag>1&&(dragDrop.groupDragging=!1);removeEventSimple(document,"mousemove",dragDrop.dragMouse);removeEventSimple(document,"mouseup",dragDrop.releaseElement);removeEventSimple(document,"keypress",dragDrop.dragKeys);removeEventSimple(document,"keypress",dragDrop.switchKeyEvents);removeEventSimple(document,"keydown",dragDrop.dragKeys);console.log("releaseElement");dragDrop.draggedObject!=null&&(i=UI.siteComponentRepository.lookupData({id:dragDrop.draggedObject.id}),StretcherFactory.isPined(i)&&(dragDrop.draggedObject=null));Grouping.isActive()?(Grouping.wrap(),dragDrop.applyGroupChanges(),Resizer.groupBind()):dragDrop.draggedObject!=null&&(r=Dock.processElementDocking(dragDrop.draggedObject),r?(u=$(n.target).getId(),t!=null&&(t=UI.siteComponentRepository.lookupData({id:u}),f=$("#"+t.id),f.highlightSelectedElement(t))):dragDrop.applyModelChanges());dragDrop.draggedObject=null;clipBoard.selectedItem(null);$(".objectx").css({display:"none"});$(".objecty").css({display:"none"})},applyGroupChanges:function(){function i(){Resizer.recalculateSizeFooterContainer($(".footer")[0])}var r=!1,n=[],t;ko.utils.arrayForEach(grouping.selectedItems(),function(t){var i=Grouping.getComponent(t.id);if(i!=null){var u=_.clone(i.getProperty(LEFT).value),f=_.clone(i.getProperty(TOP).value),e=_.clone(t.style.left),o=_.clone(t.style.top);(u!=e||f!=o)&&(r=!0);n[t.id]={oldleft:u,oldtop:f,newleft:e,newtop:o}}else console.log("DragDrop.js->applyGroupChanges: component not found!")});t=function(n,t){Object.keys(n).forEach(function(n){var i=this[n],r=i.newtop,u=i.newleft,f,e;t||(r=i.oldtop,u=i.oldleft);f=Grouping.getComponent(n);f.setProperty(TOP,r);f.setProperty(LEFT,u);e=$("#"+n);e.css(TOP,r);e.css(LEFT,u);console.log("APPLY GROUP VALUES: new>"+t+", top: "+r+", left: "+u);Grouping.wrap()},n)};r&&(t(n,!0),i(),UI.undoManagerAdd({undo:function(){t(n,!1);i()},redo:function(){t(n,!0);i()}}))},applyModelChanges:function(){var n,t;if(defined(dragDrop.draggedObject)&&$(dragDrop.draggedObject).length>0&&(n=UI.siteComponentRepository.lookupData({id:$(dragDrop.draggedObject).getId()}),n!=null)){var f=_.clone(n.getProperty(LEFT).value),e=_.clone(n.getProperty(TOP).value),i=_.clone(dragDrop.draggedObject.style.left),r=_.clone(dragDrop.draggedObject.style.top);if(f!=i||e!=r){t=function(t,i){n.setProperty(LEFT,t);n.setProperty(TOP,i);var r=$("#"+n.id);r.css(LEFT,t);r.css(TOP,i)};function u(n){var t=$("#"+n.id);Resizer.recalculateSizeFooterContainer($(".footer")[0])}t(i,r);u(n);UI.undoManagerAdd({undo:function(){t(f,e);u(n)},redo:function(){t(i,r);u(n)}})}}}};SiteSettings=function(){var n=this;n.showSettings=function(){Helpers.validationEngineInit("#"+SITE_SETTINGS_TEMPLATE);var t=UI.getBody(),i=_.clone(t.getProperty(GOOGLE_VERIFICATION_CODE)?t.getProperty(GOOGLE_VERIFICATION_CODE).value:""),r=_.clone(t.getProperty(BING_VERIFICATION_CODE)?t.getProperty(BING_VERIFICATION_CODE).value:""),u=_.clone(t.getProperty("favicon")?Helpers.convertToUniversalUrl(t.getProperty("favicon").value):""),f=_.clone(t.getProperty("meta-title").value),e=_.clone(t.getProperty("meta-keywords").value),o=_.clone(t.getProperty("meta-description").value),s=_.clone(t.getProperty("meta-facebook-title").value),h=_.clone(t.getProperty("meta-facebook-description").value),c=Helpers.convertToUniversalUrl(_.clone(t.getProperty("meta-facebook-image").value)),l=_.clone(t.getProperty(GOOGLE_ANALYTICS).value),a=_.clone(t.getProperty(SEARCHENGINE).value),v=_.clone(t.getProperty(SITEMAPXML).value);$("#google-verification-code").val(i);$("#bing-verification-code").val(r);$(".site-settings-container .favicon-image img").attr("src",u);$(".site-settings-container .seo-page-title").val(f);$(".site-settings-container .seo-page-description").val(o);$(".site-settings-container .seo-page-keywords").val(e);$(".site-settings-container .facebook-title").val(s);$(".site-settings-container .facebook-description").val(h);$(".site-settings-container .facebook-image img").attr("src",c);H.actionOnOffButtonValueSet($(".site-settings-container .btn-toggle-googleanalytics"),l);H.actionOnOffButtonValueSet($(".site-settings-container .btn-toggle-searchengine"),a);H.actionOnOffButtonValueSet($(".site-settings-container .btn-toggle-sitemapxml"),v);n.initFacebookImageUploading();n.initFaviconUploading();n.initSiteAccessibility();n.initAutoSave();n.initHeaderContent();$(".editable-tooltip").popover("destroy");ko.applyBindings({},$(".site-settings-container")[0])};n.initAutoSave=function(){var n=UI.getBody(),t=_.clone(n.getProperty(AUTO_SAVE_PERIOD).value);$(".site-settings-container .site-auto-save").val(t);Helpers.validationEngineInit("#"+SITE_AUTOSAVE_SETTINGS)};n.initHeaderContent=function(){var n=UI.getBody(),t=_.clone(n.getProperty(SITE_SETTINGS_HEADER_CONTENT).value);$("#site-settings-header-content").val(t);EditorEventsFactory.attachPlainEventNotComponent("#site-settings-header-content",UI.getBody(),CHANGE,SITE_SETTINGS_HEADER_CONTENT)};n.initSiteAccessibility=function(){var n=UI.getBody(),t=_.clone(n.getProperty(ISPROTECTED).value),i=_.clone(n.getProperty(PROTECTEDWORD).value),r=_.clone(n.getProperty(PROTECTEDEMAIL).value);$("#site-accessibility-email").val(r);$("#site-accessibility-key").val(i);H.actionOnOffButtonValueSet($(".site-settings-container .btn-toggle-isprotected"),t);EditorEventsFactory.attachPlainEventNotComponent("#site-accessibility-email",UI.getBody(),CHANGE,PROTECTEDEMAIL);EditorEventsFactory.attachPlainEventNotComponent("#site-accessibility-key",UI.getBody(),CHANGE,PROTECTEDWORD);Helpers.validationEngineInit("#"+SITE_SETTINGS_ACCESSIBILITY);$("#site-accessibility-key").bind("focus",function(){$(this).val("")})};n.saveOnOffValue=function(n){var i=UI.getBody(),r=n.data("property"),t="";param==GOOGLE_ANALYTICS&&(t="btn-toggle-googleanalytics");param==SEARCHENGINE&&(t="btn-toggle-searchengine");param==SITEMAP&&(t="btn-toggle-sitemapxml");param==ISPROTECTED&&(t="btn-toggle-isprotected");var f=_clone(H.actionOnOffButtonValueGet($(".site-settings-container ."+t))),e=_clone(i.getProperty(param).value),u=function(n){callback=callback||function(){};i.setProperty(r,n);H.actionOnOffButtonValueGet($(".site-settings-container ."+t),n);callback(i,element,n)};UI.undoManagerAddSimple(i,r,newvalue,u,!1)};n.saveFavicon=function(n){var u=$(".body")[0].id,t=UI.siteComponentRepository.lookupData({id:u}),r=_.clone(n),f=_.clone(t.getProperty("favicon")?t.getProperty("favicon").value:""),i=function(n){t.getProperty("favicon");t.setProperty("favicon",n)};i(r);UI.undoManagerAdd({undo:function(){i(f)},redo:function(){i(r)}})};n.saveAutoSaveTime=function(){if(Helpers.formValidateEngine(SITE_SETTINGS_TEMPLATE)){var r=$(".body")[0].id,n=UI.siteComponentRepository.lookupData({id:r}),u=$(".site-settings-container .site-auto-save").val(),i=_.clone(u),f=_.clone(n.getProperty(AUTO_SAVE_PERIOD).value),t=function(t){n.getProperty(AUTO_SAVE_PERIOD);n.setProperty(AUTO_SAVE_PERIOD,t);UI.initAutoSave()};t(i);UI.undoManagerAdd({undo:function(){t(f)},redo:function(){t(i)}});$(".site-popover-custom").remove()}};n.saveSettings=function(){var v=$(".body")[0].id,y=$("#google-verification-code").val(),p=$("#bing-verification-code").val();if(Helpers.formValidateEngine(SITE_SETTINGS_TEMPLATE)){var w=$(".site-settings-container .seo-page-title").val(),b=$(".site-settings-container .seo-page-description").val().replace(/(\r\n|\n|\r)/gm," "),k=$(".site-settings-container .seo-page-keywords").val(),i=$(".site-settings-container .facebook-title").val(),r=$(".site-settings-container .facebook-description").val().replace(/(\r\n|\n|\r)/gm," "),u=$(".site-settings-container .facebook-image img").attr("src"),n=UI.siteComponentRepository.lookupData({id:v}),f=_.clone(y),e=_.clone(p),o=_.clone(w),s=_.clone(k),h=_.clone(b),c=_.clone(i),l=_.clone(r),a=_.clone(u),d=_.clone(n.getProperty(GOOGLE_VERIFICATION_CODE)?n.getProperty(GOOGLE_VERIFICATION_CODE).value:""),g=_.clone(n.getProperty(BING_VERIFICATION_CODE)?n.getProperty(BING_VERIFICATION_CODE).value:""),nt=_.clone(n.getProperty("meta-title").value),tt=_.clone(n.getProperty("meta-keywords").value),it=_.clone(n.getProperty("meta-description").value),rt=_.clone(n.getProperty("meta-facebook-title").value),ut=_.clone(n.getProperty("meta-facebook-description").value),ft=_.clone(n.getProperty("meta-facebook-image").value),t=function(t,f,e,o,s){n.getProperty(GOOGLE_VERIFICATION_CODE);n.setProperty(GOOGLE_VERIFICATION_CODE,t);n.getProperty(BING_VERIFICATION_CODE);n.setProperty(BING_VERIFICATION_CODE,f);n.getProperty("meta-title");n.setProperty("meta-title",e);n.getProperty("meta-keywords");n.setProperty("meta-keywords",o);n.getProperty("meta-description");n.setProperty("meta-description",s);n.getProperty("meta-facebook-title");n.setProperty("meta-facebook-title",i);n.getProperty("meta-facebook-description");n.setProperty("meta-facebook-description",r);n.getProperty("meta-facebook-image");n.setProperty("meta-facebook-image",u)};t(f,e,o,s,h,c,l,a);UI.undoManagerAdd({undo:function(){t(d,g,nt,tt,it,rt,ut,ft)},redo:function(){t(f,e,o,s,h,c,l,a)}});$(".site-popover-custom").remove()}};n.initFacebookImageUploading=function(){upclick({type:UPCLICK_TYPE_PICTURE,element:"facebook-image-upload-btn",action:"/Editor/UploadPicture?templateId="+UI.getTemplateProperty("templateId"),accept:".gif, .jpg, .png, .jpeg, .bmp",multiple:!1,onstart:function(){Application.addLocker()},oncomplete:function(n){var t=Helpers.ProcessUploadSingleFileCompleted(n,$(".upclick-editor-error"),$("#facebook-image-upload-btn"));t!=null&&$(".site-settings-container .facebook-image img").attr("src",t.url)}});$(".upclick-container").bind("click",function(n){n.stopPropagation()})};n.initFaviconUploading=function(){upclick({type:UPCLICK_TYPE_PICTURE,element:"favicon-upload-btn",action:"/Editor/UploadFavicon?templateId="+UI.getTemplateProperty("templateId"),accept:".gif, .jpg, .png, .jpeg, .bmp, .ico",multiple:!1,onstart:function(){Application.addLocker()},oncomplete:function(t){var i=Helpers.ProcessUploadSingleFileCompleted(t,$(".upclick-editor-error"),$("#favicon-upload-btn"));i!=null&&(n.saveFavicon(i.url+"?"+i.id),$(".site-settings-container .favicon-image img").attr("src",i.url+"?"+i.id))}});$(".upclick-container").bind("click",function(n){n.stopPropagation()})};n.showPasswordModal=function(n){var t=$('<div class="above modal fade" style="z-index: 1300;" id="ssl-password-dialog"><div class="modal-dialog" style="width: 400px"><div class="modal-content"><div class="modal-header"><h4 class="pop-up modal-title">Ssl Certificate Password<\/h4><\/div><div class="modal-body"><form id="SiteSettingsSsl"><div class="form-group"><input type="password" class="form-control" id="ssl-password-dialog-input" required placeholder="Enter Password"> <\/div><div class="text-center"><button type="submit" class="std-button">Ok<\/button><\/div><\/form><\/div><\/div><\/div><\/div>').appendTo("body").modal("show");$("#SiteSettingsSsl").submit(function(i){i.preventDefault();i.stopPropagation();var r=$("#ssl-password-dialog-input").val();r&&n(r);$(".modal").length>1?(t.remove(),$(".modal-backdrop.fade.in").length?$(".modal-backdrop.fade.in")[0].remove():""):Application.removeModal()})};n.resetFacebookImage=function(){$(".site-settings-container .facebook-image img").attr("src","")};n.resetFavicon=function(){n.saveFavicon("");$(".site-settings-container .favicon-image img").attr("src","")}};SiteSettings.hideSaveMenu=function(){$(".edit-page-container").hide()};Designer=function(){var n=this;Designer.refreshBackground();Designer.paletteController=new PaletteController("")};Designer.showBackgroundMenu=function(){var n=Designer.getBody(),t=$("#bgsite");Designer.refreshBackground();$(".edit-background-container").show();$(".upclick-button").upclick(n,{multiple:!1,onlypictures:!0,oncomplete:function(n){var r=Helpers.ProcessUploadSingleFileCompleted(n,$(".upclick-editor-error"),$(".design-management-container #upclick-button")),i,t;r!=null&&(i=r.url,t=Designer.getBackgroundStruct(),Designer.saveBackground(t.color.value,i,t.position.value,t.size.value,t.isShowOptimized.value),i=ContextFactory.prepareImgSrc(i,t.isShowOptimized.value==="true"),$("#bgimage").attr("src",i))}});$(".bg-optimize-img input").bind("change",function(){console.log("change");var n=Designer.getBackgroundStruct();Designer.saveBackground(n.color.value,n.image.value,n.position.value,n.size.value,$(this).is(":checked").toString())});$(".remove-button").bind("click",function(){var n=Designer.getBackgroundStruct();Designer.saveBackground(n.color.value,"",n.position.value,n.size.value,n.isShowOptimized.value)});$(".bgposition-container input").bind("click",function(){var n=Designer.getBackgroundStruct();Designer.saveBackground(n.color.value,n.image.value,$(this).data("position"),n.size.value,n.isShowOptimized.value)});$(".bgscalling-container input").bind("click",function(){var n=Designer.getBackgroundStruct();Designer.saveBackground(n.color.value,n.image.value,n.position.value,$(this).data("scalling"),n.isShowOptimized.value)});Designer.setDefaultElement();Designer.bindPalettes();Designer.applyBindings()};Designer.getBackgroundStruct=function(){return{image:Designer.getBody().getProperty("background-image"),isShowOptimized:Designer.getBody().getProperty("show-optimized-image"),color:Designer.getBody().getProperty("background-color"),size:Designer.getBody().getProperty("background-size"),position:Designer.getBody().getProperty("background-position")}};Designer.hideDesignMenu=function(){$(".design-popover-custom").hide()};Designer.getBody=function(){return UI.siteComponentRepository.lookupData({displayName:"body"})};Designer.saveBackground=function(n,t,i,r,u){var f=Designer.getBody(),e=[{component:f,property:"background-color",newvalue:n,oldvalue:""},{component:f,property:"background-image",newvalue:t,oldvalue:""},{component:f,property:"show-optimized-image",newvalue:u,oldvalue:""},{component:f,property:"background-position",newvalue:i,oldvalue:""},{component:f,property:"background-size",newvalue:r,oldvalue:""}];UI.undoManagerAddSimpleArr(e,Designer.refreshBackground,Designer.refreshBackground,!0)};Designer.setDefaultElement=function(){var n=Designer.getBackgroundStruct();$(".bgposition-container input[data-position='"+n.position.value+"']").prop("checked",!0);$(".bgscalling-container input[data-scalling='"+n.size.value+"']").prop("checked",!0);n.isShowOptimized.value==="true"&&$(".bg-optimize-img input").prop("checked",!0);console.log($(".bgscalling-container input[data-scalling='"+n.size.value+"']"))};Designer.refreshBackground=function(){var o=Designer.getBody(),t=$("#bgsite"),n=Designer.getBackgroundStruct(),i="",r="",f,e;if(n.color!=null&&n.size!=null&&t.css("background-color",n.color.value),n.image!=null&&n.image.value!=null&&(n.image.value!=""?(f=n.image.value,f=ContextFactory.prepareImgSrc(f,n.isShowOptimized.value==="true"),t.css("background-image","url("+f+")"),t.css("background-position",n.position.value)):t.css("background-image","")),n.size!=null){if(n.size.value=="cover")var i="cover",r="no repeat",u="fixed";else if(n.size.value=="contain")var i="contain",r="no-repeat",u="fixed";else if(n.size.value=="tile")var i="auto",r="repeat",u="fixed";else if(n.size.value=="vertically")var i="auto",r="no-repeat repeat",u="fixed";else if(n.size.value=="horizontally")var i="auto",r="repeat no-repeat",u="fixed";else if(n.size.value=="normally")var i="auto",r="no-repeat",u="fixed";t.css("background-size",i);t.css("background-repeat",r);t.css("background-attachment",u);$("#bodybgcolorInput").val(n.color.value);ColorPickerHelper.bind(t,"#bodybgcolorInput",o,BACKGROUND_COLOR,!1);n.image.value==""?$("#bgimage").attr("src",BLANKIMAGE):(e=n.image.value,e=ContextFactory.prepareImgSrc(e,n.isShowOptimized.value==="true"),$("#bgimage").attr("src",e))}};Designer.applyBindings=function(n){n==null&&(n=$(".editor-content")[0]);var t={image:ko.computed(function(){return Designer.getBody().getProperty("background-image")}),isShowOptimized:ko.computed(function(){return Designer.getBody().getProperty("show-optimized-image").value}),color:ko.computed(function(){return Designer.getBody().getProperty("background-color")}),size:ko.computed(function(){return Designer.getBody().getProperty("background-size")}),position:ko.computed(function(){return Designer.getBody().getProperty("background-position")})};return ko.observable(n).extend({cleanNode:null}),ko.observable(n).extend({applyBindings:t}),ko.utils.extend(Designer,t),t};Designer.bindPalettes=function(n){return n==null&&(n=$("#palette-list")[0]),Designer.paletteController=Designer.paletteController||new PaletteController(""),ko.cleanNode(n),ko.applyBindings(Designer.paletteController,n),Designer.paletteController};Pager=function(n,t){var i=this,u,r,f;i.pages=[];var e="",o="",s="",h="";if(!UI.getSetting("ispreview")){e=Helpers.loadServiceTemplate("page-management-template");o=Helpers.loadServiceTemplate("page-menu-template");s=Helpers.loadServiceTemplate("page-parent-page-select");h=Helpers.loadServiceTemplate("page-topmenu-select");Helpers.onChangeCutting("#page-address-input",/ /g)}var c=function(){return UI.siteComponentRepository.lookupData({displayName:"main"})},l=function(n){var t=n.getProperty(PARENT_PAGE).value,i=n.getProperty(HOME).value,r=n.getProperty(HIDE_FROM_MENU).value,u=n.getProperty(NAME).value;return u=u.replace(/[^0-9a-zA-Z_-]/g,""),{parentPage:t=="null"||String.isNullOrEmpty(t)?null:t,isHome:String.isNullOrEmpty(i)?!1:i.toBoolean(),id:n.id,name:n.getProperty(NAME).value,title:n.getProperty(TITLE).value,hideFromMenu:String.isNullOrEmpty(r)?!1:r.toBoolean(),order:n.getProperty(ORDER).value.toInteger(),secure:n.getProperty(SECURE)?n.getProperty(SECURE).value.toBoolean():!1}},v=function(n){n!=null&&defined(n.children)&&Array.isArray(n.children)&&n.children.forEach(function(n){try{var t=new Page(l(n));t.isService()&&t.name==="store"&&(t.name="product",n.setProperty(NAME,"product"));i.pages.push(t)}catch(r){console.log("Error create page, component is",n.displayName);UI.siteComponentRepository.remove({id:n.id})}})},a=function(n,t){t=t||!1;t||UI.getSetting("isrenderpublish")?$(n).show():$(n).fadeIn("slow");window.scrollTo(0,0)},y=function(){i.pages.forEach(function(n){n.edit({isHome:!1})});u.children.forEach(function(n){n.setProperty("home",!1)})},p=function(){var n=i.getCurrentPageId();n!=null?i.goToPage(n,!0):i.goToPage(i.pages.firstOrDefault().id,!0)};i.hasPages=function(){return i.pages.length>0};i.removePage=function(n){var f=i.pages.where({id:n}).firstOrDefault();if(f.parentPage!=null||f.parentPage==null&&i.pages.where({parentPage:null}).length>1){var t=_.clone(n),e=function(){var r,f,o,s,e,h;return Pager.hideAddPageMenu(),r=[],f=UI.siteComponentRepository.remove({id:t}),r.push(f),o=_.cloneDeep(u.children),o.forEach(function(t){if(t.getProperty("parent-page").value==n){var i=UI.siteComponentRepository.remove({id:t.id});r.push(i)}}),s=_.cloneDeep(i.pages),e=[],i.pages.forEach(function(n){e.push(n)}),h=_.clone(HashHelper.get()),s.forEach(function(n,r){var f=HashHelper.get(),u;n.id==t&&(f==HashHelper.prepare(n.name)&&HashHelper.clear(),i.pages.remove(r),u=i.pages.where({parentPage:t}),u.forEach(function(n){var t=i.pages.indexOfByProperty({id:n.id});i.pages.remove(t);$("#"+n.id).remove()}))}),p(),$(".editor-content .page-menu-container").html("").append(Pager.renderPager(i)),UI.getViewModel("right-navigation-panel",null,null,!1).initPages(),{removedPage:f,removedComponents:r,oldHash:h,pages:e}},r=e(),o=function(){i.pages=[];r.pages.forEach(function(n){i.pages.push(n)});r.removedComponents.forEach(function(n){var t=UI.siteComponentRepository.lookupData({id:n.parentComponent.id});UI.siteComponentRepository.appendTo(n,t);UI.actionService.addToActionData(n,!0);UI.actionService.runActionForComponent(n,ACTION_ADD_TO_FORM,!0)});HashHelper.set(r.oldHash);$(".editor-content .page-menu-container").html("").append(Pager.renderPager(i));UI.getViewModel("right-navigation-panel",null,null,!1).initPages()};UI.undoManagerAdd({undo:function(){o();Helpers.refreshAllBloggingComponents()},redo:function(){e();Helpers.refreshAllBloggingComponents()}})}};i.getTopLevelPagesCount=function(){var n=0;return _.forEach(i.pages.where({isService:!1}),function(t){t.parentPage!=null||t.hideFromMenu||(n+=1)}),n};i.savePage=function(){var s=$(".save-page").data("id"),e=$(".edit-page-container .page-name").val(),a=$(".edit-page-container .page-title").val(),it=$(".edit-page-container .page-description").val().replace(/(\r\n|\n|\r)/gm," "),rt=$(".edit-page-container .page-keywords").val(),ut=$(".edit-page-container .page-date").val(),h=$(".edit-page-container .page-is-home").prop("checked"),v=$(".edit-page-container .hide-from-menu").prop("checked"),p=$(".edit-page-container .page-secure").prop("checked"),r=$(".parent-page-select").val(),u,n,k,d,ft,w,g,et,t,ot,nt,st,f,o;if(r=r.length>0?r:null,Helpers.formValidateEngine(PAGE_MANAGEMENT_SETTINGS)){if(k=_.findIndex(i.pages,function(n){return n.name.toLowerCase()==e.toLowerCase()}),d=k!=-1?i.pages[k]:null,d!=null&&d.id!=s)return $("#page-management-settings").validationEngine("hideAll"),setTimeout(function(){$("#page-address-input").validationEngine("showPrompt","Address already exists!")},400),!1;if(ft=["product","cart","thank-you"],ft.indexOf(e.toLowerCase())!==-1)return $("#page-management-settings").validationEngine("hideAll"),setTimeout(function(){$("#page-address-input").validationEngine("showPrompt","Address is reserved for service page!")},400),!1;if(h&&y(),s==null)w=!0,g=$(".save-page").data("clonedid"),g!=null&&(w=!1),o=i.pages.where({parentPage:r}).max("order"),f=o!=null?o.order+1:0,et=new ComponentService("#"+MAIN),t=null,w?(n=UI.basicComponentRepository.getAll().where({name:"page"}).firstOrDefault(),t=(new Component).createNew(n,!0)):(ot=UI.siteComponentRepository.lookupData({id:g}),t=(new Component).createFromExisting(ot,!0),et.correctComponentsBeforeCloned(new Array(t),c())),t.setProperty("parent-page",r,!0),t.setProperty("name",e,!0),t.setProperty("title",a,!0),t.setProperty("home",h,!0),t.setProperty("hide-from-menu",v,!0),t.setProperty("order",f),t.setProperty(PAGE_SECURE_PROPERTY,p),t.setProperty(META_DESCRIPTION,it,!0),t.setProperty(META_KEYWORDS,rt,!0),t.setProperty(META_DATE,ut,!0),u=w?new Page({parentPage:r,isHome:h,id:t.id,name:e,title:a,hideFromMenu:v,order:f,secure:p}):new Page(l(t)),nt=function(n){UI.siteComponentRepository.appendTo(t,UI.siteComponentRepository.lookupData({name:MAIN}));n&&UI.actionService.addToActionData(t,!0);UI.actionService.runActionForComponent(t,ACTION_ADD_TO_FORM,!0);i.pages.push(u);$(".editor-content .page-menu-container").html("").append(Pager.renderPager(i));$(t.getUISelector()).hide();Helpers.refreshAllBloggingComponents();Resizer.recalculateHeaderFooterAndPageSize($(i.getCurrentPageId()));UI.getViewModel("right-navigation-panel",null,null,!1).initPages()},nt(),Pager.hideAddPageMenu(),st=function(){i.removePage(t.id);$(".editor-content .page-menu-container").html("").append(Pager.renderPager(i));Helpers.refreshAllBloggingComponents();Resizer.recalculateHeaderFooterAndPageSize($(i.getCurrentPageId()));UI.getViewModel("right-navigation-panel",null,null,!1).initPages()},UI.undoManagerAdd({undo:function(){st()},redo:function(){nt(!0)}});else{u=i.pages.where({id:s});u!=null&&(u=u.firstOrDefault(),i.getCurrentPageId()==s&&HashHelper.set(e),f=u.order,u.parentPage!=r&&(o=i.pages.where({parentPage:r}).max("order"),f=o!=null?o.order+1:0),u.edit({name:e,title:a,isHome:h,hideFromMenu:v,parentPage:r,order:f,secure:p}),n=UI.siteComponentRepository.lookupData({id:s}));var ht=_.clone(e),ct=_.clone(a),lt=_.clone(h),at=_.clone(v),vt=_.clone(r),yt=_.clone(f),pt=_.clone(it),wt=_.clone(rt),bt=_.clone(ut),kt=_.clone(p),dt=_.clone(n.getProperty("name").value),gt=_.clone(n.getProperty("title").value),b=_.clone(n.getProperty("home").value);b=String.isNullOrEmpty(b)?!1:b.toBoolean();var ni=_.clone(n.getProperty("hide-from-menu").value),ti=_.clone(n.getProperty("parent-page").value),ii=_.clone(n.getProperty("order").value),ri=_.clone(n.getProperty(META_DESCRIPTION).value),ui=_.clone(n.getProperty(META_KEYWORDS).value),fi=_.clone(n.getProperty(META_DATE).value),ei=_.clone(n.getProperty(PAGE_SECURE_PROPERTY).value),tt=function(t,r,f,e,o,s,h,c,l,a){u.edit({name:t,title:r,isHome:f,hideFromMenu:e,parentPage:o,order:s,secure:h});n.setProperty("name",t,!0);n.setProperty("title",r,!0);n.setProperty("home",f,!0);n.setProperty("hide-from-menu",e,!0);n.setProperty("parent-page",o,!0);n.setProperty("order",s,!0);n.setProperty(PAGE_SECURE_PROPERTY,h,!0);n.setProperty(META_DESCRIPTION,c,!0);n.setProperty(META_KEYWORDS,l,!0);n.setProperty(META_DATE,a,!0);$(".editor-content .page-menu-container").html("").append(Pager.renderPager(i));Helpers.refreshAllBloggingComponents();Pager.hideAddPageMenu();UI.getViewModel("right-navigation-panel",null,null,!1).initPages()};tt(ht,ct,lt,at,vt,yt,kt,pt,wt,bt);UI.undoManagerAdd({undo:function(){tt(dt,gt,b,ni,ti,ii,ei,ri,ui,fi)},redo:function(){tt(ht,ct,lt,at,vt,yt,kt,pt,wt,bt)}})}}};i.getPageManagementTemplate=function(){return e};i.getPageMenuTemplate=function(){return o};i.getPageParentPageSelect=function(){return s};i.getPageTopMenuSelect=function(){return h};i.addPageToForm=function(n){var t=UI.siteComponentRepository.lookupData({id:n});UI.getSetting("ispreview")&&($(t.getUISelector()).html()===""||t.getProperty(ISSERVICE).value.toBoolean())?($(t.getUISelector()).remove(),UI.actionService.runActionForComponent(t,ACTION_ADD_TO_FORM,!0),MenuHelper.renderMenus(),UI.MediaService.manageMedia(),PostLoadInit.InitTextLinksToPages(i)):(MenuHelper.renderMenuSizes(i.getTopLevelPagesCount()),$(".std-component-fixed").each(function(){UI.siteComponentRepository.lookupData({id:this.id}).parentComponent.id===n&&$(this).show()}))};i.goToHomePage=function(n){var t=i.pages.where({isHome:!0});UI.MediaService.stopAllMedia();t.any()?(t=t.firstOrDefault(),i.hideAllPage(),i.hideFixedElementsInPages(),a("#"+t.id),n||HashHelper.clear(),t.setMeta(),i.addPageToForm(t.id),i.setPageHeight(t.id),UI.getSetting("ispreview")||!t.isService()&&UI.getDevice().isDesktop()?$(".position-add-new-com").show():$(".position-add-new-com").hide()):i.goToPage(i.pages.firstOrDefault().id,!0);UI.MediaService.startPlayVideoOnPage(t.id)};i.getHomePageId=function(){var n=i.pages.where({isHome:!0});return n.any()?(n=n.firstOrDefault(),n.id):null};i.getCurrentPageId=function(){var n=$(".main .page:visible");return n.length>0?n.attr("id"):i.getHomePageId()};i.otherPagesAreHidden=function(){var n=$(".main .page:visible");return n.length>1?!1:!0};i.hideAllPage=function(){$(".page").hide()};i.hideFixedElementsInPages=function(){$(".std-component-fixed").each(function(){UI.siteComponentRepository.lookupData({id:this.id}).parentComponent.proto.name==="page"&&$(this).hide()})};i.changeVisible=function(n){var t=i.pages.where({id:n});if(t.any()){t=t.firstOrDefault();var u=UI.siteComponentRepository.lookupData({id:t.id}),f=u.getProperty(PAGE_SECURE_PROPERTY).value.toBoolean(),e=!f,r=function(n){t.edit({secure:n});u.setProperty(PAGE_SECURE_PROPERTY,n.toString(),!0);$(".editor-content .page-menu-container").html("").append(Pager.renderPager(i))};r(e);UI.undoManagerAdd({undo:function(){r(f)},redo:function(){r(e)}})}};i.goToPage=function(n,t,r,u){if(t=t||!1,i.getCurrentPageId()!=n||t||!i.otherPagesAreHidden()){var f=i.pages.where({id:n});f.any()&&(UI.MediaService.stopAllMedia(),f=f.firstOrDefault(),f.isServiceTech()||(UI.getSetting("ispreview")||!f.isService()&&UI.getDevice().isDesktop()?$(".position-add-new-com").show():$(".position-add-new-com").hide(),MenuHelper.updateTopMenuSelect($(".topmenu-page-select"),f),i.hideAllPage(),i.hideFixedElementsInPages(),r||(f.isHome?HashHelper.clear():HashHelper.set(f.name,u)),UI.getSetting("ispreview")&&f.secure&&UI.authService&&!UI.authService.isAuth()?UI.componentService.addModalContentToForm(null,"#signin-secure-page"):(a("#"+f.id),i.addPageToForm(f.id),f.setMeta(),i.setPageHeight(f.id),UI.MediaService.startPlayVideoOnPage(f.id),UI.getSetting("ispreview")&&$(".carousel").carousel()),UI.RulerGuides!=undefined&&UI.RulerGuides.calculateRulerGuideHeight()))}Grouping.dropItems()};i.setPageHeight=function(n){var u=$(".main")[0],f=parseInt(UI.siteComponentRepository.lookupData({id:n}).getProperty(HEIGHT).value),r=u.offsetTop+f,t=$(".footer"),i;return t.css("top",r+"px"),$("#page-resizer").css("top",r+"px"),$("#wrapper-footer").css("top",t[0].offsetTop+t[0].offsetHeight+10+"px"),$("#bottom-body-resizer").css("top",t[0].offsetTop+t[0].offsetHeight+"px"),i=$(".header")[0],$(".dropdown.open").removeClass("open"),$("#bgpreview #bgsite").css("height","100%"),$(".site-wrapper").css("height",i?i.offsetHeight+"px":"420px"),Helpers.checkSiteWrapperHeightMobile(),UI.getSetting("ispreview")||$(".hRule").css("display")==="none"||Resizer.drawRulersTicks(t[0].offsetTop+t[0].offsetHeight),!1};i.getPageName=function(n){var t=location.href;t.indexOf("#")!=-1&&(t=t.substring(0,t.indexOf("#")));var i=this.pages.where({id:n}).firstOrDefault(),u=i.name,r=t+"#"+u;return i.isHome&&(r=t),r};i.getPageByName=function(n){var t=null;return defined(n)&&i.pages.forEach(function(i){HashHelper.prepare(i.name.toLowerCase())==HashHelper.prepare(n.toLowerCase())&&(t=i)}),t};i.getPage=function(n){return UI.pager.pages.where({id:n}).firstOrDefault()};i.getPageId=function(n){var t=i.getHomePageId();return i.pages.forEach(function(i){HashHelper.prepare(i.name.toLowerCase())==HashHelper.prepare(n.toLowerCase())&&(t=i.id)}),t};i.goToCurrentPage=function(){var t=HashHelper.get(),n=null;i.pages.forEach(function(i){HashHelper.prepare(i.name).toLowerCase()==t.toLowerCase()&&(n=i)});n!=null?i.goToPage(n.id):i.goToHomePage()};i.changeOrder=function(n,t){var r=i.pages.where({id:n}),u,e,c,l,o,s,p,h,w;if(r.any()){r=r.firstOrDefault();o=function(n,t,i,r){n.order=t;i.order=r};switch(t){case"up":if(u=i.pages.where({parentPage:r.parentPage}).orderBy("order"),e=u.indexOfByProperty({id:r.id}),e-1>=0){s=u[e-1];p=s.order;c=r.order;l=UI.siteComponentRepository.lookupData({id:r.id});var b=UI.siteComponentRepository.lookupData({id:s.id}),a=_.clone(p),f=_.clone(c),v=[{component:l,property:"order",newvalue:a,oldvalue:""},{component:b,property:"order",newvalue:f,oldvalue:""}];UI.undoManagerAddSimpleArr(v,function(){o(s,f,r,a);Pager.renderPager(UI.pager)},function(){o(s,a,r,f);Pager.renderPager(UI.pager)},!0)}break;case"down":if(u=i.pages.where({parentPage:r.parentPage}).orderBy("order"),e=u.indexOfByProperty({id:r.id}),e+1<=u.length-1){h=u[e+1];w=h.order;c=r.order;l=UI.siteComponentRepository.lookupData({id:r.id});var k=UI.siteComponentRepository.lookupData({id:h.id}),y=_.clone(w),f=_.clone(c),v=[{component:l,property:"order",newvalue:y,oldvalue:""},{component:k,property:"order",newvalue:f,oldvalue:""}];UI.undoManagerAddSimpleArr(v,function(){o(h,f,r,y);Pager.renderPager(UI.pager)},function(){o(h,y,r,f);Pager.renderPager(UI.pager)},!0);Pager.renderPager(UI.pager)}}}};u=c();v(u);r=i.getPageByName(n);r!=null?(f={},(r.name==="product"||r.name==="thank-you")&&t&&(f={key:r.name==="product"?"productId":"orderId",value:t}),i.goToPage(r.id,!1,!1,f)):i.goToCurrentPage()};Page=function(n){var t=this;t.init=function(n){t.parentPage=n.parentPage;t.isHome=n.isHome;t.id=n.id;t.name=n.name.replace(/\s/g,"");/\s/g.test(n.name)&&t.setName();t.title=n.title;t.hideFromMenu=n.hideFromMenu;t.order=n.order;t.secure=n.secure||!1};t.isService=function(){return t.id?t.getComponent().getProperty(ISSERVICE).value.toBoolean():!1};t.isServiceTech=function(){return t.isService()&&t.id&&t.name&&t.id===t.name};t.edit=function(n){defined(n.isHome)&&(t.isHome=n.isHome);(defined(n.parentPage)||n.parentPage===null)&&(t.parentPage=n.parentPage);defined(n.name)&&(t.name=n.name);defined(n.title)&&(t.title=n.title);defined(n.hideFromMenu)&&(t.hideFromMenu=n.hideFromMenu);defined(n.order)&&(t.order=n.order);defined(n.secure)&&(t.secure=n.secure)};t.setMeta=function(n){n=defined(n)?n:this.title;$("head title").length==0&&$("head").prepend("<title><\/title>");$("title").html(n)};t.getComponent=function(){return t.id?UI.siteComponentRepository.lookupData({id:t.id}):null};t.setName=function(n){n=defined(n)?n:t.name;t.getComponent().setProperty(NAME,n);t.name=n};t.init(n)};Pager.showAddPageMenu=function(n){var r,u,i,t,o,e,f;Helpers.reInitValidationEngine("#"+PAGE_MANAGEMENT_SETTINGS);r=_.filter(UI.pager.pages.where({parentPage:null}),function(n){return!n.isService()||n.isServiceTech()});n=n||null;i=[];n==null?(i.pages=[],i.pages.push({id:null,title:"None",selected:!0}),i.pages.addRange(r),u=HandlebarHelper.compileTemplate(UI.pager.getPageParentPageSelect(),i),$(".parent-page").html(u),$(".edit-page-container .page-name").val(""),$(".edit-page-container .page-title").val(""),$(".edit-page-container .page-description").val(""),$(".edit-page-container .page-keywords").val(""),$(".edit-page-container .page-date").val(""),$(".edit-page-container  .page-is-home").prop("checked",!1),$(".edit-page-container  .hide-from-menu").prop("checked",!1),$(".edit-page-container  .page-secure").prop("checked",!1)):(t=UI.pager.pages.where({id:n}),t!=null&&(t=t.firstOrDefault(),i.pages=[],i.pages.push({id:null,title:"None",selected:!1}),o=UI.pager.pages.where({parentPage:t.id}).any(),e=[],r.any()&&(r=r.whereNot({id:t.id})),r.forEach(function(n){e.push({id:n.id,title:n.title,selected:n.id==t.parentPage})}),i.pages.addRange(e),i.disabled=o,u=HandlebarHelper.compileTemplate(UI.pager.getPageParentPageSelect(),i),f=UI.siteComponentRepository.lookupData({id:n}),$(".parent-page").html(u),$(".edit-page-container .page-name").val(t.name),$(".edit-page-container .page-title").val(t.title),$(".edit-page-container .page-description").val(f.getProperty(META_DESCRIPTION).value),$(".edit-page-container .page-keywords").val(f.getProperty(META_KEYWORDS).value),$(".edit-page-container .page-date").val(f.getProperty(META_DATE).value),$(".edit-page-container  .page-is-home").prop("checked",t.isHome),$(".edit-page-container  .hide-from-menu").prop("checked",t.hideFromMenu),$(".edit-page-container  .page-secure").prop("checked",t.secure),t.isHome&&$(".edit-page-container  .page-secure").prop("disabled",!0)));$(".edit-page-container  .page-is-home").change(function(){$(".edit-page-container  .page-secure").prop("disabled",$(this).is(":checked"));$(".edit-page-container  .page-secure").prop("checked",!1)});$(".edit-page-container").show();$(".editable-tooltip").popover("destroy");ko.cleanNode($(".edit-page-container")[0]);ko.applyBindings({},$(".edit-page-container")[0]);$(".save-page").data("id",n);$(".save-page").text("Save page");$(".save-page").data("clonedid",null);Helpers.initDatePicker("#seo-custom-date-input")};Pager.showDuplicationMenu=function(n){var f,e,t,i,u,r;Helpers.reInitValidationEngine("#"+PAGE_MANAGEMENT_SETTINGS);f=UI.pager.pages.where({parentPage:null});t=UI.pager.pages.where({id:n});t!=null&&(t=t.firstOrDefault(),i=[],i.pages=[],i.pages.push({id:null,title:"None",selected:!0}),i.pages.addRange(f),e=HandlebarHelper.compileTemplate(UI.pager.getPageParentPageSelect(),i),u=Pager.getLatestDuplicateSuffix(),r=UI.siteComponentRepository.lookupData({id:n}),$(".parent-page").html(e),$(".edit-page-container .page-name").val(t.name+""+u),$(".edit-page-container .page-title").val(t.title+""+u),$(".edit-page-container .page-description").val(r.getProperty(META_DESCRIPTION).value),$(".edit-page-container .page-keywords").val(r.getProperty(META_KEYWORDS).value),$(".edit-page-container .page-date").val(r.getProperty(META_DATE).value),$(".edit-page-container  .page-is-home").prop("checked",!1),$(".edit-page-container  .hide-from-menu").prop("checked",t.hideFromMenu),$(".edit-page-container  .page-secure").prop("checked",t.secure),$(".save-page").data("id",null),$(".save-page").data("clonedid",n),$(".edit-page-container").show(),$(".save-page").text("Duplicate"),Helpers.initDatePicker("#seo-custom-date-input"))};Pager.getLatestDuplicateSuffix=function(){var t=1,n,i;if(UI.pager.hasPages){for(n=1;n<1e3;n++)if(t=n,i=UI.pager.pages.every(function(t){return t.name.slice(-2)!="-"+n}),i)break;return"-"+t}};Pager.hideAddPageMenu=function(){$(".edit-page-container").hide()};Pager.hideSettingSuccessPage=function(){$(".settings-success-page").hide()};Pager.renderPager=function(n){var r=function(n){$(".editor-content .page-menu-container").html("").append(n)},u=n.getPageMenuTemplate(),t={},i;t.pages=[];n.hasPages&&(_.forEach(n.pages,function(i){if(i.parentPage==null){var r=n.pages.where({parentPage:i.id});i.childPages=[];r.any()&&i.childPages.addRange(r.where({isService:!1}).orderBy("order"));(!i.isService()||i.isServiceTech())&&t.pages.push(i)}}),t.pages=t.pages.orderBy("order"));i=HandlebarHelper.compileTemplate(u,t);r(i);UI.renderMenus();Pager.renderTopMenuSelect()};Pager.renderTopMenuSelect=function(){var r=function(n){$(".editor-pages").html(n)},u=UI.pager.getPageTopMenuSelect(),t=_.cloneDeep(UI.pager.pages),f=UI.pager.getCurrentPageId(),n={},i;n.pages=[];t.any()&&(_.forEach(t,function(i){if(i.parentPage==null){var r=t.where({parentPage:i.id});i.childPages=[];r.any()&&i.childPages.addRange(r.orderBy("order"));n.pages.push(i)}}),n.pages=n.pages.orderBy("order"));i=HandlebarHelper.compileTemplate(u,n);r(i);Helpers.initCustomTreeView($(".topmenu-page-select").find(".tree-view"),function(n){var t=UI.pager.getPage(n);UI.pager.goToPage(t.id)});MenuHelper.updateTopMenuSelect($(".topmenu-page-select"),UI.pager.getPage(f))};Pager.getMinHeightMenu=function(n,t){var i=$("#"+n+" a:first").innerHeight();return i==0&&t>1&&(i=$("#"+n).css("min-height").toNumber()/(t-1)),i};Pager.activeCheckBox=function(n,t,i,r,u){var f,e;if(n.length>0)for(f=0;f<n.length;f++)i!=n[f]&&$("#"+n[f]).prop("checked",!1);if(t==!1&&r==!1&&(t=n,r=i),t.length>0)for(e=0;e<t.length;e++)r!=t[e]&&u.setProperty(t[e],!1)};MenuHelper=function(){};MenuHelper.renderMenus=function(){var n=[],r,t,i,u,f;n.pages=[];r=UI.getSetting("ispreview");defined(UI.pager)&&UI.pager.hasPages&&(t=_.cloneDeep(UI.pager.pages).where({isService:!1}),_.forEach(t,function(i){if(i.parentPage==null&&!i.hideFromMenu){var r=t.where({parentPage:i.id});i.childPages=[];r.any()&&r.where({hideFromMenu:!1}).forEach(function(n){n.href=Helpers.generateLinkToPage(n.name);i.childPages.push(n)});i.childPages=i.childPages.orderBy("order");i.href=Helpers.generateLinkToPage(i.name);n.pages.push(i)}}),n.pages=n.pages.orderBy("order"),i=UI.basicComponentRepository.getAll().where({name:"menu"}),i.any()&&(u=i.firstOrDefault(),f=UI.siteComponentRepository.lookupDataSet({componentId:u.id}),f.forEach(function(t){var i,u,f;n.id=t.id;n.viewer=r;n.styles=UI.getDevice().getPropertiesList(t).where({group:"style"});i=t.getProperty(PREDEFINED).value;n.predefined=i;n.borderradius=t.getProperty(BORDER_RADIUS).value;u=!UI.getDevice().isDesktop()&&t.proto.slaveTemplate?t.proto.slaveTemplate:t.proto.template;f=HandlebarHelper.compileTemplate(u,n);$(t.getUISelector()).html($(f).html());MenuHelper.renderSubstringListMenu(t.getUISelector());MenuHelper.setMenuMinSize(t,n.pages.length)})))};MenuHelper.renderSubstringListMenu=function(n){var i,t;if($(n).find("ul").hasClass("vertical"))for(i=$(n).find("a"),t=0;t<i.length;t++)$(i)[t].nodeName=="A"&&$(i[t]).css({overflow:"hidden","text-overflow":"ellipsis","text-align":"center","white-space":"nowrap"})};MenuHelper.renderMenuSizes=function(n){var t=UI.basicComponentRepository.getAll().where({name:"menu"}),i,r;t.any()&&(i=t.firstOrDefault(),r=UI.siteComponentRepository.lookupDataSet({componentId:i.id}),r.forEach(function(t){MenuHelper.setMenuMinSize(t,n)}))};MenuHelper.calculateMinWidthForSimpleMenu=function(n){var f=parseInt(n.getProperty(FONT_SIZE).value),e=n.getProperty(FONT_FAMILY).value,r=parseInt(n.getProperty(WIDTH).value),t=$(n.getUISelector()).find("ul.simple"),i=0,u;return t[0]&&(u=t.innerWidth()-t.width(),i+=u,$(t).find("li").each(function(n,t){var r=$(t),s=r.text()||"",u=Helpers.getTextWidth(s.trim(),f,e),o=parseFloat(r.css("min-width"));i+=o>u?o:u})),i>r?r:i};MenuHelper.setMenuMinSize=function(n,t){var e,o,f;if(UI.getDevice().isDesktop()){var i=Pager.getMinHeightMenu(n.id,t),s=n.getProperty(PREDEFINED).value,r=parseInt(n.getProperty(FONT_SIZE).value),l=n.getProperty(FONT_FAMILY).value,u=parseInt(n.getProperty(BORDER_WIDTH).value),h=parseInt(n.getProperty(WIDTH).value);if(s=="simple")UI.getSetting("ispreview")||(e=setInterval(function(){if(document.readyState===DOC_READY_STATE_COMPLETE){clearInterval(e);var t=MenuHelper.calculateMinWidthForSimpleMenu(n);$(n.getUISelector()).css("min-width",t+"px");console.log("menu minwidth: "+t)}},50)),i="20px",r+u*2>20&&(i=r+u*2+"px"),$(n.getUISelector()).css("min-height",i),o=StretcherFactory.getCurrentStretchStatus(n),o||$(n.getUISelector()).css("width",h);else{f=0;UI.pager!=undefined&&(f=UI.pager.getTopLevelPagesCount());var c=parseInt(r*1.42+30)*f+u*2;i=c+"px";$(n.getUISelector()).css("min-width","80px");$(n.getUISelector()).css("min-height",i)}ViewerFactory.calculateMenuLineHeight(n,"#"+n.id)}};MenuHelper.updateTopMenu=function(n,t){n.each(function(){$(this).data().id===t.id?$(this).addClass("active"):$(this).removeClass("active")})};MenuHelper.updateTopMenuSelect=function(n,t){t.id||(t=UI.pager.getPage(UI.pager.getHomePageId()));n.find("span").text(t.title);MenuHelper.updateTopMenu(n.find(".tree-view-item-link"),t)};var Helpers=function(){},H=Helpers,defined=function(n){return typeof n!="undefined"&&n!==null},isDefinedAndNotEmpty=function(n){return defined(n)&&n!=null&&n!==""?!0:!1};Helpers.clearAllSelection=function(){window.getSelection?window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges():document.selection&&document.selection.empty()};Helpers.actionOnOffButtonValueSet=function(n,t){var f,r,i,u;val=null;defined(t)&&(val=t);(H.actionOnOffButtonValueGet(n)!=val||val==null)&&($(n).find(".btn").toggleClass("active"),$(n).find(".btn-primary").size()>0&&$(n).find(".btn").toggleClass("btn-primary"),$(n).find(".btn").toggleClass("btn-default"),f=H.actionOnOffButtonValueGet(n),UI.getBody().setProperty($(n).data("property"),f,!0));r=$(n).data(CALLBACK_ACTION);i=$(n).closest("form");jQuery.isFunction(callbackActions[r])&&i.length>0&&callbackActions[r](i,H.actionOnOffButtonValueGet(n));switch($(i).prop("id")){case SITE_SETTINGS_ACCESSIBILITY:u=UI.getBody().getProperty($(n).data("property"));u!=null&&u.value==0&&Helpers.hideValidationEngine("#site-accessibility-key, #site-accessibility-email")}};Helpers.actionOnOffButtonValueGet=function(n){var t=$(n).find(".active");return t.length>0?t.data("value"):"false"};Helpers.consoleLog=function(){ENABLE_LOGGING&&console.log.apply(console,arguments)};Helpers.changeUrl=function(n,t){if(typeof history.pushState!="undefined"){var i={Title:n,Url:t};history.pushState(i,i.Title,i.Url)}};Helpers.addQueryParam=function(n,t){var i="";return i=n.lastIndexOf("?")==-1?"?"+t:"&"+t,n+i};Helpers.showModalDialog=function(n,t,i){Application.getModal('/Editor/CustomModal/")',{title:n,message:t,url:i})};Helpers.loadServiceTemplate=function(n){var t,i=$.ajaxSettings.async,r=$.ajaxSettings.cache;return $.ajaxSetup({async:!1,cache:!1}),$.get("/Content/Editor/service-templates/"+n+".html",function(n){t=n}),$.ajaxSetup({async:i,cache:r}),t};String.empty="";Helpers.isCkEditorComponent=function(n){return n.proto.name==PARAGRAPH||n.proto.name==HEADERTEXT};Helpers.isGalleryComponent=function(n){return n.proto.name==GALLERY||n.proto.name==SLIDESHOW||n.proto.name==LIST||n.proto.name==HOUSE_PHOTO_TOUR||n.proto.name==HTML_CONTAINER};Helpers.isSpecificComponent=function(n){return Helpers.isCkEditorComponent(n)&&n.isckeditorworking||Helpers.isGalleryComponent(n)&&UI.getDevice().isDesktop()};Helpers.getExt=function(n){var t=n.split(".").pop();return t==n?"":t};Helpers.ProcessUploadSingleFileCompleted=function(n,t,i){Application.removeLocker();var u=JSON.parse(n),r=Helpers.GetUploadingSingleFileError(u);return t.remove(),r==""?u.files[0]:(r='<div class="property-editor upclick-editor-error">'+r+"<\/div>",i.before(r),null)};Helpers.ProcessUploadMultipleFilesCompleted=function(n,t,i){Application.removeLocker();var u=JSON.parse(n),r=Helpers.GetUploadingSingleFileError(u);return t.remove(),r==""?u.files:(r='<div class="property-editor upclick-editor-error">'+r+"<\/div>",i.before(r),null)};Helpers.ProcessUploadSingleFileWithErrorLabelCompleted=function(n,t){Application.removeLocker();var i=JSON.parse(n),r=Helpers.GetUploadingSingleFileError(i);return r==""?i.files[0]:(t.html(r),null)};Helpers.GetUploadingSingleFileError=function(n){var t="";return(n.errorMessage!=""||n.files==null||n.files.length==0||n.files[0].bannedExtension)&&(n.errorMessage!=""?t=n.errorMessage:n.files==null||n.files.length==0?t="Files was not stored.":n.files[0].bannedExtension&&(t="The file content you have provided is not a supported image format.")),t};Helpers.getPdfThumbnail=function(n,t){PDFJS.workerSrc="\\Content\\Editor\\js\\libs\\pdfjs\\build\\pdf.worker.js";PDFJS.getDocument(n).then(function(n){n.getPage(1).then(function(n){var u=n.getViewport(.5),i=document.createElement("canvas"),r=i.getContext("2d"),f;i.height=u.height;i.width=u.width;f={canvasContext:r,viewport:u};n.render(f).then(function(){r.globalCompositeOperation="destination-over";r.fillStyle="#ffffff";r.fillRect(0,0,i.width,i.height);var n=i.toDataURL();t(n)})})})};Helpers.showPdfInsideModal=function(n,t,i,r){if(t=t||"PDF",i=i||1200,r=r||600,typeof n=="string"&&n.length>0){var u='<iframe src="'+UI.getSetting("adminSiteDomain")+"/Content/Editor/js/libs/pdfjs/web/viewer.html?file="+n+'" width="100%" height="'+r+'px" />';Application.showEmptyDialog(t,u,i,"pdf")}};Helpers.duplicateNameValue=function(n){var t=n,i=n.match(/\((.*?)\)/);return i!=null?t=t.replace(i[0],"("+(i[1].toNumber()+1)+")"):t+=" (1)",t};$.fn.extend({highlightSelectedElement:function(n,t){var i=$(this);if(i.data("ckeditorInstance")!=null||UI.isckeditorworking||EditorFactory.findAssignedParent(n,STORE_PRODUCT)!==null&&n.proto.name!==STORE_PRODUCT||EditorFactory.findAssignedParent(n,STORE_GALLERY)!==null&&n.proto.name!==STORE_GALLERY||EditorFactory.findAssignedParent(n,STORE_CART)!==null&&n.proto.name!==STORE_CART)return!1;i.data("selected",!0);n.isDraggable&&!i.hasClass("std-component-fixed")&&i.addClass("drag");$(UI.getConfigurationValue(SELECT_WRAPPER)).remove();var u=i.outerWidth()+2,f=i.outerHeight()+2,e=i.offset().top-1,o=i.offset().left-1,r=$('<div class="'+SELECT_WRAPPER+'"><ul class="'+SELECT_WRAPPER_MENU+'"><\/ul><\/div>');i.hasClass("std-component-fixed")?(r.addClass(SELECT_WRAPPER_FIXED),n?r.css(ViewerFactory.getFixedLocationPosition(n,!0)):r.css(ViewerFactory.getFixedLocationPosition(UI.siteComponentRepository.lookupData({id:this.id}),!0))):r.css({top:e+"px",left:o+"px"});(i.hasClass("std-headertext")||i.hasClass("std-paragraph"))&&r.css({background:"rgba(39, 219, 247, 0.1)"});r.css({width:u+"px",height:f+"px",pointerEvents:"none"});r.data("for",i.getId());Resizer.bind(i,r,n,t);clipBoard.selectedItem(n);Grouping.dropItems();StretcherFactory.updateComponentWrapper(n)},highlightGroupElement:function(n){var t=$(this);if(t.data("ckeditorInstance")!=null)return!1;Grouping.wrap();UI.removeEditor();$(UI.getConfigurationValue(SELECT_WRAPPER)).remove();t.data("selected",!0);n.isDraggable&&!t.hasClass("std-component-fixed")&&t.addClass("drag")},getId:function(){return $(this).attr("id")},findUnderlyingDockableElement:function(){var n=$(this),r=Positioning.createElementCoords(n),i=$("[dockable]"),t;if(i.length>0)t=!1,$(i).each(function(){if($(this).getId()!=n.getId()&&n.has($(this)).length==0&&$(this).css("display")!="none"&&$(this).parent(".page").css("display")!="none"&&!$(this).hasClass("page")&&!$(this).hasClass("main")){var i=Positioning.isAboveElement(r,Positioning.createElementCoords(this));i&&(t=!0,$(this).createDockContainer())}}),!t;else return null},createDockContainer:function(){UI.removeDockContainer();var n=$(this),i=n.outerWidth()+2,r=n.outerHeight()+2,u=n.offset().top-1,f=n.offset().left-1,t=$('<div class="'+DOCK_WRAPPER+'"><\/div>');t.css({width:i+"px",height:r+"px",pointerEvents:"none",top:u+"px",left:f+"px"});t.data("for",n.getId());$("body").append(t)},upclick:function(n,t){t=t||{};var i={accept:".gif, .jpg, .png, .jpeg, .bmp",onstart:function(){},oncomplete:function(){},multiple:!1,type:UPCLICK_TYPE_PICTURE,action:"",action_params:{}};t.accept=t.accept||i.accept;t.onstart=t.onstart||i.onstart;t.oncomplete=t.oncomplete||i.oncomplete;t.multiple=t.multiple||i.multiple;t.type=t.type||i.type;t.action="/Editor/Upload"+t.type+"?templateId="+UI.getTemplateProperty("templateId");t.action_params=t.action_params||i.action_params;upclick({element:$(this).getId(),action:t.action,accept:t.accept,multiple:t.multiple,action_params:t.action_params,onstart:function(i){Application.addLocker();t.onstart(i,n)},oncomplete:function(i){t.oncomplete(i,n);Application.removeLocker()}});$(".upclick-container").bind("click",function(n){n.stopPropagation()})}});$.fn.isElementInViewport=function(){if($(this)[0]==null)return!1;var n=$(this)[0].getBoundingClientRect();return n.top>=0&&n.left>=0&&n.bottom<=(window.innerHeight||$(window).height())&&n.right<=(window.innerWidth||$(window).width())};eventsystem=function(n){var t={};return n||{subscribe:function(n,i){t[n]||(t[n]={queue:[]});var r=t[n].queue.push(i)-1;return{remove:function(){delete t[n].queue[r]}}},publish:function(n,i){if(t[n]&&t[n].queue.length){var r=t[n].queue;r.forEach(function(n){n(i||{})})}}}}(eventsystem);flatten=function(n,t,i){return _.isObject(n)?_.each(n,function(n,r){flatten(n,t,i?i+"."+r:r)}):t[i]=n,t};Helpers.onChangeCutting=function(n,t){$(document).on("change",n,function(){$(this).val($(this).val().replace(t,""))})};Helpers.findFreePositionOnCustomForm=function(n,t,i){function o(n,t){var i={isFree:!0,collisionObjectX:0,collisionObjectY:0,collisionObjectW:0,collisionObjectH:0};return n.children().each(function(n,r){var f=UI.siteComponentRepository.lookupData({id:r.id}),u={x:parseInt(f.getProperty(LEFT).value),y:parseInt(f.getProperty(TOP).value),w:parseInt(f.getProperty(WIDTH).value),h:parseInt(f.getProperty(HEIGHT).value)};(t.x<=u.x&&t.x+t.w>=u.x||u.x<=t.x&&u.x+u.w>=t.x)&&(t.y<=u.y&&t.y+t.h>=u.y||u.y<=t.y&&u.y+u.h>=t.y)&&(i.isFree=!1,i.collisionObjectX=u.x,i.collisionObjectY=u.y,i.collisionObjectW=u.w,i.collisionObjectH=u.h)}),i}var e=$("#"+n),s=UI.siteComponentRepository.lookupData({id:n}),h=parseInt(s.getProperty(HEIGHT).value),c=parseInt(s.getProperty(WIDTH).value),l=1e4,f=[],a=0,r,u;if(e.children().each(function(n,t){var i=t.offsetLeft+t.offsetWidth;f.indexOf(i)<0&&f.push(i)}),f.sort(function(n,t){return n-t}),o(e,{x:0,y:0,w:t,h:i}).isFree==!1)for(r={x:0,y:0,w:t,h:i};l-->0;){if(u=o(e,r),u.isFree&&r.y+r.h<h)return r;if(u.isFree==!1&&(r.y=u.collisionObjectY+u.collisionObjectH+1),r.y+r.h>=h&&(r.y=0,r.x=f[a++]+1),r.x+r.w>c)break}return{x:0,y:0}};Helpers.setNewGuid=function(n){if(n==null)throw new Error("component is null");n.id=Guid.new();n.children.forEach(function(n){Helpers.setNewGuid(n)})};Helpers.generateLinkToPage=function(n,t,i){var r=location.origin;return r+=UI.getSetting("ispublished")?"/"+n+(i?"/"+i.value:""):location.pathname+location.search+(i?location.search?"&"+i.key+"="+i.value:"?"+i.key+"="+i.value:"")+"#"+n,t?r:'href="'+r+'"'};Helpers.generateEventGoToPage=function(n){n.preventDefault();var t=Helpers.parseURL(n.currentTarget.href).pathname.replace("\\","").replace("/","").replace(/ /g,"").split("/")[0];t!==location.host&&(t?UI.pager.goToPage(UI.pager.getPageId(t)):UI.pager.goToHomePage())};Helpers.validationEngineInit=function(n){isDefinedAndNotEmpty(n)&&$(n).validationEngine()};Helpers.hideValidationEngine=function(n){isDefinedAndNotEmpty(n)&&$(n).validationEngine("hide")};Helpers.reInitValidationEngine=function(n){isDefinedAndNotEmpty(n)&&(Helpers.hideValidationEngine(n),Helpers.validationEngineInit(n))};Helpers.formValidateEngine=function(n){return isDefinedAndNotEmpty(n)?jQuery("#"+n).validationEngine("validate"):!0};Helpers.getQueryParamValue=function(n){return decodeURIComponent((new RegExp("[?|&]"+n+"=([^&;]+?)(&|#|;|$)").exec(location.search)||[,""])[1].replace(/\+/g,"%20"))||null};Helpers.getStoreParamFromURL=function(n){if(UI.getSetting("ispreview")){if(UI.getSetting("ispublished")){var t=location.pathname.split("/");return t[2]?t[2]:null}return sessionStorage.getItem(n)}return null};Helpers.setQueryParamValue=function(n,t,i){var r=location.search,f=new RegExp("([?&])"+n+"=.*?(&|$)","i"),e=r.indexOf("?")!==-1?"&":"?",u="";if(u=r.match(f)?r.replace(f,"$1"+n+"="+t+"$2"):r+e+n+"="+t,i)location.search=u;else return u};Helpers.changeQueryWithoutReload=function(n){history.replaceState("",document.title,location.pathname+n)};Helpers.removeQueryParam=function(n,t){var r=location.search,i="",u=new RegExp("([?&])"+n+"=.*?(&|$)","i");if(r.match(u)&&(i=r.replace(u,"$1").replace(/[?&]$/,"")),t)location.search=i;else return i};Helpers.changeViewport=function(n,t){var r=n/t,f=document.getElementById("viewport"),u="",i;u=UI.getDevice().isDesktop()?t>n?"width="+t+",initial-scale="+r:"width=device-width,initial-scale=1.0":"width="+t+",initial-scale="+r+",maximum-scale="+r+",minimum-scale="+r+",user-scalable=no";f?f.setAttribute("content",u):(i=document.createElement("meta"),i.setAttribute("name","viewport"),i.id="viewport",i.setAttribute("content",u),$("head").append(i))};Helpers.bindViewportToResize=function(n,t){Helpers.changeViewport(n,t);var i=function(){Helpers.changeViewport(Helpers.getWindowWidth(),UI.getDevice().getWidth());Helpers.checkSiteWrapperHeightMobile()};$(window).off("resize",i).on("resize",i);$(window).off("orientationchange",i).on("orientationchange",i)};Helpers.getWindowWidth=function(){return(window.orientation===90||window.orientation===-90)&&screen.width<screen.height?screen.height:screen.width};Helpers.isComponentInsideComponent=function(n,t){var u=parseInt(n.getProperty(TOP,UI.getDefaultDeviceId()).value),f=parseInt(n.getProperty(LEFT,UI.getDefaultDeviceId()).value),i=n.getProperty(HEIGHT,UI.getDefaultDeviceId()),c=parseInt(i!=null?i.value:0)+u,r=n.getProperty(WIDTH,UI.getDefaultDeviceId()),l=parseInt(r!=null?r.value:0)+f,e=parseInt(t.getProperty(TOP,UI.getDefaultDeviceId()).value),o=parseInt(t.getProperty(LEFT,UI.getDefaultDeviceId()).value),s,h;return i=t.getProperty(HEIGHT,UI.getDefaultDeviceId()),s=parseInt(i!=null?i.value:0)+e,r=t.getProperty(WIDTH,UI.getDefaultDeviceId()),h=parseInt(r!=null?r.value:0)+o,u>=e&&u<=s&&c>=e&&c<=s&&f>=o&&f<=h&&l>=o&&l<=h?!0:!1};Helpers.isExistsByClassName=function(n){return $("."+n).length>0};Helpers.cleanSelected=function(){for(clipBoard.selectedItem(null),clipBoard.itemForClipboard(null);grouping.selectedItems().length>0;)Grouping.dropItem(grouping.selectedItems()[0]);$("."+GROUP_WRAPPER).remove()};Helpers.checkSiteWrapperHeightMobile=function(n){if(UI.getSetting("ispreview")){n==null&&(n=$(".site-wrapper")[0].scrollHeight);$(".site-wrapper").css("height",n+"px");var t=n+$(".adv").height()+1;return(!UI.getDevice().isDesktop()||$("#bgpreview #bgsite").height()<t)&&$("#bgpreview #bgsite").css("height",t+"px"),n}return null};Helpers.removeSelectWrapper=function(){$("."+SELECT_WRAPPER).remove()};Helpers.hideRuler=function(){$(".hRule").css("display","none");$(".vRule").css("display","none");$(".ruler.corner").css("display","none")};Helpers.createUserBar=function(n){var i=document.createElement("span"),r,t,o,u,s,f,e;i.className="dropdown";r=document.createElement("a");r.dataset.toggle="dropdown";r.dataset.bind="text: user().fullName";t=document.createElement("ul");t.className="dropdown-menu dropdown-menu-right";o=document.createElement("li");u=document.createElement("a");u.innerHTML="Profile";u.addEventListener("click",n.profile);o.appendChild(u);s=document.createElement("li");f=document.createElement("a");f.innerHTML="Sign Out";f.addEventListener("click",n.signout);s.appendChild(f);t.appendChild(o);t.appendChild(s);i.appendChild(r);i.appendChild(t);e=$("#sign-out-block-wrapper");e.html(i);setTimeout(function(){ko.cleanNode(e[0]);ko.applyBindings({user:UI.authService.user},e[0])},0)};Helpers.allowDelete=function(n){return n.proto.name!==STORE_CART&&n.proto.name!==STORE_THANK_YOU&&n.proto.name!==STORE_PRODUCT};Helpers.allowHide=function(n){return n.proto.name!==STORE_CART&&n.proto.name!==STORE_THANK_YOU&&n.proto.name!==STORE_PRODUCT&&n.proto.name!==SIGNIN};Helpers.parseURL=function(n){var t={protocol:"",host:"",hostname:"",port:"",pathname:"",origin:"",search:"",hash:""},u=n.split("//"),i="",f,r;return u[1]?(t.protocol=u[0],f=u[1].split("/"),t.host=f[0],t.hostname=t.host.split(":")[0],t.port=t.host.split(":")[1],t.origin=t.protocol+"//"+t.host,i=f[1]):(i=u[0],i[0]==="/"&&(i=i.substr(1))),i&&(r=i.split("?"),t.pathname="/"+r[0],r[1]&&(t.search="?"+r[1].split("#")[0],t.hash="#"+r[1].split("#")[1])),t};Helpers.getTextWidth=function(n,t,i,r){var f;r=r||"normal";var e=Helpers.textWidthCanvas||(Helpers.textWidthCanvas=document.createElement("canvas")),u=e.getContext("2d"),o=r+" "+t+"px "+i;return u.font=o,f=u.measureText(n),f.width};Helpers.hasInputClass=function(n){var t=$(n).closest(".std-input").length>0,i=$(n).closest(".std-textarea").length>0,r=$(n).closest(".ace_text-input").length>0,u=$(n).closest(".cke_focus").length>0;return t||i||r||u};Helpers.findElementsUnder=function(n,t){var i=parseInt(n.css(LEFT)),r=i+n.outerWidth(!0),f=parseInt(n.css(TOP))+n.outerHeight(!0),u=[];return t.children().each(function(t,e){if(e=$(e),e.getId()!==n.getId()){var o=parseInt(e.css(LEFT)),s=o+e.outerWidth(!0),h=parseInt(e.css(TOP));h>=f&&(o>=i&&s<=r||o<=i&&s>=r)&&u.push(e)}}),u};Helpers.gridLoadPage=function(){$(".grid-mvc").length&&$(".grid-mvc").gridmvc().loadPage()};Helpers.getMaxZIndex=function(n){var t=0;return n.parentComponent&&n.parentComponent.children.forEach(function(n){var i=n.getProperty(Z_INDEX);i&&(t=Math.max(t,Number(i.value)))}),t};Helpers.showToastMessage=function(n,t,i){n&&new PNotify({title:t||n.capitalize()+" message!",text:i||"",icon:!1,type:n})};Helpers.convertToUniversalUrl=function(n){return n&&n.replace?n.replace("https:","").replace("http:",""):n};Helpers.initCustomTreeView=function(n,t){n.find(".tree-view-item-link").find("i").bind("click",function(n){n.stopPropagation();$(this).closest(".tree-view-item").find(".tree-view-sub").toggle();$(this).hasClass("fa-chevron-right")?($(this).removeClass("fa-chevron-right"),$(this).addClass("fa-chevron-down")):($(this).addClass("fa-chevron-right"),$(this).removeClass("fa-chevron-down"))});n.find(".tree-view-item-link").bind("click",function(n){t(n.currentTarget.dataset.id)})};Helpers.initDatePicker=function(n,t){t=defined(t)?t:{};$(n).removeClass("hasDatepicker");$(n).datepicker(t);$(".ui-datepicker").on("click",function(n){n.preventDefault();n.stopPropagation()})};Helpers.bloggingPostCreate=function(n){var t,i,r,u;n.displayName===BLOGGING?(t=(new Component).createNew(UI.basicComponentRepository.lookupData({name:PAGE_COMPONENT}),!0),i=n.getProperty(PARENT_PAGE).value,i&&!UI.pager.pages.where({id:i}).any()&&(t.id=i),r="Blog "+UI.siteComponentRepository.lookupDataSet({displayName:BLOGGING}).length,t.setProperty(TITLE,r,!0),t.setProperty(ISSERVICE,"true",!0),t.setProperty(NAME,t.id,!0),UI.siteComponentRepository.appendTo(t,UI.getMain()),u=new Page({id:t.id,title:r,name:t.id,parentPage:null}),UI.pager.pages.push(u),n.setProperty(PARENT_PAGE,t.id),Pager.renderTopMenuSelect()):UI.siteComponentRepository.lookupDataSet({displayName:BLOGGING},n).forEach(function(n){Helpers.bloggingPostCreate(n)})};Helpers.bloggingPostDelete=function(n){if(n.displayName===BLOGGING){var t=n.getProperty(PARENT_PAGE).value;t&&(_.remove(UI.pager.pages,function(n){return t===n.id}),UI.siteComponentRepository.remove({id:t}),UI.pager.pages.where({parentPage:t}).forEach(function(n){n.parentPage=null;var t=n.getComponent();t.setProperty(PARENT_PAGE,null)}),Pager.renderTopMenuSelect())}else UI.siteComponentRepository.lookupDataSet({displayName:BLOGGING},n).forEach(function(n){Helpers.bloggingPostDelete(n)})};Helpers.refreshAllBloggingComponents=function(){UI.siteComponentRepository.lookupDataSet({displayName:BLOGGING}).forEach(function(n){UI.actionService.runActionForComponent(n,ACTION_REMOVE_FROM_FORM,!0);UI.actionService.runActionForComponent(n,ACTION_ADD_TO_FORM,!0)})};TemplateFactory=function(){};TemplateFactory.templateFor=function(n,t,i){if(t===EDITOR_TEMPLATE)if(!UI.getDevice().isDesktop()&&n.proto.slaveEditorTemplate)switch(n.proto.name){default:return new DefaultSlaveEditorTemplate(n)}else switch(n.proto.name){default:return new DefaultEditorTemplate(n)}else if(t===VIEWER_TEMPLATE)if(!UI.getDevice().isDesktop()&&n.proto.slaveTemplate)switch(n.proto.name){default:return new DefaultSlaveViewerTemplate(n)}else switch(n.proto.name){case"#signin-login":case"#signin-signup":case"#signin-signup-success":case"#signin-reset-password":case"#signin-change-password":case"#signin-profile":case"#signin-secure-page":case"#signin-manage-users":case"#signin-manage-users-current":case"#signin-send-email":return new SignInModalViewerTemplate(n,i);default:return new DefaultViewerTemplate(n)}};var DefaultEditorTemplate=function(n){var t=this;t.compiledTemplate="";t.context=ContextFactory.contextFor(n,EDITOR_CONTEXT);t.source=n.proto.editorTemplate;t.compiledTemplate=HandlebarHelper.compileTemplate(t.source,t.context)},DefaultViewerTemplate=function(n){var t=this;t.compiledTemplate="";t.context=ContextFactory.contextFor(n,VIEWER_CONTEXT);t.source=n.proto.template;t.compiledTemplate=HandlebarHelper.compileTemplate(t.source,t.context)},DefaultSlaveEditorTemplate=function(n){var t=this;t.compiledTemplate="";t.context=ContextFactory.contextFor(n,EDITOR_CONTEXT);t.source=n.proto.slaveEditorTemplate;t.compiledTemplate=HandlebarHelper.compileTemplate(t.source,t.context)},DefaultSlaveViewerTemplate=function(n){var t=this;t.compiledTemplate="";t.context=ContextFactory.contextFor(n,VIEWER_CONTEXT);t.source=n.proto.slaveTemplate;t.compiledTemplate=HandlebarHelper.compileTemplate(t.source,t.context)},SignInModalViewerTemplate=function(n,t){var r=this,i,u;r.compiledTemplate="";i={};t&&(i=ContextFactory.contextFor(t,VIEWER_CONTEXT));u=n.proto.template;r.compiledTemplate=HandlebarHelper.compileTemplate(u,i)},EditorFactory=function(){};EditorFactory.proxy=function(){var n=this,t=n.proto.name;return!UI.getDevice().isDesktop()&&EditorFactory.editorForComponent[t]?EditorFactory.editorForComponent["default"+SLAVE](n):EditorFactory.editorForComponent[t]?EditorFactory.editorForComponent[t](n):EditorFactory.editorForComponent.default(n)};EditorFactory.editorForComponent={};EditorFactory.editorForComponent[MENU]=function(n){return new MenuEditor(n)};EditorFactory.editorForComponent[IMAGE]=function(n){return new ImageEditor(n)};EditorFactory.editorForComponent.frame=function(n){return new FrameEditor(n)};EditorFactory.editorForComponent[PANEL]=function(n){return new PanelEditor(n)};EditorFactory.editorForComponent[FORM]=function(n){return new FormEditor(n)};EditorFactory.editorForComponent[LABEL]=function(n){return new LabelEditor(n)};EditorFactory.editorForComponent[TEXTBOX]=function(n){return new TextboxEditor(n)};EditorFactory.editorForComponent[TEXTAREA]=function(n){return new TextboxEditor(n)};EditorFactory.editorForComponent[CHECKBOX]=function(n){return new CheckboxEditor(n)};EditorFactory.editorForComponent[CAPTCHA]=function(n){return new CaptchaEditor(n)};EditorFactory.editorForComponent[RADIOLIST]=function(n){return new RadiolistEditor(n)};EditorFactory.editorForComponent[SELECTLIST]=function(n){return new SelectlistEditor(n)};EditorFactory.editorForComponent[SUBMIT]=function(n){return new SubmitEditor(n)};EditorFactory.editorForComponent[BUTTON]=function(n){return new ButtonEditor(n)};EditorFactory.editorForComponent[BLOGGING]=function(n){return new BloggingEditor(n)};EditorFactory.editorForComponent[MAP]=function(n){return new MapEditor(n)};EditorFactory.editorForComponent[PARAGRAPH]=function(n){return new ParagraphEditor(n)};EditorFactory.editorForComponent[HEADERTEXT]=function(n){return new HeadertextEditor(n)};EditorFactory.editorForComponent[GALLERY]=function(n){return new GalleryEditor(n)};EditorFactory.editorForComponent[HOUSE_PHOTO_TOUR]=function(n){return new HousePhotoTourEditor(n)};EditorFactory.editorForComponent[CONTACT_US]=function(n){return new ContactUsEditor(n)};EditorFactory.editorForComponent[HTML_CONTAINER]=function(n){return new HtmlContainerEditor(n)};EditorFactory.editorForComponent[SLIDESHOW]=function(n){return new SlideshowEditor(n)};EditorFactory.editorForComponent[VIDEO]=function(n){return new VideoEditor(n)};EditorFactory.editorForComponent[SOUND]=function(n){return new SoundEditor(n)};EditorFactory.editorForComponent[LIST]=function(n){return new ListEditor(n)};EditorFactory.editorForComponent[MORTGAGE_CALCULATOR]=function(n){return MortgageCalculatorEditor(n)};EditorFactory.editorForComponent[EVALUATE_HOME]=function(n){return EvaluateHomeEditor(n)};EditorFactory.editorForComponent.anchor=function(n){return new AnchorEditor(n)};EditorFactory.editorForComponent[PDF]=function(n){return new PdfEditor(n)};EditorFactory.editorForComponent[SIGNIN]=function(n){return new SignInEditor(n)};EditorFactory.editorForComponent[STORE_CART_LINK]=function(n){return new StoreCartLinkEditor(n)};EditorFactory.editorForComponent[STORE_CATEGORIES]=function(n){return new StoreCategoriesEditor(n)};EditorFactory.editorForComponent[STORE_CART]=function(n){return new StoreCartEditor(n)};EditorFactory.editorForComponent[STORE_CART_CHECKOUT]=function(n){return new StoreCartCheckoutEditor(n)};EditorFactory.editorForComponent[STORE_THANK_YOU]=function(n){return new StoreThankYouEditor(n)};EditorFactory.editorForComponent[STORE_PRODUCT]=function(n){return new StoreProductEditor(n)};EditorFactory.editorForComponent[STORE]=function(n){return new StoreEditor(n)};EditorFactory.editorForComponent[STORE_PRODUCT_IMAGES]=function(n){return new StoreProductImagesEditor(n)};EditorFactory.editorForComponent[STORE_PRODUCT_TITLE]=function(n){return new StoreProductTitleEditor(n)};EditorFactory.editorForComponent[STORE_PRODUCT_PRICE]=function(n){return new StoreProductPriceEditor(n)};EditorFactory.editorForComponent[STORE_PRODUCT_SKU]=function(n){return new StoreProductSkuEditor(n)};EditorFactory.editorForComponent[STORE_PRODUCT_DESCRIPTION]=function(n){return new StoreProductDescriptionEditor(n)};EditorFactory.editorForComponent[STORE_PRODUCT_OPTIONS]=function(n){return new StoreProductOptionsEditor(n)};EditorFactory.editorForComponent[STORE_PRODUCT_QUANTITY]=function(n){return new StoreProductQuantityEditor(n)};EditorFactory.editorForComponent[STORE_PRODUCT_ADD_TO_CART]=function(n){return new StoreProductAddToCartEditor(n)};EditorFactory.editorForComponent[STORE_PRODUCT_SOCIAL]=function(n){return new StoreProductSocialEditor(n)};EditorFactory.editorForComponent[STORE_GALLERY]=function(n){return new StoreGalleryEditor(n)};EditorFactory.editorForComponent[STORE_GALLERY_SHOW_MORE]=function(n){return new StoreGalleryShowMoreEditor(n)};EditorFactory.editorForComponent[STORE_GALLERY_PRODUCT]=function(n){return new StoreGalleryProductEditor(n)};EditorFactory.editorForComponent[STORE_GALLERY_PRODUCT_LABEL]=function(n){return new StoreGalleryProductLabelEditor(n)};EditorFactory.editorForComponent[STORE_GALLERY_PRODUCT_TITLE]=function(n){return new StoreGalleryProductTitleEditor(n)};EditorFactory.editorForComponent[STORE_GALLERY_PRODUCT_DESCRIPTION]=function(n){return new StoreGalleryProductDescriptionEditor(n)};EditorFactory.editorForComponent[STORE_GALLERY_PRODUCT_PRICE]=function(n){return new StoreGalleryProductPriceEditor(n)};EditorFactory.editorForComponent[STORE_GALLERY_PRODUCT_IMAGE]=function(n){return new StoreGalleryProductImageEditor(n)};EditorFactory.editorForComponent.default=function(n){return new DivEditor(n)};EditorFactory.editorForComponent["default"+SLAVE]=function(n){return new SlaveEditor(n)};var SlaveEditor=function(n){var t=$(n.getUISelector()),i;if(n.isckeditorworking){if(i=t[0],t.data("ckeditorInstance")!=null){console.log("component is allready in edit mode...");return}var r=n.getProperty(TEXT),u=r!=null?r.value:DEFAULT_PARAGRAPH_TEXT,f={ckEditor:u},e=ko.observable(u);ko.observable(i).extend({applyBindingsToNode:{model:f,extension:ko.utils.extend(ko.dataFor(i),{paragraphtext:e()})}})}else EditorEventsFactory.attachPlainEvent("#widthInput",t,n,CHANGE,WIDTH),EditorEventsFactory.attachPlainEvent("#heightInput",t,n,CHANGE,HEIGHT),EditorEventsFactory.attachPlainEvent("#leftInput",t,n,CHANGE,LEFT),EditorEventsFactory.attachPlainEvent("#topInput",t,n,CHANGE,TOP),EditorEventsFactory.attachPlainEvent("#zindex",t,n,CHANGE,Z_INDEX),ColorPickerHelper.bind(t,"#colorInput",n,COLOR),ColorPickerHelper.bind(t,"#brcolorInput",n,BORDER_COLOR),ColorPickerHelper.bind(t,"#backgroundColorInput",n,BACKGROUND_COLOR),ColorPickerHelper.bind(t,"#colorHoverInput",n,TEXT_COLOR_HOVER),ColorPickerHelper.bind(t,"#brcolorHoverInput",n,BORDER_COLOR_HOVER),ColorPickerHelper.bind(t,"#backgroundColorHoverInput",n,BACKGROUND_COLOR_HOVER),RangeSliderHelper.bind("#borderRadius",n,t,BORDER_RADIUS,{min:0,max:50,postfix:"px"},UI.renderMenus),RangeSliderHelper.bind("#borderWidth",n,t,BORDER_WIDTH,{min:0,max:15,postfix:"px"},function(){n.proto.name===BUTTON&&ViewerFactory.calculateButtonLineHeight(n.getUISelector())}),RangeSliderHelper.bind("#fontSize",n,t,FONT_SIZE,{min:6,max:50,postfix:"px"},function(){n.proto.name===LIST&&ViewerFactory.calculateHeightForList(n,t)}),EditorEventsFactory.attachPlainEvent("#captionPositionInput",t,n,CHANGE,CAPTION_POSITION,function(n,t,i){UI.actionService.runActionForComponent(n,ACTION_REMOVE_FROM_FORM,!0);n.setProperty(CAPTION_POSITION,i);UI.actionService.runActionForComponent(n,ACTION_ADD_TO_FORM,!0);$(n.getUISelector()).highlightSelectedElement(n,!0)}),EditorEventsFactory.attachPlainEvent("#scalingInput",t,n,CHANGE,IMAGE_STRETCHING,function(n,t,i){UI.actionService.runActionForComponent(n,ACTION_REMOVE_FROM_FORM,!0);n.setProperty(IMAGE_STRETCHING,i);UI.actionService.runActionForComponent(n,ACTION_ADD_TO_FORM,!0);$(n.getUISelector()).highlightSelectedElement(n,!0)})},StoreCategoriesEditor=function(n){var t=$(n.getUISelector());EditorEventsFactory.attachPlainEvent("#widthInput",t,n,CHANGE,WIDTH);EditorEventsFactory.attachPlainEvent("#heightInput",t,n,CHANGE,HEIGHT);EditorEventsFactory.attachPlainEvent("#leftInput",t,n,CHANGE,LEFT);EditorEventsFactory.attachPlainEvent("#topInput",t,n,CHANGE,TOP);EditorEventsFactory.attachPlainEvent("#zindex",t,n,CHANGE,Z_INDEX);EditorEventsFactory.attachPlainEvent("#fontFamilyInput",t,n,CHANGE,FONT_FAMILY);EditorEventsFactory.attachPlainEvent("#textAlignInput",t,n,CHANGE,TEXT_ALIGN);ColorPickerHelper.bind(t,"#colorInput",n,COLOR);ColorPickerHelper.bind(t,"#brcolorInput",n,BORDER_COLOR);ColorPickerHelper.bind(t,"#backgroundColorInput",n,BACKGROUND_COLOR);ColorPickerHelper.bind(t,"#colorHoverInput",n,TEXT_COLOR_HOVER);ColorPickerHelper.bind(t,"#brcolorHoverInput",n,BORDER_COLOR_HOVER);ColorPickerHelper.bind(t,"#backgroundColorHoverInput",n,BACKGROUND_COLOR_HOVER);RangeSliderHelper.bind("#borderRadius",n,t,BORDER_RADIUS,{min:0,max:50,postfix:"px"});RangeSliderHelper.bind("#borderWidth",n,t,BORDER_WIDTH,{min:0,max:15,postfix:"px"},function(){ViewerFactory.calculateButtonLineHeight(n.getUISelector())});RangeSliderHelper.bind("#fontSize",n,t,FONT_SIZE,{min:6,max:50,postfix:"px"})},StoreCartLinkEditor=function(n){var t=$(n.getUISelector());EditorEventsFactory.attachPlainEvent("#widthInput",t,n,CHANGE,WIDTH);EditorEventsFactory.attachPlainEvent("#heightInput",t,n,CHANGE,HEIGHT);EditorEventsFactory.attachPlainEvent("#leftInput",t,n,CHANGE,LEFT);EditorEventsFactory.attachPlainEvent("#topInput",t,n,CHANGE,TOP);EditorEventsFactory.attachPlainEvent("#zindex",t,n,CHANGE,Z_INDEX);RangeSliderHelper.bind("#fontSize",n,t,FONT_SIZE,{min:6,max:50,postfix:"px"});ColorPickerHelper.bind(t,"#color",n,COLOR);ColorPickerHelper.bind(t,"#secondary-color",n,SECONDARY_COLOR,function(n,t,i){t.find(".cart-count").css(COLOR,i)})},StoreCartEditor=function(n){var t=$(n.getUISelector());ColorPickerHelper.bind(t,"#color",n,COLOR);ColorPickerHelper.bind(t,"#bg-color",n,BACKGROUND_COLOR);ColorPickerHelper.bind(t,"#divider-color",n,DIVIDER_COLOR);EditorEventsFactory.attachPlainEvent("#font-family",t,n,CHANGE,FONT_FAMILY);EditorEventsFactory.attachPlainEvent("#text-input",t,n,CHANGE,TEXT);EditorEventsFactory.attachPlainEvent("#title-input",t,n,CHANGE,TITLE);EditorEventsFactory.attachPlainEvent("#description-input",t,n,CHANGE,DESCRIPTION);EditorFactory.runChildrenEditors(n)},StoreCartCheckoutEditor=function(n){var t=$(n.getUISelector());ColorPickerHelper.bind(t,"#checkout-color",n,COLOR);ColorPickerHelper.bind(t,"#checkout-bg",n,BACKGROUND_COLOR);ColorPickerHelper.bind(t,"#checkout-border-color",n,BORDER_COLOR);RangeSliderHelper.bind("#checkout-border-width",n,t,BORDER_WIDTH,{min:0,max:16,postfix:"px"});EditorEventsFactory.attachPlainEvent("#checkout-font-family",t,n,CHANGE,FONT_FAMILY);RangeSliderHelper.bind("#checkout-border-radius",n,t,BORDER_RADIUS,{min:0,max:50,postfix:"px"});EditorEventsFactory.attachPlainEvent("#checkout-text",t,n,CHANGE,TEXT)},StoreThankYouEditor=function(n){var t=$(n.getUISelector());ColorPickerHelper.bind(t,"#color",n,COLOR);ColorPickerHelper.bind(t,"#bg-color",n,BACKGROUND_COLOR);ColorPickerHelper.bind(t,"#divider-color",n,DIVIDER_COLOR);EditorEventsFactory.attachPlainEvent("#font-family",t,n,CHANGE,FONT_FAMILY);EditorEventsFactory.attachPlainEvent("#title-input",t,n,CHANGE,TITLE);EditorEventsFactory.attachPlainEvent("#text-input",t,n,CHANGE,TEXT);EditorEventsFactory.attachPlainEvent("#description-input",t,n,CHANGE,DESCRIPTION);EditorEventsFactory.attachPlainEvent("#text-order-number",t,n,CHANGE,TEXT_ORDER_NUMBER);EditorEventsFactory.attachPlainEvent("#text-total-cost",t,n,CHANGE,TEXT_TOTAL_COST);EditorEventsFactory.attachPlainEvent("#text-shipping-to",t,n,CHANGE,TEXT_SHIPPING_TO)};EditorFactory.findAssignedParent=function(n,t){return n!=null?n.proto.name!==t?n.parentComponent!=null?EditorFactory.findAssignedParent(n.parentComponent,t):null:n:n};EditorFactory.refreshStoreGalleryProductLayout=function(n){var i,t,r;n!=null&&n.proto.name===STORE_GALLERY_PRODUCT&&(i=EditorFactory.findAssignedParent(n,STORE_GALLERY),i!=null&&(t={},t[STORE_GALLERY_PRODUCT_IMAGE]={first:1,second:3},t[STORE_GALLERY_PRODUCT_TITLE]={first:2,second:1},t[STORE_GALLERY_PRODUCT_PRICE]={first:3,second:2},t[STORE_GALLERY_PRODUCT_DESCRIPTION]={first:4,second:4},r=n.getProperty(LAYOUT).value,n.children.sort(function(n,i){return t[n.proto.name][r]>t[i.proto.name][r]}),EditorFactory.refreshStoreGallery(i)))};EditorFactory.refreshStoreGallery=function(n,t){var i;if(t=defined(t)?t:function(){},i=EditorFactory.findAssignedParent(n,STORE_GALLERY),i!=null){Helpers.removeSelectWrapper();var r=$(n.getUISelector()),u=r.data("callbacks"),f=r.data("lastElementDiff");UI.actionService.runActionForComponent(i,ACTION_REMOVE_FROM_FORM,!0);UI.actionService.runActionForComponent(i,ACTION_ADD_TO_FORM,!0);setTimeout(function(){$(r.selector).data("lastElementDiff",f);PopoverHelper.bindEvents(r,u);EditorFactory.recalculateStoreGallerySize(i);t()},0)}};EditorFactory.runChildrenEditors=function(n){n.children.length&&_.forEach(n.children,function(n){n.editor();n.children.length&&EditorFactory.runChildrenEditors(n)})};EditorFactory.resetProperties=function(n,t,i){i=i?i:[];var r=[],u=function(n){_.forEach(n.properties,function(t){if(i.indexOf(t.name)===-1){var u={component:n,property:t.name,oldvalue:n.getProperty(t.name).value};n.resetProperty(t.name);u.newvalue=n.getProperty(t.name).value;r.push(u)}})};return u(n),t&&_.forEach(n.children,function(n){r.addRange(EditorFactory.resetProperties(n,t,i))}),r};EditorFactory.recalculateStoreGallerySize=function(n){var t=$(n.getUISelector()),r=t.find(".std-store-gallery-product"),f;if(r.length>0){var h=t.find(".std-store-gallery-show-more"),c=parseInt(t.find("hr").css("border-top-width")),l=parseInt(t.data().row),e=parseInt(t.data().col),o=parseInt(t.css(BORDER_WIDTH)),u=0,i=0;r.each(function(n,t){n%e==0?(u+=i,i=$(t).outerHeight(!0)):$(t).outerHeight(!0)>i&&(i=$(t).outerHeight(!0))});u+=i;var a=t.find(".sorting-control").outerHeight(!0),v=Math.ceil(r.outerWidth(!0)*e)+o*2,s=Math.ceil(u+c*(l-1)+o*2+(h.length?70:0)+a);n.setProperty(HEIGHT,s+"px");t.outerHeight(s);f=Resizer.checkMinMaxWidth(t[0],v,!0);n.setProperty(WIDTH,f+"px");t.outerWidth(f);Resizer.recalculateHeaderFooterAndPageSize(t.parent(".page"))}else return null};var StoreGalleryEditor=function(n){var t=$(n.getUISelector());EditorEventsFactory.attachPlainEvent("#widthInput",t,n,CHANGE,WIDTH,function(){EditorFactory.refreshStoreGallery(n,function(){$("#heightInput").val(n.getProperty(HEIGHT).value)})});EditorEventsFactory.attachPlainEvent("#heightInput",t,n,CHANGE,HEIGHT,function(){EditorFactory.refreshStoreGallery(n,function(){$("#heightInput").val(n.getProperty(HEIGHT).value)})});EditorEventsFactory.attachPlainEvent("#leftInput",t,n,CHANGE,LEFT,function(){EditorFactory.refreshStoreGallery(n)});EditorEventsFactory.attachPlainEvent("#topInput",t,n,CHANGE,TOP,function(){EditorFactory.refreshStoreGallery(n)});EditorEventsFactory.attachPlainEvent("#zindex",t,n,CHANGE,Z_INDEX,function(){EditorFactory.refreshStoreGallery(n)});RangeSliderHelper.bind("#rows",n,t,ROWS,{min:1,max:8,useOnFinish:!0},function(){EditorFactory.refreshStoreGallery(n)});RangeSliderHelper.bind("#columns",n,t,COLUMNS,{min:1,max:6,useOnFinish:!0},function(){EditorFactory.refreshStoreGallery(n)});ColorPickerHelper.bind(t,"#bg-color",n,BACKGROUND_COLOR);ColorPickerHelper.bind(t,"#border-color",n,BORDER_COLOR);RangeSliderHelper.bind("#border-width",n,t,BORDER_WIDTH,{min:0,max:16,postfix:"px"});ColorPickerHelper.bind(t,"#divider-color",n,DIVIDER_COLOR);RangeSliderHelper.bind("#divider-width",n,t,DIVIDER_WIDTH,{min:0,max:16,postfix:"px"});EditorFactory.runChildrenEditors(n);$(".add-store-gallery-item").click(function(i){var c=i.target.dataset.name,e,f,r,u=_.find(n.children,function(n){return n.proto.name===STORE_GALLERY_PRODUCT}),o,s,h;u&&(i.target.checked||i.target.dataset.type==="add"?(o=UI.basicComponentRepository.lookupData({name:c}),o&&(s=(new Component).createNew(o,!0),e=function(){UI.siteComponentRepository.remove({id:s.id})},f=function(){UI.siteComponentRepository.appendTo(s,u)},r=function(n){n();EditorFactory.refreshStoreGalleryProductLayout(u);setTimeout(function(){UI.removeEditor();$(t.selector).click()},0)},UI.undoManagerAdd({undo:function(){r(e)},redo:function(){r(f)}}),r(f))):(h=_.filter(u.children,function(n){return n.proto.name===c}),e=function(){_.forEach(h,function(n){UI.siteComponentRepository.appendTo(n,u)});EditorFactory.refreshStoreGalleryProductLayout(u)},f=function(){_.forEach(h,function(n){UI.siteComponentRepository.remove({id:n.id})})},r=function(n){n();EditorFactory.refreshStoreGallery(u);setTimeout(function(){UI.removeEditor();$(t.selector).click()},0)},UI.undoManagerAdd({undo:function(){r(e)},redo:function(){r(f)}}),r(f)))});$("#reset-style > .service-button").click(function(){var i=EditorFactory.resetProperties(n,!0,[TOP,LEFT,Z_INDEX]),t=function(t,i,r,u,f){u===f-1&&(UI.removeEditor(),EditorFactory.refreshStoreGallery(n))};UI.undoManagerAddSimpleArr(i,t,t,!0)});$("#style-setting").hide()},StoreGalleryShowMoreEditor=function(n){var t=$(n.getUISelector());ColorPickerHelper.bind(t,"#show-more-bg-color",n,BACKGROUND_COLOR);ColorPickerHelper.bind(t,"#show-more-bg-color-hover",n,BACKGROUND_COLOR_HOVER);ColorPickerHelper.bind(t,"#show-more-color",n,COLOR);ColorPickerHelper.bind(t,"#show-more-color-hover",n,TEXT_COLOR_HOVER);ColorPickerHelper.bind(t,"#show-more-border-color",n,BORDER_COLOR);ColorPickerHelper.bind(t,"#show-more-border-color-hover",n,BORDER_COLOR_HOVER);EditorEventsFactory.attachPlainEvent("#show-more-text-align",t,n,CHANGE,TEXT_ALIGN);EditorEventsFactory.attachPlainEvent("#show-more-font-family",t,n,CHANGE,FONT_FAMILY);RangeSliderHelper.bind("#show-more-font-size",n,t,FONT_SIZE,{min:6,max:40,postfix:"px"},function(n){ViewerFactory.calculateButtonLineHeight(n.getUISelector())});RangeSliderHelper.bind("#show-more-border-radius",n,t,BORDER_RADIUS,{min:0,max:50,postfix:"px"});RangeSliderHelper.bind("#show-more-border-width",n,t,BORDER_WIDTH,{min:0,max:15,postfix:"px"},function(n){ViewerFactory.calculateButtonLineHeight(n.getUISelector())});EditorEventsFactory.attachPlainEvent("#show-more-text",t,n,CHANGE,TEXT)},StoreGalleryProductEditor=function(n){var t=$(n.getUISelector());EditorEventsFactory.attachPlainEvent("#product-text-align",t,n,CHANGE,TEXT_ALIGN,function(){EditorFactory.refreshStoreGallery(n)});SwitcherHelper.bind(t,"#hover-style",n,HOVER_STYLE,function(){EditorFactory.refreshStoreGallery(n)});SwitcherHelper.bind(t,"#product-layout",n,LAYOUT,function(){EditorFactory.refreshStoreGalleryProductLayout(n)})},StoreGalleryProductTitleEditor=function(n){var t=$(n.getUISelector());ColorPickerHelper.bind(t,"#title-color",n,COLOR,function(){EditorFactory.refreshStoreGallery(n)});EditorEventsFactory.attachPlainEvent("#title-font-family",t,n,CHANGE,FONT_FAMILY,function(){EditorFactory.refreshStoreGallery(n)});RangeSliderHelper.bind("#title-font-size",n,t,FONT_SIZE,{min:6,max:40,postfix:"px"},function(){EditorFactory.refreshStoreGallery(n)})},StoreGalleryProductDescriptionEditor=function(n){var t=$(n.getUISelector());ColorPickerHelper.bind(t,"#description-color",n,COLOR,function(){EditorFactory.refreshStoreGallery(n)});EditorEventsFactory.attachPlainEvent("#description-font-family",t,n,CHANGE,FONT_FAMILY,function(){EditorFactory.refreshStoreGallery(n)});RangeSliderHelper.bind("#description-font-size",n,t,FONT_SIZE,{min:6,max:40,postfix:"px"},function(){EditorFactory.refreshStoreGallery(n)})},StoreGalleryProductPriceEditor=function(n){var t=$(n.getUISelector());ColorPickerHelper.bind(t,"#price-color",n,COLOR,function(){EditorFactory.refreshStoreGallery(n)});ColorPickerHelper.bind(t,"#price-secondary-color",n,SECONDARY_COLOR,function(){EditorFactory.refreshStoreGallery(n)});EditorEventsFactory.attachPlainEvent("#price-font-family",t,n,CHANGE,FONT_FAMILY,function(){EditorFactory.refreshStoreGallery(n)});RangeSliderHelper.bind("#price-font-size",n,t,FONT_SIZE,{min:6,max:40,postfix:"px"},function(){EditorFactory.refreshStoreGallery(n)})},StoreGalleryProductLabelEditor=function(n){var t=$(n.getUISelector());ColorPickerHelper.bind(t,"#label-color",n,COLOR,function(){EditorFactory.refreshStoreGallery(n)});EditorEventsFactory.attachPlainEvent("#label-font-family",t,n,CHANGE,FONT_FAMILY,function(){EditorFactory.refreshStoreGallery(n)});RangeSliderHelper.bind("#label-font-size",n,t,FONT_SIZE,{min:6,max:40,postfix:"px"},function(){EditorFactory.refreshStoreGallery(n)});ColorPickerHelper.bind(t,"#label-bgcolor",n,BACKGROUND_COLOR,function(){EditorFactory.refreshStoreGallery(n)});SwitcherHelper.bind(t,"#label-position",n,CAPTION_POSITION,function(){EditorFactory.refreshStoreGallery(n)})},StoreGalleryProductImageEditor=function(n){var t=$(n.getUISelector());SwitcherHelper.bind(t,"#image-ratio",n,IMAGE_RATIO,function(){EditorFactory.refreshStoreGallery(n)})},StoreEditor=function(n){var t=$(n.getUISelector());$(".editable-tooltip").popover("destroy");ko.applyBindings({},$(UI.getConfigurationValue(EDITOR))[0])},StoreProductEditor=function(n){function i(n,t){switch(n.proto.name){case STORE_PRODUCT_IMAGES:switch(t){case"first":return{top:"35px",left:"0px",width:"640px",height:"450px"};case"second":return{top:"35px",left:"0px",width:"960px",height:"675px"}}break;case STORE_PRODUCT_TITLE:switch(t){case"first":return{top:"35px",left:"640px",width:"320px"};case"second":return{top:"710px",left:"0px",width:"640px"}}break;case STORE_PRODUCT_PRICE:switch(t){case"first":return{top:"105px",left:"640px"};case"second":return{top:"710px",left:"640px"}}break;case STORE_PRODUCT_SKU:switch(t){case"first":return{top:"85px",left:"640px",width:"320px"};case"second":return{top:"760px",left:"0px",width:"640px"}}break;case STORE_PRODUCT_DESCRIPTION:switch(t){case"first":return{top:"485px",left:"0px",width:"640px",height:"205px"};case"second":return{top:"780px",left:"0px",width:"640px",height:"285px"}}break;case STORE_PRODUCT_OPTIONS:switch(t){case"first":return{top:"145px",left:"640px"};case"second":return{top:"740px",left:"640px"}}break;case STORE_PRODUCT_QUANTITY:switch(t){case"first":return{top:"205px",left:"640px"};case"second":return{top:"790px",left:"640px"}}break;case STORE_PRODUCT_ADD_TO_CART:switch(t){case"first":return{top:"265px",left:"650px"};case"second":return{top:"850px",left:"650px"}}break;case STORE_PRODUCT_SOCIAL:switch(t){case"first":return{top:"315px",left:"640px"};case"second":return{top:"900px",left:"640px"}}}}function r(r){var u=[{component:n,property:LAYOUT,newvalue:r,oldvalue:n.getProperty(LAYOUT).value}],f=function(n,t,i,r,f){t&&u.push({component:n,property:TOP,newvalue:t,oldvalue:n.getProperty(TOP).value});i&&u.push({component:n,property:LEFT,newvalue:i,oldvalue:n.getProperty(LEFT).value});r&&u.push({component:n,property:WIDTH,newvalue:r,oldvalue:n.getProperty(WIDTH).value});f&&u.push({component:n,property:HEIGHT,newvalue:f,oldvalue:n.getProperty(HEIGHT).value})};switch(r){case"first":u.push({component:n,property:HEIGHT,newvalue:"690px",oldvalue:n.getProperty(HEIGHT).value});break;case"second":u.push({component:n,property:HEIGHT,newvalue:"1065px",oldvalue:n.getProperty(HEIGHT).value})}_.forEach(n.children,function(n){var t=i(n,r);f(n,t.top,t.left,t.width,t.height)});UI.undoManagerAddSimpleArr(u,function(i,r,u,f,e){f===e-1&&(UI.actionService.runActionForComponent(n,ACTION_REMOVE_FROM_FORM,!0),UI.actionService.runActionForComponent(n,ACTION_ADD_TO_FORM,!0),Helpers.removeSelectWrapper(),Resizer.recalculateHeaderFooterAndPageSize($(t.selector).parent(".page")))},function(i,r,u,f,e){f===e-1&&(UI.actionService.runActionForComponent(n,ACTION_REMOVE_FROM_FORM,!0),UI.actionService.runActionForComponent(n,ACTION_ADD_TO_FORM,!0),Helpers.removeSelectWrapper(),Resizer.recalculateHeaderFooterAndPageSize($(t.selector).parent(".page")))},!0)}var t=$(n.getUISelector());$(".add-store-product-item").click(function(r){var c=r.target.dataset.name,o,e,f,s,u,h;r.target.checked||r.target.dataset.type==="add"?(s=UI.basicComponentRepository.lookupData({name:c}),s&&(u=(new Component).createNew(s,!0),o=function(){UI.siteComponentRepository.remove({id:u.id})},e=function(){UI.siteComponentRepository.appendTo(u,n);var t=i(u,n.getProperty(LAYOUT).value);t.top&&u.setProperty(TOP,t.top);t.left&&u.setProperty(LEFT,t.left);t.height&&u.setProperty(HEIGHT,t.height);t.width&&u.setProperty(WIDTH,t.width);UI.actionService.runActionForComponent(u,ACTION_ADD_TO_FORM,!0);ko.observable($(u.getUISelector())[0]).extend({applyBindings:UI.getViewModel(n.proto.name,n)})},f=function(i){i();TransformFactory.refreshStoreProductContainer(n,u);setTimeout(function(){$(t.selector).click();$(UI.getConfigurationValue(EDITOR)+" .accordion .ui-accordion-content").removeClass("ui-accordion-content-active").hide();$(UI.getConfigurationValue(EDITOR)+" .accordion #store-product-components").show()},0)},UI.undoManagerAdd({undo:function(){f(o)},redo:function(){f(e)}}),f(e))):(h=_.filter(n.children,function(n){return n.proto.name===c}),o=function(){_.forEach(h,function(t){UI.siteComponentRepository.appendTo(t,n);var r=i(t,n.getProperty(LAYOUT).value);r.top&&t.setProperty(TOP,r.top);r.left&&t.setProperty(LEFT,r.left);r.height&&t.setProperty(HEIGHT,r.height);r.width&&t.setProperty(WIDTH,r.width);UI.actionService.runActionForComponent(t,ACTION_ADD_TO_FORM,!0);ko.observable($(t.getUISelector())[0]).extend({applyBindings:UI.getViewModel(n.proto.name,n)})})},e=function(){_.forEach(h,function(n){UI.siteComponentRepository.remove({id:n.id})})},f=function(i){i();TransformFactory.refreshStoreProductContainer(n);setTimeout(function(){$(t.selector).click();$(UI.getConfigurationValue(EDITOR)+" .accordion .ui-accordion-content").removeClass("ui-accordion-content-active").hide();$(UI.getConfigurationValue(EDITOR)+" .accordion #store-product-components").show()},0)},UI.undoManagerAdd({undo:function(){f(o)},redo:function(){f(e)}}),f(e))});SwitcherHelper.bind(t,"#product-layout",n,LAYOUT,function(n,t,i){r(i)});ColorPickerHelper.bind(t,"#bgcolorInput",n,BACKGROUND_COLOR);_.forEach(n.children,function(n){n.editor()});$("#display-setting").hide()},StoreProductImagesEditor=function(n){var t=$(n.getUISelector());EditorEventsFactory.attachPlainEvent("#images-scalling",t,n,CHANGE,IMAGE_STRETCHING,function(){var t=EditorFactory.findAssignedParent(n,STORE_PRODUCT);t!=null&&(UI.actionService.runActionForComponent(t,ACTION_REMOVE_FROM_FORM,!0),UI.actionService.runActionForComponent(t,ACTION_ADD_TO_FORM,!0))});ColorPickerHelper.bind(t,"#images-border-color",n,BORDER_COLOR);RangeSliderHelper.bind("#images-border-width",n,t,BORDER_WIDTH,{min:6,max:50,postfix:"px"})},StoreProductTitleEditor=function(n){var t=$(n.getUISelector());ColorPickerHelper.bind(t,"#title-color",n,COLOR);EditorEventsFactory.attachPlainEvent("#title-font-family",t,n,CHANGE,FONT_FAMILY);EditorEventsFactory.attachPlainEvent("#title-text-align",t,n,CHANGE,TEXT_ALIGN)},StoreProductPriceEditor=function(n){var t=$(n.getUISelector());ColorPickerHelper.bind(t,"#price-color",n,COLOR);ColorPickerHelper.bind(t,"#price-secondary-color",n,SECONDARY_COLOR);EditorEventsFactory.attachPlainEvent("#price-font-family",t,n,CHANGE,FONT_FAMILY);EditorEventsFactory.attachPlainEvent("#price-text-align",t,n,CHANGE,TEXT_ALIGN)},StoreProductSkuEditor=function(n){var t=$(n.getUISelector());ColorPickerHelper.bind(t,"#sku-color",n,COLOR);EditorEventsFactory.attachPlainEvent("#sku-font-family",t,n,CHANGE,FONT_FAMILY);EditorEventsFactory.attachPlainEvent("#sku-text-align",t,n,CHANGE,TEXT_ALIGN)},StoreProductDescriptionEditor=function(n){var t=$(n.getUISelector());ColorPickerHelper.bind(t,"#description-color",n,COLOR);EditorEventsFactory.attachPlainEvent("#description-font-family",t,n,CHANGE,FONT_FAMILY);EditorEventsFactory.attachPlainEvent("#description-text-align",t,n,CHANGE,TEXT_ALIGN)},StoreProductOptionsEditor=function(n){var t=$(n.getUISelector());ColorPickerHelper.bind(t,"#options-color",n,COLOR);EditorEventsFactory.attachPlainEvent("#options-font-family",t,n,CHANGE,FONT_FAMILY);EditorEventsFactory.attachPlainEvent("#options-text-align",t,n,CHANGE,TEXT_ALIGN)},StoreProductQuantityEditor=function(n){var t=$(n.getUISelector());ColorPickerHelper.bind(t,"#quantity-color",n,COLOR);EditorEventsFactory.attachPlainEvent("#quantity-font-family",t,n,CHANGE,FONT_FAMILY);EditorEventsFactory.attachPlainEvent("#quantity-text-align",t,n,CHANGE,TEXT_ALIGN)},StoreProductAddToCartEditor=function(n){var t=$(n.getUISelector());EditorEventsFactory.attachPlainEvent("#add-to-cart-text",t,n,CHANGE,TEXT);ColorPickerHelper.bind(t,"#add-to-cart-color",n,COLOR);EditorEventsFactory.attachPlainEvent("#add-to-cart-font-family",t,n,CHANGE,FONT_FAMILY);EditorEventsFactory.attachPlainEvent("#add-to-cart-text-align",t,n,CHANGE,TEXT_ALIGN);ColorPickerHelper.bind(t,"#add-to-cart-bg-color",n,BACKGROUND_COLOR);ColorPickerHelper.bind(t,"#add-to-cart-border-color",n,BORDER_COLOR);RangeSliderHelper.bind("#add-to-cart-border-radius",n,t,BORDER_RADIUS,{min:0,max:50,postfix:"px"})},StoreProductSocialEditor=function(n){var t=$(n.getUISelector());EditorEventsFactory.attachPlainEvent("#social-text-align",t,n,CHANGE,TEXT_ALIGN);EditorEventsFactory.attachPlainEvent("#social-share-to-facebook",t,n,CHANGE,SHARE_TO_FACEBOOK,function(n){UI.actionService.runActionForComponent(n,"remove-component-from-form",!0);UI.actionService.runActionForComponent(n,"add-component-to-form",!0)});EditorEventsFactory.attachPlainEvent("#social-share-to-twitter",t,n,CHANGE,SHARE_TO_TWITTER,function(n){UI.actionService.runActionForComponent(n,"remove-component-from-form",!0);UI.actionService.runActionForComponent(n,"add-component-to-form",!0)});EditorEventsFactory.attachPlainEvent("#social-share-to-gplus",t,n,CHANGE,SHARE_TO_GPLUS,function(n){UI.actionService.runActionForComponent(n,"remove-component-from-form",!0);UI.actionService.runActionForComponent(n,"add-component-to-form",!0)})};EditorFactory.correctRedirectSuccessLink=function(n,t){var i=n.getProperty(SUCCESS_PAGE_LINK_REDIRECT_BUTTON).value;if(t==EDITOR_CONTEXT)i==""&&UI.pager!=null&&n.setProperty(SUCCESS_PAGE_LINK_REDIRECT_BUTTON,UI.pager.pages[0].id);else if(t==VIEWER_CONTEXT&&UI.pager!=null)return UI.pager.pages[0].id};EditorFactory.bindEventsSuccessPage=function(n){$("#description-success-page").bind("keyup",function(){n.setProperty(SUCCESS_PAGE_MESSAGE,$("#description-success-page").val())});$("#headerText").bind("keyup",function(){n.setProperty(SUCCESS_PAGE_HEADER_TEXT,$("#headerText").val())});$("#buttonText").bind("keyup",function(){n.setProperty(SUCCESS_PAGE_BUTTON_TEXT,$("#buttonText").val())});$("#list-pages").bind("change",function(){n.setProperty(SUCCESS_PAGE_LINK_REDIRECT_BUTTON,$("#list-pages").find("option:selected").val())});$("#ffOptionInputPage").bind("change",function(){n.setProperty(SUCCESS_PAGE_TEXT_FONT_FAMILY,$("#ffOptionInputPage option:selected").val())});$("#preview-success-page").bind("click",function(){ViewerFactory.createModalWindow(n)});$("#set-default-values").bind("click",function(){Application.confirmMessage("You really want to reset settings success page?")&&EditorFactory.defaultValuesSuccessPage(n)})};EditorFactory.setEventsToComponent=function(n){ColorPickerHelper.bind("","#textColor",n,SUCCESS_PAGE_TEXT_COLOR);ColorPickerHelper.bind("","#contentColor",n,SUCCESS_PAGE_CONTENT_COLOR);ColorPickerHelper.bind("","#headerColor",n,SUCCESS_PAGE_HEADER_COLOR);ColorPickerHelper.bind("","#buttonColor",n,SUCCESS_PAGE_BUTTON_COLOR);EditorEventsFactory.attachPlainEvent("#ffOptionInputPage","",n,"",SUCCESS_PAGE_TEXT_FONT_FAMILY);RangeSliderHelper.bind("#fontSizePage",n,"",SUCCESS_PAGE_TEXT_FONT_SIZE,{min:20,max:35,postfix:"px"})};EditorFactory.upclickPicture=function(n,t,i,r,u,f,e,o){$(".upclick-button").upclick(n,{type:UPCLICK_TYPE_PICTURE,multiple:!0,oncomplete:function(s){for(var tt=JSON.parse(s),w=tt.files,b=[],k=!1,l,v,y,h,p,a,d,g,nt,c=0;c<w.length;++c){if(l=w[c],l.bannedExtension){k=!0;continue}v=UI.basicComponentRepository.getAll().where({name:"gallery-item"});v.any()&&(y=v.firstOrDefault(),h=(new Component).createNew(y,!0),b.push(h),a=[],n.children.forEach(function(n){a.push(n.getProperty("order").value.toInteger())}),a.any()?(d=_.max(a),p=d+1):p=0,h.setProperty("src",l.url),h.setProperty("order",p),UI.siteComponentRepository.appendTo(h,n),g={id:h.id,src:l.url},nt=HandlebarHelper.compileTemplate(y.editorTemplate,g),$("#gallery-editor .gallery-items-list").append(nt),ko.observable($(h.getUISelector())[0]).extend({applyBindings:t}),$(h.getUISelector()).find(".remove-button").bind("click",function(n){n.stopPropagation();i($(this).closest(".gallery-item").getId())}),$(h.getUISelector()).bind("click",function(){r();u($(this).getId());var n=UI.siteComponentRepository.lookupData({id:$(this)[0].id});f(n);$("#linkInput").bind("change",validateLink);validateLink()}),$("#linkInput").bind("change",validateLink),$("#linkInput").css("backgroundColor","white"),$(h.getUISelector()).find(".order-left").bind("click",function(n){n.stopPropagation();var t=UI.siteComponentRepository.lookupData({id:$(this).parent()[0].id});o(t,"left")}),$(h.getUISelector()).find(".order-right").bind("click",function(n){n.stopPropagation();var t=UI.siteComponentRepository.lookupData({id:$(this).parent()[0].id});o(t,"right")}),r(),u($(h.getUISelector()).getId()),f(h),e())}UI.undoManagerAddAddElements(b,e);k&&alert("One or more files has unsupported image format. They were not loaded.")}})};EditorFactory.logoImageUploading=function(n){upclick({type:UPCLICK_TYPE_PICTURE,element:"logo-image-upload-btn",action:"/Editor/UploadPicture?templateId="+UI.getTemplateProperty("templateId"),accept:".gif, .jpg, .png, .jpeg, .bmp",multiple:!1,onstart:function(){Application.addLocker()},oncomplete:function(t){Application.removeLocker();var i=Helpers.ProcessUploadSingleFileCompleted(t,$("#upclick-editor-error"),$("#logo-image-upload-btn"));i!=null&&($(".logo-image").attr("src",i.url),n.setProperty(SUCCESS_PAGE_IMAGE_LOGO,i.url))}});$(".upclick-container").bind("click",function(n){n.stopPropagation()})};EditorFactory.defaultValuesSuccessPage=function(n){var t,i;$("#description-success-page").val(MEESSAGE_EMAIL_SUCCESS_DOMANIAN_NAME);n.setProperty(SUCCESS_PAGE_MESSAGE,$("#description-success-page").val());$("#headerText").val(SECCESS_TITLE_PAGE);n.setProperty(SUCCESS_PAGE_HEADER_TEXT,$("#headerText").val());$("#buttonText").val(SECCESS_BUTTON_TEXT);n.setProperty(SUCCESS_PAGE_BUTTON_TEXT,$("#buttonText").val());t=[];t.pages=ContextFactory.pages("");i=HandlebarHelper.compileTemplate(UI.pager.getPageParentPageSelect(),t);$("#list-pages").html(i);n.setProperty(SUCCESS_PAGE_LINK_REDIRECT_BUTTON,$("#list-pages").find(":selected").val());$("#headerColor").val(SECCESS_HEADER_COLOR);$("#headerColor").change();n.setProperty(SUCCESS_PAGE_HEADER_COLOR,$("#headerColor").val());$("#buttonColor").val(SECCESS_BUTTON_COLOR);$("#buttonColor").change();n.setProperty(SUCCESS_PAGE_BUTTON_COLOR,$("#buttonColor").val());$("#textColor").val(SECCESS_TEXT_COLOR);$("#textColor").change();n.setProperty(SUCCESS_PAGE_TEXT_COLOR,$("#textColor").val());$("#contentColor").val(SECCESS_CONTENT_COLOR);$("#contentColor").change();n.setProperty(SUCCESS_PAGE_CONTENT_COLOR,$("#contentColor").val());$("#fontSizePage").val(SECCESS_FONT_SIZE);$("#fontSizePage").change();n.setProperty(SUCCESS_PAGE_TEXT_FONT_SIZE,SECCESS_FONT_SIZE);RangeSliderHelper.update($("#fontSizePage"),{from:parseInt(SECCESS_FONT_SIZE)});$("#ffOptionInputPage").find(":selected").attr("selected",!1);$("#ffOptionInputPage").find('[value="'+SECCESS_FONT_FAMILY+'"]').attr("selected",!0);n.setProperty(SUCCESS_PAGE_TEXT_FONT_FAMILY,$("#ffOptionInputPage").find(":selected").val());$(".logo-image").attr("src",SUCCESS_LOGO_IMAGE);n.setProperty(SUCCESS_PAGE_IMAGE_LOGO,$(".logo-image").attr("src"))};var DivEditor=function(n){var t=n.getUISelector();EditorEventsFactory.attachPlainEvent("#widthInput",t,n,CHANGE,WIDTH);EditorEventsFactory.attachPlainEvent("#heightInput",t,n,CHANGE,HEIGHT);EditorEventsFactory.attachPlainEvent("#leftInput",t,n,CHANGE,LEFT);EditorEventsFactory.attachPlainEvent("#topInput",t,n,CHANGE,TOP);ColorPickerHelper.bind(t,"#colorInput",n,COLOR);ColorPickerHelper.bind(t,"#bgcolorInput",n,BACKGROUND_COLOR)},AnchorEditor=function(n){var t=n.getUISelector();EditorEventsFactory.attachPlainEvent("#leftInput",t,n,CHANGE,LEFT);EditorEventsFactory.attachPlainEvent("#topInput",t,n,CHANGE,TOP);EditorEventsFactory.attachPlainEvent("#titleInput",t,n,CHANGE,"name");$("#titleInput").keyup(function(n){this.value.length<6?this.value="#anchor":this.value.indexOf("#anchor")!==0&&(this.value="#anchor"+String.fromCharCode(n.which))})},FrameEditor=function(n){var t=n.getUISelector();EditorEventsFactory.attachPlainEvent("#widthInput",t,n,CHANGE,WIDTH);EditorEventsFactory.attachPlainEvent("#heightInput",t,n,CHANGE,HEIGHT);EditorEventsFactory.attachPlainEvent("#leftInput",t,n,CHANGE,LEFT);EditorEventsFactory.attachPlainEvent("#topInput",t,n,CHANGE,TOP);EditorEventsFactory.attachPlainEvent("#linkInput",t,n,CHANGE,MODE_VALUE,function(n){UI.actionService.runActionForComponent(n,ACTION_REMOVE_FROM_FORM,!0);UI.actionService.runActionForComponent(n,ACTION_ADD_TO_FORM,!0)});$("#linkInput").on(CHANGE,validateLink);$("#linkInput").tooltip({placement:"bottom"})},PdfEditor=function(n){var t=n.getUISelector(),i;EditorEventsFactory.attachPlainEvent("#widthInput",t,n,CHANGE,WIDTH);EditorEventsFactory.attachPlainEvent("#heightInput",t,n,CHANGE,HEIGHT);EditorEventsFactory.attachPlainEvent("#leftInput",t,n,CHANGE,LEFT);EditorEventsFactory.attachPlainEvent("#topInput",t,n,CHANGE,TOP);EditorEventsFactory.attachPlainEvent("#isShowOptimizedPlaceholder",t,n,CHANGE,SHOW_OPTIMIZED_PLACEHOLDER,function(n,t,r){r=r==="true";var u=n.getProperty(IMAGE_PROPERTY).value,f=ContextFactory.prepareImgSrc(u,r);UI.actionService.runActionForComponent(n,ACTION_REMOVE_FROM_FORM);i(f);UI.actionService.runActionForComponent(n,ACTION_ADD_TO_FORM)});$("#upclick-button").upclick(n,{type:UPCLICK_TYPE_PDF,accept:".pdf",oncomplete:function(t){var i=Helpers.ProcessUploadSingleFileWithErrorLabelCompleted(t,$(".std-pdf-file-uploading-label"),$("#editor #upclick-button"));if(i!=null){var e=_.clone(n.getProperty(MODE_VALUE).value),u=_.clone(i.url),f=_.clone(n.getProperty(NAME).value),o=_.clone(i.nativeName),r=function(t,i){n.setProperty(MODE_VALUE,t);n.setProperty(NAME,i);$(".std-pdf-file-uploading-label").html(i.length?i:PDF_NOT_UPLOADED);var r=n.getProperty(IMAGE_PROPERTY).value;r&&r.indexOf("data:image")===-1||(Application.addSpinner("pdf-spinner",n.getUISelector()),Helpers.getPdfThumbnail(t,function(t){UI.actionService.runActionForComponent(n,ACTION_REMOVE_FROM_FORM);n.setProperty(IMAGE_PROPERTY,t);UI.actionService.runActionForComponent(n,ACTION_ADD_TO_FORM)}))};r(u,o);UI.undoManagerAdd({undo:function(){r(e,f)},redo:function(){r(u,f)}})}}});i=function(n){$("#editor-preview-single-image").attr("src",n)};i(ContextFactory.prepareImgSrc(n.getProperty(IMAGE_PROPERTY).value,n.getProperty(SHOW_OPTIMIZED_PLACEHOLDER).value));$("#upload-pdf-placeholder").upclick(n,{type:UPCLICK_TYPE_PICTURE,oncomplete:function(t){var u=Helpers.ProcessUploadSingleFileCompleted(t,$(".upclick-editor-error"),$("#editor #upload-pdf-placeholder"));if(u!=null){var e=_.clone(n.getProperty(IMAGE_PROPERTY).value),f=_.clone(u.url),r=function(t){var r=ContextFactory.prepareImgSrc(t,n.getProperty(SHOW_OPTIMIZED_PLACEHOLDER).value);$("#editor-preview-single-image-hover").attr("src",r);i(r);UI.actionService.runActionForComponent(n,ACTION_REMOVE_FROM_FORM);n.setProperty(IMAGE_PROPERTY,t);UI.actionService.runActionForComponent(n,ACTION_ADD_TO_FORM)};r(f);UI.undoManagerAdd({undo:function(){r(e)},redo:function(){r(f)}})}}});$(".close.remove-pdf-placeholder").click(function(){if($("#editor-preview-single-image").attr("src").indexOf("data:image")===-1){var u=_.clone(n.getProperty(IMAGE_PROPERTY).value),t,r=function(t){i(t);UI.actionService.runActionForComponent(n,ACTION_REMOVE_FROM_FORM);n.setProperty(IMAGE_PROPERTY,t);UI.actionService.runActionForComponent(n,ACTION_ADD_TO_FORM)};n.getProperty(MODE_VALUE).value?(Application.addSpinner("pdf-spinner",n.getUISelector()),Helpers.getPdfThumbnail(n.getProperty(MODE_VALUE).value,function(n){t=_.clone(n);r(t)})):(t="",r(t));UI.undoManagerAdd({undo:function(){r(u)},redo:function(){r(t)}})}});ko.applyBindings({},$("#editor")[0])},MortgageCalculatorEditor=function(n){var t=n.getUISelector(),i;EditorEventsFactory.attachPlainEvent("#widthInput",t,n,CHANGE,WIDTH);EditorEventsFactory.attachPlainEvent("#heightInput",t,n,CHANGE,HEIGHT);EditorEventsFactory.attachPlainEvent("#leftInput",t,n,CHANGE,LEFT);EditorEventsFactory.attachPlainEvent("#topInput",t,n,CHANGE,TOP);EditorEventsFactory.attachPlainEvent("#zindex",t,n,CHANGE,Z_INDEX);ColorPickerHelper.bind(t,"#colorInput",n,COLOR);ColorPickerHelper.bind(t,"#brcolorInput",n,BORDER_COLOR);EditorEventsFactory.attachPlainEvent("#fontOptionInput",t,n,CHANGE,FONT_FAMILY);RangeSliderHelper.bind("#fontSize",n,t,FONT_SIZE,{min:6,max:50,postfix:"px"},function(){var i=0,r=$(t).children(":last")[0],u;i+=r.offsetTop;i+=r.offsetHeight;$(t).css(HEIGHT,i);n.setProperty(HEIGHT,i+"px");$(t).highlightSelectedElement(n,!0);u=$(t).parent(".page");Resizer.recalculateHeaderFooterAndPageSize(u)});RangeSliderHelper.bind("#borderWidth",n,t,BORDER_WIDTH,{min:0,max:15,postfix:"px"});RangeSliderHelper.bind("#borderRadius",n,t,BORDER_RADIUS,{min:0,max:50,postfix:"px"});EditorEventsFactory.attachPlainEvent("#titleInput",t,n,CHANGE,"title",function(){i()});i=function(){var t=TemplateFactory.templateFor(n,VIEWER_TEMPLATE).compiledTemplate;$(n.getUISelector()).html($(t).html())}},EvaluateHomeEditor=function(n){var t=n.getUISelector();EditorFactory.addedTooltip(["dataToogleComponent"],"bottom");EditorEventsFactory.attachPlainEvent("#widthInput",t,n,CHANGE,WIDTH);EditorEventsFactory.attachPlainEvent("#heightInput",t,n,CHANGE,HEIGHT);EditorEventsFactory.attachPlainEvent("#leftInput",t,n,CHANGE,LEFT);EditorEventsFactory.attachPlainEvent("#topInput",t,n,CHANGE,TOP);EditorEventsFactory.attachPlainEvent("#zindex",t,n,CHANGE,Z_INDEX);EditorEventsFactory.attachPlainEvent("#titleInput",t,n,CHANGE,"title",function(){u()});EditorEventsFactory.attachPlainEvent("#mail-history",t,n,CHANGE,MAIL_HISTORY_PROPERTY,function(){});EditorEventsFactory.attachPlainEvent("#formSubject",t,n,CHANGE,FORM_SUBJECT);$("#required-fields").find("input[type='checkbox']").bind(CHANGE,function(t){var f=t.target.checked,r=t.target.value,i=n.getProperty(REQUIRED_FIELD).value.split(","),u=i.indexOf(r);f?(i.push(r),i=_.uniq(i)):u!==-1&&i.splice(u,1);UI.undoManagerAddSimple(n,REQUIRED_FIELD,i.join(","),function(){},!0)});$("#useCaptcha").bind(CHANGE,function(i){var r=i.target.checked,u=n.proto.getProperty(HEIGHT).value,e=[{component:n,property:USE_CAPTCHA,newvalue:r.toString(),oldvalue:_.clone(n.getProperty(USE_CAPTCHA).value)},{component:n,property:HEIGHT,newvalue:r?parseInt(u)+55+"px":u,oldvalue:_.clone(n.getProperty(HEIGHT).value)}],f=function(n,i,r,u,f){u===f-1&&(UI.actionService.runActionForComponent(i,ACTION_REMOVE_FROM_FORM,!0),UI.actionService.runActionForComponent(i,ACTION_ADD_TO_FORM,!0),$(t).highlightSelectedElement(i,!0))};UI.undoManagerAddSimpleArr(e,f,f,!0)});EditorEventsFactory.attachPlainEvent("#typeInput",t,n,CHANGE,"type");EditorEventsFactory.attachPlainEvent("#emailInput",t,n,CHANGE,"mode-value");ColorPickerHelper.bind(t,"#colorInput",n,COLOR);ColorPickerHelper.bind(t,"#brcolorInput",n,BORDER_COLOR);ColorPickerHelper.bind(t,"#backgroundColorInput",n,BACKGROUND_COLOR);EditorEventsFactory.attachPlainEvent("#fontOptionInput",t,n,CHANGE,FONT_FAMILY);RangeSliderHelper.bind("#fontSize",n,t,FONT_SIZE,{min:6,max:50,postfix:"px"},function(){var i=0,r=$(t).children(":last")[0],u;i+=r.offsetTop;i+=r.offsetHeight;$(t).css(HEIGHT,i);n.setProperty(HEIGHT,i+"px");$(t).highlightSelectedElement(n,!0);u=$(t).parent(".page");Resizer.recalculateHeaderFooterAndPageSize(u)});RangeSliderHelper.bind("#borderWidth",n,t,BORDER_WIDTH,{min:0,max:15,postfix:"px"});RangeSliderHelper.bind("#borderRadius",n,t,BORDER_RADIUS,{min:0,max:50,postfix:"px"});var u=function(){var t=TemplateFactory.templateFor(n,VIEWER_TEMPLATE).compiledTemplate;$(n.getUISelector()).html($(t).html())},r=n.getProperty(SUCCESS_PAGE_MASTER_LINK).value,i=r&&r!==n.id?UI.siteComponentRepository.lookupData({id:r}):n;EditorFactory.bindEventsSuccessPage(i);EditorFactory.setEventsToComponent(i);EditorFactory.logoImageUploading(i);EditorFactory.correctRedirectSuccessLink(i,EDITOR_CONTEXT);SwitcherHelper.bind(t,"#useSuccessPageAnyway",n,SUCCESS_PAGE_MASTER_LINK,function(n){UI.callEditor(n);$(UI.getConfigurationValue(EDITOR)+" .accordion .ui-accordion-content").removeClass("ui-accordion-content-active").hide();$(UI.getConfigurationValue(EDITOR)+" .accordion .content-success-settings").addClass("ui-accordion-content-active").show();$(UI.getConfigurationValue(EDITOR)+" .accordion .header-success-settings").addClass("ui-accordion-header-active").show()})},MenuEditor=function(n){MenuHelper.renderSubstringListMenu(n.getUISelector());var t=n.getUISelector();$(t).css({"text-overflow":"ellipsis","white-space":"nowrap"});EditorEventsFactory.attachPlainEvent("#widthInput",t,n,CHANGE,WIDTH);EditorEventsFactory.attachPlainEvent("#heightInput",t,n,CHANGE,HEIGHT,function(i,r,u){ViewerFactory.calculateMenuLineHeight(n,t);$(t).height(u);$(r).highlightSelectedElement(i,!0)});EditorEventsFactory.attachPlainEvent("#leftInput",t,n,CHANGE,LEFT);EditorEventsFactory.attachPlainEvent("#topInput",t,n,CHANGE,TOP);ColorPickerHelper.bind(t,"#bgcolorhoverInput",n,BACKGROUND_COLOR_HOVER);ColorPickerHelper.bind(t,"#txtcolorhoverInput",n,TEXT_COLOR_HOVER);ColorPickerHelper.bind(t,"#borderColorInput",n,BORDER_COLOR);ColorPickerHelper.bind(t,"#brcolorhoverInput",n,BORDER_COLOR_HOVER);ColorPickerHelper.bind(t,"#colorInput",n,COLOR,UI.renderMenus);ColorPickerHelper.bind(t,"#bgcolorInput",n,BACKGROUND_COLOR);EditorEventsFactory.attachPlainEvent("#zindex",t,n,CHANGE,Z_INDEX);EditorEventsFactory.attachPlainEvent("#fontOptionInput",t,n,CHANGE,FONT_FAMILY);SwitcherHelper.bind(t,"#stretchToFullWidth",n,STRETCH_TO_FULL_WIDTH);StretcherFactory.onStretchChange(n);RangeSliderHelper.bind("#marginsWidth",n,t,MARGINS_WIDTH,{min:0,max:80,postfix:"px"},function(n,t,i){StretcherFactory.enableMarginsToStretchedComponent(n,t,i)});EditorFactory.changeFixPosition("#pinnedPosition","input",n);SwitcherHelper.bind(t,"#isPinedSwitcher",n,IS_PINED);EditorEventsFactory.attachPlainEvent("#styleInput",t,n,CHANGE,"predefined",function(i,r,u){var e,o,f;CHANGE&&u=="vertical"&&$(t).css("line-height","");i.setProperty("predefined",u);UI.renderMenus();$(r).highlightSelectedElement(n,!0);u=="vertical"?(f=0,$(r+" ul").first().children().each(function(){f+=$(this)[0].offsetHeight}),$("#heightInput").val(f).change()):(f=undefined,e=UI.basicComponentRepository.getAll().where({name:n.proto.name}),e.any()&&(o=e.firstOrDefault(),f=o.getProperty(HEIGHT).value),f!=undefined&&$("#heightInput").val(f).change());ViewerFactory.calculateMenuLineHeight(i,r)});RangeSliderHelper.bind("#offsetX",n,t,OFFSET_X,{min:EditorFactory.checkMinRange(n,!0),max:600,postfix:"px"},function(){UI.actionService.runActionForComponent(n,"remove-component-from-form",!0);UI.actionService.runActionForComponent(n,"add-component-to-form",!0);Helpers.removeSelectWrapper()});RangeSliderHelper.bind("#offsetY",n,t,OFFSET_Y,{min:EditorFactory.checkMinRange(n,!1),max:600,postfix:"px"},function(){UI.actionService.runActionForComponent(n,"remove-component-from-form",!0);UI.actionService.runActionForComponent(n,"add-component-to-form",!0);Helpers.removeSelectWrapper()});RangeSliderHelper.bind("#fontSize",n,t,FONT_SIZE,{min:6,max:50,postfix:"px"},function(){UI.renderMenus();n.setProperty(WIDTH,$(t).css("width"))});RangeSliderHelper.bind("#borderRadius",n,t,BORDER_RADIUS,{min:0,max:50,postfix:"px"},UI.renderMenus);RangeSliderHelper.bind("#borderWidth",n,t,BORDER_WIDTH,{min:0,max:15,postfix:"px"},UI.renderMenus);ko.applyBindings({},$("#editor")[0])},ContactUsEditor=function(n){function f(){var n=$("#typeInput").val(),t='<img src="/Images/contact-us-types/cu-'+n.split(" ").join("")+'.png" />';$("#type").empty();$("#type").prepend(t)}var t=n.getUISelector(),u,r,i;EditorFactory.addedTooltip(["dataToogleComponent"],"bottom");EditorEventsFactory.attachPlainEvent("#widthInput",t,n,CHANGE,WIDTH);EditorEventsFactory.attachPlainEvent("#heightInput",t,n,CHANGE,HEIGHT);EditorEventsFactory.attachPlainEvent("#leftInput",t,n,CHANGE,LEFT);EditorEventsFactory.attachPlainEvent("#topInput",t,n,CHANGE,TOP);EditorEventsFactory.attachPlainEvent("#zindex",t,n,CHANGE,Z_INDEX);EditorEventsFactory.attachPlainEvent("#formSubject",t,n,CHANGE,FORM_SUBJECT);EditorEventsFactory.attachPlainEvent("#typeInput",t,n,CHANGE,"type",function(){u()});EditorEventsFactory.attachPlainEvent("#titleInput",t,n,CHANGE,"title",function(){u()});$("#required-fields").find("input[type='checkbox']").bind(CHANGE,function(t){var f=t.target.checked,r=t.target.value,i=n.getProperty(REQUIRED_FIELD).value.split(","),u=i.indexOf(r);f?(i.push(r),i=_.uniq(i)):u!==-1&&i.splice(u,1);UI.undoManagerAddSimple(n,REQUIRED_FIELD,i.join(","),function(){},!0)});$("#useCaptcha").bind(CHANGE,function(i){var r=i.target.checked,u=n.getProperty(TYPE).value!=="Request a quote"?n.proto.getProperty(HEIGHT).value:"390px",e=[{component:n,property:USE_CAPTCHA,newvalue:r.toString(),oldvalue:_.clone(n.getProperty(USE_CAPTCHA).value)},{component:n,property:HEIGHT,newvalue:r?parseInt(u)+75+"px":u,oldvalue:_.clone(n.getProperty(HEIGHT).value)}],f=function(n,i,r,u,f){u===f-1&&(UI.actionService.runActionForComponent(i,ACTION_REMOVE_FROM_FORM,!0),UI.actionService.runActionForComponent(i,ACTION_ADD_TO_FORM,!0),$(t).highlightSelectedElement(i,!0))};UI.undoManagerAddSimpleArr(e,f,f,!0)});EditorEventsFactory.attachPlainEvent("#emailInput",t,n,CHANGE,"mode-value");EditorEventsFactory.attachPlainEvent("#mail-history",t,n,CHANGE,MAIL_HISTORY_PROPERTY,function(){});ColorPickerHelper.bind(t,"#colorInput",n,COLOR);ColorPickerHelper.bind(t,"#brcolorInput",n,BORDER_COLOR);ColorPickerHelper.bind(t,"#backgroundColorInput",n,BACKGROUND_COLOR);EditorEventsFactory.attachPlainEvent("#fontOptionInput",t,n,CHANGE,FONT_FAMILY,function(){});RangeSliderHelper.bind("#fontSize",n,t,FONT_SIZE,{min:6,max:50,postfix:"px"},function(){var i=0,r=$(t).children(":last")[0],u;i+=r.offsetTop;i+=r.offsetHeight;$(t).css(HEIGHT,i);n.setProperty(HEIGHT,i+"px");$(t).highlightSelectedElement(n,!0);u=$(t).parent(".page");Resizer.recalculateHeaderFooterAndPageSize(u)});RangeSliderHelper.bind("#borderWidth",n,t,BORDER_WIDTH,{min:0,max:15,postfix:"px"});RangeSliderHelper.bind("#borderRadius",n,t,BORDER_RADIUS,{min:0,max:50,postfix:"px"});u=function(){var t=TemplateFactory.templateFor(n,VIEWER_TEMPLATE).compiledTemplate;$(n.getUISelector()).html($(t).html())};$(".list-type-option").bind("click",function(){var n=$(this).text();$("#typeInput").val(n).change();f();$(".list-type-option").removeClass("active");$(this).addClass("active");Helpers.removeSelectWrapper()});f();$(".save-type").bind("click",function(){$("#typeInput").val()=="Make an Appointment"?$("#titleInput").val("Make An Appointment").change():($("#titleInput").val("Request a Quote").change(),$("#heightInput").val("390px").change());n.isNotApproved=!1;eventsystem.publish("/component/create/",n,t);UI.removeEditor()});r=n.getProperty(SUCCESS_PAGE_MASTER_LINK).value;i=r&&r!==n.id?UI.siteComponentRepository.lookupData({id:r}):n;EditorFactory.bindEventsSuccessPage(i);EditorFactory.setEventsToComponent(i);EditorFactory.logoImageUploading(i);EditorFactory.correctRedirectSuccessLink(i,EDITOR_CONTEXT);SwitcherHelper.bind(t,"#useSuccessPageAnyway",n,SUCCESS_PAGE_MASTER_LINK,function(n){UI.callEditor(n);$(UI.getConfigurationValue(EDITOR)+" .accordion .ui-accordion-content").removeClass("ui-accordion-content-active").hide();$(UI.getConfigurationValue(EDITOR)+" .accordion .content-success-settings").addClass("ui-accordion-content-active").show();$(UI.getConfigurationValue(EDITOR)+" .accordion .header-success-settings").addClass("ui-accordion-header-active").show()});ko.applyBindings({},$("#editor")[0])},VideoEditor=function(n){var t=n.getUISelector(),i,r;EditorFactory.addedTooltip(["rel"],"bottom");EditorEventsFactory.attachPlainEvent("#widthInput",t,n,CHANGE,WIDTH);EditorEventsFactory.attachPlainEvent("#heightInput",t,n,CHANGE,HEIGHT);EditorEventsFactory.attachPlainEvent("#leftInput",t,n,CHANGE,LEFT);EditorEventsFactory.attachPlainEvent("#topInput",t,n,CHANGE,TOP);EditorEventsFactory.attachPlainEvent("#zindex",t,n,CHANGE,Z_INDEX);$("#keep-aspect-button").on("click",function(){var n=parseInt($("#widthInput").val()),t=parseInt(n*9/16);$("#heightInput").val(t+"px").change()});EditorEventsFactory.attachPlainEvent("#src",t,n,CHANGE,"src",function(n,t,u){(function(i){var u,f;i=i.lastIndexOf("/")===i.length-1?i.substring(0,i.length-1):i;u=i.replace(/http:\/\//,"").split("/").pop();u=u.replace("watch?v=","");f=/vimeo/.test(i)?"http://player.vimeo.com/video/":/youtu/.test(i)?"https://www.youtube.com/embed/":"";f.length>0?($(t).val(f+u),n.setProperty("src",f+u),r(i,n)):(console.log("rejected video url: "+i),$(t).val(""),n.setProperty("src",""))})(u);i()});EditorEventsFactory.attachPlainEvent("#providerInput",t,n,CHANGE,"provider",function(t){r(Helpers.convertToUniversalUrl(n.getProperty(SRC).value),t);i()});EditorEventsFactory.attachPlainEvent("#autoplay",t,n,CHANGE,"autoplay",function(n,t,r){n.setProperty("autoplay",r);i()});EditorEventsFactory.attachPlainEvent("#loop",t,n,CHANGE,"loop",function(n,t,r){n.setProperty("loop",r);r&&($("#rel").prop("checked",!1),n.setProperty("rel",!1));i()});EditorEventsFactory.attachPlainEvent("#rel",t,n,CHANGE,"rel",function(n,t,r){n.setProperty("rel",r);r&&($("#loop").prop("checked",!1),n.setProperty("loop",!1));i()});i=function(){var i=n.getProperty(SRC).value;ViewerFactory.replacementImageInsteadVideo(t,Helpers.convertToUniversalUrl(i))};r=function(n,t){for(var r=["vimeo","youtube"],i=0;i<r.length;i++)n.toLowerCase().indexOf(r[i])>=0&&($("#providerInput").val(r[i]),t.setProperty("provider",r[i]))}},SoundEditor=function(n){var t=n.getUISelector(),i,r;$("#rel").tooltip({placement:"bottom"});EditorEventsFactory.attachPlainEvent("#leftInput",t,n,CHANGE,LEFT);EditorEventsFactory.attachPlainEvent("#topInput",t,n,CHANGE,TOP);EditorEventsFactory.attachPlainEvent("#zindex",t,n,CHANGE,Z_INDEX);EditorEventsFactory.attachPlainEvent("#soundautoplay",t,n,CHANGE,AUTOPLAY,function(n,t,i){n.setProperty(AUTOPLAY,i)});EditorEventsFactory.attachPlainEvent("#soundhide",t,n,CHANGE,HIDE,function(n,i,r){n.setProperty(HIDE,r);r?$(t).css("opacity","0.2"):$(t).css("opacity","1")});RangeSliderHelper.bind("#soundpause",n,t,"pause",{min:0,max:60,postfix:""});i=function(t){var i=n.getProperty(AUTOPLAY).value.toBoolean();t!=undefined&&(i=t.target.checked);i==!0?$("#soundpausediv").show():$("#soundpausediv").hide()};$("#soundautoplay").bind("change",i);i();r=function(n){var r=n.getProperty("id").value,t={data:""},i=UI.siteComponentRepository.lookupDataSet({componentId:SOUNDID});return i.length>0&&i.forEach(function(n){var i=n.getProperty("id").value;i!=r&&(t.data=t.data+(t.data!=""?",":"")+i)}),t};$("#sound-upload-button").upclick(n,{type:UPCLICK_TYPE_SOUND,accept:".mp3, .mp4, .m4a, .m4v",action_params:r(n),oncomplete:function(i){var r=Helpers.ProcessUploadSingleFileCompleted(i,$(".upclick-editor-error"),$("#editor #sound-upload-button")),u,f;r!=null&&(u=function(){$("#sound_file").text(n.getProperty("title").value);$("#"+n.id).find(".jp-title").html(n.getProperty("title").value);var i=$(n.getUISelector()+JPLAYER_CONTAINER_SUFFIX).outerHeight();n.setProperty(HEIGHT,i+"px");$(t).css(HEIGHT,i);$(t).highlightSelectedElement(n,!0)},f=[{component:n,property:"src",newvalue:_.clone(r.url),oldvalue:_.clone(n.getProperty("src").value)},{component:n,property:"title",newvalue:_.clone(r.nativeName),oldvalue:_.clone(n.getProperty("title").value)},{component:n,property:"id",newvalue:_.clone(r.id),oldvalue:_.clone(n.getProperty("id").value)}],UI.undoManagerAddSimpleArr(f,u,u,!0))}})},PanelEditor=function(n){var t=n.getUISelector();EditorEventsFactory.attachPlainEvent("#widthInput",t,n,CHANGE,WIDTH);EditorEventsFactory.attachPlainEvent("#heightInput",t,n,CHANGE,HEIGHT);EditorEventsFactory.attachPlainEvent("#leftInput",t,n,CHANGE,LEFT);EditorEventsFactory.attachPlainEvent("#topInput",t,n,CHANGE,TOP);EditorEventsFactory.attachPlainEvent("#zindex",t,n,CHANGE,Z_INDEX);EditorFactory.changeFixPosition("#pinnedPosition","input",n);SwitcherHelper.bind(t,"#isPinedSwitcher",n,IS_PINED);ColorPickerHelper.bind(t,"#bgcolorInput",n,BACKGROUND_COLOR);ColorPickerHelper.bind(t,"#brcolorInput",n,BORDER_COLOR);RangeSliderHelper.bind("#borderWidth",n,t,BORDER_WIDTH,{min:0,max:15,postfix:"px"});RangeSliderHelper.bind("#borderRadius",n,t,BORDER_RADIUS,{min:0,max:50,postfix:"px"});SwitcherHelper.bind(t,"#stretchToFullWidth",n,STRETCH_TO_FULL_WIDTH);StretcherFactory.onStretchChange(n);RangeSliderHelper.bind("#marginsWidth",n,t,MARGINS_WIDTH,{min:0,max:80,postfix:"px"},function(n,t,i){StretcherFactory.enableMarginsToStretchedComponent(n,t,i)});RangeSliderHelper.bind("#offsetX",n,t,OFFSET_X,{min:EditorFactory.checkMinRange(n,!0),max:600,postfix:"px"},function(){UI.actionService.runActionForComponent(n,"remove-component-from-form",!0);UI.actionService.runActionForComponent(n,"add-component-to-form",!0);Helpers.removeSelectWrapper()});RangeSliderHelper.bind("#offsetY",n,t,OFFSET_Y,{min:EditorFactory.checkMinRange(n,!1),max:600,postfix:"px"},function(){UI.actionService.runActionForComponent(n,"remove-component-from-form",!0);UI.actionService.runActionForComponent(n,"add-component-to-form",!0);Helpers.removeSelectWrapper()});this.layering=this.layering||new LayeringController(n);ko.applyBindings({},$("#editor")[0])},ImageEditor=function(n){var t=n.getUISelector();EditorFactory.linkManagementEditor(n,t);EditorEventsFactory.attachPlainEvent("#altInput",t,n,CHANGE,ALT);EditorEventsFactory.attachPlainEvent("#widthInput",t,n,CHANGE,WIDTH);EditorEventsFactory.attachPlainEvent("#heightInput",t,n,CHANGE,HEIGHT);EditorEventsFactory.attachPlainEvent("#leftInput",t,n,CHANGE,LEFT);EditorEventsFactory.attachPlainEvent("#topInput",t,n,CHANGE,TOP);EditorEventsFactory.attachPlainEvent("#zindex",t,n,CHANGE,Z_INDEX);$("#primaryImageInput").bind(CHANGE,function(){var i=$(this).is(":checked"),r=[{component:n,property:IS_IMAGE_PRIMARY,newvalue:i.toString(),oldvalue:n.getProperty(IS_IMAGE_PRIMARY).value}],u,f,t;i&&(u=UI.siteComponentRepository.lookupData({id:n.parentComponent.id}),f=UI.siteComponentRepository.lookupDataSet({displayName:IMAGE},u).whereNot({id:n.id}),r.addRange(f.map(function(n){return{component:n,property:IS_IMAGE_PRIMARY,newvalue:(!1).toString(),oldvalue:n.getProperty(IS_IMAGE_PRIMARY).value}})));t=function(n,t,i,r,u){r===u-1&&Helpers.refreshAllBloggingComponents()};UI.undoManagerAddSimpleArr(r,t,t,!0)});EditorFactory.changeFixPosition("#pinnedPosition","input",n);SwitcherHelper.bind(t,"#isPinedSwitcher",n,IS_PINED);RangeSliderHelper.bind("#offsetX",n,t,OFFSET_X,{min:EditorFactory.checkMinRange(n,!0),max:600,postfix:"px"},function(){UI.actionService.runActionForComponent(n,"remove-component-from-form",!0);UI.actionService.runActionForComponent(n,"add-component-to-form",!0);Helpers.removeSelectWrapper()});RangeSliderHelper.bind("#offsetY",n,t,OFFSET_Y,{min:EditorFactory.checkMinRange(n,!1),max:600,postfix:"px"},function(){UI.actionService.runActionForComponent(n,"remove-component-from-form",!0);UI.actionService.runActionForComponent(n,"add-component-to-form",!0);Helpers.removeSelectWrapper()});EditorEventsFactory.attachPlainEvent("#styleInput",t,n,CHANGE,"predefined",function(n,i,r){$(t).find("img").attr("class","std-img "+r)});SwitcherHelper.bind(t,"#stretchToFullWidth",n,STRETCH_TO_FULL_WIDTH);StretcherFactory.onStretchChange(n);RangeSliderHelper.bind("#marginsWidth",n,t,MARGINS_WIDTH,{min:0,max:80,postfix:"px"},function(n,t,i){StretcherFactory.enableMarginsToStretchedComponent(n,t,i)});$("#upclick-button").upclick(n,{type:UPCLICK_TYPE_PICTURE,oncomplete:function(i){var f=Helpers.ProcessUploadSingleFileCompleted(i,$(".upclick-editor-error"),$("#editor #upclick-button")),r;if(f!=null){r=new Image;r.onload=function(){var i=r.height,u=r.width,e,o,s,h,f,c;for(i>800||u>800?i>u?(e=i/u,o=~~(700/e),u=o,i="700"):i<u&&(s=u/i,h=~~(700/s),u="700",i=h):(i=r.height,u=r.width),$(t).css(HEIGHT,i),$(t).css(WIDTH,u),n.setProperty(WIDTH,u+"px"),n.setProperty(HEIGHT,i+"px"),$(t).highlightSelectedElement(n,!0),f=0;f<n.properties.length;f++)n.properties[f].name=="height"?$("#heightInput").val(i+"px"):n.properties[f].name=="width"&&$("#widthInput").val(u+"px");c=$(t).parent(".page");Resizer.recalculateHeaderFooterAndPageSize(c)};r.src=f.url;var o=_.clone(n.getProperty("src").value),e=_.clone(r.src),u=function(i){n.setProperty("src",i);var r=ContextFactory.prepareImgSrc(i,n.getProperty(SHOW_OPTIMIZED).value);SetSingleImage(t,r);Helpers.refreshAllBloggingComponents()};u(e);UI.undoManagerAdd({undo:function(){u(o)},redo:function(){u(e)}})}}});$("#upclick-button-hover").upclick(n,{type:UPCLICK_TYPE_PICTURE,oncomplete:function(t){var r=Helpers.ProcessUploadSingleFileCompleted(t,$(".upclick-editor-error"),$("#editor #upclick-button-hover")),f;if(r!=null)try{var e=_.clone(n.getProperty("image-on-hover").value),u=_.clone(r.url),i=function(t){var i=ContextFactory.prepareImgSrc(t,n.getProperty(SHOW_OPTIMIZED_HOVER).value);$("#editor-preview-single-image-hover").attr("src",i);n.setProperty("image-on-hover",t)};i(u);UI.undoManagerAdd({undo:function(){i(e)},redo:function(){i(u)}})}catch(o){f='<div class="property-editor upclick-editor-error">Old images do not have this property.<\/div>';$("#editor #upclick-button-hover").prev().after(f)}}});$("#upclick-button-pressed").upclick(n,{type:UPCLICK_TYPE_PICTURE,oncomplete:function(t){var r=Helpers.ProcessUploadSingleFileCompleted(t,$(".upclick-editor-error"),$("#editor #upclick-button-pressed")),f;if(r!=null)try{var e=_.clone(n.getProperty("image-on-pressed").value),u=_.clone(r.url),i=function(t){var i=ContextFactory.prepareImgSrc(t,n.getProperty(SHOW_OPTIMIZED_PRESSED).value);$("#editor-preview-single-image-pressed").attr("src",i);n.setProperty("image-on-pressed",t)};i(u);UI.undoManagerAdd({undo:function(){i(e)},redo:function(){i(u)}})}catch(o){f='<div class="property-editor upclick-editor-error">Old images do not have this property.<\/div>';$("#editor #upclick-button-pressed").prev().after(f)}}});$(".close.remove-button").click(function(i){var o=i.currentTarget.dataset.button,u="",r="",c=$(i.currentTarget).parent().find("img").attr("src"),f=BLANKIMAGE,s;if(c!=""){switch(o){case IMAGE:u="editor-preview-single-image";r="src";break;case HOVER:u="editor-preview-single-image-hover";r="image-on-hover";f="";break;case IMAGE_SWAP:u="editor-preview-single-image-pressed";r="image-on-pressed";f="";break;default:s='<div class="property-editor upclick-editor-error">Error: can not remove image<\/div>';$(i.currentTarget.parentElement.parentElement).find('[type="button"].service-button').prev().after(s);return}var l=_.clone(n.getProperty(r).value),h=_.clone(f),e=function(i){$("#"+u).attr("src",i);n.setProperty(r,i);o==IMAGE&&$(t).find(".std-img").attr("src",i)};e(h);UI.undoManagerAdd({undo:function(){e(l)},redo:function(){e(h)}})}});EditorEventsFactory.attachPlainEvent("#isShowOptimized",t,n,CHANGE,SHOW_OPTIMIZED,function(n,t,i){i=i==="true";var r=n.getProperty(SRC).value,u=ContextFactory.prepareImgSrc(r,i);SetSingleImage(t,u)});EditorEventsFactory.attachPlainEvent("#isShowOptimizedHover",t,n,CHANGE,SHOW_OPTIMIZED_HOVER,function(n,t,i){i=i==="true";var r=n.getProperty(IMAGE_ON_HOVER).value,u=ContextFactory.prepareImgSrc(r,i);$("#editor-preview-single-image-hover").attr("src",u)});EditorEventsFactory.attachPlainEvent("#isShowOptimizedPressed",t,n,CHANGE,SHOW_OPTIMIZED_PRESSED,function(n,t,i){i=i==="true";var r=n.getProperty(IMAGE_ON_PRESSED).value,u=ContextFactory.prepareImgSrc(r,i);$("#editor-preview-single-image-pressed").attr("src",u)});ko.applyBindings({},$("#editor")[0]);this.layering=this.layering||new LayeringController(n)},SetSingleImage=function(n,t){$(n).find(".std-img").attr("src",t);$("#editor-preview-single-image").attr("src",t);$(n).css("src",t)},ParagraphEditor=function(n){var t=n.getUISelector(),r,i;if(n.isckeditorworking){if(r=$(n.getUISelector())[0],$(n.getUISelector()).data("ckeditorInstance")!=null){console.log("component is allready in edit mode...");return}if(i=n.getProperty(TEXT),i==null&&(n.setProperty(TEXT,DEFAULT_PARAGRAPH_TEXT,!0),i=n.getProperty(TEXT)),$(n.getUISelector()).data("ckeditorInstance")!=null){console.log("component is allready in edit mode...");return}var u=i.hasOwnProperty("value")===!0?i.value:DEFAULT_PARAGRAPH_TEXT,f={ckEditor:u},e=ko.observable(u);ko.observable(r).extend({applyBindingsToNode:{model:f,extension:ko.utils.extend(ko.dataFor(r),{paragraphtext:e()})}})}else EditorEventsFactory.attachPlainEvent("#widthInput",t,n,CHANGE,WIDTH),EditorEventsFactory.attachPlainEvent("#heightInput",t,n,CHANGE,HEIGHT),EditorEventsFactory.attachPlainEvent("#leftInput",t,n,CHANGE,LEFT),EditorEventsFactory.attachPlainEvent("#topInput",t,n,CHANGE,TOP),EditorEventsFactory.attachPlainEvent("#zindex",t,n,CHANGE,Z_INDEX),ColorPickerHelper.bind(t,"#brcolorInput",n,BORDER_COLOR),ColorPickerHelper.bind(t,"#bgcolorInput",n,BACKGROUND_COLOR),RangeSliderHelper.bind("#borderWidth",n,t,BORDER_WIDTH,{min:0,max:15,postfix:"px"}),RangeSliderHelper.bind("#borderRadius",n,t,BORDER_RADIUS,{min:0,max:50,postfix:"px"}),EditorFactory.linkManagementEditor(n,t);this.layering=this.layering||new LayeringController(n)},HeadertextEditor=function(n){var t=n.getUISelector(),r,i;if(n.isckeditorworking){if(r=$(n.getUISelector())[0],$(n.getUISelector()).data("ckeditorInstance")!=null){console.log("component is allready in edit mode...");return}i=n.getProperty(TEXT);i==null&&(n.setProperty(TEXT,"Heading",!0),i=n.getProperty(TEXT));var u=i.hasOwnProperty("value")===!0?i.value:"Heading",f={ckEditor:u},e=ko.observable(u);ko.observable(r).extend({applyBindingsToNode:{model:f,extension:ko.utils.extend(ko.dataFor(r),{headertexttext:e()})}})}else EditorEventsFactory.attachPlainEvent("#widthInput",t,n,CHANGE,WIDTH),EditorEventsFactory.attachPlainEvent("#heightInput",t,n,CHANGE,HEIGHT),EditorEventsFactory.attachPlainEvent("#leftInput",t,n,CHANGE,LEFT),EditorEventsFactory.attachPlainEvent("#topInput",t,n,CHANGE,TOP),EditorEventsFactory.attachPlainEvent("#zindex",t,n,CHANGE,Z_INDEX),ColorPickerHelper.bind(t,"#brcolorInput",n,BORDER_COLOR),ColorPickerHelper.bind(t,"#bgcolorInput",n,BACKGROUND_COLOR),RangeSliderHelper.bind("#borderWidth",n,t,BORDER_WIDTH,{min:0,max:15,postfix:"px"}),RangeSliderHelper.bind("#borderRadius",n,t,BORDER_RADIUS,{min:0,max:50,postfix:"px"}),EditorFactory.linkManagementEditor(n,t);this.layering=this.layering||new LayeringController(n)},BloggingEditor=function(n){var t=n.getUISelector(),i,r;EditorEventsFactory.attachPlainEvent("#widthInput",t,n,CHANGE,WIDTH);EditorEventsFactory.attachPlainEvent("#heightInput",t,n,CHANGE,HEIGHT);EditorEventsFactory.attachPlainEvent("#leftInput",t,n,CHANGE,LEFT);EditorEventsFactory.attachPlainEvent("#topInput",t,n,CHANGE,TOP);EditorEventsFactory.attachPlainEvent("#zindex",t,n,CHANGE,Z_INDEX);EditorEventsFactory.attachPlainEvent("#fontOptionInput",t,n,CHANGE,FONT_FAMILY);i=n.getProperty(PARENT_PAGE).value;i&&(r=UI.siteComponentRepository.lookupData({id:i}),r&&$("#titleInput").bind(CHANGE,function(){var n=_.clone($(this).val());UI.undoManagerAddSimple(r,TITLE,n,function(n,t){UI.pager.getPage(t.id).title=n;Pager.renderTopMenuSelect()},!0)}));RangeSliderHelper.bind("#borderWidth",n,t,BORDER_WIDTH,{min:0,max:15,postfix:"px"});RangeSliderHelper.bind("#borderRadius",n,t,BORDER_RADIUS,{min:0,max:50,postfix:"px"});RangeSliderHelper.bind("#fontSize",n,t,FONT_SIZE,{min:6,max:50,postfix:"px"});ColorPickerHelper.bind(t,"#colorInput",n,COLOR);ColorPickerHelper.bind(t,"#bgcolorInput",n,BACKGROUND_COLOR);ColorPickerHelper.bind(t,"#brcolorInput",n,BORDER_COLOR);SwitcherHelper.bind(t,"#page-layout",n,LAYOUT)},ButtonEditor=function(n){var t=n.getUISelector();$(t).css({"text-overflow":"ellipsis",overflow:"hidden"});EditorEventsFactory.attachPlainEvent("#widthInput",t,n,CHANGE,WIDTH);EditorEventsFactory.attachPlainEvent("#heightInput",t,n,CHANGE,HEIGHT,function(n){ViewerFactory.calculateButtonLineHeight(n.getUISelector())});EditorEventsFactory.attachPlainEvent("#leftInput",t,n,CHANGE,LEFT);EditorEventsFactory.attachPlainEvent("#topInput",t,n,CHANGE,TOP);EditorEventsFactory.attachPlainEvent("#textalign",t,n,CHANGE,TEXT_ALIGN);EditorEventsFactory.attachPlainEvent("#contentInput",t,n,CHANGE,TEXT);EditorEventsFactory.attachPlainEvent("#fontOptionInput",t,n,CHANGE,FONT_FAMILY);EditorEventsFactory.attachPlainEvent("#zindex",t,n,CHANGE,Z_INDEX);EditorFactory.changeFixPosition("#pinnedPosition","input",n);SwitcherHelper.bind(t,"#isPinedSwitcher",n,IS_PINED);ColorPickerHelper.bind(t,"#colorInput",n,COLOR);ColorPickerHelper.bind(t,"#bgcolorInput",n,BACKGROUND_COLOR);ColorPickerHelper.bind(t,"#bgcolorhoverInput",n,BACKGROUND_COLOR_HOVER);ColorPickerHelper.bind(t,"#brcolorhoverInput",n,BORDER_COLOR_HOVER);ColorPickerHelper.bind(t,"#txtcolorhoverInput",n,TEXT_COLOR_HOVER);ColorPickerHelper.bind(t,"#brcolorInput",n,BORDER_COLOR);RangeSliderHelper.bind("#borderWidth",n,t,BORDER_WIDTH,{min:0,max:15,postfix:"px"},function(){ViewerFactory.calculateButtonLineHeight(n.getUISelector())});RangeSliderHelper.bind("#borderRadius",n,t,BORDER_RADIUS,{min:0,max:50,postfix:"px"});RangeSliderHelper.bind("#fontSize",n,t,FONT_SIZE,{min:6,max:50,postfix:"px"});RangeSliderHelper.bind("#offsetX",n,t,OFFSET_X,{min:EditorFactory.checkMinRange(n,!0),max:600,postfix:"px"},function(){UI.actionService.runActionForComponent(n,"remove-component-from-form",!0);UI.actionService.runActionForComponent(n,"add-component-to-form",!0);Helpers.removeSelectWrapper()});RangeSliderHelper.bind("#offsetY",n,t,OFFSET_Y,{min:EditorFactory.checkMinRange(n,!1),max:600,postfix:"px"},function(){UI.actionService.runActionForComponent(n,"remove-component-from-form",!0);UI.actionService.runActionForComponent(n,"add-component-to-form",!0);Helpers.removeSelectWrapper()});EditorFactory.linkManagementEditor(n,t);ko.applyBindings({},$("#editor")[0]);this.layering=this.layering||new LayeringController(n)},MapEditor=function(n){function i(n){UI.actionService.runActionForComponent(n,ACTION_REMOVE_FROM_FORM,!0);UI.actionService.runActionForComponent(n,ACTION_ADD_TO_FORM,!0)}function r(t,r,u){if(t&&r&&u){var e=[{component:n,property:TEXT,newvalue:t,oldvalue:n.getProperty(TEXT).value},{component:n,property:LATITUDE,newvalue:r,oldvalue:n.getProperty(LATITUDE).value},{component:n,property:LONGITUDE,newvalue:u,oldvalue:n.getProperty(LONGITUDE).value}],f=function(n,t,r,u,f){r===TEXT?$("#textInput").val(n):r===LATITUDE?$("#latInput").val(n):r===LONGITUDE&&$("#lngInput").val(n);u===f-1&&i(t)};UI.undoManagerAddSimpleArr(e,f,f,!0)}}var t=n.getUISelector();EditorEventsFactory.attachPlainEvent("#widthInput",t,n,CHANGE,WIDTH);EditorEventsFactory.attachPlainEvent("#heightInput",t,n,CHANGE,HEIGHT);EditorEventsFactory.attachPlainEvent("#leftInput",t,n,CHANGE,LEFT);EditorEventsFactory.attachPlainEvent("#topInput",t,n,CHANGE,TOP);EditorEventsFactory.attachPlainEvent("#zindex",t,n,CHANGE,Z_INDEX);$("#textInput").bind(CHANGE,function(){var f=$(this).val(),u=$(t).find(".map").get(0),n,i;u&&(n=u.contentWindow,n&&(i=n.googleMapsGeocoder,i&&i.geocode({address:f},function(n,t){t==="OK"?n[0]?r(n[0].formatted_address,n[0].geometry.location.lat(),n[0].geometry.location.lng()):Application.showOkDialog("Error","No results found"):console.log("Geocoder failed due to: "+t)})))});EditorEventsFactory.attachPlainEvent("#titleInput",t,n,CHANGE,TITLE,i);SwitcherHelper.bind(t,"#showMapTypeSwitcher",n,SHOW_MAP_TYPE,i);SwitcherHelper.bind(t,"#showZoomSwitcher",n,SHOW_ZOOM,i);SwitcherHelper.bind(t,"#mapInteractiveSwitcher",n,MAP_INTERACTIVE,i);SwitcherHelper.bind(t,"#showStreetViewSwitcher",n,SHOW_STREET_VIEW,i)};EditorFactory.checkMinRange=function(n,t){var i=n.getProperty(FIXED_LOCATION).value,r=0,u=0;return t&&(i==="center-top"||i==="center-bottom")?r=-600:t||i!=="left-center"&&i!=="right-center"||(u=-600),t?r:u};EditorFactory.changeFixPosition=function(n,t,i){$(n).on("click",t,function(n){var t,f,r,u,e;n.preventDefault();t=$(this).data().position;$(this).addClass(t);$("#pinnedOffsetXY").show("fast");$("#pinnedPosition label.elemposition-selected").removeClass("elemposition-selected");$(this).next().addClass("elemposition-selected");f=function(n,t){UI.actionService.runActionForComponent(t,"remove-component-from-form",!0);UI.actionService.runActionForComponent(t,"add-component-to-form",!0);Helpers.removeSelectWrapper()};r="20px";(t==="center-top"||t==="center-bottom")&&(r="0px");u="20px";(t==="left-center"||t==="right-center")&&(u="0px");e=[{component:i,property:IS_PINED,newvalue:(!0).toString(),oldvalue:i.getProperty(IS_PINED).value},{component:i,property:FIXED_LOCATION,newvalue:t,oldvalue:i.getProperty(FIXED_LOCATION).value},{component:i,property:OFFSET_X,newvalue:r,oldvalue:i.getProperty(OFFSET_X).value},{component:i,property:OFFSET_Y,newvalue:u,oldvalue:i.getProperty(OFFSET_Y).value}];UI.undoManagerAddSimpleArr(e,f,f,!0);RangeSliderHelper.update("#offsetX",{from:parseInt(r),min:EditorFactory.checkMinRange(i,!0)});RangeSliderHelper.update("#offsetY",{from:parseInt(u),min:EditorFactory.checkMinRange(i,!1)})})};var SignInEditor=function(n){var t=$(n.getUISelector()),i;t.css({"text-overflow":"ellipsis",overflow:"hidden"});EditorEventsFactory.attachPlainEvent("#widthInput",t,n,CHANGE,WIDTH);EditorEventsFactory.attachPlainEvent("#heightInput",t,n,CHANGE,HEIGHT,function(n){ViewerFactory.calculateButtonLineHeight(n.getUISelector())});EditorEventsFactory.attachPlainEvent("#leftInput",t,n,CHANGE,LEFT);EditorEventsFactory.attachPlainEvent("#topInput",t,n,CHANGE,TOP);EditorEventsFactory.attachPlainEvent("#textalign",t,n,CHANGE,TEXT_ALIGN);EditorEventsFactory.attachPlainEvent("#contentInput",t,n,CHANGE,TEXT);EditorEventsFactory.attachPlainEvent("#fontOptionInput",t,n,CHANGE,FONT_FAMILY);EditorEventsFactory.attachPlainEvent("#zindex",t,n,CHANGE,Z_INDEX);ColorPickerHelper.bind(t,"#colorInput",n,COLOR);ColorPickerHelper.bind(t,"#bgcolorInput",n,BACKGROUND_COLOR);ColorPickerHelper.bind(t,"#bgcolorhoverInput",n,BACKGROUND_COLOR_HOVER);ColorPickerHelper.bind(t,"#brcolorhoverInput",n,BORDER_COLOR_HOVER);ColorPickerHelper.bind(t,"#txtcolorhoverInput",n,TEXT_COLOR_HOVER);ColorPickerHelper.bind(t,"#brcolorInput",n,BORDER_COLOR);RangeSliderHelper.bind("#borderWidth",n,t,BORDER_WIDTH,{min:0,max:15,postfix:"px"},function(){ViewerFactory.calculateButtonLineHeight(n.getUISelector())});RangeSliderHelper.bind("#borderRadius",n,t,BORDER_RADIUS,{min:0,max:50,postfix:"px"});RangeSliderHelper.bind("#fontSize",n,t,FONT_SIZE,{min:6,max:50,postfix:"px"});$("#manage-users-btn").on("click",function(){UI.removeEditor();UI.componentService.addModalContentToForm(n,"#signin-manage-users")});i=UI.getViewModel("#signin-user-fields");ko.applyBindings(i,$("#switch-user-profile-fields")[0]);this.layering=this.layering||new LayeringController(n)},GalleryEditor=function(n){function e(n,t){$(n).find(".holder").children().each(function(){$(this).parent().hasClass("stretch")?($(this).attr("class","std-gallery "+t),t=="plain"?$(this).removeClass("std-gallery "+t):t=="shadow"&&$(this).addClass("std-gallery "+t)):($(this).children().attr("class","std-gallery "+t),t=="plain"&&$(this).removeClass("std-gallery "+t))})}function l(){var i=$("#scalingInput").val()||"fill",r=new StretchingController(["fill","crop"],i,n);ko.observable($(t).find(".gallery-items-list")[0]).extend({applyBindings:r})}function o(){var i=$(".with-captions"),r=$("#gallery-editor");n.getProperty(TYPE).value=="with-captions"?(i.is(":visible")||r.css("height",r.innerHeight()+60+"px"),i.show(),$(t).find(".title").css("color",n.getProperty(IMAGE_SETTINGS_HEADERCOLOR).value),$(t).find(".descr").css("color",n.getProperty(IMAGE_SETTINGS_COLOR).value),$(t).find(".info").css("background-color",n.getProperty(IMAGE_SETTINGS_BGCOLOR).value)):(i.is(":visible")&&r.css("height",r.innerHeight()-60+"px"),i.hide())}var t,f,c,u,i;EditorFactory.addedTooltip(["linkInput"],"bottom");t=n.getUISelector();f=StretchingController.shareInstanceBetweenNodes($(t).children()[0],$("#gallery-editor")[0]);EditorEventsFactory.attachPlainEvent("#widthInput",t,n,CHANGE,WIDTH);EditorEventsFactory.attachPlainEvent("#heightInput",t,n,CHANGE,HEIGHT,function(n,t){ViewerFactory.calculateHeightForGallery(n,t)});EditorEventsFactory.attachPlainEvent("#leftInput",t,n,CHANGE,LEFT);EditorEventsFactory.attachPlainEvent("#topInput",t,n,CHANGE,TOP);EditorEventsFactory.attachPlainEvent("#typeInput",t,n,CHANGE,"type",function(){i()});EditorEventsFactory.attachPlainEvent("#zindex",t,n,CHANGE,Z_INDEX);ColorPickerHelper.bind(t,"#headercolorInput",n,IMAGE_SETTINGS_HEADERCOLOR,function(n,t,i){$(t).find(".title").css("color",i)});ColorPickerHelper.bind(t,"#colorInput",n,IMAGE_SETTINGS_COLOR,function(n,t,i){$(t).find(".descr").css("color",i)});ColorPickerHelper.bind(t,"#bgcolorInput",n,IMAGE_SETTINGS_BGCOLOR,function(n,t,i){$(t).find(".info").css("background-color",i)});EditorEventsFactory.attachPlainEvent("#styleInput",t,n,CHANGE,"predefined",function(n,i,r){e(t,r)});EditorEventsFactory.attachPlainEvent("#fontOptionInput",t,n,CHANGE,"font-family",function(){i()});EditorEventsFactory.attachPlainEvent("#isShowOptimized",t,n,CHANGE,SHOW_OPTIMIZED,function(){i()});SwitcherHelper.bind(t,"#stretchToFullWidth",n,STRETCH_TO_FULL_WIDTH);StretcherFactory.onStretchChange(n);RangeSliderHelper.bind("#marginsWidth",n,t,MARGINS_WIDTH,{min:0,max:80,postfix:"px"},function(n,t,i){StretcherFactory.enableMarginsToStretchedComponent(n,t,i)});$("#scalingInput").bind(CHANGE,function(){var n=$("#styleInput").val();i();e(t,n)});RangeSliderHelper.bind("#fontSize",n,t,FONT_SIZE,{min:6,max:50,postfix:"px"},function(){i()});$("#expandCheckbox").change(function(){$(this).is(":checked")?$("#property-link").show():$("#property-link").hide()});o(n,t.selector);RangeSliderHelper.bind("#columnCount",n,t,"columns",{min:1,max:10,onChange:function(t){var o=_.clone(n.getProperty("columns").value),f=_.clone(t.fromNumber),r=function(t){n.setProperty("columns",t);i()},u,e;r(f);u="columns";e=UI.undoManagerGetLatestComponentId();u!=null&&"columns"==u&&e!=null&&e==n.id?UI.undoManagerAddSpecific({redo:function(){r(f,"")}},"redo"):UI.undoManagerAdd({undo:function(){r(o)},redo:function(){r(f)},property:u,componentId:n.id})}});$("#expandCheckbox").bind("change",function(){UI.undoManagerAddSimple(n,"expand",$(this).prop("checked"),i,!0)});var r=function(n,t){var s=function(){r.detach();r.insertBefore(u)},r=$("#"+n.id),h,u,f,e,o,c;if(t=="left"){if(u=r.prev(),u.length>0&&(f=UI.siteComponentRepository.lookupData({id:u.getId()}),f!=null)){var l=_.clone(n.getProperty("order").value.toInteger()),a=_.clone(f.getProperty("order").value.toInteger()),v=[{component:n,property:"order",newvalue:a,oldvalue:""},{component:f,property:"order",newvalue:l,oldvalue:""}];UI.undoManagerAddSimpleArr(v,function(){s(r,u);i()},function(){s(u,r);i()},!0)}}else t=="right"&&(e=r.next(),e.length>0&&(o=UI.siteComponentRepository.lookupData({id:e.getId()}),o!=null&&(r.detach(),r.insertAfter(e),h=n.getProperty("order").value.toInteger(),c=o.getProperty("order").value.toInteger(),n.setProperty("order",c),o.setProperty("order",h),i())))},s=function(){$("#gallery-editor .gallery-items-list .gallery-item").removeClass("active")},h=function(n){$("#gallery-editor .gallery-items-list #"+n).addClass("active")};EditorFactory.bindEvents(n);c=function(){var u=$(".save-gallery-item").data("id"),t=n.children.where({id:u}),r;t.any()&&(t=t.firstOrDefault(),r=[{component:t,property:"title",newvalue:$("#gallery-editor .gallery-item-title").val(),oldvalue:""},{component:t,property:"description",newvalue:$("#gallery-editor .gallery-item-description").val(),oldvalue:""}],UI.undoManagerAddSimpleArr(r,i,i,!0))};$("#gallery-editor .close-button").bind("click",function(){UI.removeEditor()});u=function(n){UI.undoManagerAddRemoving(n,"#gallery-editor .gallery-items-list #"+n,i)};i=function(){var e=TemplateFactory.templateFor(n,VIEWER_TEMPLATE).compiledTemplate,t,i,u,f,r;if($(n.getUISelector()).html($(e).html()),t=n.getUISelector(),n.children.length==0)for(i=0;i<9;i+=1)u='<div class="gallery-item c3"><div class="holder"><a class="fancybox" rel="gallery" href="/Images/gallery_predefined.png"><img src="/Images/gallery_predefined.png"><\/a><\/div><\/div>',f='<div class="gallery-item c3"><div class="holder stretch" data-bind="css: classToApply"><div style="width: 100%; height: 100%; background-image: url(/Images/gallery_predefined.png); background-size: cover;" data-bind="style: stretchClass" class="std-gallery shadow"><a class="fancybox" rel="gallery" href="/Images/gallery_predefined.png"><\/a><\/div><\/div><\/div>',n.getProperty(IMAGE_STRETCHING).value=="crop"?$(t).find(".gallery-items-list").append(f):$(t).find(".gallery-items-list").append(u);o(n,t);l();r=n.getProperty(SHOW_OPTIMIZED).value.toBoolean();n.children.forEach(function(n){$("#gallery-editor .gallery-items-list .gallery-item#"+n.id+">div>div").css("background-image",'url("'+ContextFactory.prepareImgSrc(n.getProperty(SRC).value,r)+'")');$("#gallery-editor .gallery-items-list .gallery-item#"+n.id+" img").attr("src",ContextFactory.prepareImgSrc(n.getProperty(SRC).value,r))});ViewerFactory.calculateMarginForGallery(n,t);ViewerFactory.calculateHeightForGallery(n,t)};n.children.forEach(function(n){$(n.getUISelector()).find(".remove-button").bind("click",function(n){n.stopPropagation();u($(this).closest(".gallery-item").getId())});$(n.getUISelector()).find(".order-left").bind("click",function(t){t.stopPropagation();r(n,"left")});$(n.getUISelector()).find(".order-right").bind("click",function(t){t.stopPropagation();r(n,"right")});$(n.getUISelector()).bind("click",function(){s();h($(this).getId());EditorFactory.showItemSettings(n);Helpers.hideValidationEngine("#linkInput")})});$(".gallery-item-title, .gallery-item-description").bind("change",function(){c()});$(".save-gallery-item").hide();EditorFactory.hideItemSettings();EditorFactory.upclickPicture(n,f,u,s,h,EditorFactory.showItemSettings,i,r);this.layering=this.layering||new LayeringController(n)},HousePhotoTourEditor=function(n){function s(){var i=$("#scalingInput").val()||"fill",r=new StretchingController(["fill","crop"],i,n);ko.observable($(t).find(".std-house-photo-tour-predefined-items")[0]).extend({applyBindings:r})}var t=n.getUISelector(),o=StretchingController.shareInstanceBetweenNodes($(t).find(".std-house-photo-tour-predefined-items")[0],$("#gallery-editor")[0]),u,i;EditorEventsFactory.attachPlainEvent("#widthInput",t,n,CHANGE,WIDTH,function(n){var t=n.getProperty(WIDTH).value;parseInt(t)<960&&n.setProperty(WIDTH,"960px");i()});EditorEventsFactory.attachPlainEvent("#heightInput",t,n,CHANGE,HEIGHT,function(){i()});EditorEventsFactory.attachPlainEvent("#leftInput",t,n,CHANGE,LEFT);EditorEventsFactory.attachPlainEvent("#topInput",t,n,CHANGE,TOP);EditorEventsFactory.attachPlainEvent("#zindex",t,n,CHANGE,Z_INDEX);EditorEventsFactory.attachPlainEvent("#scalingInput",t,n,CHANGE,IMAGE_STRETCHING,function(){i()});EditorEventsFactory.attachPlainEvent("#fontOptionInput",t,n,CHANGE,"font-family",function(){i()});EditorEventsFactory.attachPlainEvent("#taInput",t,n,CHANGE,"text-align",function(){i()});EditorEventsFactory.attachPlainEvent("#isShowOptimized",t,n,CHANGE,SHOW_OPTIMIZED,function(){i()});EditorEventsFactory.attachPlainEvent("#locationInput",t,n,CHANGE,"location",function(n,t,i){i=="left"?($(t).find(".house_photo_tour_div").css("right","480px"),$(t).find(".house_photo_tour_editor_div").css("right","480px")):($(t).find(".house_photo_tour_div").css("right","0px"),$(t).find(".house_photo_tour_editor_div").css("right","0px"))});ColorPickerHelper.bind(t,"#headercolorInput",n,IMAGE_SETTINGS_HEADERCOLOR,function(n,t,i){$(t).find(".title").css("color",i)});ColorPickerHelper.bind(t,"#textbgcolorInput",n,PHOTO_TOUR_TEXT_COLOR,function(n,t,i){$(t).find(".house_photo_tour_div").css("background-color",i);$(t).find(".house_photo_tour_editor_div").css("background-color",i)});ColorPickerHelper.bind(t,"#colorInput",n,IMAGE_SETTINGS_COLOR,function(n,t,i){$(t).find(".hpt_descr").css("color",i)});ColorPickerHelper.bind(t,"#bgcolorInput",n,BACKGROUND_COLOR);RangeSliderHelper.bind("#fontSize",n,t,FONT_SIZE,{min:10,max:26,postfix:"px"});$("#expandCheckbox").change(function(){$(this).is(":checked")?$("#property-link").show():$("#property-link").hide()});$("#expandCheckbox").bind("change",function(){UI.undoManagerAddSimple(n,"expand",$(this).prop("checked"),i,!0)});SwitcherHelper.bind(t,"#stretchToFullWidth",n,STRETCH_TO_FULL_WIDTH);StretcherFactory.onStretchChange(n);RangeSliderHelper.bind("#marginsWidth",n,t,MARGINS_WIDTH,{min:0,max:80,postfix:"px"},function(n,t,r){StretcherFactory.enableMarginsToStretchedComponent(n,t,r);i()});EditorFactory.bindEvents(n);var r=function(n,t){var r=$("#"+n.id),u,f,e,h,o,s,c;t=="left"?(f=r.prev(),f.length>0&&(e=UI.siteComponentRepository.lookupData({id:f.getId()}),e!=null&&(r.detach(),r.insertBefore(f),u=n.getProperty("order").value.toInteger(),h=e.getProperty("order").value.toInteger(),n.setProperty("order",h),e.setProperty("order",u),i()))):t=="right"&&(o=r.next(),o.length>0&&(s=UI.siteComponentRepository.lookupData({id:o.getId()}),s!=null&&(r.detach(),r.insertAfter(o),u=n.getProperty("order").value.toInteger(),c=s.getProperty("order").value.toInteger(),n.setProperty("order",c),s.setProperty("order",u),i())))},f=function(){$("#gallery-editor .gallery-items-list .gallery-item").removeClass("active")},e=function(n){$("#gallery-editor .gallery-items-list #"+n).addClass("active")},h=function(){var u=$(".save-gallery-item").data("id"),t=n.children.where({id:u}),r;t.any()&&(t=t.firstOrDefault(),r=[{component:t,property:"title",newvalue:_.clone($(".item-edit-container .gallery-item-title").val()),oldvalue:""},{component:t,property:"description",newvalue:_.clone($(".item-edit-container .gallery-item-description").val()),oldvalue:""}],UI.undoManagerAddSimpleArr(r,i,i,!0))};$("#gallery-editor .close-button").bind("click",function(){UI.removeEditor()});u=function(n){UI.undoManagerAddRemoving(n,"#gallery-editor .gallery-items-list #"+n,i)};i=function(){var i=TemplateFactory.templateFor(n,VIEWER_TEMPLATE).compiledTemplate,t;$(n.getUISelector()).html($(i).html());ViewerFactory.housePhotoTourPostRender(n);s();t=n.getProperty(SHOW_OPTIMIZED).value.toBoolean();n.children.forEach(function(n){$("#gallery-editor .gallery-items-list .gallery-item#"+n.id+" img").attr("src",ContextFactory.prepareImgSrc(n.getProperty(SRC).value,t));$("#gallery-editor .gallery-items-list .gallery-item#"+n.id+">div>div").css("background-image",'url("'+ContextFactory.prepareImgSrc(n.getProperty(SRC).value,t)+'")')})};n.children.forEach(function(n){$(n.getUISelector()).find(".remove-button").bind("click",function(n){n.stopPropagation();u($(this).closest(".gallery-item").getId())});$(n.getUISelector()).find(".order-left").bind("click",function(t){t.stopPropagation();r(n,"left")});$(n.getUISelector()).find(".order-right").bind("click",function(t){t.stopPropagation();r(n,"right")});$(n.getUISelector()).bind("click",function(){f();e($(this).getId());EditorFactory.showItemSettings(n);Helpers.hideValidationEngine("#linkInput")})});$(".gallery-item-title, .gallery-item-description").bind("change",function(){h()});$(".save-gallery-item").hide();EditorFactory.hideItemSettings();EditorFactory.upclickPicture(n,o,u,f,e,EditorFactory.showItemSettings,i,r);this.layering=this.layering||new LayeringController(n)},SlideshowEditor=function(n){function e(){n.getProperty(CAPTION).value.toBoolean()?($(".image-settings").show(),$(t).find(".title").css("color",n.getProperty(IMAGE_SETTINGS_HEADERCOLOR).value),$(t).find(".descr").css("color",n.getProperty(IMAGE_SETTINGS_COLOR).value),$(t).find(".carousel-caption").css("background-color",n.getProperty(IMAGE_SETTINGS_BGCOLOR).value)):($(".image-settings").hide(),$(t).find(".carousel-caption").css("background-color","transparent"))}function c(){var i=$("#scalingInput").val()||"fill",r=new StretchingController(["fill","crop"],i,n);ko.observable($(t).find(".carousel-inner")[0]).extend({applyBindings:r})}var t=n.getUISelector(),f,h,u,i;EditorFactory.addedTooltip(["linkInput"],"bottom");f=StretchingController.shareInstanceBetweenNodes($(t).find(".carousel-inner")[0],$("#gallery-editor")[0]);EditorEventsFactory.attachPlainEvent("#widthInput",t,n,CHANGE,WIDTH);EditorEventsFactory.attachPlainEvent("#heightInput",t,n,CHANGE,HEIGHT);EditorEventsFactory.attachPlainEvent("#leftInput",t,n,CHANGE,LEFT);EditorEventsFactory.attachPlainEvent("#topInput",t,n,CHANGE,TOP);EditorEventsFactory.attachPlainEvent("#stretchInput",t,n,CHANGE,IMAGE_STRETCHING);EditorEventsFactory.attachPlainEvent("#captionPositionInput",t,n,CHANGE,"caption-position",function(){i()});ColorPickerHelper.bind(t,"#headercolorInput",n,IMAGE_SETTINGS_HEADERCOLOR,function(n,t,i){$(t).find(".title").css("color",i)});ColorPickerHelper.bind(t,"#colorInput",n,IMAGE_SETTINGS_COLOR,function(n,t,i){$(t).find(".descr").css("color",i)});ColorPickerHelper.bind(t,"#bgcolorInput",n,IMAGE_SETTINGS_BGCOLOR,function(n,t,i){$(t).find(".carousel-caption").css("background-color",i)});RangeSliderHelper.bind("#fontSize",n,t,FONT_SIZE,{min:6,max:50,postfix:"px"});EditorEventsFactory.attachPlainEvent("#fontOptionInput",t,n,CHANGE,"font-family",function(){i()});EditorEventsFactory.attachPlainEvent("#isShowOptimized",t,n,CHANGE,SHOW_OPTIMIZED,function(){i()});SwitcherHelper.bind(t,"#stretchToFullWidth",n,STRETCH_TO_FULL_WIDTH);StretcherFactory.onStretchChange(n);RangeSliderHelper.bind("#marginsWidth",n,t,MARGINS_WIDTH,{min:0,max:80,postfix:"px"},function(n,t,i){StretcherFactory.enableMarginsToStretchedComponent(n,t,i)});e(n,t.selector);$("#expandCheckbox").change(function(){$(this).is(":checked")?$("#property-link").show():$("#property-link").hide()});RangeSliderHelper.bind("#interval",n,t,"interval",{min:1,max:10,postfix:"sec",onChange:function(t){var o=_.clone(n.getProperty("interval").value),f=_.clone(t.fromNumber),r=function(t){n.setProperty("interval",t);i()},u,e;r(f);u="interval";e=UI.undoManagerGetLatestComponentId();u!=null&&"interval"==u&&e!=null&&e==n.id?UI.undoManagerAddSpecific({redo:function(){r(f,"")}},"redo"):UI.undoManagerAdd({undo:function(){r(o)},redo:function(){r(f)},property:u,componentId:n.id})}});$("#pauseCheckbox").bind("change",function(){UI.undoManagerAddSimple(n,"pause",$(this).prop("checked"),i,!0)});$("#navCheckbox").bind("change",function(){UI.undoManagerAddSimple(n,"nav",$(this).prop("checked"),i,!0)});$("#dotCheckbox").bind("change",function(){UI.undoManagerAddSimple(n,"dot",$(this).prop("checked"),i,!0)});$("#captionCheckbox").bind("change",function(){UI.undoManagerAddSimple(n,"caption",$(this).prop("checked"),i,!0)});$("#expandCheckbox").bind("change",function(){UI.undoManagerAddSimple(n,"expand",$(this).prop("checked"),i,!0)});var r=function(n,t){var r=$("#"+n.id),u,f,e,h,o,s,c;t=="left"?(f=r.prev(),f.length>0&&(e=UI.siteComponentRepository.lookupData({id:f.getId()}),e!=null&&(r.detach(),r.insertBefore(f),u=n.getProperty("order").value.toInteger(),h=e.getProperty("order").value.toInteger(),n.setProperty("order",h),e.setProperty("order",u),i()))):t=="right"&&(o=r.next(),o.length>0&&(s=UI.siteComponentRepository.lookupData({id:o.getId()}),s!=null&&(r.detach(),r.insertAfter(o),u=n.getProperty("order").value.toInteger(),c=s.getProperty("order").value.toInteger(),n.setProperty("order",c),s.setProperty("order",u),i())))},o=function(){$("#gallery-editor .gallery-items-list .gallery-item").removeClass("active")},s=function(n){$("#gallery-editor .gallery-items-list #"+n).addClass("active")};EditorFactory.bindEvents(n);h=function(){var u=$(".save-gallery-item").data("id"),t=n.children.where({id:u}),r;t.any()&&(t=t.firstOrDefault(),r=[{component:t,property:"title",newvalue:_.clone($(".item-edit-container .gallery-item-title").val()),oldvalue:""},{component:t,property:"description",newvalue:_.clone($(".item-edit-container .gallery-item-description").val()),oldvalue:""}],UI.undoManagerAddSimpleArr(r,i,i,!0))};$("#gallery-editor .close-button").bind("click",function(){UI.removeEditor()});u=function(n){UI.undoManagerAddRemoving(n,"#gallery-editor .gallery-items-list #"+n,i)};i=function(){var r=TemplateFactory.templateFor(n,VIEWER_TEMPLATE).compiledTemplate,i,t;$(n.getUISelector()).html($(r).html());i=n.getUISelector();e(n,i);c();ViewerFactory.tryUpdatePredefinedView(n);t=n.getProperty(SHOW_OPTIMIZED).value.toBoolean();n.children.forEach(function(n){$("#gallery-editor .gallery-items-list .gallery-item#"+n.id+">div>div").css("background-image",'url("'+ContextFactory.prepareImgSrc(n.getProperty(SRC).value,t)+'")');$("#gallery-editor .gallery-items-list .gallery-item#"+n.id+" img").attr("src",ContextFactory.prepareImgSrc(n.getProperty(SRC).value,t))})};n.children.forEach(function(n){$(n.getUISelector()).find(".remove-button").bind("click",function(n){n.stopPropagation();u($(this).closest(".gallery-item").getId())});$(n.getUISelector()).find(".order-left").bind("click",function(t){t.stopPropagation();r(n,"left")});$(n.getUISelector()).find(".order-right").bind("click",function(t){t.stopPropagation();r(n,"right")});$(n.getUISelector()).bind("click",function(){o();s($(this).getId());EditorFactory.showItemSettings(n);Helpers.hideValidationEngine("#linkInput")})});$(".gallery-item-title, .gallery-item-description").bind("change",function(){h()});$(".save-gallery-item").hide();EditorFactory.hideItemSettings();EditorFactory.upclickPicture(n,f,u,o,s,EditorFactory.showItemSettings,i,r);this.layering=this.layering||new LayeringController(n)},HtmlContainerEditor=function(n){function u(){UI.actionService.runActionForComponent(n,ACTION_REMOVE_FROM_FORM,!0);UI.actionService.runActionForComponent(n,ACTION_ADD_TO_FORM,!0)}var t=n.getUISelector(),r,i;EditorEventsFactory.attachPlainEvent("#widthInput",t,n,CHANGE,WIDTH);EditorEventsFactory.attachPlainEvent("#heightInput",t,n,CHANGE,HEIGHT);EditorEventsFactory.attachPlainEvent("#leftInput",t,n,CHANGE,LEFT);EditorEventsFactory.attachPlainEvent("#topInput",t,n,CHANGE,TOP);ColorPickerHelper.bind(t,"#bgcolorInput",n,BACKGROUND_COLOR,function(){});ColorPickerHelper.bind(t,"#brcolorInput",n,BORDER_COLOR,function(){});RangeSliderHelper.bind("#borderWidth",n,t,BORDER_WIDTH,{min:0,max:10,postfix:"px"});r=n.getProperty(TEXT).value;$("#htmleditor").text(r);i=ace.edit("htmleditor");i.setTheme("ace/theme/monokai");i.getSession().setMode("ace/mode/html");i.setShowPrintMargin(!1);i.on("blur",function(){UI.undoManagerAddSimple(n,"text",i.getValue(),u,!1);n.setProperty("text",i.getValue());u()});$("#gallery-editor .close-button").bind("click",function(){UI.removeEditor()});this.layering=this.layering||new LayeringController(n)},ListEditor=function(n){function v(){var i=$("#scalingInput").val()||"fill",r=new StretchingController(["fill","crop"],i,n);ko.observable($(t).find(".list-stretch-binding-node")[0]).extend({applyBindings:r})}function c(){var n=$("#typeInput").val(),t='<img src="/Images/list-types/list-'+n.split(" ").join("")+'.png" />';$("#list-type").empty();$("#list-type").prepend(t)}function l(){for(var i=0,r=$(t).find(".item"),n=0;n<r.length;n++)i+=parseInt($(r[n]).css("height")),n!=r.length-1&&(i+=parseInt($(r[n]).css("margin-bottom")));return i<25&&(i=300),i}function y(){var t=n.getProperty(TYPE).value;switch(t){case"vertical":$("#list-item-optional").hide();break;case"only text":$("#list-item-optional").hide();$("#list-item-upload").hide();break;case"lines":$("#list-item-optional").hide();$("#list-item-upload").hide();break;case"thumbnails":$("#list-item-optional").hide();$("#list-item-description").hide()}}function p(i){$(t).find(".title").css("color",n.getProperty(IMAGE_SETTINGS_HEADERCOLOR).value);$(t).find(".meta").css("color",n.getProperty(IMAGE_SETTING_OPTIONALCOLOR).value);$(t).find(".description").css("color",n.getProperty(IMAGE_SETTINGS_COLOR).value);var r=n.getProperty(IMAGE_SETTINGS_BGCOLOR).value;$(t).find(".content").css("background-color",r);$(t).find(".title, .description, .meta, .optional").css("font-size",n.getProperty(FONT_SIZE).value);$(t).find(".vertical").hasClass("vertical")&&$(t).find(".title, .description").css("background-color",r);$(t).find(".general").hasClass("general")&&$(t).find(".title, .description, .meta").css("background-color",r);$(t).find(".lines").hasClass("lines")&&$(t).find(".p5").css("background-color",r);$(t).find(".thumbnails").hasClass("thumbnails")&&$(t).find(".title").css("background-color",r);$(t).css("display")=="block"&&ViewerFactory.correctShowListComponent(i)}function h(){var h=BLANKIMAGE,c=UI.basicComponentRepository.getAll().where({name:"list-item"}),a,v,y;if(c.any()){var l=c.firstOrDefault(),t=(new Component).createNew(l,!0),u,o=[];n.children.forEach(function(n){o.push(n.getProperty("order").value.toInteger())});o.any()?(a=_.max(o),u=a+1):u=0;t.setProperty("src",h);t.setProperty("order",u);UI.siteComponentRepository.appendTo(t,n);v={id:t.id,src:h};y=HandlebarHelper.compileTemplate(l.editorTemplate,v);$("#gallery-editor .gallery-items-list").append(y);$(t.getUISelector()).find(".remove-button").bind("click",function(n){n.stopPropagation();s($(this).closest(".gallery-item").getId())});$(t.getUISelector()).bind("click",function(){f();e($(this).getId());EditorFactory.showItemSettings(t)});$(t.getUISelector()).find(".order-left").bind("click",function(n){n.stopPropagation();r(t,"left")});$(t.getUISelector()).find(".order-right").bind("click",function(n){n.stopPropagation();r(t,"right")});f();e($(t.getUISelector()).getId());EditorFactory.showItemSettings(t);i();UI.undoManagerAddAddElements([t],i)}}var t=n.getUISelector(),a,u,o,s,i;EditorFactory.addedTooltip(["linkInput"],"bottom");EditorEventsFactory.attachPlainEvent("#widthInput",t,n,CHANGE,WIDTH);EditorEventsFactory.attachPlainEvent("#heightInput",t,n,CHANGE,HEIGHT);EditorEventsFactory.attachPlainEvent("#leftInput",t,n,CHANGE,LEFT);EditorEventsFactory.attachPlainEvent("#topInput",t,n,CHANGE,TOP);EditorEventsFactory.attachPlainEvent("#typeInput",t,n,CHANGE,"type",function(){i()});EditorEventsFactory.attachPlainEvent("#zindex",t,n,CHANGE,Z_INDEX);EditorEventsFactory.attachPlainEvent("#fontOptionInput",t,n,CHANGE,"font-family",function(){i()});EditorEventsFactory.attachPlainEvent("#isShowOptimized",t,n,CHANGE,SHOW_OPTIMIZED,function(){i()});$("#gallery-editor").css("display")=="block"&&(a=StretchingController.shareInstanceBetweenNodes($(t).find(".list-stretch-binding-node")[0],$("#gallery-editor")[0]));scallingItemList($("#gallery-editor").find(".holder"),$("#scalingInput").val());$("#scalingInput").bind(CHANGE,function(){i();scallingItemList($("#gallery-editor").find(".holder"),$(this).val())});ColorPickerHelper.bind(t,"#headercolorInput",n,IMAGE_SETTINGS_HEADERCOLOR,function(n,t,i){$(t).find(".title").css("color",i)});ColorPickerHelper.bind(t,"#colorInput",n,IMAGE_SETTINGS_COLOR,function(n,t,i){$(t).find(".description").css("color",i)});ColorPickerHelper.bind(t,"#bgcolorInput",n,IMAGE_SETTINGS_BGCOLOR,function(n,t,i){$(t).find(".vertical").hasClass("vertical")&&($(t).find(".title").css("background-color",i),$(t).find(".description").css("background-color",i));$(t).find(".general").hasClass("general")&&($(t).find(".title").css("background-color",i),$(t).find(".description").css("background-color",i),$(t).find(".meta").css("background-color",i));$(t).find(".lines").hasClass("lines")&&$(t).find(".p5").css("background-color",i);$(t).find(".thumbnails").hasClass("thumbnails")&&$(t).find(".title").css("background-color",i);$(t).find(".content").css("background-color",i)});ColorPickerHelper.bind(t,"#optionalcolorInput",n,IMAGE_SETTING_OPTIONALCOLOR,function(n,t,i){$(t).find(".meta").css("color",i)});RangeSliderHelper.bind("#fontSize",n,t,FONT_SIZE,{min:6,max:40,postfix:"px"},function(){o();ViewerFactory.calculateHeightForList(n,t)});$(".list-type-option").bind("click",function(){var n=$(this).text();$("#typeInput").val(n).change();c();$(".list-type-option").removeClass("active");$(this).addClass("active");Helpers.removeSelectWrapper()});c();$(".save-type").bind("click",function(){n.isNotApproved=!1;h();h();eventsystem.publish("/component/create/",n,t);$("#heightInput").val(l()).change();UI.removeEditor()});u=n.getProperty(TYPE).value;u=="only text"||u=="lines"?($("#expandLabel").hide(),$("#expandCheckbox").hide()):($("#expandCheckbox").change(function(){$(this).is(":checked")?$("#property-link").show():$("#property-link").hide()}).change(),$("#expandCheckbox").bind("change",function(){UI.undoManagerAddSimple(n,"expand",$(this).prop("checked"),i,!0)}));y();var r=function(n,t){var r=$("#"+n.id),u,f,e,h,o,s,c;t=="left"?(f=r.prev(),f.length>0&&(e=UI.siteComponentRepository.lookupData({id:f.getId()}),e!=null&&(r.detach(),r.insertBefore(f),u=n.getProperty("order").value.toInteger(),h=e.getProperty("order").value.toInteger(),n.setProperty("order",h),e.setProperty("order",u),i()))):t=="right"&&(o=r.next(),o.length>0&&(s=UI.siteComponentRepository.lookupData({id:o.getId()}),s!=null&&(r.detach(),r.insertAfter(o),u=n.getProperty("order").value.toInteger(),c=s.getProperty("order").value.toInteger(),n.setProperty("order",c),s.setProperty("order",u),i())))},f=function(){$("#gallery-editor .gallery-items-list .gallery-item").removeClass("active")},e=function(n){$("#gallery-editor .gallery-items-list #"+n).addClass("active")};EditorFactory.bindEvents(n);o=function(){var u=$(".save-gallery-item").data("id"),t=n.children.where({id:u}),r;t.any()&&(t=t.firstOrDefault(),r=[{component:t,property:"title",newvalue:_.clone($(".item-edit-container .gallery-item-title").val()),oldvalue:""},{component:t,property:"description",newvalue:_.clone($(".item-edit-container .gallery-item-description").val()),oldvalue:""},{component:t,property:"optional",newvalue:_.clone($(".item-edit-container .gallery-item-optional").val()),oldvalue:""}],UI.undoManagerAddSimpleArr(r,i,i,!0))};$("#gallery-editor .close-button").bind("click",function(){UI.removeEditor()});s=function(n){UI.undoManagerAddRemoving(n,"#gallery-editor .gallery-items-list #"+n,i)};i=function(){var i=TemplateFactory.templateFor(n,VIEWER_TEMPLATE).compiledTemplate,t;$(n.getUISelector()).html($(i).html());p();v();$("#heightInput").val(l()).change();t=n.getProperty(SHOW_OPTIMIZED).value.toBoolean();n.children.forEach(function(n){$("#gallery-editor .gallery-items-list .gallery-item#"+n.id+" img").attr("src",ContextFactory.prepareImgSrc(n.getProperty(SRC).value,t))})};n.children.forEach(function(n){$(n.getUISelector()).find(".remove-button").bind("click",function(n){n.stopPropagation();s($(this).closest(".gallery-item").getId())});$(n.getUISelector()).find(".order-left").bind("click",function(t){t.stopPropagation();r(n,"left")});$(n.getUISelector()).find(".order-right").bind("click",function(t){t.stopPropagation();r(n,"right")});$(n.getUISelector()).bind("click",function(){f();e($(this).getId());EditorFactory.showItemSettings(n);Helpers.hideValidationEngine("#linkInput")})});$(".gallery-item-title, .gallery-item-description, .gallery-item-optional").bind("change",function(){o()});$(".save-gallery-item").hide();EditorFactory.hideItemSettings();$("#add-button").bind("click",function(){h()});$(".upclick-button").upclick(n,{type:UPCLICK_TYPE_PICTURE,oncomplete:function(n){var t=Helpers.ProcessUploadSingleFileCompleted(n,$(".upclick-editor-error"),$(".upclick-button")),r,u,f;t!=null&&(r=$(".save-gallery-item").data("id"),$("#"+r).find(".holder img").attr("src",t.url),u=UI.siteComponentRepository.lookupData({id:r}),u.setProperty("src",t.url),UI.undoManagerAddSimple(u,"src",t.url,i,!1),i(),f=new Image,f.onload=function(){scallingItemList($("#gallery-editor").find(".holder"),$("#scalingInput").val())},f.src=t.url)}});this.layering=this.layering||new LayeringController(n)},FormEditor=function(n){var t=n.getUISelector(),i;EditorEventsFactory.attachPlainEvent("#widthInput",t,n,CHANGE,WIDTH);EditorEventsFactory.attachPlainEvent("#heightInput",t,n,CHANGE,HEIGHT);EditorEventsFactory.attachPlainEvent("#leftInput",t,n,CHANGE,LEFT);EditorEventsFactory.attachPlainEvent("#topInput",t,n,CHANGE,TOP);EditorEventsFactory.attachPlainEvent("#zindex",t,n,CHANGE,Z_INDEX);ColorPickerHelper.bind(t,"#bgcolorInput",n,BACKGROUND_COLOR);ColorPickerHelper.bind(t,"#brcolorInput",n,BORDER_COLOR);RangeSliderHelper.bind("#borderWidth",n,t,BORDER_WIDTH,{min:0,max:15,postfix:"px"});RangeSliderHelper.bind("#borderRadius",n,t,BORDER_RADIUS,{min:0,max:50,postfix:"px"});i=function(){};$("#add-label-to-form").on("click",function(){app.addNewComponent("_label",i,n)});$("#add-textbox-to-form").on("click",function(){app.addNewComponent("_textbox",i,n)});$("#add-textarea-to-form").on("click",function(){app.addNewComponent("_textarea",i,n)});$("#add-radio-list-to-form").on("click",function(){app.addNewComponent("_radio-list",i,n)});$("#add-select-list-to-form").on("click",function(){app.addNewComponent("_select-list",i,n)});$("#add-checkbox-to-form").on("click",function(){app.addNewComponent("_checkbox",i,n)});$("#add-submit-to-form").on("click",function(){app.addNewComponent("_submit",i,n)});$("#add-captcha-to-form").on("click",function(){app.addNewComponent(CAPTCHA,i,n)});EditorEventsFactory.attachPlainEvent("#mail-history",t,n,CHANGE,MAIL_HISTORY_PROPERTY,function(){});this.layering=this.layering||new LayeringController(n)},LabelEditor=function(n){var t=n.getUISelector(),i;EditorEventsFactory.attachPlainEvent("#widthInput",t,n,CHANGE,WIDTH);EditorEventsFactory.attachPlainEvent("#heightInput",t,n,CHANGE,HEIGHT);EditorEventsFactory.attachPlainEvent("#leftInput",t,n,CHANGE,LEFT);EditorEventsFactory.attachPlainEvent("#topInput",t,n,CHANGE,TOP);ColorPickerHelper.bind(t,"#bgcolorInput",n,BACKGROUND_COLOR);EditorEventsFactory.attachPlainEvent("#textInput",t,n,CHANGE,"text",function(){i()});EditorEventsFactory.attachPlainEvent("#textalign",t,n,CHANGE,TEXT_ALIGN);EditorEventsFactory.attachPlainEvent("#fontOptionInput",t,n,CHANGE,FONT_FAMILY);ColorPickerHelper.bind(t,"#colorInput",n,COLOR);RangeSliderHelper.bind("#fontSize",n,t,FONT_SIZE,{min:6,max:50,postfix:"px"});i=function(){var t=TemplateFactory.templateFor(n,VIEWER_TEMPLATE).compiledTemplate;$(n.getUISelector()).html($(t).html())}},TextboxEditor=function(n){var t=n.getUISelector(),i;EditorEventsFactory.attachPlainEvent("#widthInput",t,n,CHANGE,WIDTH);EditorEventsFactory.attachPlainEvent("#heightInput",t,n,CHANGE,HEIGHT);EditorEventsFactory.attachPlainEvent("#leftInput",t,n,CHANGE,LEFT);EditorEventsFactory.attachPlainEvent("#topInput",t,n,CHANGE,TOP);EditorEventsFactory.attachPlainEvent("#isRequired",t,n,CHANGE,REQUIRED_FIELD);EditorEventsFactory.attachPlainEvent("#contentInput",t,n,CHANGE,"placeholder",function(n,t,i){$(t).attr("placeholder",i)});EditorEventsFactory.attachPlainEvent("#textboxtype",t,n,CHANGE,"text-box-type");EditorEventsFactory.attachPlainEvent("#fontOptionInput",t,n,CHANGE,FONT_FAMILY);EditorEventsFactory.attachPlainEvent("#zindex",t,n,CHANGE,Z_INDEX);ColorPickerHelper.bind(t,"#colorInput",n,COLOR);ColorPickerHelper.bind(t,"#bgcolorInput",n,BACKGROUND_COLOR);ColorPickerHelper.bind(t,"#brcolorInput",n,BORDER_COLOR);RangeSliderHelper.bind("#borderWidth",n,t,BORDER_WIDTH,{min:0,max:15,postfix:"px"});RangeSliderHelper.bind("#borderRadius",n,t,BORDER_RADIUS,{min:0,max:50,postfix:"px"});RangeSliderHelper.bind("#fontSize",n,t,FONT_SIZE,{min:6,max:50,postfix:"px"});$("#formSpaceAfterItem").bind("change",function(){UI.undoManagerAddSimple(n,FORM_SPACE_AFTER_ITEM,$(this).prop("checked"),function(){},!0)});EditorEventsFactory.attachPlainEvent("#labeltype",t,n,CHANGE,SELECTEDLABELTYPE,function(n){EditorFactory.switchLabelType(n)});$("#labelselect,#labelname").bind("change",function(){EditorFactory.switchLabelType(n)});EditorFactory.switchLabelType(n);i=function(){var t=TemplateFactory.templateFor(n,VIEWER_TEMPLATE).compiledTemplate;$(n.getUISelector()).html($(t).html())};this.layering=this.layering||new LayeringController(n)},RadiolistEditor=function(n){var t=n.getUISelector(),r=function(n){UI.undoManagerAddRemoving(n,"#editor #radio-item-list #"+n,i)},u=function(n){var t=$(n).data("id"),i=UI.siteComponentRepository.lookupData({id:t}),r=$(n).val(),u;i.setProperty("text",r,!1);u=$(i.parentComponent.getUISelector());u.find('label[for="'+t+'"]').html(r)},i;$("#editor #radio-item-list .remove-button ").on("click",function(n){n.stopPropagation();r($(this).data("id"))});$("#editor #radio-item-list input").on("change",function(n){n.stopPropagation();u(this)});$("#formSpaceAfterItem").bind("change",function(){UI.undoManagerAddSimple(n,FORM_SPACE_AFTER_ITEM,$(this).prop("checked"),function(){},!0)});$("#add-radio-button").on("click",function(){var o=UI.basicComponentRepository.getAll().where({name:"_editor-item"}),h,c,l;if(o.any()){var s=o.firstOrDefault(),t=(new Component).createNew(s,!0),f,e=[];n.children.forEach(function(n){e.push(n.getProperty("order").value.toInteger())});e.any()?(h=_.max(e),f=h+1):f=0;t.setProperty("order",f);UI.siteComponentRepository.appendTo(t,n);c={id:t.id,text:t.getProperty("text").value};l=HandlebarHelper.compileTemplate(s.editorTemplate,c);$("#editor #radio-item-list").append(l);$("#editor #radio-item-list #"+t.id+" .remove-button ").on("click",function(n){n.stopPropagation();r($(this).data("id"))});$("#editor #radio-item-list #"+t.id+" input").on("change",function(n){n.stopPropagation();u(this)});i()}});EditorEventsFactory.attachPlainEvent("#widthInput",t,n,CHANGE,WIDTH);EditorEventsFactory.attachPlainEvent("#heightInput",t,n,CHANGE,HEIGHT);EditorEventsFactory.attachPlainEvent("#leftInput",t,n,CHANGE,LEFT);EditorEventsFactory.attachPlainEvent("#topInput",t,n,CHANGE,TOP);EditorEventsFactory.attachPlainEvent("#isRequired",t,n,CHANGE,REQUIRED_FIELD);EditorEventsFactory.attachPlainEvent("#fontOptionInput",t,n,CHANGE,FONT_FAMILY);EditorEventsFactory.attachPlainEvent("#zindex",t,n,CHANGE,Z_INDEX);ColorPickerHelper.bind(t,"#colorInput",n,COLOR);ColorPickerHelper.bind(t,"#bgcolorInput",n,BACKGROUND_COLOR);ColorPickerHelper.bind(t,"#brcolorInput",n,BORDER_COLOR);EditorEventsFactory.attachPlainEvent("#styleInput",t,n,CHANGE,"predefined",function(){i()});RangeSliderHelper.bind("#borderWidth",n,t,BORDER_WIDTH,{min:0,max:15,postfix:"px"});RangeSliderHelper.bind("#borderRadius",n,t,BORDER_RADIUS,{min:0,max:50,postfix:"px"});RangeSliderHelper.bind("#fontSize",n,t,FONT_SIZE,{min:6,max:50,postfix:"px"});EditorEventsFactory.attachPlainEvent("#labeltype",t,n,CHANGE,SELECTEDLABELTYPE,function(n){EditorFactory.switchLabelType(n)});$("#labelselect,#labelname").bind("change",function(){EditorFactory.switchLabelType(n)});EditorFactory.switchLabelType(n);i=function(){var t=TemplateFactory.templateFor(n,VIEWER_TEMPLATE).compiledTemplate;$(n.getUISelector()).html($(t).html())};this.layering=this.layering||new LayeringController(n)},SelectlistEditor=function(n){var t=n.getUISelector(),r=function(n){UI.undoManagerAddRemoving(n,"#editor #select-item-list #"+n,i)},u=function(n){var t=$(n).data("id"),r=UI.siteComponentRepository.lookupData({id:t}),u=$(n).val();r.setProperty("text",u,!1);i()},i;$("#editor #select-item-list .remove-button ").on("click",function(n){n.stopPropagation();r($(this).data("id"))});$("#editor #select-item-list input").on("change",function(n){n.stopPropagation();u(this)});$("#formSpaceAfterItem").bind("change",function(){UI.undoManagerAddSimple(n,FORM_SPACE_AFTER_ITEM,$(this).prop("checked"),function(){},!0)});$("#add-select-button").on("click",function(){var o=UI.basicComponentRepository.getAll().where({name:"_editor-item"}),h,c,l;if(o.any()){var s=o.firstOrDefault(),t=(new Component).createNew(s,!0),f,e=[];n.children.forEach(function(n){e.push(n.getProperty("order").value.toInteger())});e.any()?(h=_.max(e),f=h+1):f=0;t.setProperty("order",f);UI.siteComponentRepository.appendTo(t,n);c={id:t.id,text:t.getProperty("text").value};l=HandlebarHelper.compileTemplate(s.editorTemplate,c);$("#editor #select-item-list").append(l);$("#editor #select-item-list #"+t.id+" .remove-button ").on("click",function(n){n.stopPropagation();r($(this).data("id"))});$("#editor #select-item-list #"+t.id+" input").on("change",function(n){n.stopPropagation();u(this)});i()}});EditorEventsFactory.attachPlainEvent("#widthInput",t,n,CHANGE,WIDTH);EditorEventsFactory.attachPlainEvent("#heightInput",t,n,CHANGE,HEIGHT);EditorEventsFactory.attachPlainEvent("#leftInput",t,n,CHANGE,LEFT);EditorEventsFactory.attachPlainEvent("#topInput",t,n,CHANGE,TOP);EditorEventsFactory.attachPlainEvent("#fontOptionInput",t,n,CHANGE,FONT_FAMILY);EditorEventsFactory.attachPlainEvent("#zindex",t,n,CHANGE,Z_INDEX);EditorEventsFactory.attachPlainEvent("#isRequired",t,n,CHANGE,REQUIRED_FIELD);ColorPickerHelper.bind(t,"#colorInput",n,COLOR);ColorPickerHelper.bind(t,"#bgcolorInput",n,BACKGROUND_COLOR);ColorPickerHelper.bind(t,"#brcolorInput",n,BORDER_COLOR);RangeSliderHelper.bind("#borderWidth",n,t,BORDER_WIDTH,{min:0,max:15,postfix:"px"});RangeSliderHelper.bind("#borderRadius",n,t,BORDER_RADIUS,{min:0,max:50,postfix:"px"});RangeSliderHelper.bind("#fontSize",n,t,FONT_SIZE,{min:6,max:50,postfix:"px"});EditorEventsFactory.attachPlainEvent("#labeltype",t,n,CHANGE,SELECTEDLABELTYPE,function(n){EditorFactory.switchLabelType(n)});$("#labelselect,#labelname").bind("change",function(){EditorFactory.switchLabelType(n)});EditorFactory.switchLabelType(n);i=function(){var t=TemplateFactory.templateFor(n,VIEWER_TEMPLATE).compiledTemplate;$(n.getUISelector()).html($(t).html())};this.layering=this.layering||new LayeringController(n)},CheckboxEditor=function(n){var t=n.getUISelector();EditorEventsFactory.attachPlainEvent("#leftInput",t,n,CHANGE,LEFT);EditorEventsFactory.attachPlainEvent("#topInput",t,n,CHANGE,TOP);EditorEventsFactory.attachPlainEvent("#zindex",t,n,CHANGE,Z_INDEX);EditorEventsFactory.attachPlainEvent("#labeltype",t,n,CHANGE,SELECTEDLABELTYPE,function(n){EditorFactory.switchLabelType(n)});$("#labelselect,#labelname").bind("change",function(){EditorFactory.switchLabelType(n)});EditorFactory.switchLabelType(n);$("#formSpaceAfterItem").bind("change",function(){UI.undoManagerAddSimple(n,FORM_SPACE_AFTER_ITEM,$(this).prop("checked"),function(){},!0)});this.layering=this.layering||new LayeringController(n)},CaptchaEditor=function(n){var t=n.getUISelector();EditorEventsFactory.attachPlainEvent("#leftInput",t,n,CHANGE,LEFT);EditorEventsFactory.attachPlainEvent("#topInput",t,n,CHANGE,TOP);EditorEventsFactory.attachPlainEvent("#zindex",t,n,CHANGE,Z_INDEX);this.layering=this.layering||new LayeringController(n)},SubmitEditor=function(n){var t=n.getUISelector(),r,i;EditorEventsFactory.attachPlainEvent("#widthInput",t,n,CHANGE,WIDTH);EditorEventsFactory.attachPlainEvent("#heightInput",t,n,CHANGE,HEIGHT,function(n){ViewerFactory.calculateButtonLineHeight(n.getUISelector())});EditorEventsFactory.attachPlainEvent("#leftInput",t,n,CHANGE,LEFT);EditorEventsFactory.attachPlainEvent("#topInput",t,n,CHANGE,TOP);EditorEventsFactory.attachPlainEvent("#zindex",t,n,CHANGE,Z_INDEX);EditorEventsFactory.attachPlainEvent("#formSubject",t,n,CHANGE,FORM_SUBJECT);EditorEventsFactory.attachPlainEvent("#textalign",t,n,CHANGE,TEXT_ALIGN);EditorEventsFactory.attachPlainEvent("#contentInput",t,n,CHANGE,TEXT);EditorEventsFactory.attachPlainEvent("#fontOptionInput",t,n,CHANGE,FONT_FAMILY);RangeSliderHelper.bind("#fontSize",n,t,FONT_SIZE,{min:6,max:50,postfix:"px"});ColorPickerHelper.bind(t,"#colorInput",n,COLOR);ColorPickerHelper.bind(t,"#txtcolorhoverInput",n,TEXT_COLOR_HOVER);ColorPickerHelper.bind(t,"#brcolorInput",n,BORDER_COLOR);ColorPickerHelper.bind(t,"#brcolorhoverInput",n,BORDER_COLOR_HOVER);ColorPickerHelper.bind(t,"#bgcolorInput",n,BACKGROUND_COLOR);ColorPickerHelper.bind(t,"#bgcolorhoverInput",n,BACKGROUND_COLOR_HOVER);RangeSliderHelper.bind("#borderWidth",n,t,BORDER_WIDTH,{min:0,max:15,postfix:"px"},function(){ViewerFactory.calculateButtonLineHeight(n.getUISelector())});RangeSliderHelper.bind("#borderRadius",n,t,BORDER_RADIUS,{min:0,max:50,postfix:"px"});EditorEventsFactory.attachPlainEvent("#emailInput",t,n,CHANGE,"mode-value");this.layering=this.layering||new LayeringController(n);r=n.getProperty(SUCCESS_PAGE_MASTER_LINK).value;i=r&&r!==n.id?UI.siteComponentRepository.lookupData({id:r}):n;EditorFactory.bindEventsSuccessPage(i);EditorFactory.setEventsToComponent(i);EditorFactory.logoImageUploading(i);EditorFactory.correctRedirectSuccessLink(i,EDITOR_CONTEXT);SwitcherHelper.bind(t,"#useSuccessPageAnyway",n,SUCCESS_PAGE_MASTER_LINK,function(n){UI.callEditor(n);$(UI.getConfigurationValue(EDITOR)+" .accordion .ui-accordion-content").removeClass("ui-accordion-content-active").hide();$(UI.getConfigurationValue(EDITOR)+" .accordion .content-success-settings").addClass("ui-accordion-content-active").show();$(UI.getConfigurationValue(EDITOR)+" .accordion .header-success-settings").addClass("ui-accordion-header-active").show()});ko.applyBindings({},$("#editor")[0])};EditorFactory.switchLabelType=function(n){var i=n.getProperty(SELECTEDLABELTYPE).value,r=n.getProperty(SELECTEDLABEL).value,t="",u=_.clone(r);switch(i){case"Label":$("#labelselect").show();$("#labelname").hide();$("#labelname").val("");t=_.clone($("#labelselect").val());break;case"Name":$("#labelname").show();$("#labelselect").hide();$("#labelselect").val("");t=_.clone($("#labelname").val())}UI.undoManagerAddSimple(n,SELECTEDLABEL,t,null,!0)};EditorFactory.linkManagementEditor=function(n,t){EditorFactory.addedTooltip(["linkInput"],"bottom");$("#blankPage").bind("change",function(){UI.undoManagerAddSimple(n,"open-link-on-blank",$(this).prop("checked"),function(){},!0)});EditorEventsFactory.attachPlainEvent("#modeInput",t,n,CHANGE,"mode",function(n){EditorFactory.switchModes(n)});$("#linkInput,#anchorInputSelect,#pageInput,#callInput").bind("change",function(){EditorFactory.switchModes(n)});EditorFactory.switchModes(n)};EditorFactory.hideItemSettings=function(){$(".save-gallery-item").data("id",null);$(".item-edit-container").hide();$(".save-gallery-item").data("id",null);$("#gallery-editor .gallery-item-title").val("");$("#gallery-editor .gallery-item-description").val("");$(".item-edit-container .gallery-item-title").val("");$(".item-edit-container .gallery-item-optional").val("");$(".item-edit-container .gallery-item-description").val("")};EditorFactory.showItemSettings=function(n){$(".item-edit-container").show();$(".save-gallery-item").data("id",n.id);$(".item-edit-container .gallery-item-title, #gallery-editor .gallery-item-title").val(n.getProperty(TITLE).value);var t=n.getProperty(OPTIONAL);t!=null&&$(".item-edit-container .gallery-item-optional").val(t.value);$(".item-edit-container .gallery-item-description, #gallery-editor .gallery-item-description").val(n.getProperty(DESCRIPTION).value);$("#modeInput").val(n.getProperty(MODE).value);$("#linkInput, #anchorInputSelect, #pageInput, #anchorInput, #callInput").val(n.getProperty(MODE_VALUE).value);$("#blankPage").prop("checked",n.getProperty(OPEN_LINK_ON_BLANK).value.toBoolean());$("#expandCheckbox").is(":checked")?$("#property-link").show():$("#property-link").hide();EditorFactory.switchModes(n)};EditorFactory.bindEvents=function(n){$("#blankPage").bind("change",function(){var i=$(".save-gallery-item").data("id"),t=n.children.where({id:i});t.any()&&(t=t.firstOrDefault(),t.setProperty("open-link-on-blank",$(this).prop("checked")))});$("#modeInput").bind("change",function(){var i=$(".save-gallery-item").data("id"),t=n.children.where({id:i});t.any()&&(t=t.firstOrDefault(),t.setProperty("mode",$("#modeInput").val()),EditorFactory.switchModes(t))});$("#linkInput,#anchorInputSelect,#pageInput,#callInput").bind("change",function(){var i=$(".save-gallery-item").data("id"),t=n.children.where({id:i});t.any()&&(t=t.firstOrDefault(),EditorFactory.switchModes(t))})};EditorFactory.switchModes=function(n){var i=n.getProperty(MODE).value,r=n.getProperty(MODE_VALUE).value,t="",u=_.clone(r);$("#linkInput").removeAttr("disabled");$("#anchorInput").removeAttr("disabled");$("#anchorInputSelect").removeAttr("disabled");$("#pageInput").removeAttr("disabled");$("#callInput").removeAttr("disabled");switch(i){case"none":$(".mode-value").hide();$("#linkInput").attr("disabled","disabled");$("#linkInput").hide();$("#callInput").hide();$("#anchorInput").hide();$("#callInput").attr("disabled","disabled");$("#anchorInput").attr("disabled","disabled");$("#anchorInputSelect").attr("disabled","disabled");$("#pageInput").attr("disabled","disabled");t="";break;case"link":$(".mode-value").show();$("#linkInput").show();$("#callInput").hide();$("#callInput").val("");$("#pageInput").hide();$("#anchorInput").hide();$("#anchorInputSelect").hide();$("#anchorInput").val("");$('#pageInput option[value="None"]').prop("selected",!0);t=_.clone($("#linkInput").val());break;case"page":$(".mode-value").show();$("#linkInput").hide();$("#callInput").hide();$("#callInput").val("");$("#pageInput").show();$("#linkInput").val("");$("#anchorInput").hide();$("#anchorInputSelect").hide();$("#anchorInput").val("");t=_.clone($("#pageInput").val());break;case"anchor":$(".mode-value").show();$("#anchorInput").hide();$("#anchorInputSelect").show();$("#callInput").hide();$("#callInput").val("");$("#linkInput").hide();$("#pageInput").hide();$("#linkInput").val("");$('#pageInput option[value="None"]').prop("selected",!0);t=_.clone($("#anchorInputSelect").val());break;case"call":$(".mode-value").show();$("#callInput").show();$("#anchorInput").hide();$("#anchorInputSelect").hide();$("#linkInput").hide();$("#pageInput").hide();$("#linkInput").val("");$('#pageInput option[value="None"]').prop("selected",!0);t=_.clone($("#callInput").val())}UI.undoManagerAddSimple(n,MODE_VALUE,t,null,!0)};EditorFactory.addedTooltip=function(n,t){if(n.length>0)for(var i=0;i<n.length;i++)$("#"+n[i]).tooltip({placement:t})};ViewerFactory=function(){};ViewerFactory.proxy=function(){var n=this,i=$(n.getUISelector()),r,t;return n.getProperty(BACKGROUND_COLOR)!=null&&i.css("background-color",n.getProperty(BACKGROUND_COLOR).value),n.getProperty(COLOR)!=null&&i.css("color",n.getProperty(COLOR).value),r=n.getProperty(HIDE_COMPONENT),r!=null&&r.value.toBoolean()&&i.addClass("disabled-component"),t=n.proto.name,!UI.getDevice().isDesktop()&&ViewerFactory.viewerForComponent[t+SLAVE]&&(t+=SLAVE),ViewerFactory.viewerForComponent[t]?ViewerFactory.viewerForComponent[t](n):ViewerFactory.viewerForComponent.default(n)};ViewerFactory.viewerForComponent={};ViewerFactory.viewerForComponent[MENU]=function(n){return new MenuComponentViewer(n)};ViewerFactory.viewerForComponent[BUTTON]=function(n){return new ButtonComponentViewer(n)};ViewerFactory.viewerForComponent[MAP]=function(n){return new MapComponentViewer(n)};ViewerFactory.viewerForComponent[BLOGGING]=function(n){return new BloggingComponentViewer(n)};ViewerFactory.viewerForComponent[ANCHOR]=function(n){return new AnchorComponentViewer(n)};ViewerFactory.viewerForComponent[IMAGE]=function(n){return new ImageComponentViewer(n)};ViewerFactory.viewerForComponent[FRAME]=function(n){return new FrameComponentViewer(n)};ViewerFactory.viewerForComponent[PANEL]=function(n){return new PanelComponentViewer(n)};ViewerFactory.viewerForComponent[FORM]=function(n){return new FormComponentViewer(n)};ViewerFactory.viewerForComponent[TEXTBOX]=function(n){return new FormSubComponentViewer(n)};ViewerFactory.viewerForComponent[LABEL]=function(n){return new FormSubComponentViewer(n)};ViewerFactory.viewerForComponent[TEXTAREA]=function(n){return new FormSubComponentViewer(n)};ViewerFactory.viewerForComponent[SELECTLIST]=function(n){return new FormSubComponentViewer(n)};ViewerFactory.viewerForComponent[CHECKBOX]=function(n){return new FormSubComponentViewer(n)};ViewerFactory.viewerForComponent[RADIOLIST]=function(n){return new RadiolistComponentViewer(n)};ViewerFactory.viewerForComponent[SUBMIT]=function(n){return new FormSubmitComponentViewer(n)};ViewerFactory.viewerForComponent[CAPTCHA]=function(n){return new FormCaptchaComponentViewer(n)};ViewerFactory.viewerForComponent[PARAGRAPH]=function(n){return new ParagraphComponentViewer(n)};ViewerFactory.viewerForComponent[GALLERY]=function(n){return new GalleryComponentViewer(n)};ViewerFactory.viewerForComponent[CONTACT_US]=function(n){return new ContactUsComponentViewer(n)};ViewerFactory.viewerForComponent[HTML_CONTAINER]=function(n){return new HtmlContainerComponentViewer(n)};ViewerFactory.viewerForComponent[SLIDESHOW]=function(n){return new SlideshowComponentViewer(n)};ViewerFactory.viewerForComponent[HEADERTEXT]=function(n){return new HeadertextComponentViewer(n)};ViewerFactory.viewerForComponent[VIDEO]=function(n){return new VideoComponentViewer(n)};ViewerFactory.viewerForComponent[SOUND]=function(n){return new SoundComponentViewer(n)};ViewerFactory.viewerForComponent[LIST]=function(n){return new ListComponentViewer(n)};ViewerFactory.viewerForComponent[HOUSE_PHOTO_TOUR]=function(n){return new HousePhotoTourComponentViewer(n)};ViewerFactory.viewerForComponent[EVALUATE_HOME]=function(n){return new EvaluateHomeComponentViewer(n)};ViewerFactory.viewerForComponent[MORTGAGE_CALCULATOR]=function(n){return new MortgageCalculatorComponentViewer(n)};ViewerFactory.viewerForComponent[PDF]=function(n){return new PdfComponentViewer(n)};ViewerFactory.viewerForComponent[SIGNIN]=function(n){return new SigninComponentViewer(n)};ViewerFactory.viewerForComponent[STORE_CART_LINK]=function(n){return new StoreCartLinkComponentViewer(n)};ViewerFactory.viewerForComponent[STORE_CATEGORIES]=function(n){return new StoreCategoriesComponentViewer(n)};ViewerFactory.viewerForComponent[STORE_CART]=function(n){return new StoreCartComponentViewer(n)};ViewerFactory.viewerForComponent[STORE_THANK_YOU]=function(n){return new StoreThankYouComponentViewer(n)};ViewerFactory.viewerForComponent[STORE_PRODUCT]=function(n){return new StoreProductComponentViewer(n)};ViewerFactory.viewerForComponent[STORE_PRODUCT_PRICE]=function(n){return new StoreProductItemComponentViewer(n)};ViewerFactory.viewerForComponent[STORE_PRODUCT_SKU]=function(n){return new StoreProductItemComponentViewer(n)};ViewerFactory.viewerForComponent[STORE_PRODUCT_QUANTITY]=function(n){return new DefaultComponent(n)};ViewerFactory.viewerForComponent[STORE_PRODUCT_ADD_TO_CART]=function(n){return new StoreProductItemComponentViewer(n)};ViewerFactory.viewerForComponent[STORE_PRODUCT_TITLE]=function(n){return new StoreProductItemComponentViewer(n)};ViewerFactory.viewerForComponent[STORE_PRODUCT_IMAGES]=function(n){return new StoreProductImagesComponentViewer(n)};ViewerFactory.viewerForComponent[STORE_GALLERY]=function(n){return new StoreGalleryComponentViewer(n)};ViewerFactory.viewerForComponent[STORE_GALLERY_SHOW_MORE]=function(n){return new StoreGalleryItemComponentViewer(n)};ViewerFactory.viewerForComponent["default"]=function(n){return new DefaultComponentViewer(n)};ViewerFactory.viewerForComponent[HOUSE_PHOTO_TOUR+SLAVE]=function(n){return new HousePhotoTourSlaveComponentViewer(n)};ViewerFactory.viewerForComponent[GALLERY+SLAVE]=function(n){return new HousePhotoTourSlaveComponentViewer(n)};ViewerFactory.viewerForComponent[SLIDESHOW+SLAVE]=function(n){return new SlideshowSlaveComponentViewer(n)};ViewerFactory.viewerForComponent[MENU+SLAVE]=function(n){return new MenuSlaveComponentViewer(n)};var StoreProductItemComponentViewer=function(n){var t=".std-"+n.proto.name;ViewerFactory.calculateButtonLineHeight(t)},StoreProductImagesComponentViewer=function(n){var u=$(n.getUISelector()),t="[id='"+n.id+"']",i=new Swiper(t+" .gallery-top",{direction:"horizontal",loop:!0,loopedSlides:5,nextButton:t+" .swiper-button-next",prevButton:t+" .swiper-button-prev",centeredSlides:!0}),r=new Swiper(t+" .gallery-thumbs",{loopedSlides:6,slidesPerView:6,touchRatio:.2,loop:!0,slideToClickedSlide:!0,centeredSlides:!0});i.params.control=r;r.params.control=i;UI.getSetting("ispreview")||(i.lockSwipes(),r.lockSwipes())},StoreCartLinkComponentViewer=function(n){var t=$(n.getUISelector());UI.getSetting("ispreview")?(UI.getSetting("ispublished")&&t.bind("click",Helpers.generateEventGoToPage),setTimeout(function(){ko.applyBindings(UI.getViewModel(n.proto.name,n),t[0])},0)):(n.isSelectable&&t.bind("click",function(i){ViewerFactory.editorCanBeShown(t,i)&&(i.stopPropagation(),$(this).highlightSelectedElement(n,!0))}),n.isDraggable&&dragDrop.initElement(n.id));ViewerFactory.calculateButtonLineHeight(n.getUISelector())},StoreCartComponentViewer=function(n){var t=$(n.getUISelector());if(UI.getSetting("ispreview")){$(t.selector).on("click","a.product-item",function(n){n.preventDefault();UI.pager.goToPage(UI.pager.getPageId("product"),!1,!1,{key:"productId",value:n.currentTarget.dataset.id})});setTimeout(function(){ko.applyBindings(UI.getViewModel(n.proto.name,n),t[0])},0)}else n.isSelectable&&t.bind("click",function(i){ViewerFactory.editorCanBeShown(t,i)&&(i.stopPropagation(),$(this).highlightSelectedElement(n,UI.getDevice().isDesktop()))})},StoreThankYouComponentViewer=function(n){var t=$(n.getUISelector());UI.getSetting("ispreview")?setTimeout(function(){ko.applyBindings(UI.getViewModel(n.proto.name,n),t[0])},0):n.isSelectable&&t.bind("click",function(i){ViewerFactory.editorCanBeShown(t,i)&&(i.stopPropagation(),$(this).highlightSelectedElement(n,UI.getDevice().isDesktop()))})},StoreProductComponentViewer=function(n){var t=$(n.getUISelector());if(UI.getSetting("ispreview"))$(t.selector).on("click",".breadcrumb > li > a",Helpers.generateEventGoToPage);else n.isSelectable&&t.bind("click",function(i){ViewerFactory.editorCanBeShown(t,i)&&(i.stopPropagation(),$(this).highlightSelectedElement(n,UI.getDevice().isDesktop()))});setTimeout(function(){ko.applyBindings(UI.getViewModel(n.proto.name,n),t[0])},0);ViewerFactory.addLayeringController(this,n)},StoreGalleryItemComponentViewer=function(n){var t=$(n.getUISelector());$(t).css({"text-overflow":"ellipsis",overflow:"hidden"});$(t).hover(function(){n.getProperty(BACKGROUND_COLOR_HOVER)!=null&&$(this).css("background-color",n.getProperty(BACKGROUND_COLOR_HOVER).value);n.getProperty(BORDER_COLOR_HOVER)!=null&&$(this).css("border-color",n.getProperty(BORDER_COLOR_HOVER).value);n.getProperty(TEXT_COLOR_HOVER)!=null&&$(this).css("color",n.getProperty(TEXT_COLOR_HOVER).value)},function(){$(this).css("background-color",n.getProperty(BACKGROUND_COLOR).value);$(this).css("border-color",n.getProperty(BORDER_COLOR).value);$(this).css("color",n.getProperty(COLOR).value)});ViewerFactory.calculateButtonLineHeight(n.getUISelector())},StoreGalleryComponentViewer=function(n){var t=$(n.getUISelector());if(UI.getSetting("ispreview"))$(t.selector).on("click",".std-store-gallery-product > a",function(n){n.preventDefault();UI.pager.goToPage(UI.pager.getPageId("product"),!1,!1,{key:"productId",value:n.currentTarget.dataset.id})});else n.isSelectable&&t.bind("click",function(i){ViewerFactory.editorCanBeShown(t,i)&&(i.stopPropagation(),$(this).highlightSelectedElement(n,!0))}),n.isDraggable&&dragDrop.initElement(n.id);setTimeout(function(){ko.applyBindings(UI.getViewModel(n.proto.name,n,n.id),t[0])},0)},HousePhotoTourSlaveComponentViewer=function(n){var t=$(n.getUISelector()),f;n.children.length==0&&(f=n.getProperty(IMAGE_STRETCHING).value,f==="crop"?($(t.selector).find(".gallery-top .swiper-wrapper").append('<div class="swiper-slide"><div style="background-image: url(/Images/gallery_predefined.png);" class="stretch-image"><\/div><\/div>'),$(t.selector).find(".gallery-thumbs .swiper-wrapper").append('<div class="swiper-slide"><div style="background-image: url(/Images/gallery_predefined.png);" class="stretch-image"><\/div><\/div>')):($(t.selector).find(".gallery-top .swiper-wrapper").append('<div class="swiper-slide"><div class="fitwidth-image"><img alt="" src="/Images/gallery_predefined.png" /><\/div><\/div>'),$(t.selector).find(".gallery-thumbs .swiper-wrapper").append('<div class="swiper-slide"><div class="fitwidth-image"><img alt="" src="/Images/gallery_predefined.png" /><\/div><\/div>')));var i="[id = '"+n.id+"']",r=new Swiper(i+" .gallery-top",{direction:"horizontal",loop:!0,loopedSlides:5,nextButton:i+" .swiper-button-next",prevButton:i+" .swiper-button-prev",centeredSlides:!0}),u=new Swiper(i+" .gallery-thumbs",{loopedSlides:5,slidesPerView:4,touchRatio:.2,loop:!0,slideToClickedSlide:!0,centeredSlides:!0});r.params.control=u;u.params.control=r;UI.getSetting("ispreview")?UI.getSetting("ispublished")&&n.proto.name===GALLERY&&_.forEach(n.children,function(n){ViewerFactory.bindEventGoToPage(n,$(n.getUISelector()+"_view").find("a"))}):(r.lockSwipes(),u.lockSwipes(),n.isSelectable&&t.bind("click",function(i){ViewerFactory.editorCanBeShown(t,i)&&(i.stopPropagation(),$(this).highlightSelectedElement(n,!0))}),n.isDraggable&&dragDrop.initElement(n.id));ViewerFactory.addLayeringController(this,n)},SlideshowSlaveComponentViewer=function(n){var t=$(n.getUISelector()),f,r;n.children.length==0&&(f=n.getProperty(IMAGE_STRETCHING).value,f==="crop"?$(t.selector).find(".swiper-wrapper").append('<div class="swiper-slide"><div style="background-image: url(/Images/gallery_predefined.png);" class="stretch-image"><\/div><\/div>'):$(t.selector).find(".swiper-wrapper").append('<div class="swiper-slide"><div class="fitwidth-image"><img alt="" src="/Images/gallery_predefined.png" /><\/div><\/div>'));var u="[id = '"+n.id+"']",e=n.getProperty(INTERVAL).value.toInteger(),o=n.getProperty(NAV).value.toBoolean(),s=n.getProperty(DOT).value.toBoolean(),h=n.getProperty(PAUSE).value.toBoolean(),i={direction:"horizontal",loop:!0,autoplay:e*1e3,centeredSlides:!0,autoplayDisableOnInteraction:!1};o&&(i.nextButton=u+" .swiper-button-next",i.prevButton=u+" .swiper-button-prev");s&&(i.paginationClickable=!0,i.pagination=u+" .swiper-pagination");r=new Swiper(u+" .swiper-container",i);UI.getSetting("ispreview")?(UI.getSetting("ispublished")&&_.forEach(n.children,function(n){ViewerFactory.bindEventGoToPage(n,$(n.getUISelector()+"_view").find("a"))}),h&&$(t).hover(function(){r.stopAutoplay()},function(){r.startAutoplay()})):(r.stopAutoplay(),r.lockSwipes(),n.isSelectable&&t.bind("click",function(i){ViewerFactory.editorCanBeShown(t,i)&&(i.stopPropagation(),$(this).highlightSelectedElement(n,!0))}),n.isDraggable&&dragDrop.initElement(n.id));ViewerFactory.addLayeringController(this,n)},MenuSlaveComponentViewer=function(n){var t=$(n.getUISelector()),i;if(UI.getSetting("ispreview")){i={left:parseInt(n.getProperty(LEFT).value)};t.on("show.bs.dropdown",function(){i.height=$(".site-wrapper.mobile")[0].scrollHeight});t.on("shown.bs.dropdown",function(){$(this).find(".dropdown-menu").css(LEFT,20-i.left+"px");Helpers.checkSiteWrapperHeightMobile()});t.on("hidden.bs.dropdown",function(){Helpers.checkSiteWrapperHeightMobile(i.height)});if(UI.getSetting("ispublished"))$(t.selector).on("click","ul li a",Helpers.generateEventGoToPage)}else n.isSelectable&&t.bind("click",function(i){ViewerFactory.editorCanBeShown(t,i)&&(i.stopPropagation(),$(this).highlightSelectedElement(n,!0))}),n.isDraggable&&dragDrop.initElement(n.id);ViewerFactory.addLayeringController(this,n)},StoreCategoriesComponentViewer=function(n){var t=$(n.getUISelector()),i;if($(t).hover(function(){$(this).find(".dropdown-container").hasClass("open")||(n.getProperty(BACKGROUND_COLOR_HOVER)!=null&&$(this).css("background-color",n.getProperty(BACKGROUND_COLOR_HOVER).value),n.getProperty(BORDER_COLOR_HOVER)!=null&&$(this).css("border-color",n.getProperty(BORDER_COLOR_HOVER).value),n.getProperty(TEXT_COLOR_HOVER)!=null&&$(this).css("color",n.getProperty(TEXT_COLOR_HOVER).value))},function(){$(this).css("background-color",n.getProperty(BACKGROUND_COLOR).value);$(this).css("border-color",n.getProperty(BORDER_COLOR).value);$(this).css("color",n.getProperty(COLOR).value)}),$(t).click(function(){$(this).find(".dropdown-container").hasClass("open")||($(this).css("background-color",n.getProperty(BACKGROUND_COLOR).value),$(this).css("border-color",n.getProperty(BORDER_COLOR).value),$(this).css("color",n.getProperty(COLOR).value))}),UI.getSetting("ispreview")){if(!UI.getDevice().isDesktop()){i={left:parseInt(n.getProperty(LEFT).value)};t.on("show.bs.dropdown",function(){i.height=$(".site-wrapper.mobile")[0].scrollHeight});t.on("shown.bs.dropdown",function(){$(this).find(".dropdown-menu").css(LEFT,20-i.left+"px");Helpers.checkSiteWrapperHeightMobile()});t.on("hidden.bs.dropdown",function(){Helpers.checkSiteWrapperHeightMobile(i.height)})}setTimeout(function(){ko.applyBindings(UI.getViewModel(n.proto.name,n,n.id),t.find(".dropdown-container")[0])},0)}else n.isSelectable&&t.bind("click",function(i){ViewerFactory.editorCanBeShown(t,i)&&(i.stopPropagation(),$(this).highlightSelectedElement(n,!0))}),n.isDraggable&&dragDrop.initElement(n.id);ViewerFactory.calculateButtonLineHeight(n.getUISelector());ViewerFactory.addLayeringController(this,n)};ViewerFactory.addLayeringController=function(n,t){UI.getSetting("ispublished")||(n.layering=n.layering||new LayeringController(t))};ViewerFactory.correctShowListComponent=function(n){if(n!=null){var t=n.getProperty(TYPE).value;switch(t){case VERTICAL:$(n.getUISelector()).find(".title").css("background-color",n.getProperty(IMAGE_SETTINGS_BGCOLOR).value);$(n.getUISelector()).find(".description").css("background-color",n.getProperty(IMAGE_SETTINGS_BGCOLOR).value);break;case GENERAL:$(n.getUISelector()).find(".title").css("background-color",n.getProperty(IMAGE_SETTINGS_BGCOLOR).value);$(n.getUISelector()).find(".description").css("background-color",n.getProperty(IMAGE_SETTINGS_BGCOLOR).value);$(n.getUISelector()).find(".meta").css("background-color",n.getProperty(IMAGE_SETTINGS_BGCOLOR).value);$(n.getUISelector()).find(".meta").css("color",n.getProperty(IMAGE_SETTING_OPTIONALCOLOR).value);break;case LINES:$(n.getUISelector()).find(".p5").css("background-color",n.getProperty(IMAGE_SETTINGS_BGCOLOR).value);break;case THUMBNAILS:$(n.getUISelector()).find(".title").css("background-color",n.getProperty(IMAGE_SETTINGS_BGCOLOR).value);break;case SIMPLE:$(n.getUISelector()).find(".meta").css("color",n.getProperty(IMAGE_SETTING_OPTIONALCOLOR).value)}}};ViewerFactory.correctMessageSuccessPage=function(n,t){var i=n.getProperty(SUCCESS_PAGE_MESSAGE),u,r;return i=i!=null?i.value:MEESSAGE_EMAIL_SUCCESS_DOMANIAN_NAME,u=n.getProperty("mode-value").value,r=window.location.origin.split("/"),r[2]=r[2].length>20?r[2].substr(0,20)+"...":r[2],i=i.replace(/<DomainName>/g,r[2]),i=i.replace(/<CustomerEmail>/g,t),i.replace(/<RecipientEmail>/g,"<a href='mailto:"+u+"'>"+u+"<\/a>")};ViewerFactory.createModalWindow=function(n,t){var i=ContextFactory.contextFor(n,VIEWER_CONTEXT);i.link=i.link==""?EditorFactory.correctRedirectSuccessLink(n,VIEWER_CONTEXT):i.link;i.message=ViewerFactory.correctMessageSuccessPage(n,t);Application.showSuccessPage(i.message,i.link,i.contentColor,i.textColor,i.ff,i.fs,i.image,i.headerColor,i.buttonColor,i.headerText,i.buttonText)};ViewerFactory.setJPlayerForComponent=function(n,t,i){var r=n.getUISelector()+JPLAYER_SUFFIX,u=n.getUISelector()+JPLAYER_CONTAINER_SUFFIX;$(r).data("ready","false");$(r).jPlayer({ready:function(){$(this).jPlayer("setMedia",{title:i,m4a:t});$(this).data("ready","true")},cssSelectorAncestor:u,swfPath:"/content/image/jquery.jplayer.swf",supplied:"m4a,mp3",solution:"html,flash",useStateClassSkin:!0,autoBlur:!1,smoothPlayBar:!0,keyEnabled:!0,remainingDuration:!0,toggleDuration:!0})};var DefaultComponentViewer=function(n){var t=$(n.getUISelector()),i,r;$(t).hasClass("header")&&(i=$(t)[0].offsetHeight,$("#header-resizer").css("top",i),$(".site-wrapper").css("height",i));$(t).hasClass("main")&&(i=$(t)[0].offsetHeight+$(t)[0].offsetTop,$("#page-resizer").css("top",i));$(t).hasClass("footer")&&(r=$(t)[0].offsetHeight+$(t)[0].offsetTop,$("#bottom-body-resizer").css("top",r))},MenuComponentViewer=function(n){var t=$(n.getUISelector()),i;if(ViewerFactory.initComponentPosition(n,t),i=$(t).children("ul"),i.length!=0){ViewerFactory.calculateMenuLineHeight(n,t.selector);$(t.selector).height(n.getProperty(HEIGHT).value);$(t.selector).on("mouseenter","ul li",function(){n.getProperty(BACKGROUND_COLOR_HOVER)!=null&&$(this).css("background-color",n.getProperty(BACKGROUND_COLOR_HOVER).value);n.getProperty(BACKGROUND_COLOR)!=null&&$(t.selector).find("ul li ul").css("background-color",n.getProperty(BACKGROUND_COLOR).value)});$(t.selector).on("mouseenter","ul li:first-child",function(){var r=n.getProperty(PREDEFINED).value,t="border-bottom-left-radius",i="border-top-left-radius";r!="simple"&&(t="border-top-left-radius",i="border-top-right-radius");$(this).css(t,n.getProperty(BORDER_RADIUS).value);$(this).css(i,n.getProperty(BORDER_RADIUS).value)});$(t.selector).on("mouseenter","ul li:last-child",function(){var r=n.getProperty(PREDEFINED).value,t="border-bottom-right-radius",i="border-top-right-radius";r!="simple"&&(t="border-bottom-left-radius",i="border-bottom-right-radius");$(this).css(t,n.getProperty(BORDER_RADIUS).value);$(this).css(i,n.getProperty(BORDER_RADIUS).value)});$(t.selector).on("mouseenter","ul li ul li",function(){$(this).css("border-radius","0px")});$(t.selector).on("mouseenter","ul li a",function(){n.getProperty(TEXT_COLOR_HOVER)!=null&&$(this).css("color",n.getProperty(TEXT_COLOR_HOVER).value)});$(t.selector).on("mouseleave","ul li",function(){$(this).css("background-color","transparent")});$(t.selector).on("mouseleave","ul li a",function(){n.getProperty(COLOR)!=null&&$(this).css("color",n.getProperty(COLOR).value)});$(t.selector).on("mouseenter",function(){n.getProperty(BORDER_COLOR_HOVER)!=null&&$(this).css("border-color",n.getProperty(BORDER_COLOR_HOVER).value)});$(t.selector).on("mouseleave",function(){$(this).css("border-color",n.getProperty("border-color").value)});if(UI.getSetting("ispublished"))$(t.selector).on("click","ul li a",Helpers.generateEventGoToPage)}UI.getSetting("ispreview")||(n.isSelectable&&t.bind("click",function(i){ViewerFactory.editorCanBeShown(t,i)&&(i.stopPropagation(),$(this).highlightSelectedElement(n,!0))}),$(t).find("a").bind("click",function(n){n.preventDefault()}),n.isDraggable&&!n.getProperty(IS_PINED).value.toBoolean()&&dragDrop.initElement(n.id));n.stretcher();ViewerFactory.addLayeringController(this,n)},VideoComponentViewer=function(n){var t=$(n.getUISelector()),r=n.getProperty(AUTOPLAY).value,i;t.attr("data-autoplay",r);i=Helpers.convertToUniversalUrl(n.getProperty(SRC).value);UI.getSetting("ispreview")||($(t).children("iframe").attr("src",i),n.isSelectable&&t.bind("click",function(i){ViewerFactory.editorCanBeShown(t,i)&&(i.stopPropagation(),$(this).highlightSelectedElement(n,!0))}),$(t).find("a").bind("click",function(n){n.preventDefault()}),n.isDraggable&&dragDrop.initElement(n.id));(!UI.getSetting("ispreview")||UI.getSetting("isThumbnailPreview"))&&ViewerFactory.replacementImageInsteadVideo(t.selector,i);ViewerFactory.addLayeringController(this,n)},SoundComponentViewer=function(n){var t=$(n.getUISelector()),i,f,r,u;UI.getDevice().isDesktop()||t.removeClass("std-sound-mobile").addClass("std-sound-mobile");n.getProperty(HEIGHT)==null&&(i=$(n.getUISelector()+JPLAYER_CONTAINER_SUFFIX).outerHeight(),n.setProperty(HEIGHT,i+"px"),t.css(HEIGHT,i));f=n.getProperty(AUTOPLAY).value;t.attr("data-autoplay",f);UI.getSetting("ispreview")?(r=Helpers.convertToUniversalUrl(n.getProperty(SRC).value),u=n.getProperty(TITLE).value,document.readyState=="complete"?ViewerFactory.setJPlayerForComponent(n,r,u):$(window).load(function(){ViewerFactory.setJPlayerForComponent(n,r,u)})):(n.isSelectable&&t.bind("click",function(i){ViewerFactory.editorCanBeShown(t,i)&&(i.stopPropagation(),$(this).highlightSelectedElement(n,!0))}),n.isDraggable&&dragDrop.initElement(n.id));ViewerFactory.addLayeringController(this,n)},ContactUsComponentViewer=function(n){var t=$(n.getUISelector()),i="captcha_"+n.id,u=n.getProperty(USE_CAPTCHA).value.toBoolean(),r;if(UI.getSetting("ispreview")){$(t.selector).on("change keydown","input, select, textarea",function(){$(this).removeClass("validation-error")});$(t.selector).find("input").attr("readonly",!1);$(t.selector).find("textarea").attr("readonly",!1);$(t.selector).find("textarea").css({resize:"none"});$(t.selector).find("select").removeAttr("disabled");$(t.selector).find("input[name='SBMT']").bind("click",function(){var i=ViewerFactory.staticFormValidation(n),r;i.length?(r=_.uniq(i.map(function(n){return n.message})).join(", ")+"!",$(t.selector).find(i.map(function(n){return n.selector}).join(",")).addClass("validation-error"),Application.showOkDialog("Error",r)):f(t.selector)});function f(t){var s=n.getProperty(TYPE).value,r=[],u="";if(s=="Request a quote"){var f=$(t).find("h3").html(),e="Name: "+$(t).find("input[name='NA']")[0].value,h="Day Phone: "+$(t).find("input[name='DP']")[0].value,c="Evening Phone: "+$(t).find("input[name='EP']")[0].value,i="Email: "+$(t).find("input[name='EM']")[0].value,o="Comments: "+$(t).find("textarea[name='CM']")[0].value;r.push(f,e,h,c,i,o);u=i}else{var f=$(t).find("h3").html(),e="Name: "+$(t).find("input[name='NA']")[0].value,l="Phone: "+$(t).find("input[name='PH']")[0].value,i="Email: "+$(t).find("input[name='EM']")[0].value,a="Best Time To Call: "+$(t).find("select[name='BTTC']")[0].value,v="Inspection Address: "+$(t).find("input[name='IA']")[0].value,y="City, ST, ZIP: "+$(t).find("input[name='CSZ']")[0].value,p="Property Type: "+$(t).find("select[name='PRT']")[0].value,w="Square Footage: "+$(t).find("input[name='SF']")[0].value,b="Year Built: "+$(t).find("input[name='YB']")[0].value,k="Foundation Type: "+$(t).find("select[name='FT']")[0].value,d="Pool Type: "+$(t).find("select[name='PT']")[0].value,o="Comments: "+$(t).find("textarea[name='CM']")[0].value;r.push(f,e,l,i,a,v,y,p,w,b,k,d,o);u=i}ViewerFactory.sendComponentDataToMail(n,r,u)}}else $("#"+i).addClass("inactively"),n.isSelectable&&t.bind("click",function(i){ViewerFactory.editorCanBeShown(t,i)&&(i.stopPropagation(),$(this).highlightSelectedElement(n,!0))}),n.isDraggable&&dragDrop.initElement(n.id);r=n.getProperty(FONT_SIZE).value;$(t).css("font-size",parseInt(r)+"px");u&&ViewerFactory.initCaptcha(n,i);ViewerFactory.addLayeringController(this,n)};ViewerFactory.initCaptcha=function(n,t){function i(i){$("#"+t+" > div").removeClass("validation-error");n.valid=!!i}var r={sitekey:RECAPTCHA_SITE_KEY,callback:i,"expired-callback":i,"error-callback":i};UI.getDevice().isDesktop()||(r.size="compact");grecaptcha.ready(function(){grecaptcha.render(t,r)})};var PanelComponentViewer=function(n){var t=$(n.getUISelector());ViewerFactory.initComponentPosition(n,t);UI.getSetting("ispreview")||(n.isSelectable&&t.bind("click",function(i){ViewerFactory.editorCanBeShown(t,i)&&(i.stopPropagation(),$(this).highlightSelectedElement(n,!0))}),n.isDraggable&&!n.getProperty(IS_PINED).value.toBoolean()&&dragDrop.initElement(n.id));n.stretcher();ViewerFactory.addLayeringController(this,n)},FormComponentViewer=function(n){var t=$(n.getUISelector());if(UI.getSetting("ispreview"))t.on("change keydown","input, select, textarea",function(){$(this).removeClass("validation-error")});else n.isSelectable&&t.bind("click",function(i){ViewerFactory.editorCanBeShown(t,i)&&(i.stopPropagation(),$(this).highlightSelectedElement(n,!0))}),n.isDraggable&&dragDrop.initElement(n.id);ViewerFactory.addLayeringController(this,n)},AnchorComponentViewer=function(n){var t=$(n.getUISelector()),i=n.getProperty("name").value;UI.getSetting("ispreview")?t.attr("id",i.substring(1)):(n.isSelectable&&t.bind("click",function(i){ViewerFactory.editorCanBeShown(t,i)&&(i.stopPropagation(),$(this).highlightSelectedElement(n,!0))}),n.isDraggable&&dragDrop.initElement(n.id))},FrameComponentViewer=function(n){var t=$(n.getUISelector()),i;UI.getSetting("ispreview")?(i=n.getProperty(MODE_VALUE).value,i!=""&&t.css("background","none"),t.children().attr("src",i)):(t.empty(),i=n.getProperty(MODE_VALUE).value,i!=""&&(i.indexOf("http://")!==-1?t.append('<svg viewBox="0 0 100 100"><text fill="#fff" font-size="20" x="50%" y="50%" dy="0.3em" text-anchor="middle">Iframe<\/text><\/svg>'):(t.append('<div class="std-frame-overlay"><\/div>'),t.append('<iframe src="'+i+'" sandbox="allow-forms allow-scripts allow-same-origin"><\/iframe>'),t.css("background","none"))),n.isSelectable&&t.bind("click",function(i){ViewerFactory.editorCanBeShown(t,i)&&(i.stopPropagation(),$(this).highlightSelectedElement(n,!0))}),n.isDraggable&&dragDrop.initElement(n.id));UI.getSetting("isThumbnailPreview")&&ViewerFactory.replacementImagesInsteadEveryVideoInContainer(t.selector);ViewerFactory.addLayeringController(this,n)},PdfComponentViewer=function(n){var t=$(n.getUISelector()),i,r;if(UI.getSetting("ispreview")){i=n.getProperty("mode-value").value;r=n.getProperty("name").value;t.on("click",function(){Helpers.showPdfInsideModal(i,r)});t.addClass("std-pdf-preview")}else n.isSelectable&&t.bind("click",function(i){ViewerFactory.editorCanBeShown(t,i)&&(i.stopPropagation(),$(this).highlightSelectedElement(n,!0))}),n.isDraggable&&dragDrop.initElement(n.id);ViewerFactory.addLayeringController(this,n)},MortgageCalculatorComponentViewer=function(n){var t=$(n.getUISelector()),f;if(UI.getSetting("ispreview")){$(t.selector).find("input[name='LA'], input[name='YR'], input[name='IR'], input[name='AT'], input[name='AI']").attr("readonly",!1);$(t.selector).find("input[name='CALC']").bind("click",function(){u(t.selector)});$(t.selector).find("input[name='LA'], input[name='YR'], input[name='IR'], input[name='AT'], input[name='AI']").bind("change",function(){u(t.selector)});$(t.selector).find("input[name='LA'], input[name='YR'], input[name='IR'], input[name='AT'], input[name='AI']").bind("keypress",function(n){return e(n)});function e(n){var t=n.which?n.which:n.keyCode;return t!=46&&t>31&&(t<48||t>57)?!1:!0}function r(n){return Math.floor(n*Math.pow(10,2))/Math.pow(10,2)}function u(n){var h=$(n).find("input[name='IR']")[0],c=$(n).find("input[name='YR']")[0],l=$(n).find("input[name='PI']")[0],a=$(n).find("input[name='MT']")[0],v=$(n).find("input[name='MI']")[0],y=$(n).find("input[name='MP']")[0],f=$(n).find("input[name='LA']")[0],e=$(n).find("input[name='AT']")[0],o=$(n).find("input[name='AI']")[0],u=h.value/1200,t=1,p=1+u,s;for(i=0;i<c.value*12;i++)t=t*p;l.value=r(f.value*u/(1-1/t));a.value=r(e.value/12);v.value=r(o.value/12);s=f.value*u/(1-1/t)+e.value/12+o.value/12;y.value=r(s)}}else n.isSelectable&&t.bind("click",function(i){ViewerFactory.editorCanBeShown(t,i)&&(i.stopPropagation(),$(this).highlightSelectedElement(n,!0))}),n.isDraggable&&dragDrop.initElement(n.id);f=n.getProperty(FONT_SIZE).value;$(t).css("font-size",parseInt(f)+"px");ViewerFactory.addLayeringController(this,n)},EvaluateHomeComponentViewer=function(n){var t=$(n.getUISelector()),i="captcha_"+n.id,u=n.getProperty(USE_CAPTCHA).value.toBoolean(),r;if(UI.getSetting("ispreview")){$(t.selector).on("change keydown","input, select, textarea",function(){$(this).removeClass("validation-error")});$(t.selector).find("input").attr("readonly",!1);$(t.selector).find("input[name='SBMT']").bind("click",function(){var i=ViewerFactory.staticFormValidation(n),r;i.length?(r=_.uniq(i.map(function(n){return n.message})).join(", ")+"!",$(t.selector).find(i.map(function(n){return n.selector}).join(",")).addClass("validation-error"),Application.showOkDialog("Error",r)):f(t.selector)});function f(t){var i=[],u=$(t).find("h3").html(),f="Name: "+$(t).find("input[name='NA']")[0].value,r="Email: "+$(t).find("input[name='EM']")[0].value,e="Phone Number: "+$(t).find("input[name='PN']")[0].value,o="Address: "+$(t).find("input[name='AD']")[0].value,s="City: "+$(t).find("input[name='CT']")[0].value,h="State: "+$(t).find("input[name='ST']")[0].value,c="Zip-Code: "+$(t).find("input[name='ZC']")[0].value,l="Beds: "+$(t).find("input[name='BD']")[0].value,a="Baths: "+$(t).find("input[name='BTH']")[0].value,v="Square Feet: "+$(t).find("input[name='SF']")[0].value,y="Lot Size: "+$(t).find("input[name='LS']")[0].value,p="Year Built: "+$(t).find("input[name='YB']")[0].value;i.push(u,f,r,e,o,s,h,c,l,a,v,y,p);ViewerFactory.sendComponentDataToMail(n,i,r)}}else $("#"+i).addClass("inactively"),n.isSelectable&&t.bind("click",function(i){ViewerFactory.editorCanBeShown(t,i)&&(i.stopPropagation(),$(this).highlightSelectedElement(n,!0))}),n.isDraggable&&dragDrop.initElement(n.id);r=n.getProperty(FONT_SIZE).value;$(t).css("font-size",parseInt(r)+"px");u&&ViewerFactory.initCaptcha(n,i);ViewerFactory.addLayeringController(this,n)};ViewerFactory.staticFormValidation=function(n){var t=[],i=[],u=$(n.getUISelector()),r;switch(n.proto.name){case CONTACT_US:i=ContextFactory.getContactUsFields(n);break;case EVALUATE_HOME:i=ContextFactory.getEvaluateHomeFields(n)}return i.forEach(function(n){if(n.required){var i=$(u.selector).find(n.selector);i.length&&(i.val()?n.selector==="input[name='EM']"&&(ViewerFactory.validateEmail(i.val())||t.push({selector:n.selector,message:"Invalid email",type:"email"})):t.push({selector:n.selector,message:"Please fill required fields",type:"email"}))}}),r=n.getProperty(USE_CAPTCHA),r!=null&&r.value.toBoolean()&&(n.valid||t.push({selector:"#captcha_"+n.id+" > div",message:"Captcha required",type:"captcha"})),t};ImageComponentViewer=function(n){var t=$(n.getUISelector());if(ViewerFactory.initComponentPosition(n,t),UI.getSetting("ispreview")){$(t.selector).on("mouseenter",function(){var t=n.getProperty(IMAGE_ON_HOVER).value,i;t!=""&&(i=n.getProperty(SHOW_OPTIMIZED_HOVER).value.toBoolean(),t=ContextFactory.prepareImgSrc(t,i),$(this).children()[0].src=t)});$(t.selector).on("mousedown",function(){var t=n.getProperty(IMAGE_ON_PRESSED).value,i;t!=""&&(i=n.getProperty(SHOW_OPTIMIZED_PRESSED).value.toBoolean(),t=ContextFactory.prepareImgSrc(t,i),$(this).children()[0].src=t)});$(t.selector).on("mouseup",function(){var t=n.getProperty(IMAGE_ON_HOVER).value,r,i,u;t!=""?(r=n.getProperty(SHOW_OPTIMIZED_HOVER).value.toBoolean(),t=ContextFactory.prepareImgSrc(t,r),$(this).children()[0].src=t):(i=n.getProperty(SRC).value,u=n.getProperty(SHOW_OPTIMIZED).value.toBoolean(),i=ContextFactory.prepareImgSrc(i,u),$(this).children()[0].src=i)});$(t.selector).on("mouseleave",function(){var t=n.getProperty(SRC).value,i=n.getProperty(SHOW_OPTIMIZED).value.toBoolean();t=ContextFactory.prepareImgSrc(t,i);$(this).children()[0].src=t});UI.getSetting("ispublished")&&ViewerFactory.bindEventGoToPage(n,$(t.selector))}else n.isSelectable&&t.bind("click",function(i){ViewerFactory.editorCanBeShown(t,i)&&(i.stopPropagation(),$(this).highlightSelectedElement(n,!0))}),n.isDraggable&&!n.getProperty(IS_PINED).value.toBoolean()&&dragDrop.initElement(n.id);n.stretcher();ViewerFactory.addLayeringController(this,n)};HtmlContainerComponentViewer=function(n){var t=$(n.getUISelector());if(UI.getSetting("ispreview")?UI.getSetting("isThumbnailPreview")||(t.find('iframe[src*="youtube.com"]').each(function(){var n=$(this);n.attr("src",Helpers.addQueryParam(n.attr("src"),"enablejsapi=1"))}),t.find('iframe[src*="vimeo.com"]').each(function(){var n=$(this);n.attr("src",Helpers.addQueryParam(n.attr("src"),"api=1"))})):(n.isSelectable&&t.bind("click",function(i){ViewerFactory.editorCanBeShown(t,i)&&(i.stopPropagation(),$(this).highlightSelectedElement(n,!0))}),n.isDraggable&&dragDrop.initElement(n.id)),UI.getSetting("ispreview")&&t.find(".html-container-overlay").remove(),UI.getSetting("ispreview")||n.isPreviewEnabled){var u=n.getProperty(TEXT).value,r=t.find(".html-container-content > iframe"),i=r[0].contentDocument||r[0].contentWindow.document;i.open();i.write(u);i.close()}UI.getSetting("isThumbnailPreview")&&ViewerFactory.replacementImagesInsteadEveryVideoInContainer(t.selector);ViewerFactory.addLayeringController(this,n)};ViewerFactory.getFixedLocationPosition=function(n,t){var u=n.getProperty(OFFSET_X).value,r=n.getProperty(OFFSET_Y).value,s=n.getProperty(FIXED_LOCATION).value,f="",h=parseInt(UI.getDevice().getWidth()),e=0,c=StretcherFactory.getCurrentStretchStatus(n),l,o,i;if(!UI.getSetting("ispaid"))try{l=dealerAdvTemplate;e=parseInt(h*90/960)}catch(a){console.log("no adv..."+a)}o=$(".body").offset().top;i={};switch(s){case"center-top":f=UI.getSetting("ispreview")?parseInt(r)+e+"px":parseInt(r)+o+"px";i={top:f,left:parseInt(u)*2+"px",margin:"auto",right:"0px"};t&&(i.top=parseInt(i.top)-1+"px");break;case"left-top":f=UI.getSetting("ispreview")?parseInt(r)+e+"px":parseInt(r)+o+"px";i={top:f,left:parseInt(u)+"px"};t&&(i.top=parseInt(i.top)-1+"px",i.left=parseInt(i.left)-1+"px");break;case"right-top":f=UI.getSetting("ispreview")?parseInt(r)+e+"px":parseInt(r)+o+"px";i={top:f,right:parseInt(u)+"px",left:"initial"};t&&(i.top=parseInt(i.top)-1+"px",i.right=parseInt(i.right)-1+"px");break;case"left-center":i={top:parseInt(r)*2+"px",left:parseInt(u)+"px",margin:"auto",bottom:"0px"};t&&(i.left=parseInt(i.left)-1+"px");break;case"left-bottom":i={bottom:parseInt(r)+"px",left:parseInt(u)+"px",top:"initial"};t&&(i.bottom=parseInt(i.bottom)-1+"px",i.left=parseInt(i.left)-1+"px");break;case"center-bottom":i={bottom:parseInt(r)+"px",left:parseInt(u)*2+"px",top:"initial",margin:"auto",right:"0px"};t&&(i.bottom=parseInt(i.bottom)-1+"px",i.left=parseInt(i.left)-1+"px");break;case"right-bottom":i={bottom:parseInt(r)+"px",left:"initial",top:"initial",right:parseInt(u)+"px"};t&&(i.bottom=parseInt(i.bottom)-1+"px",i.right=parseInt(i.right)-1+"px");break;case"right-center":i={top:parseInt(r)*2+"px",right:parseInt(u)+10+"px",left:"initial",bottom:"0px",margin:"auto"};t&&(i.right=parseInt(i.right)-1+"px")}return c&&(delete i.right,delete i.left),i};ViewerFactory.initComponentPosition=function(n,t){var u=n.getProperty(IS_PINED).value.toBoolean(),f=n.getProperty(FIXED_LOCATION).value,i,r;u&&(f&&(i=$(n.getUISelector()),r=parseInt(i.css("z-index")),(!r||r<4)&&i.css("z-index",4),$(i.detach()).appendTo(UI.getBody().getUISelector())),$(t).css(ViewerFactory.getFixedLocationPosition(n)))};ViewerFactory.calculateButtonLineHeight=function(n){var t=$(n),i=parseInt(t.css("border-top-width")),r=parseInt(t.css("height")),u=r-i*2;t.css("line-height",u+"px")};var BloggingComponentViewer=function(n){var t=$(n.getUISelector());if(UI.getSetting("ispreview")){if(UI.getSetting("ispublished"))$(t.selector).on("click",".std-blogging-page a",Helpers.generateEventGoToPage)}else n.isSelectable&&t.bind("click",function(i){ViewerFactory.editorCanBeShown(t,i)&&(i.stopPropagation(),$(this).highlightSelectedElement(n,!0))}),n.isDraggable&&dragDrop.initElement(n.id);ViewerFactory.addLayeringController(this,n)},ButtonComponentViewer=function(n){var t=$(n.getUISelector());ViewerFactory.initComponentPosition(n,t);$(t).css({"text-overflow":"ellipsis",overflow:"hidden"});$(t).hover(function(){n.getProperty(BACKGROUND_COLOR_HOVER)!=null&&$(this).css("background-color",n.getProperty(BACKGROUND_COLOR_HOVER).value);n.getProperty(BORDER_COLOR_HOVER)!=null&&$(this).css("border-color",n.getProperty(BORDER_COLOR_HOVER).value);n.getProperty(TEXT_COLOR_HOVER)!=null&&$(this).css("color",n.getProperty(TEXT_COLOR_HOVER).value)},function(){$(this).css("background-color",n.getProperty(BACKGROUND_COLOR).value);$(this).css("border-color",n.getProperty(BORDER_COLOR).value);$(this).css("color",n.getProperty(COLOR).value)});UI.getSetting("ispreview")?UI.getSetting("ispublished")&&ViewerFactory.bindEventGoToPage(n,t):(n.isSelectable&&t.bind("click",function(i){ViewerFactory.editorCanBeShown(t,i)&&(i.stopPropagation(),$(this).highlightSelectedElement(n,!0))}),n.isDraggable&&!n.getProperty(IS_PINED).value.toBoolean()&&dragDrop.initElement(n.id));ViewerFactory.calculateButtonLineHeight(n.getUISelector());ViewerFactory.addLayeringController(this,n)},MapComponentViewer=function(n){var t=$(n.getUISelector()),i=n.getProperty(LATITUDE).value,r=n.getProperty(LONGITUDE).value,u=n.getProperty(TEXT).value,f=n.getProperty(TITLE).value,e=n.getProperty(SHOW_MAP_TYPE).value,o=n.getProperty(SHOW_ZOOM).value,s=n.getProperty(MAP_INTERACTIVE).value,h=n.getProperty(SHOW_STREET_VIEW).value,c="/Editor/GoogleMap?lat="+i+"&lng="+r+"&address="+u+"&title="+f+"&showMapType="+e+"&showZoom="+o+"&mapInteractive="+s+"&showStreetView="+h;t.empty();t.append('<iframe class="map" src="'+c+'" frameborder="0" scrolling="no" marginheight="0" marginwidth="0"><\/iframe>');UI.getSetting("ispreview")||(t.find(".map").addClass("not-active"),n.isSelectable&&t.bind("click",function(i){ViewerFactory.editorCanBeShown(t,i)&&(i.stopPropagation(),$(this).highlightSelectedElement(n,!0))}),n.isDraggable&&dragDrop.initElement(n.id));ViewerFactory.addLayeringController(this,n)},SigninComponentViewer=function(n){var t=$(n.getUISelector());$(t).css({"text-overflow":"ellipsis",overflow:"hidden"});$(t).hover(function(){n.getProperty(BACKGROUND_COLOR_HOVER)!=null&&$(this).css("background-color",n.getProperty(BACKGROUND_COLOR_HOVER).value);n.getProperty(BORDER_COLOR_HOVER)!=null&&$(this).css("border-color",n.getProperty(BORDER_COLOR_HOVER).value);n.getProperty(TEXT_COLOR_HOVER)!=null&&$(this).css("color",n.getProperty(TEXT_COLOR_HOVER).value)},function(){$(this).css("background-color",n.getProperty(BACKGROUND_COLOR).value);$(this).css("border-color",n.getProperty(BORDER_COLOR).value);$(this).css("color",n.getProperty(COLOR).value)});UI.getSetting("ispreview")?t.bind("click",function(){UI.componentService.addModalContentToForm(n,"#signin-login")}):(n.isSelectable&&t.bind("click",function(i){ViewerFactory.editorCanBeShown(t,i)&&(i.stopPropagation(),$(this).highlightSelectedElement(n,!0))}),n.isDraggable&&dragDrop.initElement(n.id));ViewerFactory.calculateButtonLineHeight(n.getUISelector());ViewerFactory.addLayeringController(this,n)},ParagraphComponentViewer=function(n){var t=$(n.getUISelector());n.isckeditorworking=!1;UI.getSetting("ispreview")||(t.bind("dblclick",function(){var t=n.getProperty(HIDE_COMPONENT);UI.isckeditorworking==!0||t!=null&&t.value.toBoolean()||(n.isckeditorworking=!0,$(this).attr("contenteditable","true"),UI.isckeditorworking=!0,UI.callEditor(n))}),n.isSelectable&&t.bind("click",function(i){ViewerFactory.editorCanBeShown(t,i)&&(i.stopPropagation(),$(this).highlightSelectedElement(n,!n.isckeditorworking))}),n.isDraggable&&dragDrop.initElement(n.id));ViewerFactory.addLayeringController(this,n)},HeadertextComponentViewer=function(n){var t=$(n.getUISelector());n.isckeditorworking=!1;UI.getSetting("ispreview")||(t.bind("dblclick",function(){var t=n.getProperty(HIDE_COMPONENT);UI.isckeditorworking==!0||t!=null&&t.value.toBoolean()||(n.isckeditorworking=!0,$(this).attr("contenteditable","true"),UI.isckeditorworking=!0,UI.callEditor(n))}),n.isSelectable&&t.bind("click",function(i){ViewerFactory.editorCanBeShown(t,i)&&(i.stopPropagation(),$(this).highlightSelectedElement(n,!n.isckeditorworking))}),n.isDraggable&&dragDrop.initElement(n.id));ViewerFactory.addLayeringController(this,n)};ViewerFactory.calculateMenuLineHeight=function(n,t){var u=n.getProperty(PREDEFINED).value,i,r;u=="simple"&&(i=parseInt($(t).css("height")),r=parseInt($(t).css("border-top-width")),$(t).css("line-height",i-r*2+"px"))};ViewerFactory.calculateMarginForGallery=function(n,t,i){var f;if(i=i||!1,f=n.getProperty(TYPE).value,f!="with-captions")return!1;for(var o=n.getProperty(COLUMNS).value,e=$(t).find(".gallery-item"),s=n.getProperty(FONT_SIZE).value,h=parseInt(s),u=0,r=0;r<e.length;r++)u=ViewerFactory.calcRowMargin(n,t,parseInt(r/o),i),$(e[r]).css("margin-bottom",u+"px"),!i&&n.children.length>0&&n.children[r].setProperty("gallery-item-bottom-margin",u+"px");return!1};ViewerFactory.calcRowMargin=function(n,t,i,r){var e,h,o;r=r||!1;for(var c=$(t).find(".info"),s=n.getProperty(COLUMNS).value,l=i*s,a=(i+1)*s-1,f=0,u=l;u<=a;u++){if(r)return e=10,n.children.length>0&&(e=n.children[u].getProperty(GALLERY_ITEM_BOTTOM_MARGIN).value),parseInt(e);h=$(c[u]).outerHeight(!0);o=h;o>f&&(f=o)}return f+10};ViewerFactory.calculateHeightForGallery=function(n,t,i){var e,o,f,c,r;if(i=i||!1,n.proto.name==GALLERY){var l=n.getProperty(TYPE).value,s=parseInt(n.getProperty(HEIGHT).value),h=n.getProperty(COLUMNS).value,u=3;n.children.length>0&&(u=Math.ceil(n.children.length/h));e=10;r=(s-(u*e-e))/u;r<10&&(r=10);$(t).find(".gallery-item").css("height",r+"px");function a(){for(var i=0,f=0,c=$(t).find(".gallery-item"),r,e,o,s,i=0;i<u;i++)r=c[i*h],r!=undefined&&(e=parseInt($(r).css("margin-bottom")),o=parseInt($(r).css("height")),f+=e+o);n.setProperty("height",f+"px");$(t).css("height",f+"px");s=$(t).parent(".page");Resizer.recalculateHeaderFooterAndPageSize(s)}if(l=="with-captions"){for(o=0,f=0;f<u;f++)c=ViewerFactory.calcRowMargin(n,t,f,i),o+=c;r=(s-o)/u;r<10?(r=10,$(t).find(".gallery-item").css("height",r+"px"),a()):$(t).find(".gallery-item").css("height",r+"px")}}return!1};ViewerFactory.replacementImagesInsteadEveryVideoInContainer=function(n){$($(n).find('iframe[src*="youtube.com"], iframe[src*="vimeo.com"]')).each(function(n,t){ViewerFactory.replacementImageInsteadVideo("#"+$(t).parent()[0].id,t.src,t,n)})};ViewerFactory.replacementImageInsteadVideo=function(n,t,i,r){var f=$(n),r=r||0,e,u,o;i===undefined?(e='<img data-index="'+r+'" class="video-thumbnail" />',f.empty(),f.append(e)):(e='<img data-index="'+r+'" class="video-thumbnail" style="width:'+i.width+"px; height:"+i.height+'px;" />',$(i).before(e),$(i).remove());url=t.lastIndexOf("/")===t.length-1?t.substring(0,t.length-1):t;t!=""?/vimeo/.test(url)?(u=url.lastIndexOf("/"),u!=-1&&u<url.length-1&&(o=url.substring(u+1),$.ajax({type:"GET",url:"https://vimeo.com/api/v2/video/"+o+".json",jsonp:"callback",dataType:"jsonp",success:function(n){var t=n[0].thumbnail_large;f.find('img[data-index="'+r+'"]').attr("src",t)}}))):/youtu/.test(url)&&(u=url.lastIndexOf("/"),u!=-1&&u<url.length-1&&(o=url.substring(u+1),f.find('img[data-index="'+r+'"]').attr("src","//img.youtube.com/vi/"+o+"/sddefault.jpg"))):($(f).html("<span class='video-src'> Video source is not specified <\/span> "),$(f).addClass("video-src-parrent"))};GalleryComponentViewer=function(n){function f(n){UI.getSetting("isrenderpublish")||$(n.selector).find(".fancybox").fancybox()}var t=$(n.getUISelector()),i,r,u;if(n.children.length==0)for(i=0;i<9;i+=1)$(t.selector).find(".gallery-items-list").append('<div class="gallery-item c3"><div class="holder"><a class="fancybox" rel="gallery" href="/Images/gallery_predefined.png"><img src="/Images/gallery_predefined.png"><\/a><\/div><\/div>');$(t.selector).find(".title").css("color",n.getProperty(IMAGE_SETTINGS_HEADERCOLOR).value);$(t.selector).find(".descr").css("color",n.getProperty(IMAGE_SETTINGS_COLOR).value);$(t.selector).find(".info").css("background-color",n.getProperty(IMAGE_SETTINGS_BGCOLOR).value);$(t.selector).css("font-size",parseInt(n.getProperty(FONT_SIZE).value)+"px");UI.getSetting("ispreview")?(UI.getSetting("ispublished")&&_.forEach(n.children,function(n){ViewerFactory.bindEventGoToPage(n,$(n.getUISelector()+"_view").find("a"))}),f(t)):(n.isSelectable&&t.bind("click",function(i){ViewerFactory.editorCanBeShown(t,i)&&(i.stopPropagation(),$(this).highlightSelectedElement(n,!0))}),n.isDraggable&&dragDrop.initElement(n.id));r=n.getProperty(IMAGE_STRETCHING).value;u=new StretchingController(["fill","crop"],r,n);ko.observable($(t).find(".gallery-items-list")[0]).extend({applyBindings:u});ViewerFactory.calculateMarginForGallery(n,t.selector,!0);ViewerFactory.calculateHeightForGallery(n,t.selector,!0);n.stretcher();ViewerFactory.addLayeringController(this,n)};SlideshowComponentViewer=function(n){function u(n){UI.getSetting("isrenderpublish")||$(n.selector).find(".fancybox").fancybox()}var t=$(n.getUISelector()),i,r;ViewerFactory.tryUpdatePredefinedView(n);$(t.selector).find(".title").css("color",n.getProperty(IMAGE_SETTINGS_HEADERCOLOR).value);$(t.selector).find(".descr").css("color",n.getProperty(IMAGE_SETTINGS_COLOR).value);n.getProperty(CAPTION).value.toBoolean()&&$(t.selector).find(".carousel-caption").css("background-color",n.getProperty(IMAGE_SETTINGS_BGCOLOR).value);UI.getSetting("ispreview")?(u(t),UI.getSetting("ispublished")&&_.forEach(n.children,function(n){ViewerFactory.bindEventGoToPage(n,$(n.getUISelector()+"_view").find("a"))})):(n.isSelectable&&t.bind("click",function(i){ViewerFactory.editorCanBeShown(t,i)&&(i.stopPropagation(),$(this).highlightSelectedElement(n,!0))}),n.isDraggable&&dragDrop.initElement(n.id));i=n.getProperty(IMAGE_STRETCHING).value;r=new StretchingController(["fill","crop"],i,n);ko.observable($(t).find(".carousel-inner")[0]).extend({applyBindings:r});n.stretcher();ViewerFactory.addLayeringController(this,n)};ViewerFactory.housePhotoTourPostRender=function(n){var t=$(n.getUISelector()),i=n.getProperty(HEIGHT).value,s,r,h,u;parseInt(i)<480&&(i="480px");var f=t[0].offsetWidth,e=t.find('div[u="thumbnavigator"]')[0],c=e!=null?e.offsetWidth:240,o=f-c;if(n.children.length==0)t.children().css("display","none"),t.children("div.std-house-photo-tour-predefined").css("display","block");else{t.children("div.std-house-photo-tour-predefined").css("display","none");s={$AutoPlay:!1,$ArrowNavigatorOptions:{$Class:$JssorArrowNavigator$,$ChanceToShow:1,$AutoCenter:2,$Steps:1},$SlideWidth:o,$ThumbnailNavigatorOptions:{$Class:$JssorThumbnailNavigator$,$ChanceToShow:2,$ActionMode:1,$Lanes:2,$SpacingX:14,$SpacingY:12,$DisplayPieces:6,$ParkingPosition:0,$Orientation:2}};function l(n){r.$ScaleWidth(n)}UI.getSetting("isrenderpublish")?t.css("height",i):(r=new $JssorSlider$(t[0].id,s),r.$ScaleWidth(f),t.css("height",i),ViewerFactory.housePhotoTourSetHeight(t.selector),t.find(".std-house-photo-tour").css("background-color","inherit"),t.find(".std-house-photo-tour").css("font-size","inherit"),t.find(".std-house-photo-tour").find('div[u="slides"]').slice(0,2).css("width",o+"px"),t.children().css("transform"," scale(1)"),t.find('div[u="thumbnavigator"]').children().css("transform","scale(1)"),t.find(".std-house-photo-tour").css("margin","0"))}$(t.selector).find(".title").css("color",n.getProperty(IMAGE_SETTINGS_HEADERCOLOR).value);$(t.selector).find(".hpt_descr").css("color",n.getProperty(IMAGE_SETTINGS_COLOR).value);$(t.selector).find(".house_photo_tour_div").css("background-color",n.getProperty(PHOTO_TOUR_TEXT_COLOR).value);$(t.selector).find(".house_photo_tour_editor_div").css("background-color",n.getProperty(PHOTO_TOUR_TEXT_COLOR).value);n.getProperty("location").value=="left"?($(t.selector).find(".house_photo_tour_div").css("right","480px"),$(t.selector).find(".house_photo_tour_editor_div").css("right","480px")):($(t.selector).find(".house_photo_tour_div").css("right","0px"),$(t.selector).find(".house_photo_tour_editor_div").css("right","0px"));n.getProperty(IMAGE_STRETCHING)!=null&&(h=n.getProperty(IMAGE_STRETCHING).value,h=="crop"&&(u=t.find(".house_photo_tour_img"),u.removeClass("house_photo_tour_img"),u.addClass("house_photo_tour_img_crop"),t.find(".house_photo_tour_predefined_img").addClass("house_photo_tour_img_crop")))};ViewerFactory.housePhotoTourRerender=function(n){var t=TemplateFactory.templateFor(n,VIEWER_TEMPLATE).compiledTemplate;$(n.getUISelector()).html($(t).html());ViewerFactory.housePhotoTourPostRender(n)};ViewerFactory.housePhotoTourSetHeight=function(n){var r=$(n),u=$(n).children(),t=u.css("transform").match(/matrix\((-?\d*\.?\d+),\s*0,\s*0,\s*(-?\d*\.?\d+),\s*0,\s*0\)/),i,f,e;t=parseFloat(t?t[1]?t[1]:1:1);u.css("height",1/t*r[0].offsetHeight);i=u.children();i.css("height","100%");f=i.children(":not(span)");f.css("height","100%");f.children().css("height","100%");i.children("span.jssora05l").css("top",r[0].offsetHeight/2/t-20);i.children("span.jssora05r").css("top",r[0].offsetHeight/2/t-20);e=i.children("div.jssort02");e.css("height","100%");e.children().css("transform","scale(1,"+1/t+")")};HousePhotoTourComponentViewer=function(n){var t=$(n.getUISelector()),r=n.getProperty(IMAGE_STRETCHING).value,i=new StretchingController(["fill","crop"],r,n);UI.getSetting("ispreview")?(t.children("div.std-house-photo-tour-overlay").css("display","none"),ko.observable($(t).find('div[u="slides"]')[1]).extend({applyBindings:i}),UI.getSetting("ispublished")&&_.forEach(n.children,function(n){ViewerFactory.bindEventGoToPage(n,$(n.getUISelector()+"_view").find("a"))})):(n.isSelectable&&t.bind("click",function(i){ViewerFactory.editorCanBeShown(t,i)&&(i.stopPropagation(),$(this).highlightSelectedElement(n,!0))}),n.isDraggable&&dragDrop.initElement(n.id),ko.observable($(t).find(".std-house-photo-tour-predefined-items")[0]).extend({applyBindings:i}));n.stretcher();ViewerFactory.housePhotoTourPostRender(n);ViewerFactory.addLayeringController(this,n)};ViewerFactory.calculateHeightForList=function(n,t){for(var i=0,e=$(t),u=e.find(".item"),f,r=0;r<u.length;r++)i+=parseInt($(u[r]).css("height")),r!=u.length-1&&(i+=parseInt($(u[r]).css("margin-bottom")));i<25&&(i=300);n.setProperty("height",i+"px");$(t).css("height",i+"px");f=$(t).parent(".page");Resizer.recalculateHeaderFooterAndPageSize(f)};ListComponentViewer=function(n){var t=$(n.getUISelector()),i=n.getProperty(IMAGE_STRETCHING).value,r=new StretchingController(["fill","crop"],i,n);ko.observable($(t).find(".list-stretch-binding-node")[0]).extend({applyBindings:r});$(t).find(".title").css("color",n.getProperty(IMAGE_SETTINGS_HEADERCOLOR).value);$(t).find(".description").css("color",n.getProperty(IMAGE_SETTINGS_COLOR).value);$(t).find(".content").css("background-color",n.getProperty(IMAGE_SETTINGS_BGCOLOR).value);ViewerFactory.correctShowListComponent(n);$(t).find(".title, .description, .meta, .optional").css("font-size",n.getProperty(FONT_SIZE).value);ViewerFactory.calculateHeightForList(n,t);UI.getSetting("ispreview")?UI.getSetting("ispublished")&&_.forEach(n.children,function(n){ViewerFactory.bindEventGoToPage(n,$(n.getUISelector()+"_view").find("a"))}):(n.isSelectable&&t.bind("click",function(i){ViewerFactory.editorCanBeShown(t,i)&&(i.stopPropagation(),$(this).highlightSelectedElement(n,!0))}),n.isDraggable&&dragDrop.initElement(n.id));UI.getSetting("ispreview")&&!UI.getSetting("isrenderpublish")&&$(t.selector).find(".fancybox").fancybox();ViewerFactory.addLayeringController(this,n)};ViewerFactory.editorCanBeShown=function(n){var t;if(n=n||null,n==null)return!1;if(t=n[0].id,StretcherFactory.isPined(Grouping.getComponent(t)))return grouping.dropEditableGroupId(),!0;var i=Grouping.hasAnyGroup(t),r=Grouping.isSelected(t),u=Grouping.getGroupId(t);return grouping.editableGroupId!=null&&grouping.editableGroupId===u?!0:(grouping.dropEditableGroupId(),dragDrop.groupDragging&&r)?!1:grouping.ctrlIsPressed==!0||i?!1:(Grouping.dropItems(),!0)};var FormSubComponentViewer=function(n){var t=$(n.getUISelector());UI.getSetting("ispreview")||(n.isSelectable&&t.bind("click",function(i){ViewerFactory.editorCanBeShown(t,i)&&(i.stopPropagation(),$(this).highlightSelectedElement(n,!0))}),n.isDraggable&&dragDrop.initElement(n.id));ViewerFactory.addLayeringController(this,n)},RadiolistComponentViewer=function(n){var t=$(n.getUISelector());UI.getSetting("ispreview")?t.find("input").length>0&&(t.find("input")[0].checked=!0):(n.isSelectable&&t.bind("click",function(i){ViewerFactory.editorCanBeShown(t,i)&&(i.stopPropagation(),$(this).highlightSelectedElement(n,!0))}),n.isDraggable&&dragDrop.initElement(n.id));ViewerFactory.addLayeringController(this,n)},FormSubmitComponentViewer=function(n){var t=$(n.getUISelector());UI.getSetting("ispreview")?t.bind("click",function(){var t=ViewerFactory.customFormValidation(n),i,r;t.length?(r=_.uniq(t.map(function(n){return n.message})).join(", ")+"!",t.forEach(function(n){$("#"+n.id).addClass("validation-error")}),Application.showOkDialog("Error",r)):(i=ViewerFactory.getFormSubmitData(n),ViewerFactory.sendComponentDataToMail(n,i,ViewerFactory.getFormCustomerEmail(n),null,n.parentComponent.id))}):(n.isSelectable&&t.bind("click",function(i){ViewerFactory.editorCanBeShown(t,i)&&(i.stopPropagation(),$(this).highlightSelectedElement(n,!0))}),n.isDraggable&&dragDrop.initElement(n.id));$(t).css({"text-overflow":"ellipsis",overflow:"hidden"});ViewerFactory.calculateButtonLineHeight(n.getUISelector());$(t).hover(function(){n.getProperty(BACKGROUND_COLOR_HOVER)!=null&&$(this).css("background-color",n.getProperty(BACKGROUND_COLOR_HOVER).value);n.getProperty(BORDER_COLOR_HOVER)!=null&&$(this).css("border-color",n.getProperty(BORDER_COLOR_HOVER).value);n.getProperty(TEXT_COLOR_HOVER)!=null&&$(this).css("color",n.getProperty(TEXT_COLOR_HOVER).value)},function(){$(this).css("background-color",n.getProperty(BACKGROUND_COLOR).value);$(this).css("border-color",n.getProperty(BORDER_COLOR).value);$(this).css("color",n.getProperty(COLOR).value)});ViewerFactory.addLayeringController(this,n)},FormCaptchaComponentViewer=function(n){var t=$(n.getUISelector()),i="captcha_"+n.id;UI.getSetting("ispreview")||($("#"+i).addClass("inactively"),n.isSelectable&&t.bind("click",function(i){ViewerFactory.editorCanBeShown(t,i)&&(i.stopPropagation(),$(this).highlightSelectedElement(n,!0))}),n.isDraggable&&dragDrop.initElement(n.id));ViewerFactory.initCaptcha(n,i)};ViewerFactory.calculateFormMinSize=function(n,t){var i=100,r=100,u=parseInt(t.css("border-top-width"))*2;t.children().each(function(n,t){var f=t.offsetTop+t.offsetHeight+u,e=t.offsetLeft+t.offsetWidth+u;i<f&&(i=f);r<e&&(r=e)});t[0].offsetHeight<=i&&(t.css("min-height",i+"px"),t.css("height",i+"px"),n.setProperty("height",i+"px"));t[0].offsetWidth<=r&&(t.css("min-width",r+"px"),t.css("width",r+"px"),n.setProperty("width",r+"px"))};ViewerFactory.validateEmail=function(n){return/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(n)};ViewerFactory.validateRequiredField=function(n){var t=$(n.getUISelector());switch(n.proto.name){case TEXTBOX:case TEXTAREA:case SELECTLIST:return!!t.val();case RADIOLIST:return t.find("input").toArray().some(function(n){return n.checked});default:return!!t.val()}};ViewerFactory.customFormValidation=function(n){function r(n){return n.proto.name===FORM?n:UI.siteComponentRepository.lookupData({id:n.parentComponent.id})}var i=r(n),t=[];return i!=null&&i.children.forEach(function(n){var u=$(n.getUISelector()),i=n.getProperty(REQUIRED_FIELD),r;n.proto.name===CAPTCHA?n.valid||t.push({id:"captcha_"+n.id+" > div",message:"Captcha required",type:"captcha"}):(n.proto.name===TEXTBOX&&(r=n.getProperty(TEXT_BOX_TYPE).value,r=="Email"&&(ViewerFactory.validateEmail(u.val())||t.push({id:n.id,message:"Invalid email",type:"email"}))),i!=null&&i.value.toBoolean()&&(ViewerFactory.validateRequiredField(n)||t.push({id:n.id,message:"Please fill required fields",type:"required"})))}),t};ViewerFactory.getFormCustomerEmail=function(n){var t=n.parentComponent,i="";return t!=null&&t.children.forEach(function(n){var r=n.id,u=$("#"+r),t,f;u.hasClass("std-form-textbox")&&(t=UI.siteComponentRepository.lookupData({id:r}),t!=null&&(f=t.getProperty("text-box-type").value,f=="Email"&&(i=u.val())))}),i};ViewerFactory.getFormSubmitData=function(n){var i=function(n){var t=n.getProperty(SELECTEDLABEL).value,r=n.getProperty(SELECTEDLABELTYPE).value,i;return r==LABELTYPENAME?t+": ":t!=""?(i="",UI.siteComponentRepository.lookupData({id:n.parentComponent.id}).children.where({displayName:LABEL}).forEach(function(n){var r=n.getProperty(CAPTION_COMPONENTS_TO_LABEL).value;r==t&&(i=n.getProperty(TEXT).value+": ")}),i):""},t=[],r=UI.siteComponentRepository.lookupData({id:n.parentComponent.id});return r!=null&&(r.children.sort(function(n,t){var i=parseInt(n.getProperty(TOP).value),r=parseInt(t.getProperty(TOP).value),u=parseInt(n.getProperty(LEFT).value),f=parseInt(t.getProperty(LEFT).value);return i==r?u-f:i-r}),r.children.forEach(function(n){var r="",e=n.id,u=$("#"+e),f;u.hasClass("std-form-textbox")&&(r=i(n),r+=u.val(),t.push(r));u.hasClass("std-form-textarea")&&(r=i(n),r+=u.val(),t.push(r));u.hasClass("std-form-checkbox")&&(r=i(n),r+=u.find("input").is(":checked")?"Yes":"No",t.push(r));u.hasClass("std-form-radio-list")&&(r=i(n),r+=$('input[name="'+e+'"]:checked').val(),t.push(r));u.hasClass("std-form-select-list")&&(r=i(n),r+=u.val(),t.push(r));f=n.getProperty(FORM_SPACE_AFTER_ITEM);f!=null&&f.value.toBoolean()&&t.push("")})),t};ViewerFactory.tryUpdatePredefinedView=function(n){switch(n.displayName){case SLIDESHOW:n.children.length==0&&$(n.getUISelector()).find(".carousel-inner").append(PREDEFINED_VIEW_SLIDESHOW)}};ViewerFactory.bindEventGoToPage=function(n,t){var i=n.getProperty(MODE).value,r=n.getProperty(MODE_VALUE).value,u=n.getProperty(OPEN_LINK_ON_BLANK).value.toBoolean();i!="page"||r=="None"||u||t.bind("click",Helpers.generateEventGoToPage)};ViewerFactory.sendComponentDataToMail=function(n,t,i,r,u){r=r||UI.getSetting("adminSiteDomain")+"/Account/SendDataToMail";var f={templateid:app.dataServiceContext.getTemplateData().templateId,componentid:n.id,data:t,subject:n.getProperty(FORM_SUBJECT).value,sender:i,formid:u};$.ajax({url:r,type:"POST",data:f,traditional:!0,headers:null,dataType:"text",error:function(){Application.showOkDialog("Sending","Error")},beforeSend:function(){Application.addLocker()},complete:function(){Application.removeLocker()},success:function(t){t===""&&(t=window.MESSAGE_WAS_SENT);t.indexOf("[checkedMessage]")!=-1?ViewerFactory.createModalWindow(n,i):Application.showOkDialog("Sending",t)}})};StretcherFactory=function(){};StretcherFactory.proxy=function(){var n=this,i=$(n.getUISelector()),t=n.proto.name;return StretcherFactory.stretcherForComponent[t]?StretcherFactory.stretcherForComponent[t](n):StretcherFactory.stretcherForComponent.default(n)};StretcherFactory.stretcherForComponent={};StretcherFactory.stretcherForComponent[MENU]=function(n){return new MenuComponentStretcher(n)};StretcherFactory.stretcherForComponent[IMAGE]=function(n){return new ImageComponentStretcher(n)};StretcherFactory.stretcherForComponent[PANEL]=function(n){return new PanelComponentStretcher(n)};StretcherFactory.stretcherForComponent[GALLERY]=function(n){return new GalleryComponentStretcher(n)};StretcherFactory.stretcherForComponent[HOUSE_PHOTO_TOUR]=function(n){return new HousePhotoTourComponentStretcher(n)};StretcherFactory.stretcherForComponent[SLIDESHOW]=function(n){return new SlideshowComponentStretcher(n)};StretcherFactory.stretcherForComponent["default"]=function(n){return new DefaultComponent(n)};var MenuComponentStretcher=function(n){StretcherFactory.stretchComponent(n,function(){UI.renderMenus()})},ImageComponentStretcher=function(n){StretcherFactory.stretchComponent(n,function(){StretcherFactory.stretchImage(n)})},PanelComponentStretcher=function(n){StretcherFactory.stretchComponent(n)},GalleryComponentStretcher=function(n){StretcherFactory.stretchComponent(n)},HousePhotoTourComponentStretcher=function(n){StretcherFactory.stretchComponent(n)},SlideshowComponentStretcher=function(n){StretcherFactory.stretchComponent(n)},DefaultComponent=function(n){StretcherFactory.stretchComponent(n)};StretcherFactory.stretchImage=function(n){var i=$(n.getUISelector()).find("img"),t=n.getProperty(IMAGE_STRETCHING);t!=null&&i.css("object-fit",t.value)};StretcherFactory.afterStretchActions=function(n){n.proto.name===MENU?UI.renderMenus():n.proto.name===IMAGE&&StretcherFactory.stretchImage(n)};StretcherFactory.getCurrentStretchStatus=function(n){if(n==null)return!1;return n.getProperty(STRETCH_TO_FULL_WIDTH)==null?!1:n.getProperty(STRETCH_TO_FULL_WIDTH).value.toBoolean()};StretcherFactory.isPined=function(n){if(n==null)return!1;return n.getProperty(IS_PINED)==null?!1:n.getProperty(IS_PINED).value.toBoolean()};StretcherFactory.toggleStretchToFullWidth=function(n){var t=StretcherFactory.getCurrentStretchStatus(n);StretcherFactory.changeStretching(n,!t);StretcherFactory.changePropertiesVisability(!t)};StretcherFactory.changeStretching=function(n,t){var u=n.getUISelector(),r=[{component:n,property:STRETCH_TO_FULL_WIDTH,newvalue:t.toString(),oldvalue:(!t).toString()}],i;t||r.push({component:n,property:MARGINS_WIDTH,newvalue:"0px",oldvalue:""});i=function(){UI.actionService.runActionForComponent(n,"remove-component-from-form",!0);UI.actionService.runActionForComponent(n,"add-component-to-form",!0);$(u).highlightSelectedElement(n,!0);Helpers.isGalleryComponent(n)&&UI.callEditor(n)};UI.undoManagerAddSimpleArr(r,i,i,!0);StretcherFactory.afterStretchActions(n)};StretcherFactory.enableMarginsToStretchedComponent=function(n,t,i){var r=i,u=StretcherFactory.getComponentFullWidth(i);StretcherFactory.setElementValues(t,u,r,r);StretcherFactory.afterStretchActions(n);$(t).highlightSelectedElement(n,!0)};StretcherFactory.getComponentFullWidth=function(n){var t=$(".site-wrapper"),i=t.offset().left*2+t.width()-2*parseInt(n,0);return i+"px"};StretcherFactory.getComponentLeft=function(n){var t=-parseFloat($(".site-wrapper").offset().left)+"px";return StretcherFactory.isPined(n)&&(t="0px"),t};StretcherFactory.stretchComponent=function(n,t){var r,u;if(console.log("STRETCH COMPONENT"),r=$(n.getUISelector()),u=StretcherFactory.getCurrentStretchStatus(n),u){var i=n.getProperty(MARGINS_WIDTH).value==null?"0px":n.getProperty(MARGINS_WIDTH).value,f=StretcherFactory.getComponentLeft(n),e=StretcherFactory.getComponentFullWidth(i);StretcherFactory.setElementValues(r,e,i,i,f)}t=t||function(){};t()};StretcherFactory.setElementValues=function(n,t,i,r,u){$(n).css({width:t,"margin-left":i,"margin-right":r});u!=undefined&&$(n).css({left:u});parseInt(i)==0&&$(n).offset({left:0})};StretcherFactory.switchToOriginalElementSizeToTheCenterOfWindow=function(n){var t=n.getUISelector(),u=$(t).css("z-index"),r=UI.basicComponentRepository.getAll().where({name:n.proto.name});if(r.any()){var i=r.firstOrDefault(),f=i.getProperty(WIDTH).value,e=i.getProperty("margin-left")==null?"0px":i.getProperty("margin-left").value,o=i.getProperty("margin-right")==null?"0px":i.getProperty("margin-right").value;StretcherFactory.setElementValues(t,f,e,o)}t=$(t).detach();$(UI.getBody().getUISelector()).append(t);t.css("z-index","1000");$(t).position({of:$(window),at:"center center"});t.css("z-index",u);$(t).highlightSelectedElement(n,!0)};StretcherFactory.switchToOriginalElementSize=function(n){var u=UI.basicComponentRepository.getAll().where({name:n.proto.name}),i=0,r=0,t;u.any()&&(t=u.firstOrDefault(),i=t.getProperty(LEFT)!=null?t.getProperty(LEFT).value:i,r=t.getProperty(WIDTH)!=null?t.getProperty(WIDTH).value:r);var f=n.getUISelector(),e=n.getProperty(LEFT)!=null?n.getProperty(LEFT).value:i,o=n.getProperty(WIDTH)!=null?n.getProperty(WIDTH).value:r;$(f).css({left:e,width:o,"margin-left":"0px","margin-right":"0px"});$(f).highlightSelectedElement(n,!0)};StretcherFactory.updateComponentWrapper=function(n){var r=StretcherFactory.getCurrentStretchStatus(n),u=StretcherFactory.isPined(n),i;if(r){var f=document.getElementsByClassName(SELECT_WRAPPER),t=f[0],e=parseFloat($(t).css("width")),o=parseFloat($(t).css("left"));$(t).css({"border-left":"none","border-right":"none",width:e-2});u&&(i=$(n.getUISelector()).css("margin"),$(t).css("margin",i));$(t).find(".resizer").addClass("stretched");$(t).find("."+SELECT_WRAPPER_MENU).addClass("stretched")}};StretcherFactory.isPropertyCouldBeWritten=function(n,t){var i=StretcherFactory.getCurrentStretchStatus(n);return i?!(t==LEFT||t==WIDTH):!0};StretcherFactory.stretchComponents=function(){var t=document.getElementsByClassName("std-component"),n;for(i=0;i<t.length;i++)n=UI.siteComponentRepository.lookupData({id:$(t[i]).getId()}),n.getProperty("stretch-to-full-width")!=null&&n.stretcher()};StretcherFactory.onStretchChange=function(n){var t=StretcherFactory.getCurrentStretchStatus(n);StretcherFactory.changePropertiesVisability(t)};StretcherFactory.changePropertiesVisability=function(n){n?($("#marginswidthdiv").show(),$("#widthInput").parent().hide(),$("#leftInput").parent().hide()):($("#marginswidthdiv").hide(),$("#widthInput").parent().show(),$("#leftInput").parent().show())};StretcherFactory.checkOneOfSelectedElementsStretched=function(){var n=!1;return ko.utils.arrayForEach(grouping.selectedItems(),function(t){var i=$(t),r=UI.siteComponentRepository.lookupData({id:$(i).getId()}),u=StretcherFactory.getCurrentStretchStatus(r);u&&(n=!0)}),n};ContextFactory=function(){};ContextFactory.contextFor=function(n,t){var i=UI.getDevice().getPropertiesList(n);if(t===EDITOR_CONTEXT)switch(n.proto.name){case MENU:return new MenuComponentEditorContext(n);case"anchor":return new AnchorComponentEditorContext(n);case"div":return new PanelComponentEditorContext(n);case FORM:return new FormComponentEditorContext(n);case LABEL:return new LabelComponentEditorContext(n);case CAPTCHA:return new CaptchaComponentEditorContext(n);case TEXTBOX:case TEXTAREA:return new TextboxComponentEditorContext(n);case RADIOLIST:return new RadiolistComponentEditorContext(n);case SELECTLIST:return new SelectlistComponentEditorContext(n);case CHECKBOX:return new CheckboxComponentEditorContext(n);case SUBMIT:return new SubmitComponentEditorContext(n);case BLOGGING:return new BloggingComponentEditorContext(n);case"frame":return new FrameComponentEditorContext(n);case"link":return new LinkComponentEditorContext(n);case IMAGE:return new ImageComponentEditorContext(n);case GALLERY:return new GalleryComponentEditorContext(n);case HOUSE_PHOTO_TOUR:return new HousePhotoTourComponentEditorContext(n);case CONTACT_US:return new ContactUsComponentEditorContext(n);case"html-container":return new HtmlContainerComponentEditorContext(n);case SLIDESHOW:return new SlideshowComponentEditorContext(n);case VIDEO:return new VideoComponentEditorContext(n);case SOUND:return new SoundComponentEditorContext(n);case MORTGAGE_CALCULATOR:return new MortgageCalculatorComponentEditorContext(n);case EVALUATE_HOME:return new EvaluateHomeComponentEditorContext(n);case LIST:return new ListComponentEditorContext(n);case"heading":return new HeadingComponentEditorContext(n);case"button":return new ButtonComponentEditorContext(n);case MAP:return new MapComponentEditorContext(n);case"paragraph":return new ParagraphComponentEditorContext(n);case"headertext":return new HeadertextComponentEditorContext(n);case PDF:return new PdfComponentEditorContext(n);case SIGNIN:return new SignInComponentEditorContext(n);case STORE:return new StoreEditorContext(n);case STORE_PRODUCT:return new StoreProductEditorContext(n);case STORE_PRODUCT_IMAGES:return new StoreProductImagesEditorContext(n);case STORE_PRODUCT_TITLE:return new StoreProductTitleEditorContext(n);case STORE_PRODUCT_PRICE:return new StoreProductPriceEditorContext(n);case STORE_PRODUCT_SKU:return new StoreProductSkuEditorContext(n);case STORE_PRODUCT_DESCRIPTION:return new StoreProductDescriptionEditorContext(n);case STORE_PRODUCT_OPTIONS:return new StoreProductOptionsEditorContext(n);case STORE_PRODUCT_QUANTITY:return new StoreProductQuantityEditorContext(n);case STORE_PRODUCT_ADD_TO_CART:return new StoreProductAddToCartEditorContext(n);case STORE_PRODUCT_SOCIAL:return new StoreProductSocialEditorContext(n);case STORE_CART_LINK:return new StoreCartLinkEditorContext(n);case STORE_CATEGORIES:return new StoreCategoriesEditorContext(n);case STORE_CART:return new StoreCartEditorContext(n);case STORE_CART_CHECKOUT:return new StoreCartCheckoutEditorContext(n);case STORE_THANK_YOU:return new StoreThankYouEditorContext(n);case STORE_GALLERY:return new StoreGalleryEditorContext(n);case STORE_GALLERY_SHOW_MORE:return new StoreGalleryShowMoreEditorContext(n);case STORE_GALLERY_PRODUCT:return new StoreGalleryProductEditorContext(n);case STORE_GALLERY_PRODUCT_IMAGE:return new StoreGalleryProductImageEditorContext(n);case STORE_GALLERY_PRODUCT_LABEL:return new StoreGalleryProductLabelEditorContext(n);case STORE_GALLERY_PRODUCT_PRICE:return new StoreGalleryProductPriceEditorContext(n);case STORE_GALLERY_PRODUCT_TITLE:return new StoreGalleryProductTitleEditorContext(n);case STORE_GALLERY_PRODUCT_DESCRIPTION:return new StoreGalleryProductDescriptionEditorContext(n);default:return{}}else if(t===VIEWER_CONTEXT)switch(n.proto.name){case MENU:return new MenuComponentViewerContext(n,i);case"anchor":return AnchorComponentViewerContext(n,i);case"div":return new PanelComponentViewerContext(n,i);case FORM:return new FormComponentViewerContext(n,i);case LABEL:return new LabelComponentViewerContext(n,i);case CAPTCHA:return new CaptchaComponentViewerContext(n,i);case TEXTBOX:case TEXTAREA:return new TextboxComponentViewerContext(n,i);case RADIOLIST:return new RadiolistComponentViewerContext(n,i);case SELECTLIST:return new SelectlistComponentViewerContext(n,i);case CHECKBOX:return new CheckboxComponentViewerContext(n,i);case SUBMIT:return new SubmitComponentViewerContext(n,i);case"frame":return new FrameComponentViewerContext(n,i);case"link":return new LinkComponentViewerContext(n,i);case IMAGE:return new ImageComponentViewerContext(n,i);case GALLERY:return new GalleryComponentViewerContext(n,i);case HOUSE_PHOTO_TOUR:return new HousePhotoTourComponentViewerContext(n,i);case CONTACT_US:return new ContactUsComponentViewerContext(n,i);case"html-container":return new HtmlContainerComponentViewerContext(n,i);case SLIDESHOW:return new SlideshowComponentViewerContext(n,i);case VIDEO:return new VideoComponentViewerContext(n,i);case SOUND:return new SoundComponentViewerContext(n,i);case MORTGAGE_CALCULATOR:return new MortgageCalculatorComponentViewerContext(n,i);case EVALUATE_HOME:return new EvaluateHomeComponentViewerContext(n,i);case LIST:return new ListComponentViewerContext(n,i);case"heading":return new HeadingComponentViewerContext(n,i);case"button":return new ButtonComponentViewerContext(n,i);case MAP:return new MapComponentViewerContext(n,i);case"paragraph":return new ParagraphComponentViewerContext(n,i);case"headertext":return new HeadertextComponentViewerContext(n,i);case PDF:return new PdfComponentViewerContext(n,i);case BLOGGING:return new BloggingComponentViewerContext(n,i);case SIGNIN:return new SignInComponentViewerContext(n,i);case STORE:return new StoreViewerContext(n,i);case STORE_PRODUCT:return new StoreProductViewerContext(n,i);case STORE_PRODUCT_PRICE:return new StoreProductPriceViewerContext(n,i);case STORE_PRODUCT_SKU:return new StoreProductSkuViewerContext(n,i);case STORE_PRODUCT_QUANTITY:return new StoreProductQuantityViewerContext(n,i);case STORE_PRODUCT_ADD_TO_CART:return new StoreProductAddToCartViewerContext(n,i);case STORE_PRODUCT_SOCIAL:return new StoreProductSocialViewerContext(n,i);case STORE_PRODUCT_TITLE:return new StoreProductTitleViewerContext(n,i);case STORE_PRODUCT_DESCRIPTION:return new StoreProductDescriptionViewerContext(n,i);case STORE_PRODUCT_IMAGES:return new StoreProductImagesViewerContext(n,i);case STORE_PRODUCT_OPTIONS:return new StoreProductOptionsViewerContext(n,i);case STORE_CART_LINK:return new StoreCartLinkViewerContext(n,i);case STORE_CATEGORIES:return new StoreCategoriesViewerContext(n,i);case STORE_CART:return new StoreCartViewerContext(n,i);case STORE_CART_CHECKOUT:return new StoreCartCheckoutViewerContext(n,i);case STORE_THANK_YOU:return new StoreThankYouViewerContext(n,i);case STORE_GALLERY:return new StoreGalleryViewerContext(n,i);case STORE_GALLERY_SHOW_MORE:return new StoreGalleryShowMoreViewerContext(n,i);case STORE_GALLERY_PRODUCT_LABEL:return new StoreGalleryProductLabelViewerContext(n,i);case STORE_GALLERY_PRODUCT_PRICE:return new StoreGalleryProductPriceViewerContext(n,i);case STORE_GALLERY_PRODUCT_IMAGE:return new StoreGalleryProductImageViewerContext(n,i);case STORE_GALLERY_PRODUCT:return new StoreGalleryProductViewerContext(n,i);case MANAGE_STORE_PRODUCTS_ADD_CATEGORY:return new ManageStoreProductsCategoryViewerContext(n,i);case MANAGE_STORE_PRODUCTS_ADDING_PRODUCTS_TO_CATEGORY:return new ManageStoreProductsAddingProductsToCategoryViewerContext(n,i);default:return{isDockable:n.isDockable?"dockable":"",id:n.id,styles:i.where({group:"style"})}}};var StoreCategoriesViewerContext=function(n,t){return{id:n.id,styles:t.where({group:"style"}),text:"Categories"}},StoreCategoriesEditorContext=function(n){var t=n.getProperty(TEXT_COLOR_HOVER).value,i=n.getProperty(COLOR).value,r=n.getProperty(BACKGROUND_COLOR).value,u=n.getProperty(BACKGROUND_COLOR_HOVER).value,f=n.getProperty(BORDER_COLOR).value,e=n.getProperty(BORDER_COLOR_HOVER).value,o=n.getProperty(FONT_FAMILY).value,s=n.getProperty(TEXT_ALIGN).value,h=n.getProperty(WIDTH).value,c=n.getProperty(HEIGHT).value,l=n.getProperty(LEFT).value,a=n.getProperty(TOP).value,v=n.getProperty(Z_INDEX).value,y=n.getProperty(FONT_SIZE).value,p=n.getProperty(BORDER_RADIUS).value,w=n.getProperty(BORDER_WIDTH).value,b=ContextFactory.getComponentFonts();return{width:h,height:c,left:l,top:a,zindex:v||0,color:i,colorHover:t,bgColor:r,bgHoverColor:u,borderColor:f,borderColorHover:e,ff:o,ta:s,fontSize:y,borderRadius:p,borderWidth:w,ffOptions:b,taOptions:[{name:"Left",value:"left"},{name:"Right",value:"right"},{name:"Center",value:"center"},{name:"Justify",value:"justify"}]}},StoreProductImagesEditorContext=function(n){var t=n.getProperty(IMAGE_STRETCHING).value,i=n.getProperty(BORDER_COLOR).value,r=n.getProperty(BORDER_WIDTH).value;return{scaling:t,borderColor:i,borderWidth:r}},StoreProductTitleEditorContext=function(n){var t=n.getProperty(COLOR).value,i=n.getProperty(FONT_FAMILY).value,r=n.getProperty(TEXT_ALIGN).value;return{color:t,ff:i,ta:r}},StoreProductPriceEditorContext=function(n){var t=n.getProperty(COLOR).value,i=n.getProperty(SECONDARY_COLOR).value,r=n.getProperty(FONT_FAMILY).value,u=n.getProperty(TEXT_ALIGN).value;return{color:t,ff:r,ta:u,secondaryColor:i}},StoreProductSkuEditorContext=function(n){var t=n.getProperty(COLOR).value,i=n.getProperty(FONT_FAMILY).value,r=n.getProperty(TEXT_ALIGN).value;return{color:t,ff:i,ta:r}},StoreProductDescriptionEditorContext=function(n){var t=n.getProperty(COLOR).value,i=n.getProperty(FONT_FAMILY).value,r=n.getProperty(TEXT_ALIGN).value;return{color:t,ff:i,ta:r}},StoreProductOptionsEditorContext=function(n){var t=n.getProperty(COLOR).value,i=n.getProperty(FONT_FAMILY).value,r=n.getProperty(TEXT_ALIGN).value;return{color:t,ff:i,ta:r}},StoreProductQuantityEditorContext=function(n){var t=n.getProperty(COLOR).value,i=n.getProperty(FONT_FAMILY).value,r=n.getProperty(TEXT_ALIGN).value;return{color:t,ff:i,ta:r}},StoreProductAddToCartEditorContext=function(n){var t=n.getProperty(COLOR).value,i=n.getProperty(FONT_FAMILY).value,r=n.getProperty(TEXT_ALIGN).value,u=n.getProperty(TEXT).value,f=n.getProperty(BACKGROUND_COLOR).value,e=n.getProperty(BORDER_COLOR).value,o=n.getProperty(BORDER_RADIUS).value;return{text:u,color:t,ff:i,ta:r,bgcolor:f,borderColor:e,borderRadius:o}},StoreProductSocialEditorContext=function(n){return{ta:n.getProperty(TEXT_ALIGN).value,shareToFacebook:n.getProperty(SHARE_TO_FACEBOOK).value.toBoolean(),shareToTwitter:n.getProperty(SHARE_TO_TWITTER).value.toBoolean(),shareToGplus:n.getProperty(SHARE_TO_GPLUS).value.toBoolean(),fbImage:STORE_SOCIAL_FACEBOOK_IMAGE,twitterImage:STORE_SOCIAL_TWITTER_IMAGE,gplusImage:STORE_SOCIAL_GPLUS_IMAGE}},StoreProductPriceViewerContext=function(n,t){var i=n.getProperty(SECONDARY_COLOR).value;return{id:n.id,styles:t.where({group:"style"}),secondaryColor:i}},StoreProductSkuViewerContext=function(n,t){return{id:n.id,styles:t.where({group:"style"})}},StoreProductQuantityViewerContext=function(n,t){return{id:n.id,styles:t.where({group:"style"})}},StoreProductAddToCartViewerContext=function(n,t){return{id:n.id,styles:t.where({group:"style"}),text:n.getProperty(TEXT).value}},StoreProductSocialViewerContext=function(n,t){return{id:n.id,styles:t.where({group:"style"}),shareToFacebook:n.getProperty(SHARE_TO_FACEBOOK).value.toBoolean(),shareToTwitter:n.getProperty(SHARE_TO_TWITTER).value.toBoolean(),shareToGplus:n.getProperty(SHARE_TO_GPLUS).value.toBoolean(),fbImage:STORE_SOCIAL_FACEBOOK_IMAGE,twitterImage:STORE_SOCIAL_TWITTER_IMAGE,gplusImage:STORE_SOCIAL_GPLUS_IMAGE}},StoreProductTitleViewerContext=function(n,t){return{id:n.id,styles:t.where({group:"style"})}},StoreProductDescriptionViewerContext=function(n,t){return{id:n.id,styles:t.where({group:"style"})}},StoreProductImagesViewerContext=function(n,t){var r={id:n.id,styles:t.where({group:"style"}),isCrop:n.getProperty(IMAGE_STRETCHING).value==="crop"},i=UI.viewModelRepository[STORE_PRODUCT];return r.images=i&&i.product()&&!_.isEmpty(i.product())&&i.product().images().length?i.product().images():[{url:STORE_PRODUCT_DEFAULT_IMAGE}],r},StoreProductOptionsViewerContext=function(n,t){return{id:n.id,styles:t.where({group:"style"})}},StoreEditorContext=function(n){return{paypalEmail:n.getProperty(PAYPAL_EMAIL).value}},StoreViewerContext=function(n,t){return{id:n.id,styles:t.where({group:"style"})}},StoreProductEditorContext=function(n){var t=[];t.push(UI.basicComponentRepository.lookupData({name:STORE_PRODUCT_PRICE}));t.push(UI.basicComponentRepository.lookupData({name:STORE_PRODUCT_SKU}));t.push(UI.basicComponentRepository.lookupData({name:STORE_PRODUCT_QUANTITY}));t.push(UI.basicComponentRepository.lookupData({name:STORE_PRODUCT_ADD_TO_CART}));t.push(UI.basicComponentRepository.lookupData({name:STORE_PRODUCT_SOCIAL}));_.forEach(t,function(n){n.checked=!1});_.forEach(n.children,function(n){var i=_.find(t,function(t){return t.id===n.componentId});i&&(i.checked=!0)});var r=ContextFactory.getComponentFonts(),i={layout:n.getProperty(LAYOUT).value,bgcolor:n.getProperty(BACKGROUND_COLOR).value,components:t,children:{},scalingOptions:[{name:"Crop",value:"crop"},{name:"Fill",value:"fill"}],fontOptions:r,taOptions:[{name:"Left",value:"left"},{name:"Right",value:"right"},{name:"Center",value:"center"},{name:"Justify",value:"justify"}]};return _.forEach(n.children,function(n){i.children[n.proto.name]=ContextFactory.contextFor(n,EDITOR_CONTEXT)}),i},StoreProductViewerContext=function(n,t){return{id:n.id,styles:t.where({group:"style"}),layout:n.getProperty(LAYOUT).value}},StoreCartLinkEditorContext=function(n){var t=n.getProperty(WIDTH).value,i=n.getProperty(HEIGHT).value,r=n.getProperty(LEFT).value,u=n.getProperty(TOP).value,f=n.getProperty(Z_INDEX).value,e=n.getProperty(FONT_SIZE).value,o=n.getProperty(COLOR).value,s=n.getProperty(SECONDARY_COLOR).value;return{width:t,height:i,left:r,top:u,zindex:f||0,fontSize:e,color:o,secondaryColor:s}},StoreCartLinkViewerContext=function(n,t){return{id:n.id,styles:t.where({group:"style"}),href:Helpers.generateLinkToPage("cart"),secondaryColor:n.getProperty(SECONDARY_COLOR).value}},StoreCartCheckoutEditorContext=function(n){return{text:n.getProperty(TEXT).value,fontFamily:n.getProperty(FONT_FAMILY).value,color:n.getProperty(COLOR).value,bgColor:n.getProperty(BACKGROUND_COLOR).value,borderColor:n.getProperty(BORDER_COLOR).value,borderWidth:n.getProperty(BORDER_WIDTH).value,borderRadius:n.getProperty(BORDER_RADIUS).value}},StoreCartCheckoutViewerContext=function(n,t){return{id:n.id,styles:t.where({group:"style"}),text:n.getProperty(TEXT).value}},StoreCartEditorContext=function(n){var t={fontOptions:ContextFactory.getComponentFonts(),fontFamily:n.getProperty(FONT_FAMILY).value,color:n.getProperty(COLOR).value,bgColor:n.getProperty(BACKGROUND_COLOR).value,dividerColor:n.getProperty(DIVIDER_COLOR).value,title:n.getProperty(TITLE).value,text:n.getProperty(TEXT).value,description:n.getProperty(DESCRIPTION).value,checkout:{}},i=_.find(n.children,function(n){return n.proto.name===STORE_CART_CHECKOUT});return i&&(t.checkout=ContextFactory.contextFor(i,EDITOR_CONTEXT)),t},StoreCartViewerContext=function(n,t){return{id:n.id,styles:t.where({group:"style"}),title:n.getProperty(TITLE).value,text:n.getProperty(TEXT).value,description:n.getProperty(DESCRIPTION).value,dividerColor:n.getProperty(DIVIDER_COLOR).value}},StoreThankYouEditorContext=function(n){return{fontOptions:ContextFactory.getComponentFonts(),fontFamily:n.getProperty(FONT_FAMILY).value,color:n.getProperty(COLOR).value,bgColor:n.getProperty(BACKGROUND_COLOR).value,dividerColor:n.getProperty(DIVIDER_COLOR).value,title:n.getProperty(TITLE).value,text:n.getProperty(TEXT).value,description:n.getProperty(DESCRIPTION).value,textOrderNumber:n.getProperty(TEXT_ORDER_NUMBER).value,textTotalCost:n.getProperty(TEXT_TOTAL_COST).value,textShippingTo:n.getProperty(TEXT_SHIPPING_TO).value}},StoreThankYouViewerContext=function(n,t){return{id:n.id,styles:t.where({group:"style"}),title:n.getProperty(TITLE).value,text:n.getProperty(TEXT).value,description:n.getProperty(DESCRIPTION).value,textOrderNumber:n.getProperty(TEXT_ORDER_NUMBER).value,textTotalCost:n.getProperty(TEXT_TOTAL_COST).value,textShippingTo:n.getProperty(TEXT_SHIPPING_TO).value,dividerColor:n.getProperty(DIVIDER_COLOR).value}},StoreGalleryEditorContext=function(n){var f=n.getProperty(WIDTH).value,e=n.getProperty(HEIGHT).value,o=n.getProperty(LEFT).value,s=n.getProperty(TOP).value,h=n.getProperty(Z_INDEX).value,t=[],i=_.find(n.children,function(n){return n.proto.name===STORE_GALLERY_PRODUCT});i&&(t.push(UI.basicComponentRepository.lookupData({name:STORE_GALLERY_PRODUCT_TITLE})),t.push(UI.basicComponentRepository.lookupData({name:STORE_GALLERY_PRODUCT_PRICE})),t.push(UI.basicComponentRepository.lookupData({name:STORE_GALLERY_PRODUCT_DESCRIPTION})),_.forEach(t,function(n){n.checked=!1}),_.forEach(i.children,function(n){var i=_.find(t,function(t){return t.id===n.componentId});i&&(i.checked=!0)}));var c=ContextFactory.getComponentFonts(),l=n.getProperty(COLUMNS).value,a=n.getProperty(ROWS).value,u=_.find(n.children,function(n){return n.proto.name===STORE_GALLERY_SHOW_MORE}),r={width:f,height:e,left:o,top:s,zindex:h||0,components:t,columns:l,rows:a,fontOptions:c,taOptions:[{name:"Left",value:"left"},{name:"Right",value:"right"},{name:"Center",value:"center"},{name:"Justify",value:"justify"}],bgColor:n.getProperty(BACKGROUND_COLOR).value,borderColor:n.getProperty(BORDER_COLOR).value,borderWidth:n.getProperty(BORDER_WIDTH).value,dividerColor:n.getProperty(DIVIDER_COLOR).value,dividerWidth:n.getProperty(DIVIDER_WIDTH).value,children:{}};return u&&(r.showMore=ContextFactory.contextFor(u,EDITOR_CONTEXT)),i&&(r.product=ContextFactory.contextFor(i,EDITOR_CONTEXT),_.forEach(i.children,function(n){r.children[n.proto.name]=ContextFactory.contextFor(n,EDITOR_CONTEXT);_.forEach(n.children,function(n){r.children[n.proto.name]=ContextFactory.contextFor(n,EDITOR_CONTEXT)})})),r},StoreGalleryShowMoreEditorContext=function(n){return{text:n.getProperty(TEXT).value,bgcolor:n.getProperty(BACKGROUND_COLOR).value,bgcolorhover:n.getProperty(BACKGROUND_COLOR_HOVER).value,color:n.getProperty(COLOR).value,txtcolorhover:n.getProperty(TEXT_COLOR_HOVER).value,brcolor:n.getProperty(BORDER_COLOR).value,brcolorhover:n.getProperty(BORDER_COLOR_HOVER).value,borderWidth:n.getProperty(BORDER_WIDTH).value,borderRadius:n.getProperty(BORDER_RADIUS).value,ta:n.getProperty(TEXT_ALIGN).value,fontFamily:n.getProperty(FONT_FAMILY).value,fontSize:n.getProperty(FONT_SIZE).value}},StoreGalleryProductTitleEditorContext=function(n){return{color:n.getProperty(COLOR).value,fontFamily:n.getProperty(FONT_FAMILY).value,fontSize:n.getProperty(FONT_SIZE).value}},StoreGalleryProductLabelEditorContext=function(n){return{bgColor:n.getProperty(BACKGROUND_COLOR).value,color:n.getProperty(COLOR).value,fontFamily:n.getProperty(FONT_FAMILY).value,fontSize:n.getProperty(FONT_SIZE).value,position:n.getProperty(CAPTION_POSITION).value}},StoreGalleryProductPriceEditorContext=function(n){return{color:n.getProperty(COLOR).value,outOfStockColor:n.getProperty(SECONDARY_COLOR).value,fontFamily:n.getProperty(FONT_FAMILY).value,fontSize:n.getProperty(FONT_SIZE).value}},StoreGalleryProductImageEditorContext=function(n){return{ratio:n.getProperty(IMAGE_RATIO).value}},StoreGalleryProductDescriptionEditorContext=function(n){return{color:n.getProperty(COLOR).value,fontFamily:n.getProperty(FONT_FAMILY).value,fontSize:n.getProperty(FONT_SIZE).value}},StoreGalleryProductEditorContext=function(n){return{layout:n.getProperty(LAYOUT).value,ta:n.getProperty(TEXT_ALIGN).value,hoverStyle:n.getProperty(HOVER_STYLE).value}},StoreGalleryViewerContext=function(n,t){return{id:n.id,styles:t.where({group:"style"}),dividerColor:n.getProperty(DIVIDER_COLOR).value,dividerWidth:n.getProperty(DIVIDER_WIDTH).value,col:n.getProperty(COLUMNS).value,row:n.getProperty(ROWS).value}},StoreGalleryShowMoreViewerContext=function(n,t){return{id:n.id,styles:t.where({group:"style"}),text:n.getProperty(TEXT).value}},StoreGalleryProductViewerContext=function(n,t){return{id:n.id,styles:t.where({group:"style"}),hoverStyle:n.getProperty(HOVER_STYLE).value}},StoreGalleryProductLabelViewerContext=function(n,t){return{id:n.id,styles:t.where({group:"style"}),location:n.getProperty(CAPTION_POSITION).value}},StoreGalleryProductPriceViewerContext=function(n,t){return{id:n.id,styles:t.where({group:"style"}),secondaryColor:n.getProperty(SECONDARY_COLOR).value}},StoreGalleryProductImageViewerContext=function(n,t){return{id:n.id,styles:t.where({group:"style"}),ratio:n.getProperty(IMAGE_RATIO).value}},ManageStoreProductsCategoryViewerContext=function(n){var t=[];return t.push({src:"http://127.0.0.1:10000/devstoreaccount1/resources-ade0e120-464a-4007-b31d-34b13bf5b2c2/de346cd6-bb6f-463c-8d8d-82780f7bd67d.jpg",title:"Zalf bloom chair"},{src:"http://127.0.0.1:10000/devstoreaccount1/resources-ade0e120-464a-4007-b31d-34b13bf5b2c2/a6e781c0-1784-4371-9625-98e9cdc8cf7c.jpg",title:"Zalf set chair"}),{id:n.id,products:t}},ManageStoreProductsAddingProductsToCategoryViewerContext=function(n){var t=[];return t.push({src:"http://127.0.0.1:10000/devstoreaccount1/resources-ade0e120-464a-4007-b31d-34b13bf5b2c2/de346cd6-bb6f-463c-8d8d-82780f7bd67d.jpg",title:"Zalf bloom chair"},{src:"http://127.0.0.1:10000/devstoreaccount1/resources-ade0e120-464a-4007-b31d-34b13bf5b2c2/a6e781c0-1784-4371-9625-98e9cdc8cf7c.jpg",title:"Zalf set chair"}),{id:n.id,products:t}},MenuComponentEditorContext=function(n){var u=n.getProperty(WIDTH).value,f=n.getProperty(HEIGHT).value,e=n.getProperty(LEFT).value,o=n.getProperty(TOP).value,s=n.getProperty(Z_INDEX).value,h=n.getProperty(PREDEFINED).value,c=n.getProperty(BACKGROUND_COLOR).value,l=n.getProperty(BACKGROUND_COLOR_HOVER).value,a=n.getProperty(BORDER_COLOR).value,v=n.getProperty(BORDER_COLOR_HOVER).value,y=n.getProperty(BORDER_RADIUS).value,p=n.getProperty(BORDER_WIDTH).value,w=n.getProperty(TEXT_COLOR_HOVER).value,b=n.getProperty(COLOR).value,k=n.getProperty(FONT_FAMILY).value,d=n.getProperty(FONT_SIZE).value,g=n.getProperty(STRETCH_TO_FULL_WIDTH).value.toBoolean(),nt=n.getProperty(MARGINS_WIDTH).value,tt=n.getProperty(OFFSET_X).value,it=n.getProperty(OFFSET_Y).value,rt=n.getProperty(FIXED_LOCATION).value,ut=n.getProperty(IS_PINED).value.toBoolean(),i=[{name:"simple",value:"simple"},{name:"vertical",value:"vertical"}],ft=i.where({value:h}).firstOrDefault(),t,r;return ft.selected=!0,t=ContextFactory.getComponentFonts(),r=t.where({value:k.toLowerCase()}).firstOrDefault(),r.selected=!0,{width:u,height:f,left:e,top:o,zindex:s||0,fontSize:d,borderRadius:y,borderWidth:p,styleOptions:i,fontOptions:t,color:b,bgcolor:c,bgcolorhover:l,txtcolorhover:w,borderColorInput:a,brcolorhover:v,offsetX:tt,offsetY:it,positionClass:rt,isPined:ut,marginsWidth:nt,stretchToFullWidth:g}},MenuComponentViewerContext=function(n,t){var i=n.getProperty(FIXED_LOCATION),r=n.getProperty(IS_PINED);return eventsystem.subscribe("/component/stretch/",function(){n.stretcher()}),{styles:t.where({group:"style"}),id:n.id,isPined:r.value.toBoolean(),positionClass:i?i.value:"default"}},AnchorComponentEditorContext=function(n){var t=n.getProperty(LEFT).value,i=n.getProperty(TOP).value,r=n.getProperty(NAME).value,u=n.getProperty(Z_INDEX).value;return{left:t,top:i,name:r,zindex:u||0}},AnchorComponentViewerContext=function(n,t){return{id:n.id,styles:t.where({group:"style"}),isDockable:n.isDockable?"dockable":""}},MortgageCalculatorComponentEditorContext=function(n){var i=n.getProperty(WIDTH).value,r=n.getProperty(HEIGHT).value,u=n.getProperty(LEFT).value,f=n.getProperty(TOP).value,e=n.getProperty(Z_INDEX).value,o=n.getProperty(BORDER_COLOR).value,s=n.getProperty(BORDER_WIDTH).value,h=n.getProperty(BORDER_RADIUS).value,c=n.getProperty(COLOR).value,l=n.getProperty(FONT_FAMILY).value,a=n.getProperty(FONT_SIZE).value,v=n.getProperty(TITLE).value,t=ContextFactory.getComponentFonts();return t.forEach(function(n){n.selected=n.value==l}),{color:c,width:i,height:r,left:u,top:f,borderWidth:s,borderRadius:h,brcolor:o,fontSize:a,fontOptions:t,title:v,zindex:e||0}},MortgageCalculatorComponentViewerContext=function(n,t){var i=n.getProperty(TITLE).value;return{id:n.id,styles:t.where({group:"style"}),title:i}},ContactUsComponentEditorContext=function(n){var h=n.getProperty(TYPE).value,c=n.getProperty(WIDTH).value,l=n.getProperty(HEIGHT).value,a=n.getProperty(LEFT).value,v=n.getProperty(TOP).value,y=n.getProperty(Z_INDEX).value,p=n.getProperty(TITLE).value,w=n.getProperty(COLOR).value,b=n.getProperty(FONT_FAMILY).value,k=n.getProperty(FONT_SIZE).value,d=n.getProperty(BACKGROUND_COLOR).value,g=n.getProperty(BORDER_COLOR).value,nt=n.getProperty(BORDER_WIDTH).value,tt=n.getProperty(BORDER_RADIUS).value,it=n.getProperty(MODE_VALUE).value,rt=n.getProperty(FORM_SUBJECT).value,ut=n.getProperty(USE_CAPTCHA).value.toBoolean(),o=ContextFactory.getComponentFonts(),u,i,e;o.forEach(function(n){n.selected=n.value===b});u=[{name:"Request a quote",value:"Request a quote"},{name:"Make an Appointment",value:"Make an Appointment"}];i=u.where({value:h});i.any()&&(i=i.firstOrDefault(),i.selected=!0);var r=n.getProperty(SUCCESS_PAGE_MASTER_LINK).value,t=r&&r!==n.id?UI.siteComponentRepository.lookupData({id:r}):n,ft=t.getProperty(SUCCESS_PAGE_MESSAGE).value,et=t.getProperty(SUCCESS_PAGE_LINK_REDIRECT_BUTTON).value,ot=t.getProperty(SUCCESS_PAGE_CONTENT_COLOR).value,st=t.getProperty(SUCCESS_PAGE_TEXT_COLOR).value,s=t.getProperty(SUCCESS_PAGE_TEXT_FONT_FAMILY).value,ht=t.getProperty(SUCCESS_PAGE_TEXT_FONT_SIZE).value,f=t.getProperty(SUCCESS_PAGE_IMAGE_LOGO).value,ct=t.getProperty(SUCCESS_PAGE_HEADER_COLOR).value,lt=t.getProperty(SUCCESS_PAGE_BUTTON_COLOR).value,at=t.getProperty(SUCCESS_PAGE_HEADER_TEXT).value,vt=t.getProperty(SUCCESS_PAGE_BUTTON_TEXT).value;f===""&&(f=SUCCESS_LOGO_IMAGE);e=ContextFactory.getComponentFonts();e.forEach(function(n){n.selected=n.value===s});var yt=ContextFactory.pages(et),pt=ContextFactory.getContactUsFields(n),wt=n.getProperty(MAIL_HISTORY_PROPERTY).value.toBoolean();return{fields:_.filter(pt,function(n){return!n.hideForEditor}),color:w,width:c,height:l,left:a,top:v,useCaptcha:ut,borderWidth:nt,borderRadius:tt,backgroundColor:d,mailHistory:wt,brcolor:g,fontSize:k,fontOptions:o,email:it,options:u,title:p,formSubject:rt,successPageMessage:ft,successPageParentPages:yt,successPageContentColor:ot,successPageTextColor:st,successPageTextFontFamily:s,successPageTextFontSize:ht,successPageImageLogo:f,successPageHeaderColor:ct,successPageButtonColor:lt,successPageHeaderText:at,successPageButtonText:vt,successPageFFValues:e,zindex:y||0,useSuccessPageAnyway:r}};ContextFactory.getContactUsFields=function(n){var t=[],r=n.getProperty(TYPE).value,i;return t=r=="Request a quote"?[{selector:"input[name='NA']",title:"Name",required:!1},{selector:"input[name='DP']",title:"Day Phone",required:!1},{selector:"input[name='EP']",title:"Evening Phone",required:!1},{selector:"input[name='EM']",title:"Email",required:!1},{selector:"textarea[name='CM']",title:"Comments",required:!1}]:[{selector:"input[name='NA']",title:"Name",required:!1},{selector:"input[name='PH']",title:"Phone",required:!1},{selector:"input[name='EM']",title:"Email",required:!1},{selector:"select[name='BTTC']",title:"Best Time To Call",required:!1,hideForEditor:!0},{selector:"input[name='IA']",title:"Inspection Address",required:!1},{selector:"input[name='CSZ']",title:"City, ST, ZIP",required:!1},{selector:"select[name='PRT']",title:"Property Type",required:!1,hideForEditor:!0},{selector:"input[name='SF']",title:"Square Footage",required:!1},{selector:"input[name='YB']",title:"Year Built",required:!1},{selector:"select[name='FT']",title:"Foundation Type",required:!1,hideForEditor:!0},{selector:"select[name='PT']",title:"Pool Type",required:!1,hideForEditor:!0},{selector:"textarea[name='CM']",title:"Comments",required:!1}],i=n.getProperty(REQUIRED_FIELD).value.split(","),t.forEach(function(n){n.required=i.indexOf(n.selector)!==-1}),t};ContactUsComponentViewerContext=function(n,t){var o=n.getProperty(TITLE).value,s=n.getProperty(TYPE).value,f=!1,e=!1;switch(s){case"Request a quote":f=!0;break;case"Make an Appointment":e=!0}var h=n.getProperty(USE_CAPTCHA).value.toBoolean(),r=n.getProperty(SUCCESS_PAGE_MASTER_LINK).value,i=r&&r!==n.id?UI.siteComponentRepository.lookupData({id:r}):n,c=i.getProperty(SUCCESS_PAGE_MESSAGE).value,l=i.getProperty(SUCCESS_PAGE_LINK_REDIRECT_BUTTON).value,a=i.getProperty(SUCCESS_PAGE_CONTENT_COLOR).value,v=i.getProperty(SUCCESS_PAGE_TEXT_COLOR).value,y=i.getProperty(SUCCESS_PAGE_TEXT_FONT_FAMILY).value,p=i.getProperty(SUCCESS_PAGE_TEXT_FONT_SIZE).value,u=i.getProperty(SUCCESS_PAGE_IMAGE_LOGO).value,w=i.getProperty(SUCCESS_PAGE_HEADER_COLOR).value,b=i.getProperty(SUCCESS_PAGE_BUTTON_COLOR).value,k=i.getProperty(SUCCESS_PAGE_HEADER_TEXT).value,d=i.getProperty(SUCCESS_PAGE_BUTTON_TEXT).value;return u===""&&(u=SUCCESS_LOGO_IMAGE),{id:n.id,styles:t.where({group:"style"}),requestQuote:f,makeAppointment:e,title:o,message:c,link:l,contentColor:a,textColor:v,ff:y,fs:p,image:u,headerColor:w,buttonColor:b,headerText:k,buttonText:d,hasCaptcha:h}};EvaluateHomeComponentEditorContext=function(n){var o=n.getProperty(WIDTH).value,s=n.getProperty(HEIGHT).value,h=n.getProperty(Z_INDEX).value,c=n.getProperty(COLOR).value,l=n.getProperty(BORDER_COLOR).value,a=n.getProperty(BACKGROUND_COLOR).value,v=n.getProperty(LEFT).value,y=n.getProperty(TOP).value,p=n.getProperty(FONT_FAMILY).value,w=n.getProperty(BORDER_WIDTH).value,b=n.getProperty(BORDER_RADIUS).value,k=n.getProperty(FONT_SIZE).value,d=n.getProperty(MODE_VALUE).value,g=n.getProperty(TITLE).value,nt=n.getProperty(USE_CAPTCHA).value.toBoolean(),tt=n.getProperty(FORM_SUBJECT).value,f=ContextFactory.getComponentFonts(),u;f.forEach(function(n){n.selected=n.value==p});var i=n.getProperty(SUCCESS_PAGE_MASTER_LINK).value,t=i&&i!==n.id?UI.siteComponentRepository.lookupData({id:i}):n,it=t.getProperty(SUCCESS_PAGE_MESSAGE).value,rt=t.getProperty(SUCCESS_PAGE_LINK_REDIRECT_BUTTON).value,ut=t.getProperty(SUCCESS_PAGE_CONTENT_COLOR).value,ft=t.getProperty(SUCCESS_PAGE_TEXT_COLOR).value,e=t.getProperty(SUCCESS_PAGE_TEXT_FONT_FAMILY).value,et=t.getProperty(SUCCESS_PAGE_TEXT_FONT_SIZE).value,r=t.getProperty(SUCCESS_PAGE_IMAGE_LOGO).value,ot=t.getProperty(SUCCESS_PAGE_HEADER_COLOR).value,st=t.getProperty(SUCCESS_PAGE_BUTTON_COLOR).value,ht=t.getProperty(SUCCESS_PAGE_HEADER_TEXT).value,ct=t.getProperty(SUCCESS_PAGE_BUTTON_TEXT).value;r===""&&(r=SUCCESS_LOGO_IMAGE);u=ContextFactory.getComponentFonts();u.forEach(function(n){n.selected=n.value===e});var lt=ContextFactory.pages(rt),at=ContextFactory.getEvaluateHomeFields(n),vt=n.getProperty(MAIL_HISTORY_PROPERTY).value.toBoolean();return{fields:_.filter(at,function(n){return!n.hideForEditor}),color:c,width:o,zindex:h||0,height:s,left:v,top:y,mailHistory:vt,borderWidth:w,borderRadius:b,backgroundColor:a,useCaptcha:nt,brcolor:l,fontSize:k,fontOptions:f,email:d,title:g,formSubject:tt,successPageMessage:it,successPageParentPages:lt,successPageContentColor:ut,successPageTextColor:ft,successPageTextFontFamily:e,successPageTextFontSize:et,successPageImageLogo:r,successPageHeaderColor:ot,successPageButtonColor:st,successPageHeaderText:ht,successPageButtonText:ct,successPageFFValues:u,useSuccessPageAnyway:i}};ContextFactory.getEvaluateHomeFields=function(n){var t=[{selector:"input[name='NA']",title:"Name",required:!1},{selector:"input[name='EM']",title:"Email",required:!1},{selector:"input[name='PN']",title:"Phone Number",required:!1},{selector:"input[name='AD']",title:"Address",required:!1},{selector:"input[name='CT']",title:"City",required:!1},{selector:"input[name='ST']",title:"State",required:!1},{selector:"input[name='ZC']",title:"Zip-Code",required:!1},{selector:"input[name='BD']",title:"Beds",required:!1},{selector:"input[name='BTH']",title:"Baths",required:!1},{selector:"input[name='SF']",title:"Square Feet",required:!1},{selector:"input[name='LS']",title:"Lot Size",required:!1},{selector:"input[name='YB']",title:"Year Built",required:!1}],i=n.getProperty(REQUIRED_FIELD).value.split(",");return t.forEach(function(n){n.required=i.indexOf(n.selector)!==-1}),t};var EvaluateHomeComponentViewerContext=function(n,t){var f=n.getProperty(TITLE).value,e=n.getProperty(USE_CAPTCHA).value.toBoolean(),r=n.getProperty(SUCCESS_PAGE_MASTER_LINK).value,i=r&&r!==n.id?UI.siteComponentRepository.lookupData({id:r}):n,o=i.getProperty(SUCCESS_PAGE_MESSAGE).value,s=i.getProperty(SUCCESS_PAGE_LINK_REDIRECT_BUTTON).value,h=i.getProperty(SUCCESS_PAGE_CONTENT_COLOR).value,c=i.getProperty(SUCCESS_PAGE_TEXT_COLOR).value,l=i.getProperty(SUCCESS_PAGE_TEXT_FONT_FAMILY).value,a=i.getProperty(SUCCESS_PAGE_TEXT_FONT_SIZE).value,u=i.getProperty(SUCCESS_PAGE_IMAGE_LOGO).value,v=i.getProperty(SUCCESS_PAGE_HEADER_COLOR).value,y=i.getProperty(SUCCESS_PAGE_BUTTON_COLOR).value,p=i.getProperty(SUCCESS_PAGE_HEADER_TEXT).value,w=i.getProperty(SUCCESS_PAGE_BUTTON_TEXT).value;return u===""&&(u=SUCCESS_LOGO_IMAGE),{id:n.id,styles:t.where({group:"style"}),title:f,message:o,link:s,contentColor:h,textColor:c,ff:l,fs:a,image:u,headerColor:v,buttonColor:y,headerText:p,buttonText:w,hasCaptcha:e}},HtmlContainerComponentEditorContext=function(n){var t=n.getProperty(WIDTH).value,i=n.getProperty(HEIGHT).value,r=n.getProperty(Z_INDEX).value,u=n.getProperty(BACKGROUND_COLOR).value,f=n.getProperty(LEFT).value,e=n.getProperty(TOP).value,o=n.getProperty(TEXT).value,s=n.getProperty(BORDER_WIDTH).value,h=n.getProperty(BORDER_COLOR).value;return{bgcolor:u,zindex:r||0,width:t,height:i,left:f,top:e,borderWidth:s,brcolor:h,text:o,isPreviewEnabled:n.isPreviewEnabled}},HtmlContainerComponentViewerContext=function(n,t){var i=n.getProperty(TEXT).value,r=!1;return(UI.getSetting("ispreview")||!new RegExp(REGEXP_CHECK_HTML_SCRIPT_AND_IFRAME_TAG).test(i))&&(r=!0,n.isPreviewEnabled=!0),{id:n.id,styles:t.where({group:"style"}),text:i,isPreview:r||n.isPreviewEnabled}},VideoComponentViewerContext=function(n,t){var r=n.getProperty(SRC).value,l=n.getProperty(PROVIDER).value,f=n.getProperty(LOOP).value.toBoolean(),e=n.getProperty(REL).value.toBoolean(),a=n.getProperty("autoplay").value.toBoolean(),i=[],u="?",o=!1,s=!1,h,c;switch(l){case"youtube":i.push("rel="+(e?"0":"1"));i.push("enablejsapi=1");i.push("autoplay=0");i.push("loop="+(f?"1&playlist="+r.substring(r.lastIndexOf("/")+1):"0"));u+=i.join("&");o=!0;break;case"vimeo":s=!0;r=r.replace("http:","");i.push("rel="+(e?"0":"1"));i.push("api=1");i.push("autoplay=0");i.push("loop="+(f?"1":"0"));u+=i.join("&")}return h=UI.getSetting("ispreview"),c={src:Helpers.convertToUniversalUrl(r),styles:t.where({group:"style"}),id:n.id,viewer:h,youtube:o,vimeo:s,paramsString:u},c},VideoComponentEditorContext=function(n){var i=n.getProperty(WIDTH).value,r=n.getProperty(HEIGHT).value,u=n.getProperty(TOP).value,f=n.getProperty(LEFT).value,e=n.getProperty(Z_INDEX).value,o=n.getProperty(REL).value.toBoolean(),s=n.getProperty(SRC).value,h=n.getProperty(PROVIDER).value,c=n.getProperty(AUTOPLAY).value.toBoolean(),l=n.getProperty(LOOP).value.toBoolean(),t=[{name:"youtube",value:"youtube"},{name:"vimeo",value:"vimeo"}],a=t.where({value:h}).firstOrDefault();return a.selected=!0,{width:i,height:r,top:u,left:f,src:Helpers.convertToUniversalUrl(s),zindex:e||0,providerOptions:t,autoplay:c,loop:l,rel:o}},SoundComponentViewerContext=function(n,t){var i=n.getProperty(HIDE).value.toBoolean(),r=n.getProperty(PAUSE).value,u=n.getProperty(TITLE).value;return{hide:i,viewer:UI.getSetting("ispreview"),styles:t.where({group:"style"}),id:n.id,title:u,soundpause:r}},SoundComponentEditorContext=function(n){var t=n.getProperty(TOP).value,i=n.getProperty(LEFT).value,r=n.getProperty(Z_INDEX).value,u=n.getProperty(SRC).value,f=n.getProperty(TITLE).value,e=n.getProperty(AUTOPLAY).value.toBoolean(),o=n.getProperty(HIDE).value.toBoolean(),s=n.getProperty(PAUSE).value,h=n.getProperty(HEIGHT).value;return{top:t,left:i,src:Helpers.convertToUniversalUrl(u),zindex:r||0,autoplay:e,hide:o,soundpause:s,title:f,height:h}},PanelComponentEditorContext=function(n){var t=n.getProperty(WIDTH).value,i=n.getProperty(HEIGHT).value,r=n.getProperty(BACKGROUND_COLOR).value,u=n.getProperty(BORDER_COLOR).value,f=n.getProperty(LEFT).value,e=n.getProperty(TOP).value,o=n.getProperty(Z_INDEX).value,s=n.getProperty(OFFSET_X).value,h=n.getProperty(OFFSET_Y).value,c=n.getProperty(FIXED_LOCATION).value,l=n.getProperty(IS_PINED).value.toBoolean(),a=n.getProperty(STRETCH_TO_FULL_WIDTH).value.toBoolean(),v=n.getProperty(BORDER_WIDTH).value,y=n.getProperty(BORDER_RADIUS).value,p=n.getProperty(MARGINS_WIDTH).value;return{bgcolor:r,width:t,height:i,left:f,top:e,zindex:o||0,borderWidth:v,borderRadius:y,brcolor:u,offsetX:s,offsetY:h,positionClass:c,isPined:l,marginsWidth:p,stretchToFullWidth:a}},PanelComponentViewerContext=function(n,t){eventsystem.subscribe("/component/stretch/",function(){n.stretcher()});var r=n.getProperty(CONTENT).value,i=n.getProperty(FIXED_LOCATION),u=n.getProperty(IS_PINED);return{id:n.id,styles:t.where({group:"style"}),content:r,isDockable:n.isDockable?"dockable":"",isPined:u.value.toBoolean(),positionClass:i?i.value:"default"}},LinkComponentEditorContext=function(){return{}},LinkComponentViewerContext=function(n,t){var i=n.getProperty(TEXT).value;return{id:n.id,styles:t.where({group:"style"}),text:i}},ImageComponentEditorContext=function(n){var h=n.getProperty(WIDTH).value,c=n.getProperty(HEIGHT).value,l=n.getProperty(TOP).value,a=n.getProperty(LEFT).value,v=n.getProperty("alt").value,y=n.getProperty(Z_INDEX).value,u=n.getProperty(SRC).value,o=n.getProperty(SHOW_OPTIMIZED).value.toBoolean(),i,f,r,e;u=ContextFactory.prepareImgSrc(u,o);i=n.getProperty(IMAGE_ON_HOVER).value;f=n.getProperty(SHOW_OPTIMIZED_HOVER).value.toBoolean();i=ContextFactory.prepareImgSrc(i,f);r=n.getProperty(IMAGE_ON_PRESSED).value;e=n.getProperty(SHOW_OPTIMIZED_PRESSED).value.toBoolean();r=ContextFactory.prepareImgSrc(r,e);var p=n.getProperty(MARGINS_WIDTH).value,w=n.getProperty(PREDEFINED).value,s=[{name:"plain",value:"plain"},{name:"shadow",value:"shadow"}],b=s.where({value:w}).firstOrDefault();b.selected=!0;var t=ContextFactory.linkManagementEditor(n),k=n.getProperty(OFFSET_X).value,d=n.getProperty(OFFSET_Y).value,g=n.getProperty(FIXED_LOCATION).value,nt=n.getProperty(IS_PINED).value.toBoolean(),tt=n.getProperty(STRETCH_TO_FULL_WIDTH).value.toBoolean(),it=n.getProperty(IS_IMAGE_PRIMARY).value.toBoolean();return{isPrimary:it,width:h,height:c,top:l,left:a,zindex:y||0,alt:v,preview:u,styleOptions:s,modeOptions:t.linkModes,pageOptions:t.pages,modeValue:t.modeValue,anchors:t.anchors,previewHover:i,previewPressed:r,blankPage:t.blankPage,offsetX:k,offsetY:d,positionClass:g,isPined:nt,marginsWidth:p,stretchToFullWidth:tt,isShowOptimized:o,isShowOptimizedHover:f,isShowOptimizedPressed:e}},ImageComponentViewerContext=function(n,t){eventsystem.subscribe("/component/stretch/",function(){n.stretcher()});var i=ContextFactory.linkManagementViewer(n),r=n.getProperty(SRC).value,u=n.getProperty(SHOW_OPTIMIZED).value.toBoolean();r=ContextFactory.prepareImgSrc(r,u);var e=n.getProperty(ALT).value,o=n.getProperty(PREDEFINED).value,f=n.getProperty(FIXED_LOCATION),s=n.getProperty(IS_PINED);return{src:r,alt:e,styles:t.where({group:"style"}),id:n.id,predefined:o,href:i.href,target:i.target,isShowLink:i.isShowLink,isPined:s.value.toBoolean(),positionClass:f?f.value:"default",isShowOptimized:u}};ContextFactory.prepareImgSrc=function(n,t){var i=n.split("/").pop(),r=i.split(".").pop(),u;return n===""?n=NO_IMAGE_YET:t&&n.indexOf(";base64")<0&&r!=="gif"&&(n.indexOf(UI.getSetting("templateId"))>0||(UI.getSetting("parentTemplateId")!=""&&n.indexOf(UI.getSetting("parentTemplateId")))>0)&&(u="optimized-"+i.replace(r,"jpg"),n=n.replace(i,u)),Helpers.convertToUniversalUrl(n)};var HeadingComponentEditorContext=function(){return{}},HeadingComponentViewerContext=function(n,t){return{id:n.id,styles:t.where({group:"style"})}},ButtonComponentEditorContext=function(n){var f=n.getProperty(WIDTH).value,e=n.getProperty(HEIGHT).value,o=n.getProperty(BACKGROUND_COLOR).value,s=n.getProperty(BACKGROUND_COLOR_HOVER).value,h=n.getProperty(BORDER_COLOR_HOVER).value,c=n.getProperty(COLOR).value,l=n.getProperty(TEXT_COLOR_HOVER).value,a=n.getProperty(BORDER_COLOR).value,v=n.getProperty(LEFT).value,y=n.getProperty(TOP).value,p=n.getProperty(Z_INDEX).value,w=n.getProperty(TEXT_ALIGN).value,b=n.getProperty(FONT_FAMILY).value,k=n.getProperty(BORDER_WIDTH).value,d=n.getProperty(BORDER_RADIUS).value,g=n.getProperty(FONT_SIZE).value,nt=n.getProperty(TEXT).value,tt=n.getProperty(OFFSET_X).value,it=n.getProperty(OFFSET_Y).value,rt=n.getProperty(FIXED_LOCATION).value,ut=n.getProperty(IS_PINED).value.toBoolean(),i=[{name:"left",value:"left"},{name:"right",value:"right"},{name:"center",value:"center"},{name:"justify",value:"justify"}],r=ContextFactory.getComponentFonts(),t,u;return i.forEach(function(n){n.taselected=n.value==w}),r.forEach(function(n){n.selected=n.value==b}),t=ContextFactory.linkManagementEditor(n),u={bgcolor:o,color:c,width:f,height:e,left:v,top:y,zindex:p||0,borderWidth:k,borderRadius:d,brcolor:a,text:nt,taOptions:i,fontSize:g,bgcolorhover:s,brcolorhover:h,fontOptions:r,txtcolorhover:l,modeValue:t.modeValue,modeOptions:t.linkModes,pageOptions:t.pages,blankPage:t.blankPage,anchors:t.anchors,offsetX:tt,offsetY:it,positionClass:rt,isPined:ut},u},ButtonComponentViewerContext=function(n,t){var u=n.getProperty(TEXT).value,i=ContextFactory.linkManagementViewer(n),r=n.getProperty(FIXED_LOCATION),f=n.getProperty(IS_PINED);return{id:n.id,styles:t.where({group:"style"}),text:u,isShowLink:i.isShowLink,href:i.href,onclick:i.target,isPined:f.value.toBoolean(),positionClass:r?r.value:"default"}},BloggingComponentEditorContext=function(n){var f=n.getProperty(WIDTH).value,e=n.getProperty(HEIGHT).value,o=n.getProperty(LEFT).value,s=n.getProperty(TOP).value,h=n.getProperty(Z_INDEX).value,c=n.getProperty(BACKGROUND_COLOR).value,l=n.getProperty(BORDER_COLOR).value,a=n.getProperty(COLOR).value,v=n.getProperty(FONT_FAMILY).value,y=n.getProperty(BORDER_WIDTH).value,p=n.getProperty(BORDER_RADIUS).value,w=n.getProperty(FONT_SIZE).value,b=n.getProperty(LAYOUT).value,r="",u=n.getProperty(PARENT_PAGE).value,t,i;return u&&(t=UI.siteComponentRepository.lookupData({id:u}),t&&(r=t.getProperty(TITLE).value)),i=ContextFactory.getComponentFonts(),i.forEach(function(n){n.selected=n.value===v}),{bgcolor:c,color:a,width:f,height:e,left:o,top:s,zindex:h||0,title:r,borderWidth:y,borderRadius:p,brcolor:l,layout:b,fontSize:w,fontOptions:i}},BloggingComponentViewerContext=function(n,t){var f=n.getProperty(LAYOUT).value,r=[],i=n.getProperty(PARENT_PAGE).value,u;return i&&(u=UI.siteComponentRepository.lookupData({id:i}),u&&(r=UI.siteComponentRepository.lookupDataByProperty({"parent-page":i}).where({displayName:PAGE_COMPONENT}).map(function(n){var t=BLOGGING_EMPTY_IMAGE_URL;return UI.siteComponentRepository.lookupDataSet({displayName:IMAGE},n).forEach(function(n){if(n.getProperty(IS_IMAGE_PRIMARY).value.toBoolean()){var i=n.getProperty(SHOW_OPTIMIZED).value.toBoolean();t=ContextFactory.prepareImgSrc(n.getProperty(SRC).value,i)}}),{id:n.id,imageSrc:t,date:n.getProperty(META_DATE).value,title:n.getProperty(TITLE).value,href:Helpers.generateLinkToPage(n.getProperty(NAME).value,!0),description:n.getProperty(META_DESCRIPTION).value}}))),{id:n.id,styles:t.where({group:"style"}),layout:f,pages:r}},MapComponentEditorContext=function(n){var t=n.getProperty(WIDTH).value,i=n.getProperty(HEIGHT).value,r=n.getProperty(LEFT).value,u=n.getProperty(TOP).value,f=n.getProperty(Z_INDEX).value,e=n.getProperty(TEXT).value,o=n.getProperty(TITLE).value,s=n.getProperty(LATITUDE).value,h=n.getProperty(LONGITUDE).value,c=n.getProperty(SHOW_MAP_TYPE).value.toBoolean(),l=n.getProperty(SHOW_ZOOM).value.toBoolean(),a=n.getProperty(MAP_INTERACTIVE).value.toBoolean(),v=n.getProperty(SHOW_STREET_VIEW).value.toBoolean();return{width:t,height:i,left:r,top:u,zindex:f||0,text:e,title:o,lat:s,lng:h,showMapType:c,showZoom:l,mapInteractive:a,showStreetView:v}},MapComponentViewerContext=function(n,t){return{id:n.id,styles:t.where({group:"style"})}},SignInComponentEditorContext=function(n){var r=n.getProperty(WIDTH).value,u=n.getProperty(HEIGHT).value,f=n.getProperty(BACKGROUND_COLOR).value,e=n.getProperty(BACKGROUND_COLOR_HOVER).value,o=n.getProperty(BORDER_COLOR_HOVER).value,s=n.getProperty(COLOR).value,h=n.getProperty(BORDER_COLOR).value,c=n.getProperty(LEFT).value,l=n.getProperty(TOP).value,a=n.getProperty(Z_INDEX).value,v=n.getProperty(TEXT_ALIGN).value,y=n.getProperty(FONT_FAMILY).value,p=n.getProperty(BORDER_WIDTH).value,w=n.getProperty(BORDER_RADIUS).value,b=n.getProperty(FONT_SIZE).value,k=n.getProperty(TEXT).value,t=[{name:"left",value:"left"},{name:"right",value:"right"},{name:"center",value:"center"},{name:"justify",value:"justify"}],i=ContextFactory.getComponentFonts();return t.forEach(function(n){n.taselected=n.value===v}),i.forEach(function(n){n.selected=n.value===y}),{id:n.id,bgcolor:f,color:s,width:r,height:u,left:c,top:l,zindex:a||0,borderWidth:p,borderRadius:w,brcolor:h,text:k,taOptions:t,fontSize:b,bgcolorhover:e,brcolorhover:o,fontOptions:i}},SignInComponentViewerContext=function(n,t){var i=n.getProperty(TEXT).value;return{id:n.id,styles:t.where({group:"style"}),text:i}},ParagraphComponentEditorContext=function(n){var i=n.getProperty(TEXT).value,r=n.getProperty(WIDTH).value,u=n.getProperty(HEIGHT).value,f=n.getProperty(LEFT).value,e=n.getProperty(TOP).value,o=n.getProperty(Z_INDEX).value,s=n.getProperty(BORDER_WIDTH).value,h=n.getProperty(BORDER_RADIUS).value,c=n.getProperty(BORDER_COLOR).value,l=n.getProperty(BACKGROUND_COLOR).value,t=ContextFactory.linkManagementEditor(n);return{text:i,width:r,height:u,left:f,top:e,zindex:o||0,borderWidth:s,borderRadius:h,brcolor:c,bgcolor:l,modeValue:t.modeValue,modeOptions:t.linkModes,pageOptions:t.pages,anchors:t.anchors,blankPage:t.blankPage}},ParagraphComponentViewerContext=function(n,t){var r=n.getProperty(TEXT).value,i=ContextFactory.linkManagementViewer(n);return{id:n.id,styles:t.where({group:"style"}),text:r,isShowLink:i.isShowLink,href:i.href,target:i.target}},HeadertextComponentEditorContext=function(n){var i=n.getProperty(TEXT).value,r=n.getProperty(WIDTH).value,u=n.getProperty(HEIGHT).value,f=n.getProperty(LEFT).value,e=n.getProperty(TOP).value,o=n.getProperty(Z_INDEX).value,s=n.getProperty(BORDER_WIDTH).value,h=n.getProperty(BORDER_RADIUS).value,c=n.getProperty(BORDER_COLOR).value,l=n.getProperty(BACKGROUND_COLOR).value,t=ContextFactory.linkManagementEditor(n);return{text:i,width:r,height:u,left:f,top:e,zindex:o||0,borderWidth:s,borderRadius:h,brcolor:c,bgcolor:l,modeValue:t.modeValue,modeOptions:t.linkModes,pageOptions:t.pages,anchors:t.anchors,blankPage:t.blankPage}},HeadertextComponentViewerContext=function(n,t){var r=n.getProperty(TEXT).value,i=ContextFactory.linkManagementViewer(n);return{id:n.id,styles:t.where({group:"style"}),text:r,isShowLink:i.isShowLink,href:i.href,target:i.target}},GalleryComponentEditorContext=function(n){var a=n.getProperty(WIDTH).value,v=n.getProperty(HEIGHT).value,y=n.getProperty(TOP).value,p=n.getProperty(LEFT).value,w=n.getProperty(Z_INDEX).value,b=n.getProperty(TYPE).value,k=n.getProperty(COLUMNS).value,d=n.getProperty(EXPAND).value.toBoolean(),g=n.getProperty(IMAGE_SETTINGS_COLOR).value,nt=n.getProperty(IMAGE_SETTINGS_HEADERCOLOR).value,tt=n.getProperty(IMAGE_SETTINGS_BGCOLOR).value,it=n.getProperty(FONT_SIZE).value,rt=n.getProperty(PREDEFINED).value,ut=n.getProperty(MARGINS_WIDTH).value,ft=n.getProperty(IMAGE_STRETCHING).value,e=[{name:"crop",value:"crop"},{name:"fill",value:"fill"}],o,i,r,u,c,l;e.forEach(function(n){n.siselected=n.value===ft});o=n.getProperty(FONT_FAMILY).value;i=ContextFactory.getComponentFonts();i.forEach(function(n){n.selected=n.value==o});var s=[{name:"plain",value:"plain"},{name:"shadow",value:"shadow"}],et=s.where({value:rt}).firstOrDefault(),h=[{name:"simple",value:"simple"},{name:"with captions",value:"with-captions"}],t=h.where({value:b});t.any()&&(t=t.firstOrDefault(),t.selected=!0);r=n.getProperty(SHOW_OPTIMIZED).value.toBoolean();u=[];n.children.forEach(function(n){u.push({id:n.id,src:ContextFactory.prepareImgSrc(n.getProperty(SRC).value,r),order:n.getProperty(ORDER).value.toInteger()})});var f=ContextFactory.linkManagementEditor(n),ot=n.getProperty(CAPTION_POSITION).value,st=ContextFactory.getSlideshowCaptionPositionList(ot);return et.selected=!0,c=n.getProperty(STRETCH_TO_FULL_WIDTH).value.toBoolean(),l={width:a,height:v,top:y,left:p,zindex:w||0,galleryItems:u.orderBy(ORDER),options:h,columnCount:k,expand:d,modeOptions:f.linkModes,pageOptions:f.pages,anchors:f.anchors,fontSize:it,color:g,headercolor:nt,bgcolor:tt,isOptions:e,styleOptions:s,fontOptions:i,cpOptions:st,marginsWidth:ut,stretchToFullWidth:c,isShowOptimized:r},l},GalleryComponentViewerContext=function(n,t){eventsystem.subscribe("/component/stretch/",function(){n.stretcher()});var f=n.getProperty(TYPE).value,e=n.getProperty(COLUMNS).value,o=n.getProperty(EXPAND).value.toBoolean(),i=!1;switch(f){case"with-captions":i=!0}var r=[],s=n.getProperty(IMAGE_STRETCHING).value,h=n.getProperty(CAPTION_POSITION).value,c=n.getProperty(IMAGE_SETTINGS_BGCOLOR).value,l=n.getProperty(IMAGE_SETTINGS_HEADERCOLOR).value,a=n.getProperty(IMAGE_SETTINGS_COLOR).value,u=n.getProperty(SHOW_OPTIMIZED).value.toBoolean();return n.children.forEach(function(t){var f=ContextFactory.linkManagementViewer(t);r.push({id:t.id,src:ContextFactory.prepareImgSrc(t.getProperty(SRC).value,u),title:t.getProperty(TITLE).value,description:t.getProperty(DESCRIPTION).value,order:t.getProperty(ORDER).value.toInteger(),columnCount:"c"+e,simpleWithCaptions:i,expand:f.href==""?o:!0,href:f.href,onclick:f.target,isShowLink:f.isShowLink,marginbottom:t.getProperty(GALLERY_ITEM_BOTTOM_MARGIN).value,predefined:n.getProperty(PREDEFINED).value,infoBgColor:c,titleColor:l,descrColor:a,isCrop:s==="crop",captionPosition:h})}),{id:n.id,styles:t.where({group:"style"}),galleryItems:r.orderBy(ORDER),predefined:n.getProperty(PREDEFINED).value,isShowOptimized:u}},HousePhotoTourComponentEditorContext=function(n){var l=n.getProperty(WIDTH).value,a=n.getProperty(HEIGHT).value,v=n.getProperty(TOP).value,y=n.getProperty(LEFT).value,p=n.getProperty(Z_INDEX).value,w=n.getProperty(IMAGE_SETTINGS_COLOR).value,b=n.getProperty(IMAGE_SETTINGS_HEADERCOLOR).value,k=n.getProperty(BACKGROUND_COLOR).value,d=n.getProperty(FONT_SIZE).value,g=n.getProperty(FONT_FAMILY).value,nt=n.getProperty(TEXT_ALIGN).value,tt=n.getProperty(MARGINS_WIDTH).value,it=n.getProperty(EXPAND).value.toBoolean(),o=[{name:"left",value:"left"},{name:"right",value:"right"},{name:"center",value:"center"},{name:"justify",value:"justify"}],s,t,i,r,h,u,f;o.forEach(function(n){n.selected=n.value==nt});s=n.getProperty(LOCATION).value;t=[{name:"left",value:"left"},{name:"right",value:"right"}];t.forEach(function(n){n.selected=n.value==s});i=n.getProperty(SHOW_OPTIMIZED).value.toBoolean();r=[];n.children.forEach(function(n){r.push({id:n.id,src:ContextFactory.prepareImgSrc(n.getProperty(SRC).value,i),order:n.getProperty(ORDER).value.toInteger()})});h=n.getProperty(IMAGE_STRETCHING).value;u=[{name:"crop",value:"crop"},{name:"fill",value:"fill"}];u.forEach(function(n){n.siselected=n.value===h});f=ContextFactory.getComponentFonts();f.forEach(function(n){n.selected=n.value===g});var rt=n.getProperty(PHOTO_TOUR_TEXT_COLOR).value,ut=n.getProperty(CAPTION_POSITION).value,ft=ContextFactory.getSlideshowCaptionPositionList(ut),c=n.getProperty(STRETCH_TO_FULL_WIDTH).value.toBoolean(),e=ContextFactory.linkManagementEditor(n);return{width:l,height:a,top:v,left:y,zindex:p||0,galleryItems:r.orderBy(ORDER),isOptions:u,fontSize:d,color:w,headercolor:b,bgcolor:k,fontOptions:f,taoptions:o,textbgcolor:rt,locationoptions:t,cpOptions:ft,marginsWidth:tt,stretchToFullWidth:c,expand:it,modeOptions:e.linkModes,pageOptions:e.pages,anchors:e.anchors,stretchToFullWidth:c,isShowOptimized:i}},HousePhotoTourComponentViewerContext=function(n,t){eventsystem.subscribe("/component/stretch/",function(){n.stretcher()});var i=[],e=n.getProperty(IMAGE_STRETCHING).value,r=n.getProperty(CAPTION_POSITION).value,o=n.getProperty(PHOTO_TOUR_TEXT_COLOR).value,s=n.getProperty(IMAGE_SETTINGS_HEADERCOLOR).value,h=n.getProperty(IMAGE_SETTINGS_COLOR).value,u=n.getProperty(EXPAND).value.toBoolean(),f=n.getProperty(SHOW_OPTIMIZED).value.toBoolean();return n.children.forEach(function(n){var t=ContextFactory.linkManagementViewer(n);i.push({id:n.id,src:ContextFactory.prepareImgSrc(n.getProperty(SRC).value,f),title:n.getProperty(TITLE).value,description:n.getProperty(DESCRIPTION).value,order:n.getProperty(ORDER).value.toInteger(),infoBgColor:o,titleColor:s,descrColor:h,isCrop:e==="crop",captionPosition:r,expand:t.href==""?u:!0,href:t.href,onclick:t.target,captionPosition:r,isShowOptimized:f})}),{id:n.id,styles:t.where({group:"style"}),galleryItems:i.orderBy(ORDER),expand:u}},SlideshowComponentEditorContext=function(n){var e=n.getProperty(WIDTH).value,o=n.getProperty(HEIGHT).value,s=n.getProperty(TOP).value,h=n.getProperty(LEFT).value,c=n.getProperty(Z_INDEX).value,l=n.getProperty(PAUSE).value.toBoolean(),a=n.getProperty(NAV).value.toBoolean(),v=n.getProperty(DOT).value.toBoolean(),y=n.getProperty(CAPTION).value.toBoolean(),p=n.getProperty(INTERVAL).value.toInteger(),w=n.getProperty(IMAGE_STRETCHING).value,b=n.getProperty(EXPAND).value.toBoolean(),k=n.getProperty(IMAGE_SETTINGS_COLOR).value,d=n.getProperty(IMAGE_SETTINGS_HEADERCOLOR).value,g=n.getProperty(IMAGE_SETTINGS_BGCOLOR).value,nt=n.getProperty(FONT_SIZE).value,tt=n.getProperty(FONT_FAMILY).value,it=n.getProperty(MARGINS_WIDTH).value,u=n.getProperty(SHOW_OPTIMIZED).value.toBoolean(),f=[],i,t,r;n.children.forEach(function(n){f.push({id:n.id,src:ContextFactory.prepareImgSrc(n.getProperty(SRC).value,u),order:n.getProperty(ORDER).value.toInteger()})});i=[{name:"crop",value:"crop"},{name:"fill",value:"fill"}];i.forEach(function(n){n.siselected=n.value==w});t=ContextFactory.linkManagementEditor(n);r=ContextFactory.getComponentFonts();r.forEach(function(n){n.selected=n.value==tt});var rt=n.getProperty(CAPTION_POSITION).value,ut=ContextFactory.getSlideshowCaptionPositionList(rt),ft=n.getProperty(STRETCH_TO_FULL_WIDTH).value.toBoolean();return{width:e,height:o,top:s,left:h,zindex:c||0,galleryItems:f.orderBy(ORDER),interval:p,pauseOnHover:l,nav:a,dot:v,caption:y,expand:b,isOptions:i,modeOptions:t.linkModes,pageOptions:t.pages,anchors:t.anchors,fontSize:nt,color:k,headercolor:d,bgcolor:g,fontOptions:r,cpOptions:ut,marginsWidth:it,stretchToFullWidth:ft,isShowOptimized:u}},SlideshowComponentViewerContext=function(n,t){var r,u,s;eventsystem.subscribe("/component/stretch/",function(){n.stretcher()});var h=n.getProperty(PAUSE).value.toBoolean(),c=n.getProperty(INTERVAL).value.toInteger(),l=n.getProperty(NAV).value.toBoolean(),a=n.getProperty(DOT).value.toBoolean(),v=n.getProperty(CAPTION).value.toBoolean(),f=n.getProperty(EXPAND).value.toBoolean(),i=[],y=n.getProperty(IMAGE_STRETCHING).value,e=n.getProperty(CAPTION_POSITION).value,p=n.getProperty(IMAGE_SETTINGS_BGCOLOR).value,w=n.getProperty(IMAGE_SETTINGS_HEADERCOLOR).value,b=n.getProperty(IMAGE_SETTINGS_COLOR).value,o=n.getProperty(SHOW_OPTIMIZED).value.toBoolean();return n.children.forEach(function(t){var r=ContextFactory.linkManagementViewer(t);i.push({id:t.id,controlId:n.id,src:ContextFactory.prepareImgSrc(t.getProperty(SRC).value,o),title:t.getProperty(TITLE).value,description:t.getProperty(DESCRIPTION).value,order:t.getProperty(ORDER).value.toInteger(),caption:v,expand:r.href==""?f:!0,href:r.href,onclick:r.target,isCrop:y==="crop",captionPosition:e,infoBgColor:p,titleColor:w,descrColor:b})}),i=i.orderBy(ORDER),r=i.firstOrDefault(),r!=null&&(r.active=!0),i.forEach(function(n,t){n.index=t}),u="",s=ContextFactory.getSlideshowCaptionPositionList(e),s.forEach(function(n){n.selected&&(u=n.class)}),{id:n.id,styles:t.where({group:"style"}),galleryItems:i,nav:l,dot:a,expand:f,captionPositionClass:u,interval:c*1e3,pauseOnHover:h,isShowOptimized:o}},ListComponentEditorContext=function(n){var c=n.getProperty(WIDTH).value,l=n.getProperty(HEIGHT).value,a=n.getProperty(Z_INDEX).value,v=n.getProperty(TOP).value,y=n.getProperty(LEFT).value,p=n.getProperty(TYPE).value,w=n.getProperty(EXPAND).value.toBoolean(),b=n.getProperty(IMAGE_SETTINGS_COLOR).value,k=n.getProperty(IMAGE_SETTINGS_HEADERCOLOR).value,d=n.getProperty(IMAGE_SETTINGS_BGCOLOR).value,g=n.getProperty(FONT_SIZE).value,nt=n.getProperty(IMAGE_SETTING_OPTIONALCOLOR).value,tt=n.getProperty(FONT_FAMILY).value,o=ContextFactory.getComponentFonts(),s,r,u,t,f,e,i,h;return o.forEach(function(n){n.selected=n.value==tt}),s=n.getProperty(IMAGE_STRETCHING).value,r=[{name:"crop",value:"crop"},{name:"fill",value:"fill"}],r.forEach(function(n){n.siselected=n.value==s}),u=[{name:"simple",value:"simple"},{name:"vertical",value:"vertical"},{name:"only text",value:"only text"},{name:"lines",value:"lines"},{name:"general",value:"general"},{name:"thumbnails",value:"thumbnails"}],t=u.where({value:p}),t.any()&&(t=t.firstOrDefault(),t.selected=!0),f=n.getProperty(SHOW_OPTIMIZED).value.toBoolean(),e=[],n.children.forEach(function(n){e.push({id:n.id,src:ContextFactory.prepareImgSrc(n.getProperty(SRC).value,f),order:n.getProperty(ORDER).value.toInteger()})}),i=ContextFactory.linkManagementEditor(n),h={width:c,height:l,top:v,left:y,galleryItems:e.orderBy(ORDER),options:u,modeOptions:i.linkModes,pageOptions:i.pages,anchors:i.anchors,expand:w,color:b,headercolor:k,bgcolor:d,fontSize:g,zindex:a||0,optionalcolor:nt,isOptions:r,fontOptions:o,isShowOptimized:f},h},ListComponentViewerContext=function(n,t){var l=n.getProperty(IMAGE_SETTINGS_COLOR).value,a=n.getProperty(IMAGE_SETTINGS_HEADERCOLOR).value,v=n.getProperty(IMAGE_SETTINGS_BGCOLOR).value,y=n.getProperty(FONT_SIZE).value,p=n.getProperty(IMAGE_SETTING_OPTIONALCOLOR).value,w=n.getProperty(TYPE).value,i=n.getProperty(EXPAND).value.toBoolean(),f=!1,e=!1,o=!1,s=!1,h=!1,c=!1,r,u;switch(w){case"simple":f=!0;break;case"vertical":e=!0;break;case"only text":o=!0;i=!1;break;case"lines":s=!0;i=!1;break;case"general":h=!0;break;case"thumbnails":c=!0}return r=n.getProperty(SHOW_OPTIMIZED).value.toBoolean(),u=[],n.children.forEach(function(n){var t=ContextFactory.linkManagementViewer(n),e="pointer",f=t.href==""?i:!0,o=ContextFactory.prepareImgSrc(n.getProperty(SRC).value,r);o==BLANKIMAGE&&(f=!1);f&&(e="pointer");u.push({id:n.id,src:o,title:n.getProperty(TITLE).value,description:n.getProperty(DESCRIPTION).value,optional:n.getProperty(OPTIONAL).value,order:n.getProperty(ORDER).value.toInteger(),href:t.href,onclick:t.target,isShowLink:t.isShowLink,cursor:e,expand:f})}),{id:n.id,styles:t.where({group:"style"}),galleryItems:u.orderBy(ORDER),vertical:e,simple:f,onlytext:o,lines:s,general:h,thumbnail:c,color:l,headercolor:a,bgcolor:v,fontSize:y,optionalcolor:p,isShowOptimized:r}},FrameComponentEditorContext=function(n){var t=n.getProperty(WIDTH).value,i=n.getProperty(HEIGHT).value,r=n.getProperty(LEFT).value,u=n.getProperty(TOP).value,f=n.getProperty(Z_INDEX).value,e=n.getProperty(MODE_VALUE).value;return{width:t,height:i,left:r,top:u,zindex:f||0,src:e}},FrameComponentViewerContext=function(n,t){var i=n.getProperty(MODE_VALUE).value;return{id:n.id,styles:t.where({group:"style"}),isDockable:n.isDockable?"dockable":"",src:i}},PdfComponentEditorContext=function(n){var r=n.getProperty(WIDTH).value,u=n.getProperty(HEIGHT).value,f=n.getProperty(LEFT).value,e=n.getProperty(TOP).value,o=n.getProperty(Z_INDEX).value,t=n.getProperty(MODE_VALUE).value,s=n.getProperty(SHOW_OPTIMIZED_PLACEHOLDER).value.toBoolean(),h=n.getProperty(IMAGE_PROPERTY).value,i=n.getProperty(NAME).value;return t.length===0&&(i=PDF_NOT_UPLOADED),{width:r,height:u,left:f,top:e,zindex:o||0,src:t,name:i,isShowOptimizedPlaceholder:s}},PdfComponentViewerContext=function(n,t){var r=n.getProperty(MODE_VALUE).value,i=n.getProperty(SHOW_OPTIMIZED_PLACEHOLDER).value.toBoolean(),u=n.getProperty(IMAGE_PROPERTY).value;return{id:n.id,styles:t.where({group:"style"}),isDockable:n.isDockable?"dockable":"",src:r,image:ContextFactory.prepareImgSrc(u,i),isShowOptimizedPlaceholder:i}},FormComponentEditorContext=function(n){var t=n.getProperty(WIDTH).value,i=n.getProperty(HEIGHT).value,r=n.getProperty(LEFT).value,u=n.getProperty(TOP).value,f=n.getProperty(Z_INDEX).value,e=n.getProperty(BACKGROUND_COLOR).value,o=n.getProperty(BORDER_COLOR).value,s=n.getProperty(BORDER_WIDTH).value,h=n.getProperty(BORDER_RADIUS).value,c=n.getProperty(MAIL_HISTORY_PROPERTY).value.toBoolean();return{width:t,height:i,left:r,top:u,zindex:f||0,bgcolor:e,borderWidth:s,borderRadius:h,brcolor:o,mailHistory:c}},FormComponentViewerContext=function(n,t){return{id:n.id,styles:t.where({group:"style"}),isDockable:n.isDockable?"dockable":""}},LabelComponentEditorContext=function(n){var r=n.getProperty(WIDTH).value,u=n.getProperty(HEIGHT).value,f=n.getProperty(LEFT).value,e=n.getProperty(TOP).value,o=n.getProperty(Z_INDEX).value,s=n.getProperty(TEXT).value,h=n.getProperty(BACKGROUND_COLOR).value,c=n.getProperty(TEXT_ALIGN).value,l=n.getProperty(FONT_FAMILY).value,a=n.getProperty(COLOR).value,v=n.getProperty(FONT_SIZE).value,i=[{name:"left",value:"left"},{name:"right",value:"right"},{name:"center",value:"center"},{name:"justify",value:"justify"}],t;return i.forEach(function(n){n.taselected=n.value===c}),t=ContextFactory.getComponentFonts(),t.forEach(function(n){n.selected=n.value===l}),{width:r,height:u,left:f,top:e,zindex:o||0,text:s,color:a,taOptions:i,fontSize:v,fontOptions:t,bgcolor:h}},CaptchaComponentEditorContext=function(n){var t=n.getProperty(WIDTH).value,i=n.getProperty(HEIGHT).value,r=n.getProperty(LEFT).value,u=n.getProperty(TOP).value,f=n.getProperty(Z_INDEX).value;return{width:t,height:i,left:r,top:u,zindex:f||0}},LabelComponentViewerContext=function(n,t){var i=n.getProperty(TEXT).value;return n.getProperty(CAPTION_COMPONENTS_TO_LABEL).value===""&&n.setProperty(CAPTION_COMPONENTS_TO_LABEL,n.id),{id:n.id,styles:t.where({group:"style"}),text:i,isDockable:n.isDockable?"dockable":""}},CaptchaComponentViewerContext=function(n,t){return{id:n.id,styles:t.where({group:"style"})}},TextboxComponentEditorContext=function(n){var u=n.getProperty(LEFT).value,f=n.getProperty(TOP).value,e=n.getProperty(WIDTH).value,o=n.getProperty(HEIGHT).value,s=n.getProperty(PLACEHOLDER).value,h=n.getProperty(BACKGROUND_COLOR).value,c=n.getProperty(COLOR).value,l=n.getProperty(BORDER_COLOR).value,a=n.getProperty(Z_INDEX).value,v=n.getProperty(FONT_FAMILY).value,y=n.getProperty(FONT_SIZE).value,p=n.getProperty(BORDER_WIDTH).value,w=n.getProperty(BORDER_RADIUS).value,b=ContextFactory.getFormLabels(n),k=ContextFactory.getFormLabelTypes(n),d=n.getProperty(SELECTEDLABEL).value,i=ContextFactory.getComponentFonts(),r,t;i.forEach(function(n){n.selected=n.value===v});r=n.proto.name==="textbox"?n.getProperty(TEXT_BOX_TYPE).value:"";t=[{name:"Text",value:"Text"},{name:"Email",value:"Email"}];t.forEach(function(n){n.selected=n.value===r});var g=n.getProperty(FORM_SPACE_AFTER_ITEM).value.toBoolean(),nt=n.getProperty(REQUIRED_FIELD).value.toBoolean();return{bgcolor:h,color:c,width:e,height:o,left:u,top:f,zindex:a||0,borderWidth:p,borderRadius:w,brcolor:l,placeholder:s,fontSize:y,fontOptions:i,labelOptions:b,labelTypes:k,labelValue:d,typeOptions:t,formSpaceAfterItem:g,isRequired:nt}},TextboxComponentViewerContext=function(n,t){var i=n.getProperty(PLACEHOLDER).value,r=UI.getSetting("ispreview")?"":"readonly",u=n.getProperty(REQUIRED_FIELD).value.toBoolean();return{id:n.id,styles:t.where({group:"style"}),placeholder:i,isDockable:n.isDockable?"dockable":"",isdisabled:r,isRequired:u}},RadiolistComponentEditorContext=function(n){var u=n.getProperty(LEFT).value,f=n.getProperty(TOP).value,e=n.getProperty(WIDTH).value,o=n.getProperty(HEIGHT).value,s=n.getProperty(BACKGROUND_COLOR).value,h=n.getProperty(COLOR).value,c=n.getProperty(BORDER_COLOR).value,l=n.getProperty(Z_INDEX).value,a=n.getProperty(FONT_FAMILY).value,v=n.getProperty(FONT_SIZE).value,y=n.getProperty(BORDER_WIDTH).value,p=n.getProperty(BORDER_RADIUS).value,i=ContextFactory.getComponentFonts(),t;i.forEach(function(n){n.selected=n.value==a});t=[];n.children.forEach(function(i){t.push({id:i.id,text:i.getProperty(TEXT).value,listid:n.id})});var w=n.getProperty(PREDEFINED).value,r=[{name:"Horizontal",value:"Horizontal"},{name:"Vertical",value:"Vertical"}],b=r.where({value:w}).firstOrDefault();b.selected=!0;var k=ContextFactory.getFormLabels(n),d=ContextFactory.getFormLabelTypes(n),g=n.getProperty(SELECTEDLABEL).value,nt=n.getProperty(FORM_SPACE_AFTER_ITEM).value.toBoolean(),tt=n.getProperty(REQUIRED_FIELD).value.toBoolean();return{bgcolor:s,color:h,width:e,height:o,left:u,top:f,zindex:l||0,borderWidth:y,borderRadius:p,brcolor:c,fontSize:v,fontOptions:i,items:t,styleOptions:r,labelOptions:k,labelTypes:d,labelValue:g,formSpaceAfterItem:nt,isRequired:tt}},RadiolistComponentViewerContext=function(n,t){var r=[],u,i,f,e;return n.children.forEach(function(t){r.push({id:t.id,text:t.getProperty("text").value,listid:n.id})}),u=n.getProperty(PREDEFINED).value,i="",u==="Horizontal"&&(i="radio-list-horizontal"),f=n.getProperty(REQUIRED_FIELD).value.toBoolean(),e={id:n.id,styles:t.where({group:"style"}),isDockable:n.isDockable?"dockable":"",items:r,additionalClass:i,isRequired:f},e},SelectlistComponentEditorContext=function(n){var r=n.getProperty(LEFT).value,u=n.getProperty(TOP).value,f=n.getProperty(WIDTH).value,e=n.getProperty(HEIGHT).value,o=n.getProperty(BACKGROUND_COLOR).value,s=n.getProperty(COLOR).value,h=n.getProperty(BORDER_COLOR).value,c=n.getProperty(Z_INDEX).value,l=n.getProperty(FONT_FAMILY).value,a=n.getProperty(FONT_SIZE).value,v=n.getProperty(BORDER_WIDTH).value,y=n.getProperty(BORDER_RADIUS).value,t=ContextFactory.getComponentFonts();t.forEach(function(n){n.selected=n.value===l});var p=ContextFactory.getFormLabels(n),w=ContextFactory.getFormLabelTypes(n),b=n.getProperty(SELECTEDLABEL).value,i=[];n.children.forEach(function(n){i.push({id:n.id,text:n.getProperty(TEXT).value})});var k=n.getProperty(FORM_SPACE_AFTER_ITEM).value.toBoolean(),d=n.getProperty(REQUIRED_FIELD).value.toBoolean();return{bgcolor:o,color:s,width:f,height:e,left:r,top:u,zindex:c||0,borderWidth:v,borderRadius:y,brcolor:h,fontSize:a,fontOptions:t,items:i,labelOptions:p,labelTypes:w,labelValue:b,formSpaceAfterItem:k,isRequired:d}},SelectlistComponentViewerContext=function(n,t){var i=[];n.children.forEach(function(n){i.push({text:n.getProperty(TEXT).value})});var r=n.getProperty(REQUIRED_FIELD).value.toBoolean();return{id:n.id,styles:t.where({group:"style"}),isDockable:n.isDockable?"dockable":"",items:i,isReadOnly:"",isRequired:r}},CheckboxComponentEditorContext=function(n){var t=n.getProperty(LEFT).value,i=n.getProperty(TOP).value,r=n.getProperty(Z_INDEX).value,u=ContextFactory.getFormLabels(n),f=ContextFactory.getFormLabelTypes(n),e=n.getProperty(SELECTEDLABEL).value,o=n.getProperty(FORM_SPACE_AFTER_ITEM).value.toBoolean();return{left:t,top:i,zindex:r||0,labelOptions:u,labelTypes:f,labelValue:e,formSpaceAfterItem:o}},CheckboxComponentViewerContext=function(n,t){return{id:n.id,styles:t.where({group:"style"}),isDockable:n.isDockable?"dockable":"",isReadOnly:""}},SubmitComponentEditorContext=function(n){var l=n.getProperty(LEFT).value,a=n.getProperty(TOP).value,v=n.getProperty(WIDTH).value,y=n.getProperty(HEIGHT).value,p=n.getProperty(Z_INDEX).value,w=n.getProperty(COLOR).value,b=n.getProperty(TEXT_COLOR_HOVER).value,k=n.getProperty(BORDER_COLOR).value,d=n.getProperty(BORDER_COLOR_HOVER).value,g=n.getProperty(BACKGROUND_COLOR).value,nt=n.getProperty(BACKGROUND_COLOR_HOVER).value,tt=n.getProperty(TEXT).value,it=n.getProperty(TEXT_ALIGN).value,rt=n.getProperty(FONT_FAMILY).value,ut=n.getProperty(FONT_SIZE).value,ft=n.getProperty(BORDER_WIDTH).value,et=n.getProperty(BORDER_RADIUS).value,f=[{name:"left",value:"left"},{name:"right",value:"right"},{name:"center",value:"center"},{name:"justify",value:"justify"}],e=ContextFactory.getComponentFonts(),s,u,h,c;f.forEach(function(n){n.taselected=n.value===it});e.forEach(function(n){n.selected=n.value===rt});var ot=n.getProperty(MODE_VALUE).value,i=n.getProperty(SUCCESS_PAGE_MASTER_LINK).value,t=i&&i!==n.id?UI.siteComponentRepository.lookupData({id:i}):n,st=t.getProperty(SUCCESS_PAGE_MESSAGE).value,ht=t.getProperty(SUCCESS_PAGE_LINK_REDIRECT_BUTTON).value,ct=t.getProperty(SUCCESS_PAGE_CONTENT_COLOR).value,lt=t.getProperty(SUCCESS_PAGE_TEXT_COLOR).value,o=t.getProperty(SUCCESS_PAGE_TEXT_FONT_FAMILY).value,at=t.getProperty(SUCCESS_PAGE_TEXT_FONT_SIZE).value,r=t.getProperty(SUCCESS_PAGE_IMAGE_LOGO).value,vt=t.getProperty(SUCCESS_PAGE_HEADER_COLOR).value,yt=t.getProperty(SUCCESS_PAGE_BUTTON_COLOR).value,pt=t.getProperty(SUCCESS_PAGE_HEADER_TEXT).value,wt=t.getProperty(SUCCESS_PAGE_BUTTON_TEXT).value;return r===""&&(r=SUCCESS_LOGO_IMAGE),s=ContextFactory.pages(ht),u=ContextFactory.getComponentFonts(),u.forEach(function(n){n.selected=n.value==o}),h=n.getProperty(FORM_SUBJECT).value,c={width:v,height:y,left:l,top:a,zindex:p||0,color:w,txtcolorhover:b,brcolor:k,brcolorhover:d,bgcolor:g,bgcolorhover:nt,text:tt,taOptions:f,fontSize:ut,fontOptions:e,borderWidth:ft,borderRadius:et,email:ot,formSubject:h,successPageMessage:st,successPageParentPages:s,successPageContentColor:ct,successPageTextColor:lt,successPageTextFontFamily:o,successPageTextFontSize:at,successPageImageLogo:r,successPageHeaderColor:vt,successPageButtonColor:yt,successPageHeaderText:pt,successPageButtonText:wt,successPageFFValues:u,useSuccessPageAnyway:i},c},SubmitComponentViewerContext=function(n,t){var f=n.getProperty(TEXT).value,r=n.getProperty(SUCCESS_PAGE_MASTER_LINK).value,i=r&&r!==n.id?UI.siteComponentRepository.lookupData({id:r}):n,e=i.getProperty(SUCCESS_PAGE_MESSAGE).value,o=i.getProperty(SUCCESS_PAGE_LINK_REDIRECT_BUTTON).value,s=i.getProperty(SUCCESS_PAGE_CONTENT_COLOR).value,h=i.getProperty(SUCCESS_PAGE_TEXT_COLOR).value,c=i.getProperty(SUCCESS_PAGE_TEXT_FONT_FAMILY).value,l=i.getProperty(SUCCESS_PAGE_TEXT_FONT_SIZE).value,u=i.getProperty(SUCCESS_PAGE_IMAGE_LOGO).value,a=i.getProperty(SUCCESS_PAGE_HEADER_COLOR).value,v=i.getProperty(SUCCESS_PAGE_BUTTON_COLOR).value,y=i.getProperty(SUCCESS_PAGE_HEADER_TEXT).value,p=i.getProperty(SUCCESS_PAGE_BUTTON_TEXT).value;return u===""&&(u=SUCCESS_LOGO_IMAGE),{id:n.id,styles:t.where({group:"style"}),text:f,message:e,link:o,contentColor:s,textColor:h,ff:c,fs:l,image:u,headerColor:a,buttonColor:v,headerText:y,buttonText:p}};ContextFactory.getComponentFonts=function(){return[{name:"Open Sans",value:"open sans"},{name:"Open Sans Semibold",value:"open sans semibold"},{name:"Open Sans Bold",value:"open sans bold"},{name:"Open Sans Italic",value:"open sans italic"},{name:"Open Sans Semibold Italic",value:"open sans semibold italic"},{name:"Alegreya",value:"alegreya"},{name:"Andada",value:"andada"},{name:"Andale",value:"'andale mono', andalemono, monospace"},{name:"Arial",value:"arial,helvetica,sans-serif"},{name:"Arvo",value:"arvo"},{name:"Bitter",value:"bitter"},{name:"Brush Script MT",value:"'brush script mt', cursive"},{name:"Cambria",value:"cambria, georgia, serif"},{name:"Comic Sans MS",value:"comic sans ms"},{name:"Courier New",value:"courier new"},{name:"Droid Serif",value:"droid serif"},{name:"Kaushan Script",value:"kaushan script"},{name:"Lobster",value:"lobster"},{name:"Lobster Two",value:"lobster two"},{name:"Lucida Sans Unicode",value:"lucida sans unicode,lucida grande,sans-serif"},{name:"Palatino",value:"palatino, 'palatino linotype', 'palatino lt std', 'book antiqua', georgia, serif"},{name:"Raleway",value:"raleway"},{name:"Roboto",value:"roboto,sans-serif"},{name:"Tahoma",value:"tahoma,geneva,sans-serif"},{name:"Times New Roman",value:"times new roman"},{name:"Verdana",value:"verdana,geneva,sans-serif"}]};ContextFactory.getComponentFontsInline=function(){var n="";return ContextFactory.getComponentFonts().forEach(function(t){n+=t.name+"/"+t.value+";"}),n};ContextFactory.getSlideshowCaptionPositionList=function(n){var t=[{name:"Bottom",value:"bottom","class":"slideshow-caption-bottom"},{name:"Top",value:"top","class":"slideshow-caption-top"}];return n!==undefined&&t.forEach(function(t){t.selected=t.value==n}),t};ContextFactory.pages=function(n){for(var i=UI.pager.pages,r=[],t=0;t<i.length;t++)n===""&&i[t].isHome||i[t].id==n?r.push({id:i[t].id,title:i[t].title,selected:!0}):r.push({id:i[t].id,title:i[t].title});return r};ContextFactory.getFormLabels=function(n){var t=[],i,r;return(t.push({id:"",name:"None",selected:!1}),n.parentComponent==null)?(console.log("ContextFactory.getFormLabels -> parent component == null, componentid:"+n.id),t):(i=n.parentComponent.id,r=n.getProperty(SELECTEDLABEL).value,UI.siteComponentRepository.lookupData({id:i}).children.where({displayName:LABEL}).forEach(function(n){var i=n.getProperty(CAPTION_COMPONENTS_TO_LABEL).value,u={id:i,name:n.getProperty("text").value,selected:i===r};t.push(u)}),t)};ContextFactory.getFormLabelTypes=function(n){var i=n.getProperty(SELECTEDLABELTYPE).value,t=[{name:"Label",value:"Label"},{name:LABELTYPENAME,value:LABELTYPENAME}],r=t.where({value:i}).firstOrDefault();return r.selected=!0,t};ContextFactory.linkManagementViewer=function(n){var o=n.getProperty(MODE).value,t=n.getProperty(MODE_VALUE).value,i="",f="",r=!1,s=n.getProperty(OPEN_LINK_ON_BLANK).value.toBoolean(),u,e;if(s&&(f="target='_blank'"),UI.getSetting("ispreview")){switch(o){case"anchor":isDefinedAndNotEmpty(t)&&(i="href='"+t+"'",r=!0);break;case"link":isDefinedAndNotEmpty(t)&&(/http/.test(t)||(t="//"+t),i="href='"+t+"'",r=!0);break;case"page":isDefinedAndNotEmpty(t)&&t!="None"&&(u=UI.siteComponentRepository.lookupData({id:t}),u!=null&&(e=u.getProperty("name"),i=Helpers.generateLinkToPage(e.value),r=!0));break;case"call":isDefinedAndNotEmpty(t)&&(i="href='tel:"+t+"'",r=!0)}return{target:f,href:i,isShowLink:r}}return{target:"",href:"",isShowLink:!1}};ContextFactory.linkManagementEditor=function(n){var o=n.getProperty(MODE),s=n.getProperty(MODE_VALUE),a=o?o.value:"",i=s?s.value:"",e,t;i==undefined&&(i="None");var h=[{name:"none",value:"none",selected:!1},{name:"link",value:"link",selected:!1},{name:"page",value:"page",selected:!1},{name:"anchor",value:"anchor",selected:!1},{name:"call",value:"call",selected:!1}],c=h.where({value:a}).firstOrDefault(),f=[{title:"None",id:"None"}];f.addRange(_.map(_.cloneDeep(UI.pager.pages.where({isService:!1})),function(n){return n.selected=!1,n}));e=f.where({id:i}).firstOrDefault();e!=null&&(e.selected=!0);c!=null&&(c.selected=!0);var l=n.getProperty(OPEN_LINK_ON_BLANK),v=l?l.value.toBoolean():!1,y=UI.pager.getCurrentPageId(),p=UI.siteComponentRepository.lookupData({id:y}),w=UI.siteComponentRepository.lookupData({displayName:"header"}),b=UI.siteComponentRepository.lookupData({displayName:"footer"}),t=UI.siteComponentRepository.lookupDataSet({displayName:"anchor"},p),r=[],u=[];return t!=null&&(u=_.map(t,function(n){return{name:n.getProperty(NAME).value,selected:i==n.getProperty(NAME).value}})),r=u.concat(r),t=UI.siteComponentRepository.lookupDataSet({displayName:"anchor"},w),t!=null&&(u=_.map(t,function(n){return{name:n.getProperty(NAME).value,selected:i==n.getProperty(NAME).value}})),r=r.concat(u),t=UI.siteComponentRepository.lookupDataSet({displayName:"anchor"},b),t!=null&&(u=_.map(t,function(n){return{name:n.getProperty(NAME).value,selected:i==n.getProperty(NAME).value}})),r=r.concat(u),{modeValue:i,linkModes:h,pages:f,blankPage:v,anchors:[{name:"None",selected:!1}].concat(r)}};TransformFactory=function(){};TransformFactory.staticHeightComponent=function(n){switch(n.proto.name){case SOUND:return 110;case ANCHOR:return 10;default:return 10}};TransformComponent=function(n,t){var i=this;i.init=function(n,t){i.component=n;i.children=[];i.isTransform=!1;i.transformCalls=0;i.parent=t};i.isLastTransformCall=function(){return i.transformCalls>=i.children.length};i.isComponentInside=function(n){return Helpers.isComponentInsideComponent(n.component,i.component)};i.setParent=function(n){i.parent=n};i.addChild=function(n){n.setParent(i);i.children.push(n)};i.isHaveComponentChildren=function(){return i.component.children.length};i.getHeightChildren=function(){var n=0,t=10;return _.forEach(i.children,function(i){var u=i.component,f=i.getHeightChildren(),r=u.getProperty(HEIGHT);r=parseInt(r?r.value:TransformFactory.staticHeightComponent(u));f>r?(u.setProperty(HEIGHT,f+"px"),n+=t+f):n+=t+r}),n};i.checkHeight=function(){var n=i.getHeightChildren();parseInt(i.component.getProperty(HEIGHT).value)<n&&i.component.setProperty(HEIGHT,n+"px")};n&&i.init(n,t)};TransformFactory.wrapComponent=function(n){var t=new TransformComponent(n);return t.isHaveComponentChildren()&&_.forEach(n.children,function(n){t.addChild(TransformFactory.wrapComponent(n))}),t};TransformFactory.transformMobileOrder=function(n,t){t=t?t:UI.getDevice().getId();var i=TransformFactory.wrapComponent(n);TransformFactory.runTransformMobileOrder(i,t)};TransformFactory.runTransformMobileOrder=function(n,t){t=t?t:UI.getDevice().getId();n.children.length?_.forEach(n.children,function(n){TransformFactory.runTransformMobileOrder(n,t)}):n.parent&&!n.parent.isTransform&&TransformFactory.transformMobileOrderSorting(n.parent,t)};TransformFactory.sortAndSet=function(n,t,i){i=i?i:UI.getDevice().getId();t=t?t:0;var r=t,u=10;return _.forEach(n,function(n){var t=n.component,e=r+u,f;t.proto.name===PANEL&&n.checkHeight();f=t.getProperty(HEIGHT,i);r=e+parseInt(f?f.value:TransformFactory.staticHeightComponent(t));t.setProperty(TOP,e+"px",!1,i);t.setProperty(LEFT,u+"px",!1,i)}),r-t+u};TransformFactory.sortByList=function(n){var t={};return t[STORE_PRODUCT_TITLE]=1,t[STORE_PRODUCT_SKU]=2,t[STORE_PRODUCT_PRICE]=3,t[STORE_PRODUCT_IMAGES]=4,t[STORE_PRODUCT_DESCRIPTION]=5,t[STORE_PRODUCT_OPTIONS]=6,t[STORE_PRODUCT_QUANTITY]=7,t[STORE_PRODUCT_ADD_TO_CART]=8,t[STORE_PRODUCT_SOCIAL]=9,_.sortBy(n,function(n){return t[n.component.proto.name]})};TransformFactory.sortByTop=function(n){return _.sortBy(n,function(n){var i=n.component,t=i.getProperty(TOP,UI.getDefaultDeviceId());if(t!=null)return parseInt(t.value);throw new Error("Does not have TOP property");})};TransformFactory.transformMobileOrderSorting=function(n,t){var i,r,u,f;t=t?t:UI.getDevice().getId();n.component.proto.name===PAGE_COMPONENT||n.component.proto.name===HEADER||n.component.proto.name===FOOTER||n.component.proto.name===FORM||n.component.proto.name===STORE_PRODUCT?(i=n.component.proto.name===STORE_PRODUCT?TransformFactory.sortByList(n.children):TransformFactory.sortByTop(n.children),n.component.proto.name!==PAGE_COMPONENT&&n.component.proto.name!==HEADER&&n.component.proto.name!==FOOTER?(r=TransformFactory.sortAndSet(i,n.component.proto.name===STORE_PRODUCT?25:0),n.component.proto.name===STORE_PRODUCT&&parseInt(n.component.getProperty(HEIGHT).value)>r||n.component.setProperty(HEIGHT,r+"px"),n.isTransform=!0,TransformFactory.transformMobileOrderSorting(n.parent,t)):(n.transformCalls++,n.isLastTransformCall()&&(i=_.sortBy(i,function(n){return n.component.proto.name!==PANEL}),u=function(n,t){for(var i,f,e,r=0;r<t.length-1;r++)if(i=t[r],i&&i.component.proto.name===PANEL){for(f=r+1;f<t.length;f++)e=t[f],e&&i.isComponentInside(e)&&(i.addChild(e),t[f]=null);u(i,i.children)}n.children=_.compact(t)},u(n,i),f=function(n){var r,t,i,u;n.children.length&&(n.isTransform||n.component.proto.name!==PAGE_COMPONENT&&n.component.proto.name!==HEADER&&n.component.proto.name!==FOOTER&&n.component.proto.name!==PANEL||(r=TransformFactory.sortByTop(n.children),t=n.component.getProperty(TOP),n.component.proto.name===FOOTER&&(t=null),i=TransformFactory.sortAndSet(r,parseInt(t!=null?t.value:0)),parseInt(n.component.getProperty(HEIGHT).value)<i&&(n.component.setProperty(HEIGHT,i+"px"),n.component.proto.name===HEADER&&(u=UI.getMain(),u.setProperty(TOP,i+"px"))),n.isTransform=!0),_.forEach(n.children,function(n){n.children.length&&f(n)}))},f(n)))):(Helpers.isGalleryComponent(n.component)||n.component.proto.name===STORE_GALLERY||n.component.proto.name===STORE_CART)&&(n.isTransform=!0,TransformFactory.transformMobileOrderSorting(n.parent,t))};TransformFactory.getLastChildByTop=function(n,t,i){return i=i?i:UI.getDevice().getId(),_.last(_.sortBy(n.children,function(n){var r;if(t)if(n.id!==t){if(r=n.getProperty(TOP,i),r!=null)return parseInt(r.value);throw new Error("Does not have TOP property");}else return-1;else{if(r=n.getProperty(TOP,i),r!=null)return parseInt(r.value);throw new Error("Does not have TOP property");}}))};TransformFactory.checkMinSizeContainer=function(n,t){var i,h,e;if(t=t?t:UI.getDevice().getId(),i=TransformFactory.getLastChildByTop(n,!1,t),i!=null){var f=10,r=parseInt(i.getProperty(TOP,t).value),o=i.getProperty(HEIGHT,t),u=parseInt(o?o.value:TransformFactory.staticHeightComponent(i)),s=n.getProperty(HEIGHT,t),c=parseInt(s?s.value:TransformFactory.staticHeightComponent(n));c<r+u&&(n.setProperty(HEIGHT,r+u+f+"px",!1,t),n.proto.name===HEADER?(h=UI.getMain(),h.setProperty(TOP,r+u+f+"px",!1,t)):n.proto.name===FORM&&(e=parseInt(n.getProperty(TOP).value)+r+u+f*2,e>parseInt(n.parentComponent.getProperty(HEIGHT,t).value)&&n.parentComponent.setProperty(HEIGHT,e+"px",!1,t)))}};TransformFactory.setNewPosition=function(n){n.proto.name!=="page"&&n.proto.name!=="header"&&n.proto.name!=="footer"&&n.proto.name!=="main"&&n.proto.name!=="body"&&_.forEach(UI.getTemplateProperty("devices"),function(t){var u,f,i,e;if(t!==UI.getDefaultDeviceId()&&(u=UI.getDevice(t),u.isHaveComponentProperties()||Device.setDeviceRequest(u),TransformFactory.runTransform(n,t),f=10,i=n.parentComponent,i!=null)){var r=TransformFactory.getLastChildByTop(i,n.id,t),o=0,s=0;r!=null&&i.children.length>1&&(o=parseInt(r.getProperty(TOP,t).value),e=r.getProperty(HEIGHT,t),s=parseInt(e?e.value:TransformFactory.staticHeightComponent(r)));n.setProperty(TOP,o+s+f+"px",!1,t);n.setProperty(LEFT,f+"px",!1,t);TransformFactory.checkMinSizeContainer(i,t)}})};TransformFactory.refreshStoreProductContainer=function(n,t){_.forEach(UI.getTemplateProperty("devices"),function(i){var r,u;i!==UI.getDefaultDeviceId()&&(r=UI.getDevice(i),r.isHaveComponentProperties()||Device.setDeviceRequest(r),t&&TransformFactory.runTransform(t,i),u=_.map(n.children,function(t){return new TransformComponent(t,n)}),TransformFactory.sortAndSet(TransformFactory.sortByList(u),25,i))})};TransformFactory.runTransform=function(n,t,i){t=t?t:UI.getDevice().getId();TransformFactory.rules[t]&&(n.children&&n.children.length&&_.forEach(n.children,function(n){TransformFactory.runTransform(n)}),TransformFactory.rules[t][n.proto.name]&&_.forEach(_.keys(TransformFactory.rules[t][n.proto.name]),function(i){TransformFactory.rules[t][n.proto.name][i](n,i,t)}),UI.hasDeviceIdInTemplateData(t)||n.proto.name==="body"&&(TransformFactory.transformMobileOrder(n,t),UI.addDeviceIdToTemplateData(t)),i&&TransformFactory.transformMobileOrder(n,t))};TransformFactory.rules={"6de56cf1-91c5-4cb8-bc6c-f4cfb4904750":{body:{"z-index":function(n,t,i){var r=parseInt(n.getProperty(Z_INDEX,UI.getDefaultDeviceId()).value);n.addPropertyIfNotExists(t,i,r)},"only-desktop":function(n,t,i){n.removeProperty(t,i)}},header:{"z-index":function(n,t,i){var r=parseInt(n.getProperty(Z_INDEX,UI.getDefaultDeviceId()).value);n.addPropertyIfNotExists(t,i,r)},height:function(n,t,i){n.addPropertyIfNotExists(t,i)}},footer:{top:function(n,t,i){n.addPropertyIfNotExists(t,i)},"z-index":function(n,t,i){var r=parseInt(n.getProperty(Z_INDEX,UI.getDefaultDeviceId()).value);n.addPropertyIfNotExists(t,i,r)},height:function(n,t,i){n.addPropertyIfNotExists(t,i)}},main:{top:function(n,t,i){n.addPropertyIfNotExists(t,i)},"z-index":function(n,t,i){var r=parseInt(n.getProperty(Z_INDEX,UI.getDefaultDeviceId()).value);n.addPropertyIfNotExists(t,i,r)},height:function(n,t,i){n.addPropertyIfNotExists(t,i)}},page:{"z-index":function(n,t,i){var r=parseInt(n.getProperty(Z_INDEX,UI.getDefaultDeviceId()).value);n.addPropertyIfNotExists(t,i,r)},height:function(n,t,i){n.addPropertyIfNotExists(t,i)}},menu:{top:function(n,t,i){n.addPropertyIfNotExists(t,i)},left:function(n,t,i){n.addPropertyIfNotExists(t,i)},"z-index":function(n,t,i){var r=parseInt(n.getProperty(Z_INDEX,UI.getDefaultDeviceId()).value);n.addPropertyIfNotExists(t,i,r)},height:function(n,t,i){n.addPropertyIfNotExists(t,i)},width:function(n,t,i){n.addPropertyIfNotExists(t,i,"300px")},"font-size":function(n,t,i){n.addPropertyIfNotExists(t,i)},"border-width":function(n,t,i){var r=n.getProperty(BORDER_WIDTH,UI.getDefaultDeviceId()).value;n.addPropertyIfNotExists(t,i,r)},"border-color":function(n,t,i){var r=n.getProperty(BORDER_COLOR,UI.getDefaultDeviceId()).value;n.addPropertyIfNotExists(t,i,r)}},button:{top:function(n,t,i){n.addPropertyIfNotExists(t,i)},left:function(n,t,i){n.addPropertyIfNotExists(t,i)},"z-index":function(n,t,i){var r=parseInt(n.getProperty(Z_INDEX,UI.getDefaultDeviceId()).value);n.addPropertyIfNotExists(t,i,r)},height:function(n,t,i){n.addPropertyIfNotExists(t,i)},width:function(n,t,i){n.addPropertyIfNotExists(t,i,"300px")}},"house-photo-tour":{height:function(n,t,i){n.addPropertyIfNotExists(t,i)},width:function(n,t,i){n.addPropertyIfNotExists(t,i,"300px")},top:function(n,t,i){n.addPropertyIfNotExists(t,i)},left:function(n,t,i){n.addPropertyIfNotExists(t,i)},"z-index":function(n,t,i){var r=parseInt(n.getProperty(Z_INDEX,UI.getDefaultDeviceId()).value);n.addPropertyIfNotExists(t,i,r)},"caption-position":function(n,t,i){n.addPropertyIfNotExists(t,i,"top")}},"house-photo-tour-item":{"z-index":function(n,t,i){var r=parseInt(n.getProperty(Z_INDEX,UI.getDefaultDeviceId()).value);n.addPropertyIfNotExists(t,i,r)}},sound:{top:function(n,t,i){n.addPropertyIfNotExists(t,i)},left:function(n,t,i){n.addPropertyIfNotExists(t,i)},"z-index":function(n,t,i){var r=parseInt(n.getProperty(Z_INDEX,UI.getDefaultDeviceId()).value);n.addPropertyIfNotExists(t,i,r)}},"evaluate-home":{height:function(n,t,i){var r=850,u=n.getProperty(USE_CAPTCHA,UI.getDefaultDeviceId()).value.toBoolean();n.addPropertyIfNotExists(t,i,(u?r+150:r)+"px")},width:function(n,t,i){n.addPropertyIfNotExists(t,i,"300px")},top:function(n,t,i){n.addPropertyIfNotExists(t,i)},left:function(n,t,i){n.addPropertyIfNotExists(t,i)},"z-index":function(n,t,i){var r=parseInt(n.getProperty(Z_INDEX,UI.getDefaultDeviceId()).value);n.addPropertyIfNotExists(t,i,r)}},"contact-us":{height:function(n,t,i){var u=n.getProperty(TYPE,UI.getDefaultDeviceId()).value,r,f=n.getProperty(USE_CAPTCHA,UI.getDefaultDeviceId()).value.toBoolean();u==="Request a quote"?(r=450,n.addPropertyIfNotExists(t,i,(f?r+150:r)+"px")):u==="Make an Appointment"&&(r=830,n.addPropertyIfNotExists(t,i,(f?r+150:r)+"px"))},width:function(n,t,i){n.addPropertyIfNotExists(t,i,"300px")},top:function(n,t,i){n.addPropertyIfNotExists(t,i)},left:function(n,t,i){n.addPropertyIfNotExists(t,i)},"z-index":function(n,t,i){var r=parseInt(n.getProperty(Z_INDEX,UI.getDefaultDeviceId()).value);n.addPropertyIfNotExists(t,i,r)}},gallery:{height:function(n,t,i){n.addPropertyIfNotExists(t,i)},width:function(n,t,i){n.addPropertyIfNotExists(t,i,"300px")},top:function(n,t,i){n.addPropertyIfNotExists(t,i)},left:function(n,t,i){n.addPropertyIfNotExists(t,i)},"z-index":function(n,t,i){var r=parseInt(n.getProperty(Z_INDEX,UI.getDefaultDeviceId()).value);n.addPropertyIfNotExists(t,i,r)},"caption-position":function(n,t,i){n.addPropertyIfNotExists(t,i,"bottom")},"image-stretching":function(n,t,i){var r=n.getProperty(IMAGE_STRETCHING).value;n.addPropertyIfNotExists(t,i,r)}},"gallery-item":{"z-index":function(n,t,i){var r=parseInt(n.getProperty(Z_INDEX,UI.getDefaultDeviceId()).value);n.addPropertyIfNotExists(t,i,r)}},div:{height:function(n,t,i){n.addPropertyIfNotExists(t,i)},width:function(n,t,i){n.addPropertyIfNotExists(t,i,"300px")},top:function(n,t,i){n.addPropertyIfNotExists(t,i)},left:function(n,t,i){n.addPropertyIfNotExists(t,i)},"z-index":function(n,t,i){var r=parseInt(n.getProperty(Z_INDEX,UI.getDefaultDeviceId()).value);n.addPropertyIfNotExists(t,i,r)}},img:{height:function(n,t,i){var r=parseInt(n.getProperty(WIDTH,UI.getDefaultDeviceId()).value),u=parseInt(n.getProperty(HEIGHT,UI.getDefaultDeviceId()).value);r>300?n.addPropertyIfNotExists(t,i,parseInt(300*u/r)+"px"):n.addPropertyIfNotExists(t,i,u+"px")},width:function(n,t,i){var r=parseInt(n.getProperty(WIDTH,UI.getDefaultDeviceId()).value);r>300?n.addPropertyIfNotExists(t,i,"300px"):n.addPropertyIfNotExists(t,i,r+"px")},top:function(n,t,i){n.addPropertyIfNotExists(t,i)},left:function(n,t,i){n.addPropertyIfNotExists(t,i)},"z-index":function(n,t,i){var r=parseInt(n.getProperty(Z_INDEX,UI.getDefaultDeviceId()).value);n.addPropertyIfNotExists(t,i,r)}},anchor:{top:function(n,t,i){n.addPropertyIfNotExists(t,i)},left:function(n,t,i){n.addPropertyIfNotExists(t,i)},"z-index":function(n,t,i){var r=parseInt(n.getProperty(Z_INDEX,UI.getDefaultDeviceId()).value);n.addPropertyIfNotExists(t,i,r)}},slideshow:{height:function(n,t,i){n.addPropertyIfNotExists(t,i)},width:function(n,t,i){n.addPropertyIfNotExists(t,i,"300px")},top:function(n,t,i){n.addPropertyIfNotExists(t,i)},left:function(n,t,i){n.addPropertyIfNotExists(t,i)},"z-index":function(n,t,i){var r=parseInt(n.getProperty(Z_INDEX,UI.getDefaultDeviceId()).value);n.addPropertyIfNotExists(t,i,r)},"caption-position":function(n,t,i){n.addPropertyIfNotExists(t,i,"bottom")}},"mortgage-calculator":{top:function(n,t,i){n.addPropertyIfNotExists(t,i)},left:function(n,t,i){n.addPropertyIfNotExists(t,i)},"z-index":function(n,t,i){var r=parseInt(n.getProperty(Z_INDEX,UI.getDefaultDeviceId()).value);n.addPropertyIfNotExists(t,i,r)},height:function(n,t,i){n.addPropertyIfNotExists(t,i,"600px")},width:function(n,t,i){n.addPropertyIfNotExists(t,i,"300px")}},link:{"z-index":function(n,t,i){var r=parseInt(n.getProperty(Z_INDEX,UI.getDefaultDeviceId()).value);n.addPropertyIfNotExists(t,i,r)}},"html-container":{height:function(n,t,i){n.addPropertyIfNotExists(t,i)},width:function(n,t,i){n.addPropertyIfNotExists(t,i,"300px")},top:function(n,t,i){n.addPropertyIfNotExists(t,i)},left:function(n,t,i){n.addPropertyIfNotExists(t,i)},"z-index":function(n,t,i){var r=parseInt(n.getProperty(Z_INDEX,UI.getDefaultDeviceId()).value);n.addPropertyIfNotExists(t,i,r)},"border-width":function(n,t,i){var r=n.getProperty(BORDER_WIDTH,UI.getDefaultDeviceId()).value;n.addPropertyIfNotExists(t,i,r)},"border-color":function(n,t,i){var r=n.getProperty(BORDER_COLOR,UI.getDefaultDeviceId()).value;n.addPropertyIfNotExists(t,i,r)}},frame:{height:function(n,t,i){var r=parseInt(n.getProperty(WIDTH,UI.getDefaultDeviceId()).value),u=parseInt(n.getProperty(HEIGHT,UI.getDefaultDeviceId()).value);r>300?n.addPropertyIfNotExists(t,i,parseInt(300*u/r)+"px"):n.addPropertyIfNotExists(t,i,u+"px")},width:function(n,t,i){var r=parseInt(n.getProperty(WIDTH,UI.getDefaultDeviceId()).value);r>300?n.addPropertyIfNotExists(t,i,"300px"):n.addPropertyIfNotExists(t,i,r+"px")},top:function(n,t,i){n.addPropertyIfNotExists(t,i)},left:function(n,t,i){n.addPropertyIfNotExists(t,i)},"z-index":function(n,t,i){var r=parseInt(n.getProperty(Z_INDEX,UI.getDefaultDeviceId()).value);n.addPropertyIfNotExists(t,i,r)}},heading:{top:function(n,t,i){n.addPropertyIfNotExists(t,i)},left:function(n,t,i){n.addPropertyIfNotExists(t,i)},"z-index":function(n,t,i){var r=parseInt(n.getProperty(Z_INDEX,UI.getDefaultDeviceId()).value);n.addPropertyIfNotExists(t,i,r)},height:function(n,t,i){n.addPropertyIfNotExists(t,i)},width:function(n,t,i){n.addPropertyIfNotExists(t,i,"300px")}},map:{top:function(n,t,i){n.addPropertyIfNotExists(t,i)},left:function(n,t,i){n.addPropertyIfNotExists(t,i)},"z-index":function(n,t,i){var r=parseInt(n.getProperty(Z_INDEX,UI.getDefaultDeviceId()).value);n.addPropertyIfNotExists(t,i,r)},height:function(n,t,i){var r=parseInt(n.getProperty(HEIGHT,UI.getDefaultDeviceId()).value),u=parseInt(n.getProperty(WIDTH,UI.getDefaultDeviceId()).value),f=parseInt(r*300/u);n.addPropertyIfNotExists(t,i,f+"px")},width:function(n,t,i){n.addPropertyIfNotExists(t,i,"300px")}},headertext:{top:function(n,t,i){n.addPropertyIfNotExists(t,i)},left:function(n,t,i){n.addPropertyIfNotExists(t,i)},"z-index":function(n,t,i){var r=parseInt(n.getProperty(Z_INDEX,UI.getDefaultDeviceId()).value);n.addPropertyIfNotExists(t,i,r)},height:function(n,t,i){var r=parseInt(n.getProperty(HEIGHT,UI.getDefaultDeviceId()).value),u=parseInt(n.getProperty(WIDTH,UI.getDefaultDeviceId()).value),f=parseInt(u/300*r);n.addPropertyIfNotExists(t,i,f+"px")},width:function(n,t,i){n.addPropertyIfNotExists(t,i,"300px")},text:function(n,t,i){var r=n.getProperty(TEXT,UI.getDefaultDeviceId()).value;n.addPropertyIfNotExists(t,i,r)},"border-width":function(n,t,i){n.addPropertyIfNotExists(t,i,"0px")},"border-color":function(n,t,i){var r=n.getProperty(BORDER_COLOR,UI.getDefaultDeviceId()).value;n.addPropertyIfNotExists(t,i,r)}},paragraph:{top:function(n,t,i){n.addPropertyIfNotExists(t,i)},left:function(n,t,i){n.addPropertyIfNotExists(t,i)},"z-index":function(n,t,i){var r=parseInt(n.getProperty(Z_INDEX,UI.getDefaultDeviceId()).value);n.addPropertyIfNotExists(t,i,r)},height:function(n,t,i){var r=parseInt(n.getProperty(HEIGHT,UI.getDefaultDeviceId()).value),u=parseInt(n.getProperty(WIDTH,UI.getDefaultDeviceId()).value),f=parseInt(u/300*r);n.addPropertyIfNotExists(t,i,f+"px")},width:function(n,t,i){n.addPropertyIfNotExists(t,i,"300px")},text:function(n,t,i){var r=n.getProperty(TEXT,UI.getDefaultDeviceId()).value;n.addPropertyIfNotExists(t,i,r)},"border-width":function(n,t,i){n.addPropertyIfNotExists(t,i,"0px")},"border-color":function(n,t,i){var r=n.getProperty(BORDER_COLOR,UI.getDefaultDeviceId()).value;n.addPropertyIfNotExists(t,i,r)}},list:{top:function(n,t,i){n.addPropertyIfNotExists(t,i)},left:function(n,t,i){n.addPropertyIfNotExists(t,i)},"z-index":function(n,t,i){var r=parseInt(n.getProperty(Z_INDEX,UI.getDefaultDeviceId()).value);n.addPropertyIfNotExists(t,i,r)},height:function(n,t,i){var r=parseInt(n.getProperty(WIDTH,UI.getDefaultDeviceId()).value),u=parseInt(n.getProperty(HEIGHT,UI.getDefaultDeviceId()).value);r>300?n.addPropertyIfNotExists(t,i,parseInt(r*u/300)+"px"):n.addPropertyIfNotExists(t,i,u+"px")},width:function(n,t,i){var r=parseInt(n.getProperty(WIDTH,UI.getDefaultDeviceId()).value);r>300?n.addPropertyIfNotExists(t,i,"300px"):n.addPropertyIfNotExists(t,i,r+"px")},"font-size":function(n,t,i){n.addPropertyIfNotExists(t,i)}},"list-item":{"z-index":function(n,t,i){var r=parseInt(n.getProperty(Z_INDEX,UI.getDefaultDeviceId()).value);n.addPropertyIfNotExists(t,i,r)}},pdf:{top:function(n,t,i){n.addPropertyIfNotExists(t,i)},left:function(n,t,i){n.addPropertyIfNotExists(t,i)},"z-index":function(n,t,i){var r=parseInt(n.getProperty(Z_INDEX,UI.getDefaultDeviceId()).value);n.addPropertyIfNotExists(t,i,r)},height:function(n,t,i){var r=parseInt(n.getProperty(WIDTH,UI.getDefaultDeviceId()).value),u=parseInt(n.getProperty(HEIGHT,UI.getDefaultDeviceId()).value);r>300?n.addPropertyIfNotExists(t,i,parseInt(300*u/r)+"px"):n.addPropertyIfNotExists(t,i,u+"px")},width:function(n,t,i){var r=parseInt(n.getProperty(WIDTH,UI.getDefaultDeviceId()).value);r>300?n.addPropertyIfNotExists(t,i,"300px"):n.addPropertyIfNotExists(t,i,r+"px")}},video:{top:function(n,t,i){n.addPropertyIfNotExists(t,i)},left:function(n,t,i){n.addPropertyIfNotExists(t,i)},"z-index":function(n,t,i){var r=parseInt(n.getProperty(Z_INDEX,UI.getDefaultDeviceId()).value);n.addPropertyIfNotExists(t,i,r)},height:function(n,t,i){var r=parseInt(n.getProperty(WIDTH,UI.getDefaultDeviceId()).value),u=parseInt(n.getProperty(HEIGHT,UI.getDefaultDeviceId()).value);r>300?n.addPropertyIfNotExists(t,i,parseInt(300*u/r)+"px"):n.addPropertyIfNotExists(t,i,u+"px")},width:function(n,t,i){var r=parseInt(n.getProperty(WIDTH,UI.getDefaultDeviceId()).value);r>300?n.addPropertyIfNotExists(t,i,"300px"):n.addPropertyIfNotExists(t,i,r+"px")}},form:{top:function(n,t,i){n.addPropertyIfNotExists(t,i)},left:function(n,t,i){n.addPropertyIfNotExists(t,i)},"z-index":function(n,t,i){var r=parseInt(n.getProperty(Z_INDEX,UI.getDefaultDeviceId()).value);n.addPropertyIfNotExists(t,i,r)},height:function(n,t,i){n.addPropertyIfNotExists(t,i)},width:function(n,t,i){n.addPropertyIfNotExists(t,i,"300px")},"border-width":function(n,t,i){var r=n.getProperty(BORDER_WIDTH,UI.getDefaultDeviceId()).value;n.addPropertyIfNotExists(t,i,r)},"border-color":function(n,t,i){var r=n.getProperty(BORDER_COLOR,UI.getDefaultDeviceId()).value;n.addPropertyIfNotExists(t,i,r)}},_checkbox:{height:function(n,t,i){n.addPropertyIfNotExists(t,i)},width:function(n,t,i){n.addPropertyIfNotExists(t,i)},top:function(n,t,i){n.addPropertyIfNotExists(t,i)},left:function(n,t,i){n.addPropertyIfNotExists(t,i)},"z-index":function(n,t,i){var r=parseInt(n.getProperty(Z_INDEX,UI.getDefaultDeviceId()).value);n.addPropertyIfNotExists(t,i,r)}},_submit:{height:function(n,t,i){n.addPropertyIfNotExists(t,i)},width:function(n,t,i){n.addPropertyIfNotExists(t,i,"280px")},top:function(n,t,i){n.addPropertyIfNotExists(t,i)},left:function(n,t,i){n.addPropertyIfNotExists(t,i)},"z-index":function(n,t,i){var r=parseInt(n.getProperty(Z_INDEX,UI.getDefaultDeviceId()).value);n.addPropertyIfNotExists(t,i,r)}},"_editor-item":{},"_radio-list":{height:function(n,t,i){n.addPropertyIfNotExists(t,i)},width:function(n,t,i){n.addPropertyIfNotExists(t,i,"280px")},top:function(n,t,i){n.addPropertyIfNotExists(t,i)},left:function(n,t,i){n.addPropertyIfNotExists(t,i)},"z-index":function(n,t,i){var r=parseInt(n.getProperty(Z_INDEX,UI.getDefaultDeviceId()).value);n.addPropertyIfNotExists(t,i,r)}},_textarea:{height:function(n,t,i){n.addPropertyIfNotExists(t,i)},width:function(n,t,i){n.addPropertyIfNotExists(t,i,"280px")},top:function(n,t,i){n.addPropertyIfNotExists(t,i)},left:function(n,t,i){n.addPropertyIfNotExists(t,i)},"z-index":function(n,t,i){var r=parseInt(n.getProperty(Z_INDEX,UI.getDefaultDeviceId()).value);n.addPropertyIfNotExists(t,i,r)}},_label:{height:function(n,t,i){n.addPropertyIfNotExists(t,i)},width:function(n,t,i){n.addPropertyIfNotExists(t,i,"280px")},top:function(n,t,i){n.addPropertyIfNotExists(t,i)},left:function(n,t,i){n.addPropertyIfNotExists(t,i)},"z-index":function(n,t,i){var r=parseInt(n.getProperty(Z_INDEX,UI.getDefaultDeviceId()).value);n.addPropertyIfNotExists(t,i,r)}},_captcha:{height:function(n,t,i){n.addPropertyIfNotExists(t,i,"136px")},width:function(n,t,i){n.addPropertyIfNotExists(t,i,"156px")},top:function(n,t,i){n.addPropertyIfNotExists(t,i)},left:function(n,t,i){n.addPropertyIfNotExists(t,i)},"z-index":function(n,t,i){var r=parseInt(n.getProperty(Z_INDEX,UI.getDefaultDeviceId()).value);n.addPropertyIfNotExists(t,i,r)}},_textbox:{height:function(n,t,i){n.addPropertyIfNotExists(t,i)},width:function(n,t,i){n.addPropertyIfNotExists(t,i,"280px")},top:function(n,t,i){n.addPropertyIfNotExists(t,i)},left:function(n,t,i){n.addPropertyIfNotExists(t,i)},"z-index":function(n,t,i){var r=parseInt(n.getProperty(Z_INDEX,UI.getDefaultDeviceId()).value);n.addPropertyIfNotExists(t,i,r)}},"_select-list":{height:function(n,t,i){n.addPropertyIfNotExists(t,i)},width:function(n,t,i){n.addPropertyIfNotExists(t,i,"280px")},top:function(n,t,i){n.addPropertyIfNotExists(t,i)},left:function(n,t,i){n.addPropertyIfNotExists(t,i)},"z-index":function(n,t,i){var r=parseInt(n.getProperty(Z_INDEX,UI.getDefaultDeviceId()).value);n.addPropertyIfNotExists(t,i,r)}},signin:{top:function(n,t,i){n.addPropertyIfNotExists(t,i)},left:function(n,t,i){n.addPropertyIfNotExists(t,i)},"z-index":function(n,t,i){var r=parseInt(n.getProperty(Z_INDEX,UI.getDefaultDeviceId()).value);n.addPropertyIfNotExists(t,i,r)},height:function(n,t,i){n.addPropertyIfNotExists(t,i)},width:function(n,t,i){n.addPropertyIfNotExists(t,i,"300px")}},store:{},"store-cart":{top:function(n,t,i){n.addPropertyIfNotExists(t,i)},left:function(n,t,i){n.addPropertyIfNotExists(t,i)},"z-index":function(n,t,i){var r=parseInt(n.getProperty(Z_INDEX,UI.getDefaultDeviceId()).value);n.addPropertyIfNotExists(t,i,r)},height:function(n,t,i){n.addPropertyIfNotExists(t,i)},width:function(n,t,i){n.addPropertyIfNotExists(t,i,"300px")}},"store-cart-link":{top:function(n,t,i){n.addPropertyIfNotExists(t,i)},left:function(n,t,i){n.addPropertyIfNotExists(t,i)},"z-index":function(n,t,i){var r=parseInt(n.getProperty(Z_INDEX,UI.getDefaultDeviceId()).value);n.addPropertyIfNotExists(t,i,r)},height:function(n,t,i){n.addPropertyIfNotExists(t,i)},width:function(n,t,i){n.addPropertyIfNotExists(t,i)}},"store-thank-you":{top:function(n,t,i){n.addPropertyIfNotExists(t,i)},left:function(n,t,i){n.addPropertyIfNotExists(t,i)},"z-index":function(n,t,i){var r=parseInt(n.getProperty(Z_INDEX,UI.getDefaultDeviceId()).value);n.addPropertyIfNotExists(t,i,r)},height:function(n,t,i){n.addPropertyIfNotExists(t,i,"680px")},width:function(n,t,i){n.addPropertyIfNotExists(t,i,"300px")}},"manage-store-products":{top:function(n,t,i){n.addPropertyIfNotExists(t,undefined,i)},left:function(n,t,i){n.addPropertyIfNotExists(t,i)},"z-index":function(n,t,i){var r=parseInt(n.getProperty(Z_INDEX,UI.getDefaultDeviceId()).value);n.addPropertyIfNotExists(t,i,r)},height:function(n,t,i){n.addPropertyIfNotExists(t,i)},width:function(n,t,i){n.addPropertyIfNotExists(t,i,"300px")}},"store-product":{top:function(n,t,i){n.addPropertyIfNotExists(t,i)},left:function(n,t,i){n.addPropertyIfNotExists(t,i)},"z-index":function(n,t,i){var r=parseInt(n.getProperty(Z_INDEX,UI.getDefaultDeviceId()).value);n.addPropertyIfNotExists(t,i,r)},height:function(n,t,i){n.addPropertyIfNotExists(t,i,"1200px")},width:function(n,t,i){n.addPropertyIfNotExists(t,i,"300px")}},"store-product-add-to-cart":{top:function(n,t,i){n.addPropertyIfNotExists(t,i)},left:function(n,t,i){n.addPropertyIfNotExists(t,i)},"z-index":function(n,t,i){var r=parseInt(n.getProperty(Z_INDEX,UI.getDefaultDeviceId()).value);n.addPropertyIfNotExists(t,i,r)},height:function(n,t,i){n.addPropertyIfNotExists(t,i)},width:function(n,t,i){n.addPropertyIfNotExists(t,i,"280px")}},"store-product-description":{top:function(n,t,i){n.addPropertyIfNotExists(t,i)},left:function(n,t,i){n.addPropertyIfNotExists(t,i)},"z-index":function(n,t,i){var r=parseInt(n.getProperty(Z_INDEX,UI.getDefaultDeviceId()).value);n.addPropertyIfNotExists(t,i,r)},height:function(n,t,i){n.addPropertyIfNotExists(t,i)},width:function(n,t,i){n.addPropertyIfNotExists(t,i,"280px")}},"store-product-images":{top:function(n,t,i){n.addPropertyIfNotExists(t,i)},left:function(n,t,i){n.addPropertyIfNotExists(t,i)},"z-index":function(n,t,i){var r=parseInt(n.getProperty(Z_INDEX,UI.getDefaultDeviceId()).value);n.addPropertyIfNotExists(t,i,r)},height:function(n,t,i){n.addPropertyIfNotExists(t,i)},width:function(n,t,i){n.addPropertyIfNotExists(t,i,"280px")}},"store-product-options":{top:function(n,t,i){n.addPropertyIfNotExists(t,i)},left:function(n,t,i){n.addPropertyIfNotExists(t,i)},"z-index":function(n,t,i){var r=parseInt(n.getProperty(Z_INDEX,UI.getDefaultDeviceId()).value);n.addPropertyIfNotExists(t,i,r)},height:function(n,t,i){n.addPropertyIfNotExists(t,i)},width:function(n,t,i){n.addPropertyIfNotExists(t,i,"280px")}},"store-product-price":{top:function(n,t,i){n.addPropertyIfNotExists(t,i)},left:function(n,t,i){n.addPropertyIfNotExists(t,i)},"z-index":function(n,t,i){var r=parseInt(n.getProperty(Z_INDEX,UI.getDefaultDeviceId()).value);n.addPropertyIfNotExists(t,i,r)},height:function(n,t,i){n.addPropertyIfNotExists(t,i)},width:function(n,t,i){n.addPropertyIfNotExists(t,i,"280px")}},"store-product-quantity":{top:function(n,t,i){n.addPropertyIfNotExists(t,i)},left:function(n,t,i){n.addPropertyIfNotExists(t,i)},"z-index":function(n,t,i){var r=parseInt(n.getProperty(Z_INDEX,UI.getDefaultDeviceId()).value);n.addPropertyIfNotExists(t,i,r)},height:function(n,t,i){n.addPropertyIfNotExists(t,i)},width:function(n,t,i){n.addPropertyIfNotExists(t,i,"280px")}},"store-product-sku":{top:function(n,t,i){n.addPropertyIfNotExists(t,i)},left:function(n,t,i){n.addPropertyIfNotExists(t,i)},"z-index":function(n,t,i){var r=parseInt(n.getProperty(Z_INDEX,UI.getDefaultDeviceId()).value);n.addPropertyIfNotExists(t,i,r)},height:function(n,t,i){n.addPropertyIfNotExists(t,i)},width:function(n,t,i){n.addPropertyIfNotExists(t,i,"280px")}},"store-product-social":{top:function(n,t,i){n.addPropertyIfNotExists(t,i)},left:function(n,t,i){n.addPropertyIfNotExists(t,i)},"z-index":function(n,t,i){var r=parseInt(n.getProperty(Z_INDEX,UI.getDefaultDeviceId()).value);n.addPropertyIfNotExists(t,i,r)},height:function(n,t,i){n.addPropertyIfNotExists(t,i)},width:function(n,t,i){n.addPropertyIfNotExists(t,i,"280px")}},"store-product-title":{top:function(n,t,i){n.addPropertyIfNotExists(t,i)},left:function(n,t,i){n.addPropertyIfNotExists(t,i)},"z-index":function(n,t,i){var r=parseInt(n.getProperty(Z_INDEX,UI.getDefaultDeviceId()).value);n.addPropertyIfNotExists(t,i,r)},height:function(n,t,i){n.addPropertyIfNotExists(t,i)},width:function(n,t,i){n.addPropertyIfNotExists(t,i,"280px")}},"store-gallery":{top:function(n,t,i){n.addPropertyIfNotExists(t,i)},left:function(n,t,i){n.addPropertyIfNotExists(t,i)},"z-index":function(n,t,i){var r=parseInt(n.getProperty(Z_INDEX,UI.getDefaultDeviceId()).value);n.addPropertyIfNotExists(t,i,r)},height:function(n,t,i){var r=parseInt(n.getProperty(ROWS,UI.getDefaultDeviceId()).value),u=parseInt(n.getProperty(COLUMNS,UI.getDefaultDeviceId()).value),f=(parseInt(n.getProperty(HEIGHT,UI.getDefaultDeviceId()).value)-113)/r,e=parseInt(n.getProperty(WIDTH,UI.getDefaultDeviceId()).value)/u,o=Math.ceil(300*f/e)*2+70+43;n.addPropertyIfNotExists(t,i,o+"px")},width:function(n,t,i){n.addPropertyIfNotExists(t,i,"300px")},columns:function(n,t,i){n.addPropertyIfNotExists(t,i,"1")},rows:function(n,t,i){n.addPropertyIfNotExists(t,i,"2")}},"store-categories":{top:function(n,t,i){n.addPropertyIfNotExists(t,i)},left:function(n,t,i){n.addPropertyIfNotExists(t,i)},"z-index":function(n,t,i){var r=parseInt(n.getProperty(Z_INDEX,UI.getDefaultDeviceId()).value);n.addPropertyIfNotExists(t,i,r)},height:function(n,t,i){n.addPropertyIfNotExists(t,i)},width:function(n,t,i){n.addPropertyIfNotExists(t,i,"300px")}},blogging:{top:function(n,t,i){n.addPropertyIfNotExists(t,i)},left:function(n,t,i){n.addPropertyIfNotExists(t,i)},"z-index":function(n,t,i){var r=parseInt(n.getProperty(Z_INDEX,UI.getDefaultDeviceId()).value);n.addPropertyIfNotExists(t,i,r)},height:function(n,t,i){var r=parseInt(n.getProperty(HEIGHT,UI.getDefaultDeviceId()).value),u=parseInt(n.getProperty(WIDTH,UI.getDefaultDeviceId()).value),f=parseInt(300*r/u);n.addPropertyIfNotExists(t,i,f+"px")},width:function(n,t,i){n.addPropertyIfNotExists(t,i,"300px")}}}};ProxyService=function(){};ProxyService.send=function(n,t,i,r,u,f){var c;n=defined(n)?n:{};i=defined(i)?i:"GET";r=defined(r)?r:{};u=defined(u)?u:function(){};f=defined(f)?!!f:!1;var s=!1,o={method:i,async:!f,dataType:"json",crossDomain:!0,success:function(n){Helpers.consoleLog(i,o.url,n);n&&(n.token&&UI.authService&&UI.authService.setToken(n.token),u(n.data||{}))},error:function(n){Helpers.consoleLog(i,o.url,n);s||ProxyService.errorHandler(n)},complete:function(){Application.removeLocker()}},h=UI.getSetting("webApiDomain")+"/",e=h;switch(t){case"sign-in":e+="login";n.key&&(s=!0);break;case"sign-up":e+="registrations";break;case"sign-out":e+="logout";break;case"password":e+="password";break;case"service":e+="service/";i==="GET"&&(_.isEmpty(r)?e+=n.id:(e+="?",_.forEach(_.keys(r),function(n){e+=n+"="+r[n]+"&"})));break;case"check-token":e+="checktoken";n.token&&(o.headers={Authorization:n.token},s=!0);break;case"category":e+="category/";i==="GET"?_.isEmpty(r)?e+=n.id:(e+="?",_.forEach(_.keys(r),function(n){e+=n+"="+r[n]+"&"})):i==="DELETE"&&(_.isEmpty(r)?e+=n.id:(e+="?",_.forEach(_.keys(r),function(n){e+=n+"="+r[n]+"&"})));break;case"user":e+="user/";i==="GET"?_.isEmpty(r)?(e+=n.id,n.token&&(o.headers={Authorization:n.token},s=!0)):(e+="?",_.forEach(_.keys(r),function(n){e+=n+"="+r[n]+"&"})):i==="DELETE"&&(_.isEmpty(r)?e+=n.id:(e+="?",_.forEach(_.keys(r),function(n){e+=n+"="+r[n]+"&"})));break;case"formmail":e="/Account/GetControlFormMail/";i==="GET"?_.isEmpty(r)?e+=n.id:(e+="?",_.forEach(_.keys(r),function(n){e+=n+"="+r[n]+"&"})):i==="DELETE"&&(_.isEmpty(r)?e+=n.id:(e+="?",_.forEach(_.keys(r),function(n){e+=n+"="+r[n]+"&"})));break;case"product":e+="product/";i==="GET"?_.isEmpty(r)?e+=n.id:(e+="?",_.forEach(_.keys(r),function(n){e+=n+"="+r[n]+"&"})):i==="DELETE"&&(_.isEmpty(r)?e+=n.id:(e+="?",_.forEach(_.keys(r),function(n){e+=n+"="+r[n]+"&"})));break;case"order":e+="order/";i==="GET"?_.isEmpty(r)?e+=n.id:(e+="?",_.forEach(_.keys(r),function(n){e+=n+"="+r[n]+"&"})):i==="DELETE"&&(_.isEmpty(r)?e+=n.id:(e+="?",_.forEach(_.keys(r),function(n){e+=n+"="+r[n]+"&"})));break;case"enum":e+="enum/";i==="GET"&&(e+=n.name);break;case"taxrate":e+="taxrate/";i==="GET"?_.isEmpty(r)?e+=n.id:(e+="?",_.forEach(_.keys(r),function(n){e+=n+"="+r[n]+"&"})):i==="DELETE"&&(_.isEmpty(r)?e+=n.id:(e+="?",_.forEach(_.keys(r),function(n){e+=n+"="+r[n]+"&"})));break;case"shippingrate":e+="shippingrate/";i==="GET"?_.isEmpty(r)?e+=n.id:(e+="?",_.forEach(_.keys(r),function(n){e+=n+"="+r[n]+"&"})):i==="DELETE"&&(_.isEmpty(r)?e+=n.id:(e+="?",_.forEach(_.keys(r),function(n){e+=n+"="+r[n]+"&"})));break;case"sendemail":e+="service/sendemail";break;case"resetstore":e+="service/resetstore";break;case"storesettings":e+="storesettings";i==="GET"&&(e+="/0")}(c=function(){var n="";return UI.getSetting("ispreview")||(e.indexOf("?")!==-1?(e.slice(-1)!=="&"&&(n+="&"),n+="fake=1"):n+="?fake=1"),n},e!==h)&&(i!=="GET"?o.data='{ "data": '+JSON.stringify(n)+"}":n.fake&&(e+=c()),o.url=e,Application.addLocker(),UI.ajaxSetup(),$.ajax(o))};ProxyService.errorHandler=function(n){var t=this;t.handleStatus=function(n){switch(n.status){case 0:return"Connection error!";default:return n.statusText}};Application.showOkDialog("Error",n.responseJSON?n.responseJSON.message:t.handleStatus(n))};ActionFactory=function(){};ActionFactory.actionFor=function(n,t){if(t===ACTION_SIGN_OUT)switch(n.name){case SIGNIN:return new SignInButtonSignOutAction(n);default:return null}else if(t===ACTION_SIGN_IN)switch(n.name){case SIGNIN:return new SignInButtonSignInAction(n);default:return null}else{if(t===ACTION_ADD_TO_FORM)return new AddComponentToFormAction(n);if(t===ACTION_REMOVE_FROM_FORM)return new RemoveComponentFromFormAction(n);if(t===ACTION_EDITOR_OPEN)switch(n.name){case STORE_GALLERY:return new EditorOpenStoreGalleryAction(n);default:return null}else if(t===ACTION_EDITOR_CLOSED)switch(n.name){case STORE_GALLERY:return new EditorClosedStoreGalleryAction(n);default:return null}}};var SignInButtonSignOutAction=function(){return function(n){UI.actionService.runActionForComponent(n,ACTION_ADD_TO_FORM);$("#sign-out-block-wrapper").html("")}},SignInButtonSignInAction=function(){return function(n){UI.actionService.runActionForComponent(n,ACTION_REMOVE_FROM_FORM);Helpers.createUserBar({profile:function(){UI.componentService.addModalContentToForm(n,"#signin-profile")},signout:function(){UI.authService.logout()}})}},AddComponentToFormAction=function(){return function(n,t){var i,r=null;return n.parentComponent==null||n.parentComponent.proto.name!==FORM?(i=n.getProperty(HIDE_COMPONENT),(i==null||!i.value.toBoolean()||UI.getSetting("showHidden"))&&(n.proto.name===SIGNIN&&UI.authService&&UI.authService.isAuth()||(r=UI.componentService.addComponentToForm(n,t),n.viewer(),n.proto.name===MENU&&UI.renderMenus()))):(i=n.parentComponent.getProperty(HIDE_COMPONENT),(i==null||!i.value.toBoolean()||UI.getSetting("showHidden"))&&(r=UI.componentService.addComponentToForm(n,t),n.viewer())),r}},RemoveComponentFromFormAction=function(){return function(n){$(n.getUISelector()).remove()}},EditorOpenStoreGalleryAction=function(){return function(n){var t=$(n.getUISelector()),i=t.parent(".page"),r=Resizer.calculateContainerBottomLine(i[0],0);t.data("lastElementDiff",i.height()-r)}},EditorClosedStoreGalleryAction=function(){return function(n){var i=$(n.getUISelector()),t=i.parent(".page"),u=Resizer.calculateContainerBottomLine(t[0],0),r=parseInt(i.data("lastElementDiff")),f,e;i.data("lastElementDiff",null);r!==NaN&&t.height()-u!==r&&(f=UI.siteComponentRepository.lookupData({id:t.getId()}),e=u+r,UI.undoManagerAddSimple(f,HEIGHT,e+"px",function(n){t.height(n);Resizer.recalculateHeaderFooterAndPageSize(t[0])},!0))}},AuthService=function(){var n=this;n.token=ko.observable();n.isAuth=ko.observable();n.user=ko.observable({});n.token.subscribe(function(t){t?$.ajaxSetup({headers:{Authorization:t}}):(n.user({}),delete $.ajaxSettings.headers.Authorization);n.isAuth(!!t)});n.isAuth.subscribe(function(n){n?UI.actionService.runAction(ACTION_SIGN_IN):UI.actionService.runAction(ACTION_SIGN_OUT)});n.isAuthentificate=function(t){var f={id:Guid.empty()},r=!0,u,i;t&&(u=Helpers.getQueryParamValue("key"),i=Helpers.getQueryParamValue("resetKey"),u||i?(r=!1,n.login({key:u||i},function(){i&&UI.componentService.addModalContentToForm(null,"#signin-change-password",{resetKey:i})},!0)):LocalStorageService.GetItem("user_token")?f.token=LocalStorageService.GetItem("user_token"):r=!1);r&&ProxyService.send(f,"user","GET",{},function(t){t&&t[0]&&(n.user(new User(t[0])),n.setToken(LocalStorageService.GetItem("user_token")))},t)};n.setToken=function(t){n.token(t);t?LocalStorageService.SetItem("user_token",t):LocalStorageService.RemoveItem("user_token")};n.getToken=function(){return n.token()};n.login=function(t,i,r){r=defined(r)?r:!1;ProxyService.send(t,"sign-in","POST",{},function(){ProxyService.send({id:Guid.empty()},"user","GET",{},function(t){t&&t[0]&&(n.user(new User(t[0])),i())})},r)};n.logout=function(){ProxyService.send({},"sign-out","DELETE",{},function(){n.setToken("")})};n.signup=function(n,t){ProxyService.send(n,"sign-up","POST",{},function(){t()})};n.resetPassword=function(n){ProxyService.send(n,"password","POST",{},function(){$("#component-modal .modal .modal-body").html("Link to reset your pass was sent to your email!")})};n.changePassword=function(n,t){ProxyService.send(n,"password","PUT",{},function(){$("#component-modal .modal").modal("hide");t()})}},ViewerEventsFactory=function(){};ViewerEventsFactory.attachEvents=function(n,t,i){switch(t){case"#signin-login":return new LoginFormEvents(n);case"#signin-signup":return new SignUpFormEvents(n);case"#signin-reset-password":return new ResetPasswordFormEvents(n);case"#signin-change-password":return new ChangePasswordFormEvents(n,i);case"#signin-profile":return new ProfileFormEvents(n);case"#signin-manage-users":return new ManageUsersFormEvents(n);case MANAGE_MAILS_COMPONENT:return new ManageMailsFormEvents(n,i);case"#manage-store-products":return new ManageStoreProductsFormEvents(n);case"#signin-manage-users-current":return new ManageUsersCurrentFormEvents(n);case MANAGE_MAILS_CURRENT_COMPONENT:return new ManageMailsCurrentFormEvents(n,i);case"#signin-secure-page":return new SecurePageEvents(n);case"#signin-send-email":return new SendEmailEvents(n);default:return null}};var LoginFormEvents=function(n){$("#forgot-password").click(function(){UI.getSetting("ispublished")?UI.componentService.addModalContentToForm(n,"#signin-reset-password"):Application.showOkDialog("Error","Available only on published site!")});$("#sign-up").click(function(){UI.getSetting("ispublished")?UI.componentService.addModalContentToForm(n,"#signin-signup"):Application.showOkDialog("Error","Available only on published site!")});$("#login-form.form").submit(function(n){n.preventDefault();var t=$("#email").val(),i=$("#password").val();UI.authService.login({userName:t,password:i},function(){$("#component-modal .modal").modal("hide")})})},SignUpFormEvents=function(n){function r(){i.value!==t.value?t.setCustomValidity("Passwords Don't Match"):t.setCustomValidity("")}$("#login").click(function(){UI.componentService.addModalContentToForm(n,"#signin-login")});var u=document.getElementById("email"),i=document.getElementById("password"),t=document.getElementById("password-confirm");i.onchange=r;t.onkeyup=r;$("#signup-form.form").submit(function(t){t.preventDefault();UI.authService.signup({userName:u.value,password:i.value},function(){UI.componentService.addModalContentToForm(n,"#signin-signup-success")})})},ResetPasswordFormEvents=function(n){$("#login").click(function(){UI.componentService.addModalContentToForm(n,"#signin-login")});$("#reset-password-form.form").submit(function(n){n.preventDefault();var t=$("#email").val();UI.authService.resetPassword({userName:t})})},ChangePasswordFormEvents=function(n,t){function f(){r.value!==i.value?i.setCustomValidity("Passwords Don't Match"):i.setCustomValidity("")}var u=document.getElementById("password"),r=document.getElementById("new-password"),i=document.getElementById("password-confirm");t&&t.resetKey&&u.parentNode.remove();r.onchange=f;i.onkeyup=f;$("#profile").on("click",function(){UI.componentService.addModalContentToForm(n,"#signin-profile")});$("#change-password.form").submit(function(i){i.preventDefault();var f={newPassword:r.value};t&&t.resetKey?f.resetKey=t.resetKey:f.oldPassword=u.value;UI.authService.changePassword(f,function(){UI.componentService.addModalContentToForm(n,"#signin-profile")})})},ProfileFormEvents=function(n){var t=UI.getViewModel("#signin-profile",{component:n,user:UI.authService.user});ko.applyBindings(t,$("#user-profile")[0])},ManageUsersFormEvents=function(n){var t=UI.getViewModel("#signin-manage-users"),i;$("#component-modal .modal").on("hide.bs.modal",function(){$(".grid-mvc").gridmvc().currentPage&&(t.currentPage=$(".grid-mvc").gridmvc().currentPage)});i={updateGridAction:"/Account/CommerceUsersListGrid"};t.currentPage&&(i.currentPage=t.currentPage);$.ajax({url:i.updateGridAction,dataType:"json",success:function(r){$("#grid").html(r.Html);$(".grid-mvc").gridmvc();var u=[];$("#send-emails").on("click",function(){u.length&&(t.sendEmailTo=u,UI.componentService.addModalContentToForm(n,"#signin-send-email"))});$("#delete-users").on("click",function(){u.length&&ProxyService.send({},"user","DELETE",{params:u.join(",")},function(){Helpers.gridLoadPage()})});GridMvcAjax.demo.init(i,"commerceUsersList",function(){u=[];$("th.select-user").replaceWith(function(){var t=$('<input type="checkbox"/>'),n;t.on("change",function(n){var t=$("td[data-name='UserId'");n.target.checked?t.each(function(){var n=$(this).text();$("input[data-userid='"+n+"'").prop("checked",!0);u.push(n)}):t.each(function(){var n=$(this).text();$("input[data-userid='"+n+"'").prop("checked",!1);u=[]})});return n=$('<label class="checkbox-inline"><\/label>'),n.append(t),$('<th class="select-user text-center"><\/th>').append(n)});pageGrids.commerceUsersList.onRowSelect(function(n){var t=n.row.UserId,i=u.indexOf(t);i===-1?(u.push(t),$("input[data-userid='"+t+"'").prop("checked",!0)):(u.splice(i,1),$("input[data-userid='"+t+"'").prop("checked",!1))});$(".actions-item.edit-user").on("click",function(i){i.stopPropagation();Helpers.consoleLog(i.currentTarget.dataset.userid);t.currentUser=i.currentTarget.dataset.userid;UI.componentService.addModalContentToForm(n,"#signin-manage-users-current")});$(".actions-item.send-user-email").on("click",function(i){i.stopPropagation();t.sendEmailTo=[i.currentTarget.dataset.userid];UI.componentService.addModalContentToForm(n,"#signin-send-email")});$(".actions-item.delete-user").on("click",function(n){n.stopPropagation();ProxyService.send({id:n.currentTarget.dataset.userid},"user","DELETE",{},function(){Helpers.gridLoadPage()})})})}})},ManageMailsFormEvents=function(n,t){var i=UI.getViewModel(MANAGE_MAILS_COMPONENT,t,t.controlId),r,u;$("#component-modal .modal").on("hide.bs.modal",function(){$(".grid-mvc").gridmvc().currentPage&&(i.currentPage=$(".grid-mvc").gridmvc().currentPage)});r={updateGridAction:MANAGE_MAILS_GRID_URL};i.currentPage&&(r.currentPage=i.currentPage);u=t;$.ajax({url:r.updateGridAction,data:{controlId:t.controlId},dataType:"json",success:function(n){if($("#grid").html(n.Html),$(".grid-mvc").gridmvc(),GridMvcAjax.demo.init(r,"formMailsList",function(){pageGrids.formMailsList.onRowSelect(function(n){var t=n.row.ControlFormMailId;Helpers.consoleLog(t);i.currentItem=t;UI.componentService.addModalContentToForm(null,MANAGE_MAILS_CURRENT_COMPONENT,u)})}),pageGrids&&pageGrids.formMailsList)pageGrids.formMailsList.onRowSelect(function(n){var t=n.row.ControlFormMailId;Helpers.consoleLog(t);i.currentItem=t;UI.componentService.addModalContentToForm(null,MANAGE_MAILS_CURRENT_COMPONENT,u)})}})},ManageStoreProductsFormEvents=function(n){var t=UI.getViewModel("#manage-store-products",{component:n});ko.applyBindings(t,$("#manage-store-products")[0]);$("#productsTab").click();$("#productsTab").addClass("active");$("#productsTab").siblings(".tablinks").removeClass("active");$("#component-modal").off("click");$("#component-modal").on("click",".edit-product",function(n){n.stopPropagation();var t=$(this).attr("data-productid");Product.view(t)});$("#component-modal").on("click",".duplicate-product",function(n){n.stopPropagation();var t=$(this).attr("data-productid");Product.duplicate(t,function(){PopoverHelper.hidePopovers();Product.handleGridRows(!1);Helpers.gridLoadPage()})});$("#component-modal").on("click",".delete-product",function(n){n.stopPropagation();var t=$(this).attr("data-productid");Product.delete(t,function(){PopoverHelper.hidePopovers();Product.handleGridRows(!1);Helpers.gridLoadPage()})});$("#component-modal").on("click",".edit-category",function(n){n.stopPropagation();var t=$(this).attr("data-categoryid");Category.view(t)});$("#component-modal").on("click",".delete-category",function(n){n.stopPropagation();var t=$(this).attr("data-categoryid");Category.delete(t,function(){Helpers.gridLoadPage()})});$("#component-modal").on("click",".edit-order",function(n){n.stopPropagation();var t=$(this).attr("data-orderid");Order.view(t)});$("#component-modal").on("click","#add-product",function(t){t.stopPropagation();var i=UI.basicComponentRepository.getAll().where({name:"#manage-store-products-product"})[0],r=TemplateFactory.templateFor({proto:i},VIEWER_TEMPLATE,n).compiledTemplate;$("#manage-store-products-tab-content").html("");ko.cleanNode($("#manage-store-products-tab-content")[0]);$("#manage-store-products-tab-content").html(r).promise().done(function(n){setTimeout(function(n){ko.cleanNode($("#manage-store-products-tab-content")[0]);var t=UI.getViewModel("#manage-store-products-product");ko.applyBindings(t,n[0])},0,n,i)})});$("#component-modal").on("click","#add-category",function(n){n.stopPropagation();var t=UI.getViewModel("#manage-store-products-category",null);t.addCategory(null)});$("#component-modal").bind("click",function(){PopoverHelper.hidePopovers(BATCH_OPERATIONS_POPOVER_CUSTOM)});$("#manage-store-products").on("hidden.bs.modal",function(){$("#component-modal").unbind()})},ManageUsersCurrentFormEvents=function(n){var t=UI.getViewModel("#signin-manage-users"),i,r;t.currentUser!=null?(i=t.currentUser,r=UI.getViewModel("#signin-manage-users-current",i),ko.applyBindings(r,$("#manage-users-current")[0])):Helpers.consoleLog("error - no current user");$("#component-modal .modal").on("hide.bs.modal",function(){UI.componentService.addModalContentToForm(n,"#signin-manage-users")})},ManageMailsCurrentFormEvents=function(n,t){var i,r,u;$("#component-modal .modal").on("hide.bs.modal",function(){UI.componentService.addModalContentToForm(null,MANAGE_MAILS_COMPONENT,t)});i=UI.getViewModel(MANAGE_MAILS_COMPONENT,t,t.controlId);i.currentItem!=null?(r=i.currentItem,u=UI.getViewModel(MANAGE_MAILS_CURRENT_COMPONENT,r),ko.applyBindings(u,$("#manage-mails-current")[0])):(Helpers.consoleLog("error - no current mail"),$("#component-modal .modal").modal("hide"))},SecurePageEvents=function(n){$("#component-modal .modal").on("hidden.bs.modal",function(){UI.pager.goToHomePage()});$("#login").on("click",function(){UI.pager.goToHomePage();UI.componentService.addModalContentToForm(n,"#signin-login")})},SendEmailEvents=function(n){var t,i;UI.viewModelRepository["#signin-manage-users"]?(t=UI.viewModelRepository["#signin-manage-users"].sendEmailTo,t&&(i=function(i){if(i){var r=[];_.forEach(i,function(n){r.push(n.userName)});r.length>1?$("#email").text(r.join(", ")):$("#email").text(r[0]);$("#send-email .form").submit(function(i){i.preventDefault();ProxyService.send({data:t.join(","),title:$("#email-title").val(),body:$("#email-text").val()},"sendemail","POST",{},function(){UI.componentService.addModalContentToForm(n,"#signin-manage-users");Application.showOkDialog("Success","The Email has been sent successfully!")})});$("#component-modal .modal").on("hide.bs.modal",function(){UI.componentService.addModalContentToForm(n,"#signin-manage-users")})}else UI.componentService.addModalContentToForm(n,"#signin-manage-users"),Application.showOkDialog("Error","Can't get users!")},ProxyService.send({},"user","GET",{params:t.join(","),requesttype:"items"},i))):Helpers.consoleLog("error - no viewmodel")},ViewModelFactory=function(){};ViewModelFactory.getModel=function(n,t){switch(n){case"#signin-login":return null;case"#signin-signup":return null;case"#signin-reset-password":return null;case"#signin-change-password":return null;case"#signin-profile":return new UserProfileViewModel(t);case"#signin-manage-users":return new ManageUsersViewModel;case"#signin-manage-users-current":return new ManageUsersCurrentViewModel(t);case MANAGE_MAILS_COMPONENT:return new ManageMailsViewModel;case MANAGE_MAILS_CURRENT_COMPONENT:return new ManageMailsCurrentViewModel(t);case"#signin-user-fields":return new UserFieldsViewModel;case"device-management":return new DeviceManagementModel(t);case"hidden-elements":return new HiddenElementsModel(t);case"#manage-store-products":return new ManageStoreProductsViewModel(t);case"#manage-store-products-product":return new ManageStoreProductsProductViewModel(t);case"#manage-store-products-category":return new ManageStoreProductsCategoryViewModel(t);case"#manage-store-products-order":return new ManageStoreProductsOrderViewModel(t);case"#manage-store-products-tab-products":return new ManageStoreProductsTabProductsViewModel;case"#manage-store-products-tab-categories":return new ManageStoreProductsTabCategoriesViewModel;case"#manage-store-products-tab-orders":return new ManageStoreProductsTabOrdersViewModel;case"#manage-store-products-tab-payments":return new ManageStoreProductsTabPaymentsViewModel;case"#manage-store-products-tab-store-settings":return new ManageStoreProductsTabStoreSettingsViewModel;case"#manage-store-products-tab-shipping-and-tax":return new ManageStoreProductsTabShippingAndTaxViewModel(t);case"#manage-store-products-add-shipping-rate":return new ManageStoreProductsAddShippingRateViewModel(t);case"#manage-store-products-add-shipping-location":return new ManageStoreProductsAddShippingLocationViewModel;case"#manage-store-products-add-tax-location":return new ManageStoreProductsAddTaxLocationViewModel;case"#manage-store-products-adding-products-to-category":return new ManageStoreProductsAddingProductsToCategoryViewModel(t);case"#manage-store-products-adding-category-to-products":return new ManageStoreProductsAddingCategoryToProductsViewModel(t);case"#manage-store-products-adding-discount-to-products":return new ManageStoreProductsAddingDiscountToProductsViewModel(t);case"#manage-store-products-change-products-visability":return new ManageStoreProductsChangeProductsVisabilityViewModel(t);case"right-navigation-panel":return new RightNavigationPanelModel(t);case"history-management":return new HistoryManagementModel(t);case STORE_PRODUCT:return new StoreProductViewModel(t);case STORE_GALLERY:return new StoreGalleryViewModel(t);case STORE_CART:return new StoreCartViewModel(t);case STORE_THANK_YOU:return new StoreThankYouViewModel(t);case STORE_CART_LINK:return new StoreCartLinkViewModel(t);case STORE_CATEGORIES:return new StoreCategoriesViewModel(t);default:return null}};var ManageUsersViewModel=function(){var n=this;return n.currentUser=null,n.currentPage=null,n.sendEmailTo=null,n.init=function(){},n.init(),n},ManageMailsViewModel=function(){var n=this;return n.currentItem=null,n.currentPage=null,n.init=function(){},n.init(),n},ManageStoreProductsViewModel=function(n){var t=this;return t.currentProduct=null,t.currentPage=null,t.component=n.component,t.openTab=function(n,i,r,u,f){var o,s,e;$("#"+n).addClass("active");$("#"+n).siblings(".tabcontent").removeClass("active");$(f.currentTarget).addClass("active");$(f.currentTarget).siblings(".tablinks").removeClass("active");$("#"+n).css("display","block");$("#"+n).siblings(".tabcontent").css("display","none");o=UI.basicComponentRepository.getAll().where({name:"#manage-store-products-tab-"+n})[0];s=TemplateFactory.templateFor({proto:o},VIEWER_TEMPLATE,u.component).compiledTemplate;$("#manage-store-products-tab-content").html("");$("#manage-store-products-tab-content").html(s);e=UI.getViewModel("#manage-store-products-tab-"+n);ko.cleanNode($("#manage-store-products-tab-content")[0]);ko.applyBindings(e,$("#manage-store-products-tab-content")[0]);t.currentTab=n;r!=""&&t.renderGrid(r,e)},t.renderGrid=function(n,i){var u=UI.getViewModel("#manage-store-products"),r;$("#component-modal .modal").on("hide.bs.modal",function(){$(".grid-mvc").gridmvc().currentPage&&(u.currentPage=$(".grid-mvc").gridmvc().currentPage)});r={updateGridAction:"/Account/Commerce"+n+"ListGrid"};t.currentPage&&(r.currentPage=t.currentPage);n.toLowerCase()=="products"&&i.selectedProducts([]);$.ajax({url:r.updateGridAction,dataType:"json",success:function(t){$("#grid").html(t.Html);var f=$(".grid-mvc").gridmvc(),u="commerce"+n+"List";GridMvcAjax.demo.init(r,u,function(){$("#grid").find("table").attr("id",n.toLowerCase()+"Grid");pageGrids[u].onRowSelect(function(n){Helpers.consoleLog("e.row = ",n.row)});var t='.select-product input[type="checkbox"]',r=function(){var i=$._data($("#component-modal")[0],"events").click,n=!1;return $.each(i,function(i,r){r.selector==t&&(n=!0)}),n};if(n.toLowerCase()=="products"&&!r())$("#component-modal").on("click",t,function(n){var r;n.stopPropagation();var u=$(this).attr("data-productid"),f=$(this).prop("checked"),t=i.selectedProducts();f?t.push(u):(r=t.indexOf(u),r>-1&&t.splice(r,1));i.selectedProducts(t)})})}})},t.init=function(){},t.init(),t},ManageUsersCurrentViewModel=function(n){var t=this,i,r;return t.user=ko.observable(),t.fields=ko.observableArray([]),i=function(){upclick({type:UPCLICK_TYPE_PICTURE,element:"upload-avatar",action:"/Editor/UploadPicture?templateId="+UI.getTemplateProperty("templateId"),accept:".gif, .jpg, .png, .jpeg, .bmp",multiple:!1,onstart:function(){Application.addLocker()},oncomplete:function(n){Application.removeLocker();var i=Helpers.ProcessUploadSingleFileCompleted(n,$("#upclick-editor-error"),$("#upload-avatar"));i!=null&&t.user().avatar(i.url)}});$(".upclick-container").bind("click",function(n){n.stopPropagation()})},r=function(){$("#birthday-user-input").mask("99/99/9999",{placeholder:"mm/dd/yyyy"})},t.init=function(n){t.fields(_.filter(UI.getCustomUserFields(),function(n){return n.active()}));t.user(null);var u=function(n){n&&n[0]&&(t.user(new User(n[0])),i(),r())};ProxyService.send({id:n},"user","GET",{},u)},t.saveProfile=function(){t.user().save(function(){$("#component-modal > .modal").modal("hide")})},t.init(n),t},ManageMailsCurrentViewModel=function(n){var t=this;return t.mail=ko.observable(null),t.init=function(n){t.mail(null);var i=function(n){n&&n[0]&&t.mail(new FormMail(n[0]))};ProxyService.send({id:n},"formmail","GET",{},i)},t.init(n),t},ManageStoreProductsProductViewModel=function(n){var t=this,i;return t.product=ko.observable({}),t.options=ko.observableArray([]),t.weightUnitOptions=ko.observableArray([]),i=function(){upclick({type:UPCLICK_TYPE_PICTURE,element:"image-upload-button",action:"/Editor/UploadPicture?templateId="+UI.getTemplateProperty("templateId"),accept:".gif, .jpg, .png, .jpeg, .bmp",multiple:!0,onstart:function(){Application.addLocker()},oncomplete:function(n){Application.removeLocker();var i=Helpers.ProcessUploadMultipleFilesCompleted(n,$("#upclick-editor-error"),$("#image-upload-button"));i!=null&&i.forEach(function(n){t.addImage(Guid.empty(),n.url)})}});$(".upclick-container").bind("click",function(n){n.stopPropagation()})},t.imageChangeOrder=function(n,i){if(t.product()){var u=function(n,i){var r=t.product().images(),u=t.product().images()[n];r[n]=r[i];r[i]=u;t.product().images(r)},r=t.product().images.indexOf(n);i>0?r!==t.product().images().length-1&&u(r,r+1):r!==0&&u(r,r-1)}},t.imageRemove=function(n){t.product()&&t.product().images.remove(n)},t.addImage=function(n,i){t.product()&&t.product().images.push({id:n,url:i})},t.changeWeightUnit=function(){t.weightUnit(this)},t.addOptionValue=function(){this.items.push({id:"",value:"",diff:0})},t.addOption=function(){t.options.push({id:"",title:"",items:ko.observableArray([])})},t.deleteOption=function(){t.options.remove(this)},t.backToProducts=function(){$("#productsTab").click()},t.changeCategories=function(){var n=t.product().categories,i=$("#categories-list").tagsinput("items");_.forEach(n,function(n){n.isActive=!1});_.forEach(i,function(t){t.isActive=!0;var i=n.filter(function(n){return n.id===t.id});i.length===1?i[0].isActive=!0:n.push(t)})},t.saveProduct=function(){t.product().options=ko.toJS(t.options);t.product().save(function(){t.backToProducts()})},t.initCategories=function(){ProxyService.send({},"category","GET",{count:100,requesttype:"items"},function(n){var i=new Bloodhound({datumTokenizer:Bloodhound.tokenizers.obj.whitespace("name"),queryTokenizer:Bloodhound.tokenizers.whitespace,local:n});i.initialize();$("#categories-list").tagsinput({itemValue:"id",itemText:"name",typeaheadjs:{name:"bh",displayKey:"name",source:i.ttAdapter()}});_.forEach(t.product().categories,function(n){$("#categories-list").tagsinput("add",n)})})},t.toggleDiscoutType=function(){t.discountType()===2?t.discountType(1):t.discountType(2)},t.ckEditorHandling=function(){CKEDITOR.on("instanceReady",function(){var n=CKEDITOR.instances.ckEditorDescription;n.on("change",function(n){t.product().description=n.editor.getData()})})},t.initWeightUnitOptions=function(){var n=UI.store.getWeightUnit();return _.filter(UI.store.weightUnitOptions,function(t){return t.groupId===n.groupId})},t.init=function(n){i();t.weightUnitOptions(t.initWeightUnitOptions());t.product(new Product(n));t.weightUnit=ko.observable(t.product().weightUnit);t.ckEditorText=ko.observable(t.product().description);t.ckEditorHandling();t.inStock=ko.observable(!t.product().outOfStock);t.price=ko.observable(t.product().price);t.discount=ko.observable(t.product().discount);t.discountType=ko.observable(t.product().discountType);t.isDiscount=ko.observable(t.product().isDiscount);t.discountPrice=ko.observable(Product.calculateDiscountPrice(t.discountType(),t.price(),t.discount()));t.inStock.subscribe(function(n){t.product().stockStatus=n?2:3;t.product().outOfStock=!n});t.weightUnit.subscribe(function(n){t.product().weightUnit=n;t.product().weightUnitTypeId=n.id});t.price.subscribe(function(n){(n||n===0)&&(t.product().price=n,t.isDiscount()?t.discountPrice.codeUpdate(Product.calculateDiscountPrice(t.discountType(),n,t.discount())):t.discountPrice.codeUpdate(n))});t.discount.subscribe(function(n){if((n||n===0)&&(t.product().discount=n,t.isDiscount())){var i=Product.calculateDiscountPrice(t.discountType(),t.price(),n);i>t.price()?(t.discount(0),t.discountPrice.codeUpdate(t.price())):t.discountPrice.codeUpdate(i)}});t.discountType.subscribe(function(n){var i=n==="codeUpdate";n&&!i&&(t.product().discountType=n,t.discount(0))});t.discountPrice.subscribe(function(n){var r=n==="codeUpdate",i;(n||n===0)&&!r&&(t.product().discountType=2,t.discountType.codeUpdate(2),i=t.price()-n,t.discount(parseFloat(i.toFixed(2))))});t.isDiscount.subscribe(function(n){t.product().isDiscount=n?n.toBoolean():!1;t.discountType()===2?t.discount(0):t.discountType(2)});t.initOptions();t.newCategory=ko.observable();t.initCategories()},t.initOptions=function(){t.options([]);_.forEach(t.product().options,function(n){t.options.push({id:n.id,title:n.title,items:ko.observableArray(n.items)})})},t.init(n),t},ManageStoreProductsOrderViewModel=function(n){var t=this;return t.back=function(){$("#ordersTab").click()},t.deleteOrder=function(){var n=this.order().id;Application.showYesNoDialog("Are you sure you want to delete this order?","Delete order",function(){Order.delete(n,t.back())})},t.init=function(n){var i,r;t.order=ko.observable(new Order(n));t.statusOptions=ko.observableArray(t.order().getAllStatuses());i=_.find(t.statusOptions(),function(n){return t.order().statusId===n.id});i==null?(r={desc:"Not Defined",name:"notdef",id:t.order().statusId},t.status=ko.observable(r),t.statusOptions.push(r)):t.status=ko.observable(i);t.status.subscribe(function(n){n&&(t.order().statusId=n.id,t.order().updateOrderStatus(function(){}))})},t.init(n),t},ManageStoreProductsTabPaymentsViewModel=function(){var n=this;return n.paymentAccounts=ko.observableArray([{icon:"fa-paypal",type:"paypal",label:"PayPal",createAccountLink:"https://www.paypal.com/us/webapps/mpp/merchant",disabled:ko.observable(!0),connectMode:ko.observable(!1),value:ko.observable(""),newvalue:ko.observable("")}]),n.init=function(){_.forEach(n.paymentAccounts(),function(n){var t=UI.store.getPaymentAccount(n.type);n.value(t);n.newvalue(t);n.disabled(!0);n.connectMode(!1)})},n.save=function(){var n=this.newvalue().trim();UI.store.setPaymentAccount(this.type,n);this.value(n);this.disabled(!0)},n.cancel=function(){this.disabled(!0);var n=this.value().trim();this.value(n);this.newvalue(n)},n.edit=function(){this.disabled(!1)},n.connectAccount=function(){this.connectMode(!0)},n.connectExisting=function(){this.value(" ");this.disabled(!1);this.connectMode(!1)},n.disconnectAccount=function(){UI.store.setPaymentAccount(this.type,"");this.value("");this.newvalue("")},n.init(),n},ManageStoreProductsTabCategoriesViewModel=function(){var n=this;return n.allProductsQuantity=ko.observable(0),n.init=function(){ProxyService.send({id:"countproduct"},"service","GET",{},function(t){n.allProductsQuantity(t[0].count)})},n.init(),n},ManageStoreProductsTabProductsViewModel=function(){var n=this,t=function(t,i,r){var u,f,e,o,s;event.stopPropagation();PopoverHelper.hidePopovers();u=UI.basicComponentRepository.getAll().where({name:i})[0];f=TemplateFactory.templateFor({proto:u},VIEWER_TEMPLATE).compiledTemplate;PopoverHelper.bind(t,f,BATCH_OPERATIONS_POPOVER_CUSTOM);$(".popover-title").remove();$(".popover .arrow").remove();$("body > div.batch-operations-popover-custom").css({"z-index":1300,"min-width":"400px"});e=t.offset().top+25;o=t.offset().left+parseFloat(t.css("width"))-$("body > div.batch-operations-popover-custom").width();$("body > div.batch-operations-popover-custom").css({top:e,left:o,"box-shadow":"0 4px 8px 8px rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19)"});s=UI.getViewModel(i,n.selectedProducts());ko.cleanNode($(r)[0]);ko.applyBindings(s,$(r)[0])};return n.addCategoryToProducts=function(){t($("#add-category-to-produts"),MANAGE_STORE_PRODUCTS_ADDING_CATEGORIES_TO_PRODUCTS,"#adding-category-to-products")},n.addDiscountToProducts=function(){t($("#add-discount-to-products"),MANAGE_STORE_PRODUCTS_ADDING_DISCOUNT_TO_PRODUCTS,"#adding-discount-to-products")},n.changeProductsVisability=function(){t($("#change-products-visability"),MANAGE_STORE_PRODUCTS_CHANGE_PRODUCTS_VISABILITY,"#changing-products-visability")},n.deleteProducts=function(){var t=[],i;n.selectedProducts().forEach(function(n){t.push({id:n,isActive:!1,processingFields:"isActive"})});i=function(){Product.handleGridRows(!1);Helpers.gridLoadPage()};Product.batchUpdate(t,i)},n.init=function(){n.selectProducts=ko.observable(!1);n.selectProducts.subscribe(function(n){Product.handleGridRows(n)});n.selectedProducts=ko.observableArray([])},n.init(),n},ManageStoreProductsTabOrdersViewModel=function(){var n=this;return n.displayingOrdersOptions=ko.observableArray(["All orders"]),n.displayingOrders=ko.observable("All orders"),n.selectAllOrders=ko.observable(!1),n.searchField=ko.observable(""),n.init=function(){},n.init(),n},ManageStoreProductsTabStoreSettingsViewModel=function(){var n=this,t;return n.currency=ko.observable(),n.weightUnit=ko.observable(),n.returnPolicy=ko.observable(),n.shippingPolicy=ko.observable(),n.currencyOptions=ko.observableArray(UI.store.currencyOptions),n.weightUnitOptions=ko.observableArray(_.filter(UI.store.weightUnitOptions,function(n){return n.isBase})),n.saveStoreSettings=function(){n.currency()&&n.weightUnit()?UI.store.saveSettings({currencyId:n.currency()?n.currency().id:"",weightUnitTypeId:n.weightUnit()?n.weightUnit().id:"",returnPolicyUrl:n.returnPolicy(),shippingPolicyUrl:n.shippingPolicy()},function(){n.backToProducts()}):Application.showOkDialog("Error","Please select currency and weight unit!")},t=function(n,t){upclick({type:UPCLICK_TYPE_PDF,element:n,action:"/Editor/UploadPdf?templateId="+UI.getTemplateProperty("templateId"),accept:".pdf",multiple:!1,onstart:function(){Application.addLocker()},oncomplete:function(i){Application.removeLocker();var r=Helpers.ProcessUploadSingleFileCompleted(i,$("#upclick-editor-error"),$("#"+n));r!=null&&t(r.url)}});$(".upclick-container").bind("click",function(n){n.stopPropagation()})},n.backToProducts=function(){$("#productsTab").click()},n.init=function(){var i=UI.store.getSettings();n.currency(UI.store.getCurrency());n.weightUnit(UI.store.getWeightUnit());n.returnPolicy(i.returnPolicyUrl);n.shippingPolicy(i.shippingPolicyUrl);t("upload-return-policy",n.returnPolicy);t("upload-shipping-policy",n.shippingPolicy)},n.init(),n},ManageStoreProductsAddingCategoryToProductsViewModel=function(n){var t=this,i=function(){var n=[];return _.forEach(t.chosenCategories(),function(t){n.push({id:t.id})}),n};return t.expandChildren=function(n,t){var i=$(t.target).closest(".parent-category"),r=i.next();r.slideToggle(500,function(){var n=i.find(".parent-category-title");r.is(":visible")?n.hasClass("expanded")||n.addClass(" expanded"):n.hasClass("expanded")&&n.removeClass(" expanded")})},t.apply=function(){var u=i(),n=[],r;t.products().forEach(function(t){n.push({id:t,categories:u,processingFields:"categories"})});r=function(){PopoverHelper.hidePopovers();Product.handleGridRows(!1)};Product.batchUpdate(n,r)},t.init=function(n){t.products=ko.observableArray(n);t.categories=ko.observableArray([]);t.chosenCategories=ko.observableArray([]);ProxyService.send({},"category","GET",{count:100,requesttype:"items","grid-filter":"ParentId__10__null"},function(n){var i=n;t.categories(i)})},t.init(n),t},ManageStoreProductsAddingDiscountToProductsViewModel=function(n){var t=this;return t.apply=function(){var n=[],i;t.products().forEach(function(i){n.push({id:i,isDiscount:!0,discount:parseFloat(t.discount()),discountType:t.discountType(),processingFields:"discount, isDiscount, discountType"})});i=function(){PopoverHelper.hidePopovers();Product.handleGridRows(!1);Helpers.gridLoadPage()};Product.batchUpdate(n,i)},t.toggleDiscoutType=function(){t.discountType()===2?t.discountType(1):t.discountType(2)},t.init=function(n){t.discount=ko.observable(0);t.discountType=ko.observable(2);t.products=ko.observableArray([]);t.currency=UI.store.getCurrency().symbol;t.products=ko.observableArray(n);t.discountType.subscribe(function(){t.discount(0)})},t.init(n),t},ManageStoreProductsChangeProductsVisabilityViewModel=function(n){var t=this;return t.changeVisability=function(n){var i,r;n=defined(n)?!0:!1;i=[];t.products().forEach(function(t){i.push({id:t,isVisible:n,processingFields:"isVisible"})});r=function(){PopoverHelper.hidePopovers();Product.handleGridRows(!1);Helpers.gridLoadPage()};Product.batchUpdate(i,r)},t.init=function(n){t.products=ko.observableArray(n)},t.init(n),t},ManageStoreProductsAddingProductsToCategoryViewModel=function(n){var t=this,i=function(n,t){for(var f=t.category().products(),u=[],r,i=0;i<n.length;i++)for(r=0;r<f.length;r++)f[r].id==n[i].id&&(n[i].addedToCategory=!0,u.push(n[i]));return t.products(n),t.addedToCategory(u),u};return t.searchField=ko.observable(""),t.searchField.subscribe(function(){t.category().getAllProducts(t.searchField(),t,i)},t),t.filteredProducts=function(){},t.addProductToCategory=function(n){t.category().products(n)},t.deleteSubcategory=function(){},t.init=function(n){t.category=ko.observable(n);t.products=ko.observableArray([]);t.addedToCategory=ko.observableArray([]);t.addedToCategory.subscribe(function(n){t.addProductToCategory(n)},t);t.category().getAllProducts("",t,i)},t.init(n),t},ManageStoreProductsCategoryViewModel=function(n){var t=this,u,i,r,f;return t.deleteCategoryFromProduct=function(n){t.category().products.remove(n)},t.deleteSubcategory=function(n){t.category().categories.remove(n);Category.delete(n.id)},t.addCategory=function(n){var t=new Category({id:"",tempId:Guid.new(),name:"",parentCategory:n,hasSubcategories:!1,products:[],categories:[]});Category.view(t)},u=function(n){var t={id:n.id,name:n.title,blobs:[]};return t.blobs=[{main:!0,url:encodeURIComponent(n.src)}],t},i=function(n){var t={id:n.id,tempId:n.tempId,name:n.name,parentCategory:ko.utils.unwrapObservable(n.parentCategory),hasSubCategories:ko.utils.unwrapObservable(n.hasSubcategories),products:[],children:[]},r=ko.utils.unwrapObservable(n.products),f=ko.utils.unwrapObservable(n.categories);return _.forEach(r,function(n){var i=u(n);t.products.push(i)}),_.forEach(f,function(n){var r=i(n);t.children.push(r)}),t},t.addSubcategory=function(){t.addCategory(t.category())},t.backToParentCategory=function(){var n=t.category().parentCategory();Category.view(i(n))},t.viewCategory=function(n){var t=i(n);Category.view(t)},r=function(n,t,i){for(var r=0;r<n.categories().length;r++)if(n.categories()[r].id===t.id)return i=="delete"?n.categories().splice(r,1):i=="merge"&&(n.categories()[r]=t),!0},t.deleteCategory=function(){if(t.category().parentCategory()==null)Category.delete(t.category().id),t.backToCategories();else{var n=t.category().parentCategory();r(n,t.category(),"delete");Category.delete(t.category().id);t.backToParentCategory()}},t.saveCategory=function(){if(t.category().parentCategory()==null)t.category().save(function(){t.backToCategories()});else{var n=t.category().parentCategory(),i=r(n,t.category(),"merge");t.category().save(function(){t.backToParentCategory()})}},t.backToCategories=function(){$("#categoriesTab").click()},f=function(n,i,r){var u,f,e,o,s;event.stopPropagation();u=UI.basicComponentRepository.getAll().where({name:i})[0];f=TemplateFactory.templateFor({proto:u},VIEWER_TEMPLATE).compiledTemplate;PopoverHelper.bind($(n),f,BATCH_OPERATIONS_POPOVER_CUSTOM);$(".popover-title").remove();$(".popover .arrow").remove();$("body > div.batch-operations-popover-custom").css({"z-index":1300,"min-width":"400px"});e=$(n).offset().top-$("body > div.batch-operations-popover-custom").height();o=$(n).offset().left+parseFloat($(n).css("width"))-$("body > div.batch-operations-popover-custom").width();$("body > div.batch-operations-popover-custom").css({top:e,left:o,"box-shadow":"0 4px 8px 8px rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19)"});s=UI.getViewModel(i,t.category());ko.cleanNode($(r)[0]);ko.applyBindings(s,$(r)[0])},t.displayAddingProductsToCategoryPopover=function(){Helpers.isExistsByClassName(BATCH_OPERATIONS_POPOVER_CUSTOM)?PopoverHelper.hidePopovers(BATCH_OPERATIONS_POPOVER_CUSTOM):f("#add-products-to-collection",MANAGE_STORE_PRODUCTS_ADDING_PRODUCTS_TO_CATEGORY,"#adding-products-to-category")},t.init=function(n){t.category=ko.observable(new Category(n));t.category().parentCategory=ko.observable(t.category().parentCategory);t.category().products=ko.observableArray(t.category().products);t.category().categories=ko.observableArray(t.category().categories);t.category().hasSubcategories=ko.observable(t.category().hasSubcategories);t.category().hasSubcategories.subscribe(function(){},t)},t.init(n),t},UserFieldsViewModel=function(){var n=this;return n.fields=ko.observableArray(UI.getCustomUserFields()),n.action=function(){},n.actionText=ko.observable(),n.isEditMode=ko.observable(),n.isEditMode.subscribe(function(t){t?(n.actionText("Save"),n.action=n.actionSave):(n.actionText("Edit"),n.action=n.actionEdit)}),n.actionEdit=function(){n.isEditMode(!0)},n.actionSave=function(){UI.setCustomUserFields(ko.toJSON(n.fields()));n.isEditMode(!1)},n.init=function(){n.fields(UI.getCustomUserFields());n.isEditMode(!1)},n.init(),n},UserProfileViewModel=function(n){var t=this,i,r;return t.user=ko.observable(),t.fields=ko.observableArray(),i=function(){upclick({type:UPCLICK_TYPE_PICTURE,element:"upload-avatar",action:"/Editor/UploadPicture?templateId="+UI.getTemplateProperty("templateId"),accept:".gif, .jpg, .png, .jpeg, .bmp",multiple:!1,onstart:function(){Application.addLocker()},oncomplete:function(n){Application.removeLocker();var i=Helpers.ProcessUploadSingleFileCompleted(n,$("#upclick-editor-error"),$("#image-upload-button"));i!=null&&t.user().avatar(i.url)}});$(".upclick-container").bind("click",function(n){n.stopPropagation()})},r=function(){$("#birthday-user-input").mask("99/99/9999",{placeholder:"mm/dd/yyyy"})},t.init=function(n){t.fields(_.filter(UI.getCustomUserFields(),function(n){return n.active()}));t.user(n.user());setTimeout(function(){i();r()},0)},t.saveProfile=function(){t.user().save(function(){$("#component-modal > .modal").modal("hide")})},t.goToChangePassword=function(){UI.componentService.addModalContentToForm(n.component,"#signin-change-password")},t.init(n),t},RightNavigationPanelModel=function(n){function r(n){try{$([document.documentElement,document.body]).animate({scrollTop:$(n.getUISelector()).offset().top-100},2e3);$(n.getUISelector()).highlightSelectedElement(n,!0)}catch(i){t.controls.remove(n)}}var t=this,u=[STORE_PRODUCT,STORE_CART,STORE_THANK_YOU],f=[SIGNIN,STORE_CATEGORIES,STORE_CART_LINK,STORE_GALLERY],i;return t.pages=ko.observableArray([]),t.sortedPages=ko.computed(function(){return t.pages().sort(function(n,t){return n.displayName===HEADER||n.displayName===FOOTER?-1:n.title<t.title?-1:n.title>t.title?1:0})}),t.selectedTab=ko.observable(),t.selectedTab.subscribe(function(n){n==="search"&&t.initPages()}),t.isPanelShown=ko.observable(!0),t.init=function(){for(var n=1;n<=3;n++)Aligning.setElementsAccess("aligning-item-"+n);Grouping.setElementsAccess();ClipboardViewModel.setElementsAccess("layer-item",clipBoard.selectedItem()||grouping.showGroupingOptions());ClipboardViewModel.setElementsAccess("add-or-delete-item",(clipBoard.selectedItem()||grouping.showGroupingOptions())&&clipBoard.isDesktopView());ClipboardViewModel.setElementsAccess("paste-item",clipBoard.itemForClipboard()&&clipBoard.isDesktopView());ClipboardViewModel.setElementsVisability();t.checkPanelCollapse();t.selectedTab("toolbox")},t.initPages=function(){t.pages([]);t.pages(_.clone(UI.pager.pages)||[]);t.pages.push(UI.getFooter());t.pages.push(UI.getHeader());t.components(UI.newComponents||[]);t.selectedPage(UI.pager.getPage(UI.pager.getCurrentPageId()));t.selectedComponent(null)},t.selectedPage=ko.observable(),t.selectedPage.subscribe(function(){t.initControls()}),t.controls=ko.observableArray([]),t.sortedControls=ko.computed(function(){return t.controls().sort(function(n,t){return n.displayName<t.displayName?-1:n.displayName>t.displayName?1:0})}),t.components=ko.observableArray([]),t.sortedComponents=ko.computed(function(){return t.components().sort(function(n,t){return n.DisplayName<t.DisplayName?-1:n.DisplayName>t.DisplayName?1:0})}),t.selectedComponent=ko.observable(),t.selectedComponent.subscribe(function(){t.initControls()}),i=function(n,t){var i=Object.keys(t),u=t[i],r=[];return n.forEach(function(n){n[i]===u&&r.push(n)}),r},t.initControls=function(){var e,u;t.controls([]);var r={},n=t.selectedPage(),f=t.selectedComponent();f&&(r.displayName=f.Name);n?(e=n.getComponent?n.getComponent():n,t.controls(i(e.children,r))):(u=[],t.pages().forEach(function(n){var t=n.getComponent?n.getComponent():n;u.addRange(t.children)}),t.controls(i(u,r)))},t.selectControl=function(n){n.parentComponent.proto.name===HEADER||n.parentComponent.proto.name===FOOTER||n.parentComponent.proto.name===PAGE&&n.parentComponent.id===UI.pager.getCurrentPageId()?r(n):(UI.pager.goToPage(n.parentComponent.id),r(n))},t.checkPanelCollapse=function(){var n=LocalStorageService.GetItem("right-panel-collapse");t.isPanelShown(n&&n.toBoolean()||!n)},t.changeVisiblePanel=function(){t.isPanelShown(!t.isPanelShown());LocalStorageService.SetItem("right-panel-collapse",t.isPanelShown())},grouping.selectedItems.subscribe(function(){for(var n=1;n<=3;n++)Aligning.setElementsAccess("aligning-item-"+n);ClipboardViewModel.setElementsAccess("layer-bring-front",ClipboardViewModel.isLayeringEnabled());ClipboardViewModel.setElementsAccess("layer-bring-back",ClipboardViewModel.isLayeringEnabled(!0))}),grouping.showGroupingOptions.subscribe(function(){Grouping.setElementsAccess();ClipboardViewModel.setElementsAccess("layer-item",clipBoard.selectedItem()||grouping.showGroupingOptions());ClipboardViewModel.setElementsAccess("add-or-delete-item",(clipBoard.selectedItem()||grouping.showGroupingOptions())&&clipBoard.isDesktopView());ClipboardViewModel.setElementsAccess("paste-item",clipBoard.itemForClipboard()&&clipBoard.isDesktopView())}),clipBoard.selectedItem.subscribe(function(){clipBoard.selectedItem()&&u.indexOf(clipBoard.selectedItem().proto.name)!==-1||(ClipboardViewModel.setElementsAccess("layer-item",clipBoard.selectedItem()||grouping.showGroupingOptions()),ClipboardViewModel.setElementsAccess("layer-bring-front",ClipboardViewModel.isLayeringEnabled()),ClipboardViewModel.setElementsAccess("layer-bring-back",ClipboardViewModel.isLayeringEnabled(!0)),clipBoard.selectedItem()?f.indexOf(clipBoard.selectedItem().proto.name)===-1?ClipboardViewModel.setElementsAccess("add-or-delete-item",clipBoard.isDesktopView()):ClipboardViewModel.setElementsAccess("add-or-delete-item",clipBoard.isDesktopView(),"only-delete"):ClipboardViewModel.setElementsAccess("add-or-delete-item",grouping.showGroupingOptions()&&clipBoard.isDesktopView()),Aligning.setElementsAccess("aligning-item-1"))}),clipBoard.isDesktopView.subscribe(function(){ClipboardViewModel.setElementsAccess("add-or-delete-item",(clipBoard.selectedItem()||grouping.showGroupingOptions())&&clipBoard.isDesktopView());ClipboardViewModel.setElementsAccess("paste-item",clipBoard.itemForClipboard()&&clipBoard.isDesktopView())}),clipBoard.itemForClipboard.subscribe(function(){ClipboardViewModel.setElementsAccess("paste-item",clipBoard.itemForClipboard()&&clipBoard.isDesktopView());ClipboardViewModel.setElementsVisability()}),t.init(n),t},DeviceManagementModel=function(n){var t=this;return t.selectedDevice=ko.observable(),t.devices=ko.observableArray(),t.onlyDesktop=ko.observable(),t.isInitModel=!1,t.init=function(n){t.isInitModel=!0;t.selectedDevice(n.device);t.devices(n.devices);t.onlyDesktop(UI.getBody().getProperty(ONLY_DESKTOP).value.toBoolean())},t.resetDevice=function(){Application.showRemoveConfirmationDialog({text:"Are you sure you want to reset your entire mobile website?",style:"text-upper text-danger-light"},"Reset Mobile Layout",[{css:"simple",text:"Reset Current Page",callback:function(){t.selectedDevice().resetPage();Application.removeModal()}},{css:"danger",text:"Reset Entire Website",callback:function(){t.selectedDevice().reset();Application.removeModal()}}],"You will lose any individual page edits you have made!<br>You might want to just reset an individual page instead.","*This action can't be Undone!")},t.optionsText=function(n){return n.getDisplayName()},t.toggleIsPublish=function(){var n=UI.getBody().getProperty(ONLY_DESKTOP).value.toBoolean();UI.undoManagerAddSimple(UI.getBody(),ONLY_DESKTOP,(!n).toString(),function(){t.onlyDesktop(UI.getBody().getProperty(ONLY_DESKTOP).value.toBoolean())},!0)},t.selectDesktop=function(){var n=t.devices().where({type:DEVICE_DESKTOP_TYPE}).firstOrDefault();n&&t.selectedDevice().getId()!==n.getId()&&t.selectedDevice(n)},t.selectMobile=function(){var n=t.devices().where({type:DEVICE_MOBILE_TYPE}).firstOrDefault();n&&t.selectedDevice().getId()!==n.getId()&&t.selectedDevice(n)},t.selectedDevice.subscribe(function(n){n&&(t.isInitModel?t.isInitModel=!1:(Application.addLocker(),setTimeout(function(){var t=!1;UI.hasDeviceIdInTemplateData(n.getId())||(t=!0);UI.setDevice(n);Application.removeLocker();t&&Application.showEmptyDialog("Hint",'<p class="text-center" style="font-size: 1.4em;">To add more elements, move them from header/footer to page, manage design, pages and site settings please change view to "Desktop" again.<\/p> <div class="text-center"><div class="service-button" data-dismiss="modal">Got It<\/div><\/div>')},500)))}),t.init(n),t},HistoryManagementModel=function(n){var t=this;return t.versions=ko.observableArray([]),t.currentTemplateVersionId=ko.observable(),t.init=function(){t.currentTemplateVersionId(window.lastEditorTemplateVersionId);t.versions([]);Application.GetHistoryManagement(window.templateId,function(n){n&&t.versions(n.map(function(n){return n.formatedDate=moment(n.date).format("DD.MM.YYYY hh:mm A"),n}))})},t.selectVersion=function(n){Application.SetTemplateVersionActive(n.templateVersionId,function(i){i&&(window.lastEditorTemplateVersionId=n.templateVersionId,t.currentTemplateVersionId(window.lastEditorTemplateVersionId),UI.unsavedChanges=!1,Application.addLocker(),window.location.reload())})},t.init(n),t},HiddenElementsModel=function(n){var t=this;return t.elements=ko.observableArray(),t.showHiddens=ko.observable(!1),t.showHiddens.subscribe(function(n){(n||n===!1)&&(UI.settings.showHidden=n,n?_.forEach(t.elements(),function(n){UI.actionService.runActionForComponent(n,ACTION_ADD_TO_FORM,!0)}):_.forEach(t.elements(),function(n){UI.actionService.runActionForComponent(n,ACTION_REMOVE_FROM_FORM,!0)}))}),t.init=function(n){t.elements(n);t.showHiddens(UI.getSetting("showHidden"))},t.toggleShowHiddens=function(){t.showHiddens(!t.showHiddens())},t.showElement=function(n){UI.undoManagerAddSimpleArr([{component:n,property:HIDE_COMPONENT,newvalue:"false",oldvalue:"true"}],function(){t.elements.remove(n);UI.getSetting("showHidden")&&UI.actionService.runActionForComponent(n,ACTION_REMOVE_FROM_FORM,!0);UI.actionService.runActionForComponent(n,ACTION_ADD_TO_FORM,!0)},function(){UI.actionService.runActionForComponent(n,ACTION_REMOVE_FROM_FORM,!0);UI.getSetting("showHidden")&&UI.actionService.runActionForComponent(n,ACTION_ADD_TO_FORM,!0)},!0)},t.init(n),t},StoreProductViewModel=function(n){var t=this,i;return t.component=n,t.productId=ko.observable(),t.galleryPage=ko.observable(),t.product=ko.observable({}),t.imagesIsCrop=!1,t.price=ko.observable(),t.discountPrice=ko.observable(0),t.price.subscribe(function(n){(n||n===0)&&t.product()&&t.product().isDiscount&&t.discountPrice(Product.calculateDiscountPrice(t.product().discountType,n,t.product().discount))}),t.options=ko.observableArray(),t.quantity=ko.observable(),t.isPreview=UI.getSetting("ispreview"),i=function(n){n?UI.store.getProduct(n,function(n){if(n){t.initProduct(n);var i=UI.pager.getPage(UI.pager.getCurrentPageId());i.name==="product"&&i.setMeta(t.product().title)}else UI.pager.goToHomePage()},UI.getSetting("ispreview")?!1:!0):UI.pager.goToHomePage()},t.init=function(n){t.component=n;t.galleryPage(UI.store.getPageWithGallery());var i=Guid.empty();UI.getSetting("ispreview")&&(i=Helpers.getStoreParamFromURL("productId"));t.productId()!==i&&t.productId(i)},t.pageGalleryName=function(){var n=t.galleryPage();return n?n.title:"Store"},t.pageGalleryLink=function(){var n=t.galleryPage();return UI.getSetting("ispreview")?n?Helpers.generateLinkToPage(n.name,!0):Helpers.generateLinkToPage(UI.pager.getPage(UI.pager.getHomePageId()).name,!0):null},t.productId.subscribe(i),t.initProduct=function(n){t.product(new Product(n));t.price(t.product().price);t.quantity(1);t.options([]);_.forEach(t.product().options,function(n){var i=ko.observable();i.subscribe(function(n){n&&t.price(t.price()+n.diff*-1)},this,"beforeChange");i.subscribe(function(n){n&&t.price(t.price()+n.diff)});t.options.push({id:n.id,title:n.title,value:i,items:ko.observableArray(n.items)})});t.shiftForOptions(t.options().length);t.refreshChild(STORE_PRODUCT_IMAGES)},t.refreshChild=function(n){var i=_.find(t.component.children,function(t){return t.proto.name===n});i&&(UI.actionService.runActionForComponent(i,ACTION_REMOVE_FROM_FORM),UI.actionService.runActionForComponent(i,ACTION_ADD_TO_FORM))},t.shiftForOptions=function(n){var i=_.find(t.component.children,function(n){return n.proto.name===STORE_PRODUCT_OPTIONS});if(i){var u=parseInt($(i.getUISelector()).find("div").css("max-height")),r=parseInt(i.getProperty(HEIGHT).value),f=(u>r*n?r*n:u)-r;f&&_.forEach(t.component.children,function(n){if(n.proto.name===STORE_PRODUCT_ADD_TO_CART||n.proto.name===STORE_PRODUCT_SOCIAL||n.proto.name===STORE_PRODUCT_QUANTITY){var t=$(n.getUISelector()),i=parseInt(n.getProperty(TOP).value);t.css(TOP,i+f+"px")}})}},t.socialShare=function(n){if(UI.getSetting("ispreview"))if(UI.getSetting("ispublished"))switch(n){case"tw":window.open("https://twitter.com/share?url="+location.href,"_blank");break;case"fb":window.open("https://www.facebook.com/sharer.php?u="+location.href,"_blank");break;case"gplus":window.open("https://plus.google.com/share?url="+location.href,"_blank")}else Application.showOkDialog("Error","Available only on published site!")},t.addToCart=function(){var n;if(UI.getSetting("ispreview")&&!t.product().outOfStock){var i=!0,r=t.productId()+"|",u=[];_.forEach(_.sortBy(t.options(),"title"),function(n){n.value()==null?i=!1:(r+=n.id+"="+n.value().id+";",u.push({id:n.id,title:n.title,items:[n.value()]}))});i?t.quantity()<1?(Application.showOkDialog("Error","Quantity of product must be greather then or equal 1"),t.quantity(1)):(UI.store.addToCart(r,t.product().toDTO(u),t.quantity()),Application.showOkDialog("Success","Your product added to cart!"),n=UI.viewModelRepository[STORE_CART_LINK],n&&n.refresh()):Application.showOkDialog("Error","Please select all options!")}},t.optionText=function(n){return n.value+" ("+(n.diff<0?"-"+t.product().currency+n.diff*-1:"+"+t.product().currency+n.diff)+")"},t.init(n),t},StoreGalleryViewModel=function(n){var t=this;return t.component={},t.products=ko.observableArray([]),t.sortOptions=[{title:"Price (low to high)",column:"CalcPrice",direction:0},{title:"Price (high to low)",column:"CalcPrice",direction:1},{title:"Name A-Z",column:"Name",direction:0},{title:"Name Z-A",column:"Name",direction:1}],t.isPreview=UI.getSetting("ispreview"),t.selectedSorting=ko.observable(),t.selectedSorting.subscribe(function(n){var i=n==="codeUpdate";defined(n)||(delete t.filter["grid-column"],delete t.filter["grid-dir"]);i||(t.loading(!1),t.initProducts(function(){},t.page()*t.getInitialCount()))}),t.page=ko.observable(1),t.columns=0,t.rows=0,t.filter={},t.isShowMoreButton=ko.observable(!1),t.loading=ko.observable(!1),t.init=function(n){n.id!==t.component.id?(t.component=n,t.filter={},t.selectedSorting.codeUpdate(undefined),t.reload()):(parseInt(t.component.getProperty(COLUMNS).value)!==t.columns||parseInt(t.component.getProperty(ROWS).value)!==t.rows)&&t.reload(function(){EditorFactory.recalculateStoreGallerySize(n)})},t.setFilter=function(n){t.filter=n;t.reload()},t.reload=function(n){n=defined(n)?n:function(){};t.loading(!1);t.initProducts(n)},t.getInitialCount=function(){return t.columns*t.rows},t.showMore=function(){if(UI.getSetting("ispreview")&&!t.loading()){t.loading(!0);var i=t.getInitialCount(),n=defined(t.filter)?t.filter:{};n.count=i;n.page=t.page()+1;n["grid-filter"]="IsVisible__1__true";t.selectedSorting()&&(n["grid-column"]=t.selectedSorting().column,n["grid-dir"]=t.selectedSorting().direction);UI.store.getProducts(n,function(n){var f;if(t.loading(!1),n){var r=$(t.component.getUISelector()),e=r.outerHeight(!0),u=r.parent(".page"),o=Helpers.findElementsUnder(r,u);t.page(t.page()+1);_.forEach(n,function(n){t.products.push(new Product(n))});t.isShowMoreButton(n.length===i);f=r.outerHeight(!0)-e;_.forEach(o,function(n){var t=parseInt(n.css(TOP));n.css(TOP,t+f+"px")});Resizer.recalculateHeaderFooterAndPageSize(u);UI.pager.setPageHeight(u.getId())}else t.isShowMoreButton(!1)})}},t.initProducts=function(n,i){n=defined(n)?n:function(){};var u=$(t.component.getUISelector()),r=defined(t.filter)?t.filter:{};t.products([]);t.isShowMoreButton(!1);t.columns=parseInt(t.component.getProperty(COLUMNS).value);t.rows=parseInt(t.component.getProperty(ROWS).value);i?r.page=1:(t.page(1),i=t.getInitialCount(),r.page=t.page());r.count=i;r["grid-filter"]="IsVisible__1__true";t.selectedSorting()&&(r["grid-column"]=t.selectedSorting().column,r["grid-dir"]=t.selectedSorting().direction);u.css("height",t.component.getProperty(HEIGHT).value);UI.store.getProducts(r,function(f){f&&(_.forEach(f,function(n){t.products.push(new Product(n))}),n(),f.length===i?(t.isShowMoreButton(!0),u.css("height","auto")):t.page()!==r.page&&t.page()>1&&u.css("height","auto"))},UI.getSetting("ispreview")?!1:!0)},t.init(n),t},StoreCartViewModel=function(n){var t=this;return t.component=n,t.products=ko.observableArray(),t.subTotal=ko.observable(),t.init=function(n){t.component=n;t.products([]);t.subTotal("");var i=0,r="";_.forEach(UI.store.getCart(),function(n){var u=ko.observable(n.quantity);u.subscribeChanged(function(i,r){var u,f,e,o;i<=0?(t.products.remove(function(t){return t.product.cartKey===n.product.cartKey}),UI.store.removeFromCart(n.product.cartKey,0,!0),u=UI.viewModelRepository[STORE_CART_LINK],u&&u.refresh()):(f=0,r&&(f=i-r),UI.store.addToCart(n.product.cartKey,n.product,f));e=0;o="";ko.utils.arrayForEach(t.products(),function(n){o=n.product.currency;e+=(n.product.isDiscount?n.product.getFullDiscountPrice():n.product.getFullPrice())*n.quantity()});t.subTotal(o+e.toFixed(2))});i+=(n.product.isDiscount?n.product.getFullDiscountPrice():n.product.getFullPrice())*n.quantity;r=n.product.currency;t.products.push({product:n.product,quantity:u})});t.subTotal(r+i.toFixed(2))},t.checkoutClick=function(){UI.getSetting("ispreview")&&UI.store.checkout(function(){t.products([]);t.subTotal("");var n=UI.viewModelRepository[STORE_CART_LINK];n&&n.refresh()})},t.back=function(){UI.getSetting("ispreview")&&(history.length>1?window.history.back():UI.pager.goToHomePage())},t.init(n),t},StoreThankYouViewModel=function(n){var t=this,i;return t.component=n,t.order=ko.observable({}),t.orderId=ko.observable(null),i=function(n){n?UI.store.getOrder(n,function(n){n?t.initOrder(n):UI.pager.goToHomePage()}):UI.pager.goToHomePage()},t.init=function(n){t.component=n;var r=Helpers.getStoreParamFromURL("orderId");t.orderId()===r?i(r):t.orderId(r)},t.initOrder=function(n){t.order(new Order(n))},t.orderId.subscribe(i),t.init(n),t},StoreCartLinkViewModel=function(n){var t=this;return t.component=n,t.count=ko.observable(),t.init=function(n){t.component=n;t.refresh()},t.refresh=function(){t.count(UI.store.cartCount())},t.init(n),t},ManageStoreProductsTabShippingAndTaxViewModel=function(n){var t=this;return t.currency="",t.weightUnit="",t.shippingLocations=ko.observableArray([]),t.taxLocations=ko.observableArray([]),t.showAddShippingLocation=ko.observable(!1),t.newShippingLocations=ko.observableArray([]),t.init=function(n){t.currency=UI.store.getCurrency().symbol;t.weightUnit=UI.store.getWeightUnit().symbol;t.showAddShippingLocation(!1);n||t.initData()},t.sortShippingLocations=function(){t.shippingLocations.sort(function(n,t){return parseInt(n.groupId)<parseInt(t.groupId)?-1:parseInt(n.groupId)>parseInt(t.groupId)?1:0})},t.sortTaxLocations=function(){t.taxLocations.sort(function(n,t){return parseInt(n.groupId)<parseInt(t.groupId)?-1:parseInt(n.groupId)>parseInt(t.groupId)?1:0})},t.getStateNamesAsString=function(n){return!n||n&&n.length==0?"":n.map(function(n){return n.state.desc}).join(", ")},t.addSavedShippingLocations=function(n,i,r,u){var o=[],f,e;_.forEach(i,function(n){o.push({id:n.id,type:n.typeId,countryId:n.countryId,name:n.name,countStart:parseFloat(n.startRange),countEnd:parseFloat(n.endRange),price:parseFloat(n.price)})});f=_.findIndex(t.shippingLocations(),function(t){return t.groupId==n});e={groupId:n,states:u,statesAsString:t.getStateNamesAsString(u),country:r,rates:ko.observableArray(o)};f==-1?t.shippingLocations.push(e):t.shippingLocations.replace(t.shippingLocations()[f],e);t.sortShippingLocations()},t.addSavedTaxLocations=function(n,i,r,u){_.forEach(i,function(i){t.taxLocations.push({groupId:n,country:r||{},states:u,statesAsString:t.getStateNamesAsString(u),taxValue:parseFloat(i.rate)})});t.sortTaxLocations()},t.handleFilteredRates=function(n,i,r,u,f){i==="shippingrate"?t.addSavedShippingLocations(n,r,u,f):i==="taxrate"&&t.addSavedTaxLocations(n,r,u,f)},t.handleRates=function(n,i,r,u){if(r){var f=r.map(function(n){return n.groupId});f=_.filter(f,function(n,t,i){return i.indexOf(n)===t});_.forEach(f,function(f){var s=_.filter(r,function(n){return n.groupId==f}),c=s[0].countryId,l=_.find(n,function(n){return n.id===c}),e,o,h;c===0?(e=s.map(function(n){return n.stateId}),e=_.filter(e,function(n,t,i){return i.indexOf(n)===t}),e.sort(),o=[],e&&e.length>0&&_.forEach(e,function(n){if(n!=undefined&&n!=""){var t=_.find(i,function(t){return t.shortName===n});o.push({state:t})}}),h={requesttype:"items",page:1,count:999},h["grid-filter"]=e&&e.length>0?"State__1__"+e[0]:"CountryId__1__0",ProxyService.send({},u,"GET",h,function(n){t.handleFilteredRates(f,u,n,l,o)})):t.handleFilteredRates(f,u,s,l,o)})}},t.initData=function(){var n=UI.store.getCountries(),i=UI.store.getStates(),r;t.shippingLocations([]);r=ko.toJS(t.newShippingLocations());_.forEach(r,function(n){if(n){var i=_.findIndex(t.shippingLocations(),function(t){return t.groupId==n.groupId});i==-1&&(t.shippingLocations.push({groupId:n.groupId,states:n.states,statesAsString:t.getStateNamesAsString(n.states),country:n.country,rates:ko.observableArray([])}),t.sortShippingLocations())}});UI.store.getShippingRates(function(r){t.handleRates(n,i,r,"shippingrate");t.sortShippingLocations()});UI.store.getTaxRates(function(r){t.taxLocations([]);t.handleRates(n,i,r,"taxrate")})},t.addShippingLocation=function(){var n=t.updateNewShippingLocations(),i=t.updateNewStates();viewEntity("#manage-store-products-add-shipping-location",{newShippingLocations:n,newStates:i})},t.addNewShippingLocations=function(n){var i={groupId:n.groupId,states:n.states,country:n.country};t.newShippingLocations.push(i)},t.updateNewShippingLocations=function(){var n=[];return _.forEach(t.newShippingLocations(),function(t){n.push(t.country.id)}),n},t.updateNewStates=function(){var n=[];return _.forEach(t.newShippingLocations(),function(t){_.forEach(t.states,function(t){n.push(t.state.shortName)})}),n},t.removeShippingLocation=function(){t.removeLocation(this.groupId,"shippingrate")},t.removeTaxLocation=function(){t.removeLocation(this.groupId,"taxrate")},t.removeLocation=function(n,i){var r={requesttype:"items",page:1,count:999,"grid-filter":"GroupId__1__"+n};ProxyService.send({},i,"GET",r,function(r){r?(r=_.map(r,function(n){return{id:n.id,isActive:!1}}),ProxyService.send({data:r,isArrayBodyRequest:!0},i,"PUT",{},function(){i=="taxrate"?t.taxLocations(_.filter(t.taxLocations(),function(t){return t.groupId!==n})):i=="shippingrate"&&t.newShippingLocations(_.filter(t.newShippingLocations(),function(t){return t.groupId!==n}));t.init()})):i=="shippingrate"&&(t.newShippingLocations(_.filter(t.newShippingLocations(),function(t){return t.groupId!==n})),t.init())})},t.removeShippingRate=function(n,i){var r=function(){t.init()};ProxyService.send({id:i.id},"shippingrate","DELETE",{},r)},t.addRate=function(){viewEntity("#manage-store-products-add-shipping-rate",{groupId:this.groupId,country:this.country,states:this.states})},t.addTaxLocation=function(){viewEntity("#manage-store-products-add-tax-location",{groupId:this.groupId,country:this.country,states:this.states})},t.init(n),t},ManageStoreProductsAddShippingRateViewModel=function(n){var t=this;return t.currency="",t.weightUnit="",t.name=ko.observable(),t.price=ko.observable(),t.countStart=ko.observable(),t.countEnd=ko.observable(),t.type=ko.observable(),t.init=function(n){t.groupId=n.groupId;t.country=n.country;t.states=n.states;t.currency=UI.store.getCurrency().symbol;t.weightUnit=UI.store.getWeightUnit().symbol;t.name("");t.price(0);t.countStart(0);t.countEnd(0);t.type(1)},t.save=function(){var n=[],i;_.forEach(t.states,function(i){var r={countryId:t.country.id,stateId:i.state.shortName,groupId:t.groupId,name:t.name(),price:t.price(),startRange:t.countStart(),endRange:t.countEnd(),typeId:t.type()};n.push(r)});t.country.id!==0&&(i={countryId:t.country.id,stateId:"",groupId:t.groupId,name:t.name(),price:t.price(),startRange:t.countStart(),endRange:t.countEnd(),typeId:t.type()},n.push(i));ProxyService.send({data:n,isArrayBodyRequest:!0},"shippingrate","POST",{},function(){t.back()})},t.toggleType=function(){t.type()===1?t.type(2):t.type(1)},t.back=function(){$("#shippingAndTaxTab").click()},t.init(n),t},ManageStoreProductsAddShippingLocationViewModel=function(n){var t=this;return t.selectedCountry=ko.observable(""),t.previousGroupId=-1,t.newShippingLocations=[],t.selectedCountry=ko.observable(),t.selectedStates=ko.observableArray([]),t.newStates=[],t.init=function(n){t.selectedCountry("");n&&n.newShippingLocations&&(t.newShippingLocations=n.newShippingLocations);n&&n.newStates&&(t.newStates=n.newStates);t.initCountries()},t.initCountries=function(){t.countries=ko.observableArray([]);t.states=ko.observableArray([]);t.availableCountries=UI.store.getCountries();t.availableStates=UI.store.getStates();ko.bindingHandlers.optionsShippingBind={preprocess:function(n,t,i){i("optionsAfterRender","function(option, item) { ko.bindingHandlers.optionsShippingBind.applyBindings(option, item, "+n+") }")},applyBindings:function(n,t,i){t!==undefined&&(n.setAttribute("data-bind",i),ko.applyBindings(ko.contextFor(n).createChildContext(t),n))}};UI.store.getShippingRates(function(n){if(n){var r=n.map(function(n){return n.countryId}),u=n.map(function(n){return n.stateId}),i=n.map(function(n){return n.groupId});t.previousGroupId=t.previousGroupId>-1?t.previousGroupId:i.length>0?Math.max.apply(-1,i):-1;_.forEach(t.availableCountries,function(n){n.enabled=ko.observable(n.id===0||$.inArray(n.id,r)==-1&&$.inArray(n.id,t.newShippingLocations)==-1)});t.countries(t.availableCountries);_.forEach(t.availableStates,function(n){n.enabled=ko.observable($.inArray(n.shortName,u)==-1&&$.inArray(n.shortName,t.newStates)==-1)});t.states(t.availableStates)}})},t.save=function(){var u={},f=[],n=t.selectedCountry(),i=t.selectedStates(),r;t.newShippingLocations.push(n);t.newStates=t.newStates.concat(i);t.previousGroupId++;(n>0||n==0&&i.length>0)&&(country=_.find(t.countries(),function(t){return t.id===n}),country.groupId=t.previousGroupId,country.id==0&&i&&_.forEach(_.filter(t.states(),function(n){return i.indexOf(n.shortName)!==-1}),function(n){f.push({state:n})}),u={groupId:t.previousGroupId,country:country,states:f},r=UI.getViewModel("#manage-store-products-tab-shipping-and-tax",{}),r&&(r.addNewShippingLocations(u),t.back()))},t.back=function(){$("#shippingAndTaxTab").click()},t.init(n),t},ManageStoreProductsAddTaxLocationViewModel=function(n){var t=this;return t.selectedCountry=ko.observable(""),t.previousGroupId=-1,t.selectedCountry=ko.observable(),t.selectedStates=ko.observableArray([]),t.taxValue=ko.observable(),t.init=function(){t.selectedCountry("");t.taxValue(0);t.initCountries()},t.initCountries=function(){t.countries=ko.observableArray([]);t.states=ko.observableArray([]);t.availableCountries=UI.store.getCountries();t.availableStates=UI.store.getStates();ko.bindingHandlers.optionsTaxBind={preprocess:function(n,t,i){i("optionsAfterRender","function(option, item) { ko.bindingHandlers.optionsTaxBind.applyBindings(option, item, "+n+") }")},applyBindings:function(n,t,i){t!==undefined&&(n.setAttribute("data-bind",i),ko.applyBindings(ko.contextFor(n).createChildContext(t),n))}};UI.store.getTaxRates(function(n){if(n){var r=n.map(function(n){return n.countryId}),u=n.map(function(n){return n.stateId}),i=n.map(function(n){return n.groupId});t.previousGroupId=t.previousGroupId>-1?t.previousGroupId:i.length>0?Math.max.apply(-1,i):-1;_.forEach(t.availableCountries,function(n){n.enabled=ko.observable(n.id===0||$.inArray(n.id,r)==-1)});t.countries(t.availableCountries);_.forEach(t.availableStates,function(n){n.enabled=ko.observable($.inArray(n.shortName,u)==-1)});t.states(t.availableStates)}})},t.save=function(){var n=[],i=t.selectedCountry(),r=t.selectedStates();t.previousGroupId++;(i>0||i==0&&r.length>0)&&(country=_.find(t.countries(),function(n){return n.id===i}),country.groupId=t.previousGroupId,country.id==0&&r?_.forEach(_.filter(t.states(),function(n){return r.indexOf(n.shortName)!==-1}),function(i){n.push({groupId:t.previousGroupId,countryId:country.id,stateId:i.shortName,rate:parseFloat(t.taxValue())})}):n.push({groupId:t.previousGroupId,countryId:country.id,stateId:"",rate:parseFloat(t.taxValue())}),ProxyService.send({data:n,isArrayBodyRequest:!0},"taxrate","POST",{},function(){t.back()}))},t.back=function(){$("#shippingAndTaxTab").click()},t.init(n),t},StoreCategoriesViewModel=function(n){var t=this;return t.component=n,t.text=ko.observable(),t.categories=ko.observableArray([]),t.init=function(n){t.component=n;t.categories([new Category({name:"All",id:0})]);t.text(t.component.getProperty(TEXT).value);t.selectedCategoryId=ko.observable(0);t.selectedCategoryId.subscribe(function(n){_.forEach(UI.store.getGalleries(),function(t){var i=UI.viewModelRepository["store-gallery"+t.id];i&&(n?i.setFilter({CategoryId:n}):i.setFilter({}))})});UI.store.getCategories({"grid-filter":"ParentId__10__null"},function(n){n&&_.forEach(n,function(n){t.categories.push(new Category(n))})})},t.changeFilter=function(){t.selectedCategoryId()===this.id||this.id===0?t.clearFilter():(t.text(this.name),t.selectedCategoryId(this.id))},t.clearFilter=function(){t.text(t.component.getProperty(TEXT).value);t.selectedCategoryId(0)},t.init(n),t},UI=function(){},autoSaveTimer=null;UI.newComponents=[];UI.init=function(){UI.undoManager=new UndoManager;UI.componentcreatedispose=eventsystem.subscribe("/component/create/",UI.componentCreatedHandler)};UI.syncGoogleAnalitycs=function(n,t){if(defined(UI.gogleAnalitycsStore)||(UI.gogleAnalitycsStore={curstep:1,code:null}),defined(n))t==null&&(t=UI.gogleAnalitycsStore.code),UI.gogleAnalitycsStore={curstep:n,code:t};else return UI.gogleAnalitycsStore};UI.configure=function(n){UI.config=n;UI.getSetting("ispublished")||$(UI.getConfigurationValue(HTML)).bind("click",function(n){if($(n.target).hasClass("fa-clone")||$(n.target).hasClass("fa-clipboard"))return!0;UI.removeEditor()});PointerEventsPolyfill.initialize({})};UI.initDevices=function(n){UI.devices=[];_.forEach(n,function(n){var t=new Device(n);UI.devices.push(t);!UI.getSetting("ispreview")&&t.isDefault?(UI.setDevice(t,!0),UI.getTemplateProperty("devices").length||UI.addDeviceIdToTemplateData(t.getId())):UI.getSetting("ispreview")&&(UI.getSetting("isThumbnailPreview")?t.isDefault&&UI.setDevice(t,!0):UI.getSetting("ispublished")?t.isWidthInRange(UI.getSetting("width"))&&UI.setDevice(t,!0):Helpers.getQueryParamValue("deviceId")?Helpers.getQueryParamValue("deviceId")==t.getId()&&UI.hasDeviceIdInTemplateData(t.getId())&&UI.setDevice(t,!0):t.isDefault&&UI.setDevice(t,!0))});!UI.getDevice()&&UI.getDefaultDeviceId()&&(UI.getSetting("ispreview")&&!UI.getSetting("ispublished")&&Helpers.getQueryParamValue("deviceId")&&Helpers.changeQueryWithoutReload(Helpers.removeQueryParam("deviceId")),UI.setDevice(UI.getDevice(UI.getDefaultDeviceId()),!0))};UI.setDevice=function(n,t){(UI.settings||(UI.settings={}),UI.getDevice()&&UI.getDevice().getId()===n.getId())||(n.isHaveComponentProperties()||Device.setDeviceRequest(n),UI.settings.current_device&&$(".site-wrapper").removeClass(UI.settings.current_device.getType()),UI.settings.current_device=n,n.isDesktop()?($("#design-management").removeClass("disabled").attr("data-original-title","Design Management").bind("click",function(n){UI.displayDesignPopover(n)}),$("#page-management").removeClass("disabled").attr("data-original-title","Page Management").bind("click",function(n){UI.displayPagePopover(n)}),$("#history-management").removeClass("disabled").attr("data-original-title","History").bind("click",function(n){UI.displayHistoryPopover(n)}),$("#site-settings").removeClass("disabled").attr("data-original-title","Site Settings").bind("click",function(n){UI.displaySitePopover(n)}),$("#store").removeClass("disabled").attr("data-original-title","My Store").bind("click",function(n){UI.displayStorePopover(n)}),$(".position-add-new-com").show()):($("#design-management").addClass("disabled").attr("data-original-title","Available only on Desktop view").unbind("click"),$("#page-management").addClass("disabled").attr("data-original-title","Available only on Desktop view").unbind("click"),$("#site-settings").addClass("disabled").attr("data-original-title","Available only on Desktop view").unbind("click"),$("#history-management").addClass("disabled").attr("data-original-title","Available only on Desktop view").unbind("click"),$("#store").addClass("disabled").attr("data-original-title","Available only on Desktop view").unbind("click"),$(".position-add-new-com").hide()),$(".site-wrapper").css("width",n.getWidth()+"px").addClass(n.getType()),t||EditorApplication.reBuild(),UI.getSetting("ispreview")&&(Helpers.bindViewportToResize(UI.getSetting("width"),n.getWidth()),$("body").addClass(n.getType())),UI.getSetting("ispreview")||clipBoard.isDesktopView(n.isDesktop()))};UI.getDevice=function(n){return n?_.find(UI.devices,function(t){return t.id===n}):UI.settings.current_device};UI.getDefaultDeviceId=function(){return UI.devices.where({isDefault:!0}).firstOrDefault().getId()};UI.logs=[];UI.addLog=function(n,t){UI.logs.push(new LogItem({action:n,controlId:t.id,componentId:t.componentId,parentId:t.parentComponent.id}))};UI.removeLog=function(n,t){_.remove(UI.logs,function(i){return i.action===n&&t.id===i.controlId})};UI.exportLogs=function(){UI.getBody().setProperty(LOGS_PROPERTY,JSON.stringify(UI.logs.map(function(n){return n.toString()})))};UI.resetLogs=function(){UI.getBody().setProperty(LOGS_PROPERTY,"");UI.logs=[]};UI.injectRepositories=function(n,t){UI.siteComponentRepository=n;UI.basicComponentRepository=t;UI.viewModelRepository={}};UI.setViewModel=function(n,t){UI.viewModelRepository[n]=t};UI.getViewModel=function(n,t,i,r){i=defined(i)?i:"";r=defined(r)?r:!0;var u=UI.viewModelRepository[n+i];return u?(r&&u.init(t),u):(u=ViewModelFactory.getModel(n,t),UI.setViewModel(n+i,u),u)};UI.injectServices=function(n){UI.componentService=n};UI.getTooltips=function(){$.ajax({url:"/Editor/GetTooltips",type:"GET",success:function(n){UI.tooltips=new Tooltips(n)}})};UI.injectPostLoadInit=function(n){UI.postLoadInit=n};UI.injectVideo=function(n){UI.MediaService=n};UI.injectRulerGuides=function(n){UI.RulerGuides=n};UI.injectJsonCompareService=function(n){UI.jsonCompareService=n};UI.injectSwitchManager=function(n){UI.SwitchManager=n};UI.injectActionService=function(n){UI.actionService=n};UI.injectAuthService=function(n){UI.authService=n;Application.addLocker();UI.authService.isAuthentificate(!0);Application.removeLocker()};UI.getConfigurationValue=function(n){return defined(UI.config[n])?UI.config[n]:String.empty};UI.setSettings=function(n){n!==null&&(UI.settings=$.extend({},{isadmin:!1,templateId:"",ispreview:!1,adminSiteDomain:"",isThumbnailPreview:!1,ispublished:!1,isrender:!1,isrenderpublish:!1,deviceType:SWITCHER_DESKTOP,actionType:0,width:960,onlyDesktop:!1,showHidden:!1,showFirstSavePopup:!0},n))};UI.ajaxSetup=function(){var n=UI.getTemplateProperty("templateId"),t={},i;$.ajaxSettings.headers&&$.ajaxSettings.headers.TemplateId&&$.ajaxSettings.headers.TemplateId===n||(t.TemplateId=n);i=UI.getSetting("webApiToken");UI.getSetting("ispreview")||!i||$.ajaxSettings.headers&&$.ajaxSettings.headers.Authorization&&$.ajaxSettings.headers.Authorization===n||(t.Authorization=i);$.ajaxSetup({headers:t})};UI.getSetting=function(n){try{if(defined(UI.settings[n]))return UI.settings[n]}catch(t){console.log("UI.getSetting fail:"+n)}};UI.undoManagerUndo=function(){$(".design-popover-custom").is(":visible")?(paletteCount--,paletteCount<1?($("#palete-undo").addClass("not-active"),UI.undoManager.undo()):UI.undoManager.undo()):(UI.removeEditor(),UI.undoManager.undo())};UI.undoManagerRedo=function(){UI.removeEditor();UI.undoManager.redo()};UI.undoManagerClear=function(){UI.undoManager.clear()};UI.undoManagerAdd=function(n){UI.undoManager.add(n)};UI.undoManagerGetLatestProperty=function(){return UI.undoManager.getLatestProperty()};UI.undoManagerGetLatestComponentId=function(){return UI.undoManager.getLatestComponentId()};UI.undoManagerAddSpecific=function(n,t){UI.undoManager.addSpecificActionToEnd(n,t)};UI.undoManagerAddSimple=function(n,t,i,r,u){return UI.undoManagerAddSimpleArr([{component:n,property:t,newvalue:_.clone(i),oldvalue:""}],r,r,u)};UI.undoManagerGetLatestCommand=function(){return UI.undoManager.getLatestCommand()};UI.undoManagerAddNewItemToUpdatedStructSimpleArr=function(n,t,i){Helpers.consoleLog("structNew ",t);Helpers.consoleLog("undoRedoItem ",n);var r=function(t,i){i=="undo"?t.forEach(function(t){t.action?t.action(t.oldvalue):(t.component.setProperty(t.property,t.oldvalue),n.callbackundo(t.component,t.property,t.oldvalue))}):t.forEach(function(t){t.action?t.action(t.newvalue):(t.component.setProperty(t.property,t.newvalue),n.callbackredo(t.component,t.property,t.newvalue))})};!n.structs&&n.callbackredo&&n.callbackundo&&(n.structs=[]);n.structs&&(n.structs.push(t),n.undo=function(){r(n.structs,"undo")},n.redo=function(){r(n.structs,"redo")});i&&(t.action?t.action(t.newvalue):(t.component.setProperty(t.property,t.newvalue),$(t.component.getUISelector()).css(t.property,t.newvalue),n.callbackredo&&n.callbackredo(t.component,t.property,t.newvalue)))};UI.undoManagerAddUpdatedStructSimpleArr=function(n,t){n=n||function(){};t=t||function(){};var i={undo:null,redo:null,structs:[],callbackredo:n,callbackundo:t};UI.undoManagerAdd(i)};UI.undoManagerAddSimpleArr=function(n,t,i,r){t=t||function(){};i=i||function(){};n.forEach(function(n){n.oldvalue==""&&(n.oldvalue=_.clone(n.component.getProperty(n.property).value))});var f=function(n,r){n.forEach(function(u,f){r=="undo"?(u.component.setProperty(u.property,u.oldvalue),i(u.oldvalue,u.component,u.property,f,n.length)):(u.component.setProperty(u.property,u.newvalue),t(u.newvalue,u.component,u.property,f,n.length))})},u={undo:function(){f(n,"undo")},redo:function(){f(n,"redo")}};return UI.undoManagerAdd(u),r&&u.redo(),u};UI.undoManagerAddRemoving=function(n,t,i){var f=_.clone(n),o=_.clone(t),r=function(){var n=UI.siteComponentRepository.remove({id:f});return i(),n},u=r(),e=function(){var n=UI.siteComponentRepository.lookupData({id:u.parentComponent.id});UI.siteComponentRepository.appendTo(u,n);i()};UI.undoManagerAdd({undo:function(){e()},redo:function(){r()}})};UI.undoManagerAddAddElements=function(n,t){var i=function(){n.forEach(function(n){var t=UI.siteComponentRepository.lookupData({id:n.parentComponent.id});UI.siteComponentRepository.appendTo(n,t)});t()},r=function(){n.forEach(function(n){UI.siteComponentRepository.remove({id:n.id})});t()};UI.undoManagerAdd({undo:function(){r()},redo:function(){i()}})};UI.setTemplateData=function(n){UI.templateData=n};UI.setTemplateProperty=function(n,t){defined(UI.templateData)&&(UI.templateData[n]=t)};UI.getTemplateProperty=function(n){return defined(UI.templateData)&&UI.templateData.hasOwnProperty(n)?UI.templateData[n]:null};UI.setTemplateProperties=function(n){if(defined(UI.templateData)){var t=Object.keys(n);t.length>0&&t.forEach(function(t){UI.setTemplateProperty(t,n[t])})}};UI.addControlsToTemplateData=function(n){defined(UI.templateData)&&(UI.templateData.controls=n)};UI.templateToJson=function(){return defined(UI.templateData)?(UI.addControlsToTemplateData(UI.siteComponentRepository.resolveDependecies()),JSON.stringify(UI.templateData)):JSON.stringify({})};UI.hasDeviceIdInTemplateData=function(n){return _.indexOf(UI.getTemplateProperty("devices"),n)!==-1};UI.addDeviceIdToTemplateData=function(n){var t=UI.getTemplateProperty("devices");t.push(n);UI.setTemplateProperty("devices",t)};UI.removeDeviceIdFromTemplateData=function(n){var t=UI.getTemplateProperty("devices");_.remove(t,function(t){return t==n});UI.setTemplateProperty("devices",t)};UI.setPager=function(n){UI.pager=defined(n)?n:null};UI.setAnchor=function(n){UI.anchor=defined(n)?n:null};UI.setSiteSettings=function(n){UI.siteSettings=defined(n)?n:null};UI.setDesigner=function(n){UI.designer=defined(n)?n:null};UI.setPaletteId=function(){var n=UI.settings.templateId;$.getJSON("/palettes/template/"+n).done(function(n){try{UI.currentPaletteId=n.Id}catch(t){console.log("Error on load default palette id")}})};UI.renderMenus=function(){MenuHelper.renderMenus()};UI.removeEditor=function(){var i,n,r,t,u;if($("#locker").length==1||$("#component-modal > .modal").length||UI.isckeditorworking)return!1;for($(UI.getConfigurationValue(EDITOR)).find("input").blur(),$(UI.getConfigurationValue(EDITOR)).remove(),$(UI.getConfigurationValue(SELECT_WRAPPER)).remove(),dragDrop.releaseElement(),$("*").data("selected",!1),PopoverHelper.hidePopovers(),ColorPickerHelper.hide(),$(".upclick-container").remove(),$("#gallery-editor").remove(),$("#gallery-pre-editor").remove(),i=["list","contact-us"],n=0;n<i.length;n++)for(r=UI.siteComponentRepository.lookupDataSet({displayName:i[n]}),t=0;t<r.length;t++)u=r[t],u.isNotApproved==!0&&UI.siteComponentRepository.remove({id:u.id})};UI.removeDockContainer=function(){$(UI.getConfigurationValue(DOCK_WRAPPER)).remove()};UI.lastKeyDownEvent=null;UI.handleKeyDown=function(n){var i=function(){var r=$(UI.getConfigurationValue(SELECT_WRAPPER));if(r.length>0){var f=$("#"+r.data("for")),e=f.getId(),i=n.lookupData({id:e});if(i==null||$("#"+i.id).attr("contenteditable")=="true"||!Helpers.allowDelete(i))return;var u=function(){var t=n.remove({id:i.id});return UI.addLog("remove",t),UI.removeEditor(),{model:t}},t=u(),o=function(){function i(n){n.componentId==="88cbc4c2-bb93-45e9-a318-57218c7c0171"&&UI.renderMenus();n.isDockable&&n.children.length>0&&n.children.forEach(i);UI.removeLog("remove",n)}var r=n.lookupData({id:t.model.parentComponent.id});n.appendTo(t.model,r);UI.actionService.addToActionData(t.model,!0);UI.actionService.runActionForComponent(t.model,ACTION_ADD_TO_FORM,!0);i(t.model)};UI.undoManagerAdd({undo:function(){o()},redo:function(){u()}})}Grouping.isActive()&&Grouping.deleteGroupSelectedComponents()},t=function(){var u=$(UI.getConfigurationValue(SELECT_WRAPPER)),r,i;if(u.length>0){var f=$("#"+u.data("for")),e=f.getId(),t=n.lookupData({id:e});if(t==null||$("#"+t.id).attr("contenteditable")=="true"||f.hasClass("std-form-subcomponent")||!Helpers.allowHide(t))return;r=t.getProperty(HIDE_COMPONENT);i=r!=null?r.value.toBoolean():!1;UI.undoManagerAddSimpleArr([{component:t,property:HIDE_COMPONENT,newvalue:(!i).toString(),oldvalue:i.toString()}],function(){i?(UI.getSetting("showHidden")&&(UI.actionService.runActionForComponent(t,ACTION_REMOVE_FROM_FORM,!0),UI.removeEditor()),UI.actionService.runActionForComponent(t,ACTION_ADD_TO_FORM,!0)):(UI.actionService.runActionForComponent(t,ACTION_REMOVE_FROM_FORM,!0),UI.removeEditor(),UI.getSetting("showHidden")&&UI.actionService.runActionForComponent(t,ACTION_ADD_TO_FORM,!0))},function(){i?(UI.actionService.runActionForComponent(t,ACTION_REMOVE_FROM_FORM,!0),UI.removeEditor(),UI.getSetting("showHidden")&&UI.actionService.runActionForComponent(t,ACTION_ADD_TO_FORM,!0)):(UI.getSetting("showHidden")&&(UI.actionService.runActionForComponent(t,ACTION_REMOVE_FROM_FORM,!0),UI.removeEditor()),UI.actionService.runActionForComponent(t,ACTION_ADD_TO_FORM,!0))},!0)}Grouping.isActive()&&Grouping.showOrHideGroupSelectedComponents(!0)};$(UI.getConfigurationValue(HTML)).bind("keydown",function(n){if(UI.disableBrowserHotKeys(n),!UI.lastKeyDownEvent||UI.lastKeyDownEvent.keyCode!==n.keyCode||n.keyCode===0){UI.lastKeyDownEvent=n;switch(n.keyCode){case 8:case 46:$(n.target).hasClass("std-input")||$(n.target).hasClass("std-textarea")||$(n.target).closest("#editor")==null||(UI.getDevice().isDesktop()?i():t(),clipBoard.selectedItem(null),clipBoard.itemForClipboard(null));UI.getDevice().isDesktop()&&Resizer.recalculateSizeFooterContainer($(".footer")[0]);UI.lastKeyDownEvent=null;break;case 67:(n.ctrlKey||n.metaKey)&&!Helpers.hasInputClass(n.target)&&ClipboardViewModel.distributionClipboard(COPY);break;case 86:(n.ctrlKey||n.metaKey)&&!Helpers.hasInputClass(n.target)&&ClipboardViewModel.distributionClipboard(PASTE);break;case 68:(n.ctrlKey||n.metaKey)&&!Helpers.hasInputClass(n.target)&&(n.stopPropagation(),n.preventDefault(),ClipboardViewModel.distributionClipboard(DUPLICATE));break;case 90:(n.ctrlKey||n.metaKey)&&!Helpers.hasInputClass(n.target)&&UI.undoManagerUndo();break;case 89:(n.ctrlKey||n.metaKey)&&!Helpers.hasInputClass(n.target)&&UI.undoManagerRedo();break;case 0:n.preventDefault();t();clipBoard.selectedItem(null);clipBoard.itemForClipboard(null)}}})};UI.handleKeyUp=function(){$(UI.getConfigurationValue(HTML)).bind("keyup",function(){UI.lastKeyDownEvent=null})};UI.disableBrowserHotKeys=function(n){switch(n.keyCode){case 8:$(n.target).is("body")&&(n.stopPropagation(),n.preventDefault());break;case 46:$(n.target).is("body")&&(n.stopPropagation(),n.preventDefault());break;case 68:(n.ctrlKey||n.metaKey)&&(n.stopPropagation(),n.preventDefault());break;case 89:n.metaKey&&(n.stopPropagation(),n.preventDefault());break;case 90:n.metaKey&&(n.stopPropagation(),n.preventDefault())}};UI.callEditor=function(n){var u=n.getProperty(HIDE_COMPONENT),t,r,i,f;if(!(UI.getSetting("showHidden")&&u!=null&&u.value.toBoolean())){for(name in CKEDITOR.instances)CKEDITOR.instances.hasOwnProperty(name)&&(t=CKEDITOR.document.getById(name),t&&t.$.isContentEditable&&t.$.contentEditable=="true"&&(r=$(t.$).data("focusManagerInstance"),r!=null&&r.blur()));UI.removeEditor();f=$(n.getUISelector());Helpers.isSpecificComponent(n)?Helpers.isGalleryComponent(n)&&UI.getDevice().isDesktop()&&(i=TemplateFactory.templateFor(n,EDITOR_TEMPLATE).compiledTemplate,$("body").append(i),$("#gallery-editor").bind("click",function(n){n.stopPropagation()}),$("#gallery-editor").position({of:$(window),at:"center center"}),parseInt($("#gallery-editor").css("top"))<0&&$("#gallery-editor").css("top","0px")):(i=TemplateFactory.templateFor(n,EDITOR_TEMPLATE).compiledTemplate,PopoverHelper.bind(f,i,"simple-editor-popover","body",{shown:function(){UI.actionService.runActionForComponent(n,ACTION_EDITOR_OPEN)},hidden:function(){UI.actionService.runActionForComponent(n,ACTION_EDITOR_CLOSED)}}),ko.observable($(UI.getConfigurationValue(EDITOR))).extend({applyBindingsToDescendants:clipBoard}));n.editor();ko.observable($(UI.getConfigurationValue(EDITOR))).extend({applyBindingsToDescendants:clipBoard});$(UI.getConfigurationValue(EDITOR)+" .accordion .ui-accordion-content").hide();$(UI.getConfigurationValue(EDITOR)+" .accordion .ui-accordion-content.ui-accordion-content-active").show();$(".popover").draggable()}};UI.callPreEditor=function(n){var t=n.getProperty(HIDE_COMPONENT),i,r,u;UI.getSetting("showHidden")&&t!=null&&t.value.toBoolean()||(UI.removeEditor(),i=$(n.getUISelector()),n.isNotApproved=!0,r=TemplateFactory.templateFor(n,EDITOR_TEMPLATE).compiledTemplate,PopoverHelper.bind(i,r,"pre-editor-popover"),$(UI.getConfigurationValue(EDITOR)).bind("click",function(n){n.stopPropagation()}),$("#gallery-editor").hide(),$("#editor").hide(),$("#gallery-pre-editor").show(),$("#pre-editor").show(),$("#gallery-pre-editor .close-button").bind("click",function(){UI.removeEditor()}),u=n.editor(),$(".popover .arrow").remove(),$(".pre-editor-popover").position({of:$(window),at:"center center"}),parseInt($(".pre-editor-popover").css("top"))<0&&$(".pre-editor-popover").css("top","0px"))};UI.displayComponentPopover=function(n){n.stopPropagation();UI.removeEditor();PopoverHelper.bind($(".component-menu-button"),$("#component-menu").html(),"add-elements-popover-custom");$(".popover .tab-li").first().addClass("active");$(".popover .tab-pane").removeClass("active");$(".popover .tab-pane").first().addClass("active")};UI.displayPagePopover=function(n){n.stopPropagation();UI.removeEditor();PopoverHelper.bind($("#page-management"),Helpers.loadServiceTemplate("page-management-template"),"page-popover-custom");Pager.renderPager(UI.pager);$(".popover-title").hide();$("body > div.page-popover-custom").css({top:"118px",position:"fixed"});$(".popover").draggable()};UI.displaySitePopover=function(n){n.stopPropagation();UI.removeEditor();PopoverHelper.bind($("#site-settings"),Helpers.loadServiceTemplate("site-settings-template"),"site-popover-custom");$(".popover-title").hide();$("body > div.site-popover-custom").css({top:"163px",position:"fixed"});UI.siteSettings.showSettings();$(".popover").draggable()};UI.displayNavigationPanelPopover=function(){var i=parseInt($(".vRule").width())+parseInt($(".vRule").css("border-right-width")),n,t;PopoverHelper.bind($("#right-navigation-panel"),Helpers.loadServiceTemplate("right-navigation-panel-template"),"right-navigation-panel-popover-custom");$(".popover-title").hide();$(".arrow").hide();n=parseInt($(window).width())-165-i;$("body > div.right-navigation-panel-popover-custom").css({"min-width":"155px",width:"155px",top:"85px",left:n,position:"fixed",margin:"0px","z-index":1100});$(".popover").draggable();t=UI.getViewModel("right-navigation-panel");ko.applyBindings(t,$(".right-navigation-panel-popover-custom")[0])};UI.displayPlacingOnCanvasTopPopover=function(n){n.stopPropagation();$(n.currentTarget).children().hasClass("disabled")||(PopoverHelper.bind($("#placing-on-canvas-top"),Helpers.loadServiceTemplate("placing-on-canvas-top-template"),"placing-on-canvas-top-custom"),$(".popover-title").hide(),$(".arrow").hide(),$("body > div.placing-on-canvas-top-custom").css({"min-width":"135px",width:"135px","max-height":"42px","max-height":"42px","border-radius":"5px"}))};UI.displayPlacingOnCanvasBottomPopover=function(n){n.stopPropagation();$(n.currentTarget).children().hasClass("disabled")||(PopoverHelper.bind($("#placing-on-canvas-bottom"),Helpers.loadServiceTemplate("placing-on-canvas-bottom-template"),"placing-on-canvas-bottom-custom"),$(".popover-title").hide(),$(".arrow").hide(),$("body > div.placing-on-canvas-bottom-custom").css({"min-width":"90px",width:"90px","max-height":"42px","max-height":"42px","border-radius":"5px"}))};UI.displayDesignPopover=function(n){n.stopPropagation();UI.removeEditor();PopoverHelper.bind($("#design-management"),TemplateCache.get("design-management-template"),DESIGN_POPOVER_CUSTOM);$(".popover-title").hide();$("body > div.design-popover-custom").css({top:"73px",position:"fixed"});Designer.showBackgroundMenu();$(".popover").draggable();ko.applyBindings({},$("#collapseThree")[0])};UI.displayDevicePopover=function(n){n.stopPropagation();UI.removeEditor();PopoverHelper.bind($("#device-management"),Helpers.loadServiceTemplate("device-management-template"),"device-popover-custom");$("body > div.device-popover-custom").css({top:"208px",position:"fixed"});$(".popover-title").hide();var t=UI.getViewModel("device-management",{device:UI.getDevice(),devices:UI.devices});ko.applyBindings(t,$("#device-management-template")[0]);$(".popover").draggable()};UI.displayHiddenPopover=function(n){n.stopPropagation();UI.removeEditor();PopoverHelper.bind($("#hidden-elements"),Helpers.loadServiceTemplate("hidden-elements-template"),"hidden-popover-custom");$("body > div.hidden-popover-custom").css({top:"253px",position:"fixed"});$(".popover-title").hide();var t=UI.getViewModel("hidden-elements",UI.siteComponentRepository.lookupDataByProperty({"hide-component":"true"}));ko.applyBindings(t,$("#hidden-elements-template")[0]);$(".popover").draggable()};UI.displayHistoryPopover=function(n){n.stopPropagation();UI.removeEditor();PopoverHelper.bind($("#history-management"),Helpers.loadServiceTemplate("history-management-template"),"history-management-popover-custom");$("body > div.history-management-popover-custom").css({top:"298px",position:"fixed"});$(".popover-title").hide();var t=UI.getViewModel("history-management");ko.applyBindings(t,$("#history-management-template")[0]);$(".popover").draggable()};UI.displayAdditionaloptions=function(n,t){n.stopPropagation();UI.removeEditor();PopoverHelper.bind($(".additionals-components-image"),TemplateCache.get("additional-options-template"),ADDITIONAL_COMPONENTS);$(".popover-title").hide();var i=$("."+ADDITIONAL_COMPONENTS);i.find(".arrow").addClass("additional-components-arrow");i.css("left",$(i).position().left+45);i.css("color",t);$(".additional-components-editor-content").css("background-color",$("."+MAIN_MENU).css("background-color"));$(".menu-icons").tooltip({placement:"bottom"})};UI.displayStorePopover=function(n){var t,i,r;n&&n.stopPropagation();t=UI.siteComponentRepository.lookupData({displayName:STORE});UI.removeEditor();i=TemplateFactory.templateFor(t,EDITOR_TEMPLATE).compiledTemplate;r=$("#store");PopoverHelper.bind(r,i,"simple-editor-popover");t.editor();$("#manage-store-btn").on("click",function(){var n=UI.componentService.addModalContentToForm(t,"#manage-store-products")});$(".accordion").accordion({heightStyle:"content"});$(".popover").draggable()};UI.saveorpublish=function(n,t,i,r,u,f,e,o,s){if($("#save-site-data").hasClass("disabled"))return!1;!UI.getSetting("showFirstSavePopup")||n===ACTION_TYPE_CREATE_WEB_SITE||n===ACTION_TYPE_CREATE_TEMPLATE||t===2&&$("#site-form").length||(UI.settings.showFirstSavePopup=!1,t===1?Application.showOkDialog("Hint",'Saving is in a background process. Publishing will need to wait a while depending upon your website size. To Re-Save please wait for the "Success" indicator at the top right of your screen.'):t===2&&Application.showOkDialog("Hint",'Publishing is in a background process.  To Re-Publish please wait a for the "Success" indicator at the top right of your screen, time out depends upon your site size.'));n!=1&&n!=4&&UI.DisableSaveAndPublishButtons(!0);UI.exportLogs();UI.setTemplateProperty("webSiteUrls",s);UI.setTemplateProperty("webSiteUrlsExtra",s);UI.setTemplateProperty("name",r);UI.setTemplateProperty("categories",u);var h=JSON.parse(UI.templateToJson());UI.jsonCompareService.compare(h.controls[0]);IndexedDBService.setLocalTemplateParam({"last-saved-model":h,"auto-saved-model":null,"auto-saved-time":null,"save-result":!1,"last-saved-version":null});console.log(UI.getBody().getProperty(LOGS_PROPERTY).value);n==1||n==4?UI.ajaxJsonRequest("/Editor/SaveOrPublish",{data:JSON.stringify(h),actionType:n,editorAction:t,blankTemplateId:e,parentTemplateId:o,thumbnail:null},null):UI.generateThumbnail(n,function(i){var r=i!=null?i.split(",")[1]:null;UI.ajaxJsonRequest("/Editor/SaveOrPublish",{data:JSON.stringify(h),actionType:n,editorAction:t,blankTemplateId:e,parentTemplateId:o,thumbnail:r},function(n){UI.DisableSaveAndPublishButtons(!1);h.templateVersionId=n.templateVersion.templateVersionId;IndexedDBService.setLocalTemplateParam({"save-result":!0,"last-saved-version":n.templateVersion.templateVersionId,"last-saved-model":h});window.lastEditorTemplateVersionId=n.templateVersion.templateVersionId;UI.resetLogs();Helpers.showToastMessage("success","Success!","Your site has been "+(t===1?"Saved":"Published"))},function(n){UI.DisableSaveAndPublishButtons(!1);console.log(n);Helpers.showToastMessage("error","Unable to Save","An error occured while "+(t===1?"saving":"publishing")+". Please try again later.")})})};UI.DisableSaveAndPublishButtons=function(n){n?(Application.addLocker(),Application.disableNewLockers=!0,$("#save-site-data").addClass("disabled"),$("#publish-site-data").addClass("disabled")):(Application.disableNewLockers=!1,Application.removeLocker(),$("#save-site-data").removeClass("disabled"),$("#publish-site-data").removeClass("disabled"))};UI.generateThumbnail=function(n,t){var i=function(n){Application.removeLocker();t(n)},r,u;n===1||n===2?(r=UI.getDevice(),u=UI.pager.getCurrentPageId(),UI.setDevice(UI.getDevice(UI.getDefaultDeviceId())),UI.pager.goToPage(UI.pager.getHomePageId()),setTimeout(function(){try{Application.removeLocker();Application.addLocker();html2canvas(document.querySelector("body"),{onclone:function(){UI.setDevice(r);UI.pager.goToPage(u)},useCORS:!0,logging:!0,y:52,windowWidth:1920,windowHeight:1080,width:1920,height:1080}).then(function(n){try{var t=n.toDataURL("image/jpeg",.1);i(t)}catch(r){console.log(r);i(null)}},function(n){console.log(n);i(null)}).catch(function(n){console.log(n);i(null)})}catch(n){Application.removeLocker();i(null)}},1e3)):i(null)};UI.ajaxJsonRequest=function(n,t,i,r){i=i||function(){};var u=t.actionType;$.ajax({type:"POST",url:n,data:t,dataType:"json",beforeSend:function(n){n.setRequestHeader("Content-Encoding","gzip")},success:function(n){var f=JSON.parse(n),r,e;f.errorCode==0&&f.templateVersion!=null?(r=f.templateVersion,u==ACTION_TYPE_CREATE_WEB_SITE&&Helpers.changeUrl("Editor","/Editor?templateId="+r.templateId+"&actionType=EditWebSite"),u==ACTION_TYPE_CREATE_TEMPLATE&&Helpers.changeUrl("Editor","/Editor?templateId="+r.templateId+"&actionType=EditTemplate"),UI.setTemplateProperty("templateVersionId",r.templateVersionId),UI.setTemplateProperty("templateId",r.templateId),UI.setTemplateProperty("templateTypeId",r.templateTypeId),UI.setTemplateProperty("actionType",r.actionType),UI.setTemplateProperty("categories",r.categories),e=JSON.parse(t.data),actionType&&(actionType=r.actionType),UI.jsonCompareService.reInit(e.controls),typeof i=="function"&&i(f)):Helpers.showModalDialog("Error",f.errorMessage,TEMPLATE_MASTER_URL)},error:function(n){typeof r=="function"?r(n):typeof i=="function"&&i()}})};UI.initializeViewerPaletteController=function(n){UI.settings.hasOwnProperty("ispreview")&&UI.settings.ispreview&&n()};UI.componentCreatedHandler=function(n){var t,r,i;if(null!=n){TransformFactory.setNewPosition(n);t=$(n.getUISelector());t.show();$(".popover").fadeOut("fast");r=t.detach();$(".wrapper .body").append(r);i=Helpers.getMaxZIndex(n);t.css("z-index",i);n.setProperty(Z_INDEX,i);t.position({of:$(window),at:"center center"}).addClass("fadeInUp").addClass("animated");t.one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",function(){var i,o,s;$(".popover").fadeIn("fast");t.removeClass("fadeInUp").removeClass("animated");var r=t[0].offsetTop,u=t[0].offsetHeight,f=$(".main")[0].offsetTop,e=$(".main")[0].offsetHeight,h=t.detach();$("#"+UI.pager.getCurrentPageId()).append(h);r+u/2<f?(Dock.unconditionalElementDocking("#"+n.id,$(".header"),!0),r+u<f&&(i=r,i<0&&(i=0),t.css("top",i))):r+u/2>f+e?(Dock.unconditionalElementDocking("#"+n.id,$(".footer"),!1),i=r-(f+e),i>0&&t.css("top",i)):(i=r-f,i<0&&(i=0),i+u>e&&(i-=i+u-e),t.css("top",i));Resizer.recalculateHeaderFooterAndPageSize($("#"+UI.pager.getCurrentPageId())[0]);o=t.css("top");s=t.css("left");n.setProperty(LEFT,s);n.setProperty(TOP,o);UI.callEditor(n);t.highlightSelectedElement(n,!0)})}};UI.ComponentMethods={div:{editor:{},viewer:{},contextviewer:{},contexteditor:{}}};UI.getComponents=function(n){n!=""&&$.ajax({url:"/Editor/GetNewComponents",data:{templateId:n},success:function(n){typeof n!="undefined"&&n!=null&&(UI.removeEditor(),$(".component-list").children().remove(),n.components.length>0?(UI.newComponents=n.components,n.components.forEach(function(n){var t;t=n.Name!==STORE?'<div class="item" onclick="app.addNewComponent(\''+n.Name+'\')"><div class="holder"><i class="'+n.Description+'"><\/i><\/div><div class="text">'+n.DisplayName+"<\/div><\/div>":'<div class="item" onclick="UI.addStore()"><div class="holder"><i class="'+n.Description+'"><\/i><\/div><div class="text">'+n.DisplayName+"<\/div><\/div>";$(".component-list").append(t)})):$(".component-list").append('<p class="m5005">Components are not available now!<\/p>'))}})};UI.getBody=function(){return UI.siteComponentRepository.lookupData({displayName:"body"})};UI.getMain=function(){return UI.siteComponentRepository.lookupData({displayName:MAIN_COMPONENT})};UI.getHeader=function(){return UI.siteComponentRepository.lookupData({displayName:HEADER})};UI.getFooter=function(){return UI.siteComponentRepository.lookupData({displayName:FOOTER})};UI.configureGoogleAnalytics=function(){var n=$("#textarea_googleanalytics_script").val();UI.getBody().setProperty(GOOGLE_ANALYTICS_SCRIPT,n,!0);UI.getBody().setProperty(GOOGLE_ANALYTICS,"1",!0);H.actionOnOffButtonValueSet($(".btn-toggle-googleanalytics"),"1");$(".edit-googleanalytics-container").hide()};UI.addStore=function(){var c,r,l,n,e,u,a,t,o,f,v,i,s,h,y,p;UI.siteComponentRepository.checkExistingRule(STORE)&&(c=UI.basicComponentRepository.lookupData({name:STORE}),c&&(r=(new Component).createNew(c,!0),UI.siteComponentRepository.appendTo(r,UI.getBody()),UI.store=new Store(r),l=["product","cart","thank-you"],_.forEach(UI.pager.pages,function(n){l.indexOf(n.name)!==-1&&n.setName(n.name+n.id)}),n=(new Component).createNew(UI.basicComponentRepository.lookupData({name:PAGE_COMPONENT}),!0),n.setProperty(TITLE,"Product Page",!0),n.setProperty(ISSERVICE,"true",!0),n.setProperty(NAME,"product",!0),UI.siteComponentRepository.appendTo(n,UI.getMain()),e=new Page({id:n.id,title:"Product Page",name:"product"}),UI.pager.pages.push(e),u=(new Component).createNew(UI.basicComponentRepository.lookupData({name:STORE_PRODUCT}),!0),UI.siteComponentRepository.appendTo(u,n),n.setProperty(HEIGHT,u.getProperty(HEIGHT).value),TransformFactory.setNewPosition(u),a=[STORE_PRODUCT_TITLE,STORE_PRODUCT_DESCRIPTION,STORE_PRODUCT_IMAGES,STORE_PRODUCT_OPTIONS,STORE_PRODUCT_PRICE,STORE_PRODUCT_ADD_TO_CART,STORE_PRODUCT_QUANTITY,STORE_PRODUCT_SOCIAL,STORE_PRODUCT_SKU],_.forEach(a,function(n){var t=(new Component).createNew(UI.basicComponentRepository.lookupData({name:n}),!0);UI.siteComponentRepository.appendTo(t,u);TransformFactory.setNewPosition(t)}),UI.actionService.runActionForComponent(n,ACTION_ADD_TO_FORM,!0),$(n.getUISelector()).hide(),t=(new Component).createNew(UI.basicComponentRepository.lookupData({name:PAGE_COMPONENT}),!0),t.setProperty(TITLE,"Cart Page",!0),t.setProperty(ISSERVICE,"true",!0),t.setProperty(NAME,"cart",!0),UI.siteComponentRepository.appendTo(t,UI.getMain()),o=new Page({id:t.id,title:"Cart Page",name:"cart"}),UI.pager.pages.push(o),f=(new Component).createNew(UI.basicComponentRepository.lookupData({name:STORE_CART}),!0),UI.siteComponentRepository.appendTo(f,t),t.setProperty(HEIGHT,f.getProperty(HEIGHT).value),TransformFactory.setNewPosition(f),v=(new Component).createNew(UI.basicComponentRepository.lookupData({name:STORE_CART_CHECKOUT}),!0),UI.siteComponentRepository.appendTo(v,f),UI.actionService.runActionForComponent(t,ACTION_ADD_TO_FORM,!0),$(t.getUISelector()).hide(),i=(new Component).createNew(UI.basicComponentRepository.lookupData({name:PAGE_COMPONENT}),!0),i.setProperty(TITLE,"Thank You Page",!0),i.setProperty(ISSERVICE,"true",!0),i.setProperty(NAME,"thank-you",!0),UI.siteComponentRepository.appendTo(i,UI.getMain()),s=new Page({id:i.id,title:"Thank You Page",name:"thank-you"}),UI.pager.pages.push(s),h=(new Component).createNew(UI.basicComponentRepository.lookupData({name:STORE_THANK_YOU}),!0),UI.siteComponentRepository.appendTo(h,i),i.setProperty(HEIGHT,h.getProperty(HEIGHT).value),TransformFactory.setNewPosition(h),UI.actionService.runActionForComponent(i,ACTION_ADD_TO_FORM,!0),$(i.getUISelector()).hide(),Pager.renderTopMenuSelect(),y=function(){$("#store").show();UI.siteComponentRepository.appendTo(r,UI.getBody());UI.store=new Store(r);UI.siteComponentRepository.appendTo(n,UI.getMain());UI.siteComponentRepository.appendTo(t,UI.getMain());UI.siteComponentRepository.appendTo(i,UI.getMain());UI.pager.pages.push(e);UI.pager.pages.push(o);UI.pager.pages.push(s);UI.actionService.addToActionData(r,!0);UI.actionService.addToActionData(n,!0);UI.actionService.addToActionData(t,!0);UI.actionService.addToActionData(i,!0);UI.actionService.runActionForComponent(n,ACTION_ADD_TO_FORM,!0);$(n.getUISelector()).hide();UI.actionService.runActionForComponent(t,ACTION_ADD_TO_FORM,!0);$(t.getUISelector()).hide();UI.actionService.runActionForComponent(i,ACTION_ADD_TO_FORM,!0);$(i.getUISelector()).hide();Pager.renderTopMenuSelect()},p=function(){$("#store").hide();UI.siteComponentRepository.remove({id:r.id});UI.store=null;n.id===UI.pager.getCurrentPageId()&&UI.pager.goToHomePage();t.id===UI.pager.getCurrentPageId()&&UI.pager.goToHomePage();i.id===UI.pager.getCurrentPageId()&&UI.pager.goToHomePage();_.remove(UI.pager.pages,function(n){return e.id===n.id});_.remove(UI.pager.pages,function(n){return o.id===n.id});_.remove(UI.pager.pages,function(n){return s.id===n.id});UI.siteComponentRepository.remove({id:n.id});UI.siteComponentRepository.remove({id:t.id});UI.siteComponentRepository.remove({id:i.id});Pager.renderTopMenuSelect()},UI.undoManagerAdd({undo:function(){p()},redo:function(){y()}}),$("#store").show(),UI.displayStorePopover()))};UI.showRemoveStoreConfirmationModal=function(n){n=defined(n)?n:!1;n?Application.showRemoveConfirmationDialog("Are you sure you want to reset your store data?","Reset Store Data",[{css:"danger",text:"Reset",callback:function(){UI.store&&UI.store.reset(function(){Application.removeModal()})}}],"This action will completely delete your store data without ability to restore it: products, categories, orders etc.","*This action can't be Undo!"):Application.showRemoveConfirmationDialog("Are you sure you want to remove your store?","Remove Store",[{css:"simple",text:"Remove",callback:function(){UI.removeStore();Application.removeModal()}}],"This action will remove your store from the website and save all related data for future usage: products, categories, orders etc.")};UI.removeStore=function(){var n,o,s,c,l;if(UI.store){n=UI.store.component;UI.store=null;UI.siteComponentRepository.remove({id:n.id});var u=_.remove(UI.pager.pages,function(n){return"product"===n.name})[0],f=_.remove(UI.pager.pages,function(n){return"cart"===n.name})[0],e=_.remove(UI.pager.pages,function(n){return"thank-you"===n.name})[0];u.id===UI.pager.getCurrentPageId()&&UI.pager.goToHomePage();f.id===UI.pager.getCurrentPageId()&&UI.pager.goToHomePage();e.id===UI.pager.getCurrentPageId()&&UI.pager.goToHomePage();var t=UI.siteComponentRepository.remove({id:u.id}),i=UI.siteComponentRepository.remove({id:f.id}),r=UI.siteComponentRepository.remove({id:e.id}),h=UI.siteComponentRepository.lookupDataSet({displayName:STORE_GALLERY});_.forEach(h,function(n){UI.siteComponentRepository.remove({id:n.id})});o=UI.siteComponentRepository.lookupDataSet({displayName:STORE_CART_LINK});_.forEach(o,function(n){UI.siteComponentRepository.remove({id:n.id})});s=UI.siteComponentRepository.lookupDataSet({displayName:STORE_CATEGORIES});_.forEach(s,function(n){UI.siteComponentRepository.remove({id:n.id})});$("#store").hide();UI.removeEditor();Pager.renderTopMenuSelect();c=function(){$("#store").hide();UI.store=null;UI.siteComponentRepository.remove({id:n.id});t.id===UI.pager.getCurrentPageId()&&UI.pager.goToHomePage();i.id===UI.pager.getCurrentPageId()&&UI.pager.goToHomePage();r.id===UI.pager.getCurrentPageId()&&UI.pager.goToHomePage();_.remove(UI.pager.pages,function(n){return u.id===n.id});_.remove(UI.pager.pages,function(n){return f.id===n.id});_.remove(UI.pager.pages,function(n){return e.id===n.id});UI.siteComponentRepository.remove({id:t.id});UI.siteComponentRepository.remove({id:i.id});UI.siteComponentRepository.remove({id:r.id});_.forEach(o,function(n){UI.siteComponentRepository.remove({id:n.id})});_.forEach(h,function(n){UI.siteComponentRepository.remove({id:n.id})});_.forEach(s,function(n){UI.siteComponentRepository.remove({id:n.id})});Pager.renderTopMenuSelect()};l=function(){$("#store").show();UI.siteComponentRepository.appendTo(n,UI.getBody());UI.store=new Store(n);UI.siteComponentRepository.appendTo(t,UI.getMain());UI.siteComponentRepository.appendTo(i,UI.getMain());UI.siteComponentRepository.appendTo(r,UI.getMain());UI.pager.pages.push(u);UI.pager.pages.push(f);UI.pager.pages.push(e);UI.actionService.addToActionData(n,!0);UI.actionService.addToActionData(t,!0);UI.actionService.addToActionData(i,!0);UI.actionService.addToActionData(r,!0);_.forEach(o,function(n){var t=UI.siteComponentRepository.lookupData({id:n.parentComponent.id});UI.siteComponentRepository.appendTo(n,t);UI.actionService.addToActionData(n,!0);UI.actionService.runActionForComponent(n,ACTION_ADD_TO_FORM,!0)});_.forEach(h,function(n){var t=UI.siteComponentRepository.lookupData({id:n.parentComponent.id});UI.siteComponentRepository.appendTo(n,t);UI.actionService.addToActionData(n,!0);UI.actionService.runActionForComponent(n,ACTION_ADD_TO_FORM,!0)});_.forEach(s,function(n){var t=UI.siteComponentRepository.lookupData({id:n.parentComponent.id});UI.siteComponentRepository.appendTo(n,t);UI.actionService.addToActionData(n,!0);UI.actionService.runActionForComponent(n,ACTION_ADD_TO_FORM,!0)});UI.actionService.runActionForComponent(t,ACTION_ADD_TO_FORM,!0);$(t.getUISelector()).hide();UI.actionService.runActionForComponent(i,ACTION_ADD_TO_FORM,!0);$(i.getUISelector()).hide();UI.actionService.runActionForComponent(r,ACTION_ADD_TO_FORM,!0);$(r.getUISelector()).hide();Pager.renderTopMenuSelect()};UI.undoManagerAdd({undo:function(){l()},redo:function(){c()}})}};UI.getSignInComponent=function(){return UI.siteComponentRepository.lookupData({displayName:SIGNIN})};UI.getCustomUserFields=function(){var t=UI.getSignInComponent(),n;return t?(n=[],_.forEach(JSON.parse(t.getProperty(CUSTOM_USER_FIELDS).value),function(t){n.push(new CustomUserField(t))}),n):null};UI.setCustomUserFields=function(n){var t=UI.getSignInComponent();t&&t.setProperty(CUSTOM_USER_FIELDS,n)};UI.getSiteColors=function(){var n=UI.getBody().getProperty(SITE_COLORS).value;return n?n.split(";"):[]};UI.addSiteColor=function(n){var t=UI.getSiteColors();t.length<100&&(t.push(n),t=_.uniq(t),UI.getBody().setProperty(SITE_COLORS,t.join(";")))};UI.initAutoSave=function(){autoSaveTimer&&clearInterval(autoSaveTimer);var n=UI.getBody().getProperty(AUTO_SAVE_PERIOD).value*6e4;console.log(n);autoSaveTimer=setInterval(UI.AutoSaveLocalTemplate,n)};UI.AutoSaveLocalTemplate=function(){var t=JSON.parse(UI.templateToJson()),n=new Date;IndexedDBService.setLocalTemplateParam({"auto-saved-model":t,"auto-saved-time":n.toLocaleString()});console.log("autosave",n.toLocaleString())};BasicComponent=function(n,t){var i=this;t=defined(t)?t:null;n.properties=defined(n.properties)?n.properties:[];n.children=defined(n.children)?n.children:[];i.id=n.componentId;i.index="";i.template=n.templateData||"";i.editorTemplate=n.editorTemplateData||"";i.slaveTemplate=n.slaveTemplateData||"";i.slaveEditorTemplate=n.slaveEditorTemplateData||"";i.name=n.name;i.properties=[];i.children=[];i.parentComponent=t;i.complexComponent=n.isComplex;i.isDraggable=defined(n.isDraggable)?n.isDraggable:!0;i.isDockable=defined(n.isDockable)?n.isDockable:!1;i.isSelectable=defined(n.isSelectable)?n.isSelectable:!0;i.displayName=defined(n.displayName)?n.displayName:n.name;i.description=defined(n.description)?n.description:"";i.events=null;i.actions={};i.actions[ACTION_SIGN_IN]=ActionFactory.actionFor(i,ACTION_SIGN_IN);i.actions[ACTION_SIGN_OUT]=ActionFactory.actionFor(i,ACTION_SIGN_OUT);i.actions[ACTION_ADD_TO_FORM]=ActionFactory.actionFor(i,ACTION_ADD_TO_FORM);i.actions[ACTION_REMOVE_FROM_FORM]=ActionFactory.actionFor(i,ACTION_REMOVE_FROM_FORM);i.actions[ACTION_EDITOR_OPEN]=ActionFactory.actionFor(i,ACTION_EDITOR_OPEN);i.actions[ACTION_EDITOR_CLOSED]=ActionFactory.actionFor(i,ACTION_EDITOR_CLOSED);defined(n.children)&&n.children.forEach(function(n){var t=new BasicComponent(n,i);i.children.push(t)});n.properties.forEach(function(n){var t=new Property(n);i.properties.push(t)});i.getProperty=function(n,t){t=t?t:UI.getDefaultDeviceId();var r=i.properties.where({name:n}).where({deviceId:t});return r?r.firstOrDefault():null}};Component=function(){var n=this;return n.createNew=function(n,t,i){var r;if(UI.unsavedChanges=!0,r=this,i=defined(i)?i:null,r.id=t?Guid.new():n.controlId,r.name=t?n.id:n.componentId,r.children=[],r.complexComponent=defined(n.complexComponent)?n.complexComponent:!1,r.isDraggable=defined(n.isDraggable)?n.isDraggable:!0,r.isDockable=defined(n.isDockable)?n.isDockable:!1,r.isSelectable=defined(n.isSelectable)?n.isSelectable:!0,r.isNew=t,r.parentComponent=i,r.events=r.componentEvents(n.componentName!=undefined?n.componentName:n.name),r.proto=n,r.viewer=ViewerFactory.proxy,r.stretcher=StretcherFactory.proxy,r.editor=EditorFactory.proxy,UI.actionService.addToActionData(r),defined(n.children))if(n.componentId==="9acd3bc9-f075-4f50-9cb8-496b718377c8"){var u=n.properties.where({name:TOP}).firstOrDefault(),f=n.properties.where({name:LEFT}).firstOrDefault(),e=n.properties.where({name:Z_INDEX}).firstOrDefault();_.forEach(n.children,function(n){var i=(new Component).createNew(n,t,r.parentComponent),o,s,h;r.parentComponent.children.push(i);u!=null&&(o=i.properties.where({name:TOP}).firstOrDefault(),o==null&&(o=new Property(_.defaults({controlId:i.id},u)),i.properties.push(o),o.value="0"),o.value=parseInt(o.value)+parseInt(u.value)+"px");f!=null&&(s=i.properties.where({name:LEFT}).firstOrDefault(),s==null&&(s=new Property(_.defaults({controlId:i.id},f)),i.properties.push(s),s.value="0"),s.value=parseInt(s.value)+parseInt(f.value)+"px");e!=null&&(h=i.properties.where({name:Z_INDEX}).firstOrDefault(),h==null&&(h=new Property(_.defaults({controlId:i.id},e)),i.properties.push(h),h.value="0"),h.value=parseInt(h.value)+parseInt(e.value)+1)})}else n.children.forEach(function(n){var i=(new Component).createNew(n,t,r);r.children.push(i)});return r.proto!=null&&(r.componentId=defined(r.proto.id)?r.proto.id:n.componentId,r.complexComponent=defined(r.proto.complexComponent)?r.proto.complexComponent:r.complexComponent,r.isDraggable=defined(r.proto.isDraggable)?r.proto.isDraggable:r.isDraggable,r.isDockable=defined(r.proto.isDockable)?r.proto.isDockable:r.isDockable,r.isSelectable=defined(r.proto.isSelectable)?r.proto.isSelectable:r.isSelectable,r.displayName=defined(r.proto.name)?r.proto.name:n.componentName),r.properties=Component.cloneProperties(n.properties,r),r},n.componentEvents=function(n){switch(n){case"menu":return{onComponentProcessed:UI.renderMenus};default:return undefined}},n.getUISelector=function(){return"#"+this.id},n.createFromExisting=function(t){return n.id=t.id,n.name=t.name,n.children=[],n.parentComponent=t.parentComponent,n.proto=UI.basicComponentRepository.lookupData({id:t.name}),n.viewer=ViewerFactory.proxy,n.editor=EditorFactory.proxy,n.stretcher=StretcherFactory.proxy,UI.actionService.addToActionData(n),n.isNew=t.isNew,n.componentId=n.proto.id,n.complexComponent=n.proto.complexComponent,n.isDraggable=n.proto.isDraggable,n.isDockable=n.proto.isDockable,n.isSelectable=n.proto.isSelectable,n.displayName=n.proto.name,n.events=t.events,n.properties=Component.cloneProperties(t.properties,n),defined(t.children)&&t.children.forEach(function(t){var i=(new Component).createFromExisting(t,UI.basicComponentRepository);i.displayName=="header"||i.displayName=="footer"?n.children.unshift(i):n.children.push(i);i.parentComponent=n}),n},n.removeProperty=function(t,i){i=i?i:UI.getDevice().getId();return _.remove(n.properties,function(n){return n.deviceId==i&&n.name==t})},n.resetProperty=function(t,i){var f,r,e,u;i=i?i:UI.getDevice().getId();f=UI.getDevice(i);f.inheritComponentProperty(n,t)&&(i=UI.getDefaultDeviceId());r=n.properties.where({name:t}).where({deviceId:i});e=r?r.firstOrDefault():null;e!=null&&(u=UI.basicComponentRepository.lookupData({name:n.displayName}).getProperty(t),u!=null&&n.setProperty(t,u.value,!0,i))},n.getProperty=function(t,i){var f,e,u,r;return i=i?i:UI.getDevice().getId(),f=UI.getDevice(i),f.inheritComponentProperty(n,t)&&(i=UI.getDefaultDeviceId()),e=n.properties.where({name:t}).where({deviceId:i}),u=e?e.firstOrDefault():null,u==null&&f.isComponentHasProperty(n,t)&&(r=UI.basicComponentRepository.lookupData({name:n.displayName}).getProperty(t),r!=null&&(u=n.addProperty(t,r.value,r.type,r.group,r.propertyId,i))),u},n.getPropertyInt=function(t){var i=n.getProperty(t);return i!=null?parseInt(i.value.replace(/[A-Za-z$-]/g,"")):0},n.setProperty=function(t,i,r,u){if(StretcherFactory.isPropertyCouldBeWritten(n,t)){UI.unsavedChanges=!0;u=u?u:UI.getDevice().getId();r=r||!1;var f=n.getProperty(t,u);f!=null?f.value=i:r&&n.addProperty(t,i)}},n.addPropertyIfNotExists=function(t,i,r){var f,e,o,u;i=i?i:UI.getDevice().getId();f=UI.getDevice(i);f.inheritComponentProperty(n,t)&&(i=UI.getDefaultDeviceId());e=n.properties.where({name:t}).where({deviceId:i});o=e?e.firstOrDefault():null;o==null&&f.isComponentHasProperty(n,t)&&(u=UI.basicComponentRepository.lookupData({name:n.displayName}).getProperty(t),u!=null&&(r=defined(r)?r:u.value,n.addProperty(t,r,u.type,u.group,u.propertyId,i)))},n.addProperty=function(t,i,r,u,f,e){defined(f)||console.log("[Classes.js -> function addProperty] PropertyId not defined. Property Name: "+t);var o=n.properties.where({name:t}).where({deviceId:e}).firstOrDefault();return o==null&&(r=defined(r)?r:"common",u=defined(u)?u:"common",i=defined(i)?i:"",f=defined(f)?f:"",e=defined(e)?e:UI.getDevice().getId(),o=new Property({name:t,value:i,type:r,group:u,propertyId:f,deviceId:e,componentId:n.proto.id,controlId:n.id}),n.properties.push(o)),o},n};Component.cloneProperties=function(n,t){var i=[];return defined(n)&&n.forEach(function(n){var r=new Property(n,t);i.push(r)}),i};var Property=function(n,t){var i=this,r,u;if(i.name=n.name,i.value=defined(n.value)?n.value:n.defaultValue,i.group=n.group,i.propertyId=defined(n.propertyId)?n.propertyId:"",i.componentId=defined(n.componentId)?n.componentId:"",i.controlId=defined(n.controlId)?n.controlId:"",i.type=n.type,i.deviceId=n.deviceId||UI.getDefaultDeviceId(),defined(t))try{r={"meta-title":"bf88797a-ab62-4b91-bada-bd2d81c6b60e","meta-description":"0e7555e1-7147-4a30-8991-e30eb93c6217","meta-keywords":"eadff7bf-0b15-4a55-9e5e-2793946a7a1f",title:"BB0C3CBD-B973-4C30-8F96-BC8BE47967CE",name:"14cbb701-790c-4003-947b-d07379851d1d",home:"0e12b99c-e2de-47ad-86ed-78cb4712da8a","googleanalytics-script":"131BAC41-0F4E-4977-B1EC-6F7796254BA8",sitemapxml:"12CCC4D6-A97F-4F80-B8AB-5E071D369384",searchengine:"0E4A7BB3-911E-4F32-A7A3-DCAEDD68EBEE",googleanalytics:"DF243CDF-6880-44F5-B96F-D9EBCAF5B67A",isprotected:"54227F57-AF4A-47CB-AD24-CBB88ABDEAA7",protectedemail:"F9F53835-D319-4D5B-9545-FCA2F9FF9688",protectedword:"ADCED20D-FE79-4D46-9D7F-F134E0A7CEF5","google-verification-code":"B0811B3F-BBB0-44B4-B370-DFF85023ABC5","bing-verification-code":"074F2EC5-662B-437D-B0C9-08D23EC9C368","meta-facebook-title":"43769BF9-BB22-4189-A1D3-8B051E6066F4","meta-facebook-description":"626E1D9D-6546-4B84-A362-7397498F617B","meta-facebook-image":"94447ED1-5D9C-4689-B58A-9F7BD8D669A6","auto-save-period":"1028DF1F-DFDF-4CBA-A51B-037661DD2D36","header-content":"a95eefb7-616c-7e15-396a-126afd6a3344"};defined(r[i.name])&&(i.propertyId=r[i.name]);defined(i.propertyId)&&i.propertyId!=""||(u=UI.basicComponentRepository.getAll().where({id:t.componentId}).firstOrDefault().getProperty(n.name),i.propertyId=u.propertyId);defined(i.componentId)&&i.componentId!=""||(i.componentId=t.componentId);defined(i.componentId)&&i.controlId!=""||(i.controlId=t.id)}catch(f){console.log("Error new Property")}},Tooltips=function(n){var t=this;t.data={};_.forEach(_.keys(n),function(i){t.data[i]=ko.observable(n[i])});t.getAll=function(){return t.data};t.getValueByKey=function(n){return t.data[n]?t.data[n]():null};t.setValueByKey=function(n,i){t.data[n](i);$.ajax({url:"/Editor/SetTooltip",type:"POST",data:{data:JSON.stringify({key:n,value:i})}})};t.viewModel={value:ko.observable(),save:function(n,i){i.stopPropagation();t.setValueByKey(n.key,n.value());t.viewModel.element.popover("destroy")},cancel:function(n,i){i.stopPropagation();t.viewModel.element.popover("destroy")}};t.getViewModel=function(n){t.viewModel.key=n.key;t.viewModel.name=n.name;var i=t.getValueByKey(n.key);return i!==null?(t.viewModel.value(i),t.viewModel.element=n.element,t.viewModel):null}},User=function(n){var t=this,i;return t.id=n.id||"",t.email=n.userName||"",t.avatar=ko.observable(n.avatar?decodeURIComponent(n.avatar):""),t.customFields={},i=function(n){var r=n.getFullYear(),i=(1+n.getMonth()).toString(),t;return i=i.length>1?i:"0"+i,t=n.getDate().toString(),t=t.length>1?t:"0"+t,i+"/"+t+"/"+r},_.forEach(UI.getCustomUserFields(),function(r){if(r.name==="birthday"&&n[r.name]){var u=new Date(n[r.name]);t.customFields[r.name]=ko.observable(i(u))}else t.customFields[r.name]=ko.observable(n[r.name]||"")}),t.fullName=ko.computed(function(){return _.keys(t.customFields).length&&t.customFields.firstName()&&t.customFields.lastName()?t.customFields.firstName()+" "+t.customFields.lastName():t.email},t),t.getAvatar=function(){return t.avatar()?t.avatar():SIGNIN_USER_DEFAULT_IMAGE},t.toDTO=function(){var n={id:t.id,userName:t.email,avatar:encodeURIComponent(t.avatar())};return _.forEach(_.keys(t.customFields),function(i){n[i]=t.customFields[i]()}),n},t.save=function(n){n=defined(n)?n:function(){};ProxyService.send(t.toDTO(),"user","PUT",{},n)},t},CustomUserField=function(n){var t=this;return t.name=n.name,t.displayName=n.displayName,t.active=ko.observable(n.active),t.required=ko.observable(n.required),t},Device=function(n){var t=this;return t.init=function(n){t.type=n.type;t.width=n.width;t.displayName=n.displayName;t.minWidth=n.minWidth;t.maxWidth=n.maxWidth;t.componentsProperties=n.componentsProperties;t.name=n.name;t.id=n.id;t.isDefault=n.isDefault||!1},t.isWidthInRange=function(n){return n>=t.minWidth&&n<=t.maxWidth},t.isHaveComponentProperties=function(){return!!t.componentsProperties},t.isDesktop=function(){return t.type===DEVICE_DESKTOP_TYPE},t.getName=function(){return t.name},t.getDisplayName=function(){return t.displayName},t.getId=function(){return t.id},t.getType=function(){return t.type},t.getWidth=function(){return t.width},t.getPropertiesList=function(n){var i=t.componentsProperties[n.proto.name],r=[];return _.forEach(n.properties,function(n){var u=n.name,f=n.deviceId;(i[u]===!0&&f===UI.getDefaultDeviceId()||i[u]===!1&&f===t.id)&&r.push(n)}),r},t.isComponentHasProperty=function(n,i){return _.has(t.componentsProperties[n.proto.name],i)},t.inheritComponentProperty=function(n,i){return t.componentsProperties[n.proto.name][i]},t.setComponentsProperties=function(n){t.componentsProperties=n},t.getComponentsProperties=function(){return t.componentsProperties},t.reset=function(){var n=[],i=function(){Application.addLocker();setTimeout(function(){UI.removeDeviceIdFromTemplateData(t.getId());n=Device.removeDeviceProperties(UI.siteComponentRepository.getAll().firstOrDefault(),t.getId());UI.setDevice(t);Application.removeLocker()},500)},r=function(){Application.addLocker();setTimeout(function(){_.forEach(n,function(n){_.forEach(n.property,function(t){n.component.setProperty(t.name,t.value,!1,t.deviceId)})});UI.setDevice(t);Application.removeLocker()},500)};UI.undoManagerAdd({undo:function(){r()},redo:function(){i()}});i()},t.resetPage=function(){var i=[],n=UI.siteComponentRepository.lookupData({id:UI.pager.getCurrentPageId()}),r=function(){Application.addLocker();UI.actionService.runActionForComponent(n,ACTION_REMOVE_FROM_FORM,!0);setTimeout(function(){i=Device.removeDeviceProperties(n,t.getId());TransformFactory.runTransform(n,t.getId(),!0);UI.actionService.runActionForComponent(n,ACTION_ADD_TO_FORM,!0);Resizer.recalculateHeaderFooterAndPageSize($(n.getUISelector()));Application.removeLocker()},500)},u=function(){Application.addLocker();UI.actionService.runActionForComponent(n,ACTION_REMOVE_FROM_FORM,!0);setTimeout(function(){_.forEach(i,function(n){_.forEach(n.property,function(t){n.component.setProperty(t.name,t.value,!1,t.deviceId)})});UI.actionService.runActionForComponent(n,ACTION_ADD_TO_FORM,!0);Resizer.recalculateHeaderFooterAndPageSize($(n.getUISelector()));Application.removeLocker()},500)};UI.undoManagerAdd({undo:function(){u()},redo:function(){r()}});r()},t.init(n),t};Device.removeDeviceProperties=function(n,t){var i=UI.getDevice(t),r=[],u;return i.isHaveComponentProperties()&&(u=i.getComponentsProperties(),_.forEach(_.keys(u[n.proto.name]),function(t){if(u[n.proto.name][t]===!1){var f=n.removeProperty(t,i.getId());r.push({component:n,property:f})}}),_.forEach(n.children,function(n){r.addRange(Device.removeDeviceProperties(n,i.getId()))})),r};Device.getDevices=function(){var n=[];return $.ajax({url:"/Editor/GetDevices",type:"GET",data:{templateId:UI.getTemplateProperty("templateId")},async:!1,success:function(t){var i=JSON.parse(t);n=i.devices}}),n};Device.setDeviceRequest=function(n){var t=UI.getTemplateProperty("templateId");(UI.getSetting("actionType")==ACTION_TYPE_CREATE_WEB_SITE||UI.getSetting("actionType")==ACTION_TYPE_CREATE_TEMPLATE)&&(t=$("#sitecontent").data("templateid"));$.ajax({url:"/Editor/SetDevice",type:"GET",data:{templateId:t,deviceId:n.getId()},async:!1,success:function(t){var i=JSON.parse(t);n.init(i)}})};var StoreEnum=function(n){var t=this;return t.id=0,t.title="",t.value="",t.symbol="",t.isBase=!1,t.groupId="",t.init=function(n){n&&(t.id=n.id,t.title=n.desc,t.value=n.name,t.symbol=n.shortName,t.isBase=n.isBase.toBoolean(),t.groupId=n.groupId)},t.init(n),t},Store=function(n){var t=this,i;return t.component=n,i={currencyId:0,weightUnitTypeId:2,shippingPolicyUrl:"",returnPolicyUrl:""},t.getCurrencyOptions=function(){var n=[];return ProxyService.send({name:"currency"},"enum","GET",{},function(t){t&&t.length&&_.forEach(t,function(t){n.push(new StoreEnum(t))})},!0),t.currencyOptions=n,n},t.getWeightUnitOptions=function(){var n=[];return ProxyService.send({name:"weightunit"},"enum","GET",{},function(t){t&&t.length&&_.forEach(t,function(t){n.push(new StoreEnum(t))})},!0),t.weightUnitOptions=n,n},t.reset=function(n){n=defined(n)?n:function(){};ProxyService.send({},"resetstore","POST",{},function(){_.forEach(UI.store.getGalleries(),function(n){var t=UI.viewModelRepository["store-gallery"+n.id];t&&t.reload()});n()})},t.getGalleries=function(){return UI.siteComponentRepository.lookupDataSet({displayName:STORE_GALLERY})},t.getCurrency=function(){var n=_.find(t.currencyOptions,function(n){return t.settings&&n.id===t.settings.currencyId});return n==null?{}:n},t.getWeightUnit=function(n){var i=_.find(t.weightUnitOptions,function(i){return defined(n)?i.id===n:t.settings&&i.id===t.settings.weightUnitTypeId});return i==null?{}:i},t.getProduct=function(n,t,i){var r={id:n};defined(i)&&!!i&&(r.fake=!!i);ProxyService.send(r,"product","GET",{},function(n){n&&n[0]?t(n[0]):t(null)})},t.getOrder=function(n,t){ProxyService.send({id:n},"order","GET",{},function(n){n&&n[0]?t(n[0]):t(null)})},t.updateOrder=function(n,t){t=defined(t)?t:function(){};ProxyService.send(n,"order","PUT",{},function(){t()})},t.getOrderStatuses=function(){var n=[];return ProxyService.send({name:"orderstatus"},"enum","GET",{},function(t){t&&(n=t)},!0),n},t.getCountries=function(){var n=[];return ProxyService.send({name:"country"},"enum","GET",{},function(t){t&&(n=t)},!0),n},t.getStates=function(){var n=[];return ProxyService.send({name:"usstates"},"enum","GET",{},function(t){t&&(n=t)},!0),n},t.getSettings=function(){return ProxyService.send({},"storesettings","GET",{},function(n){n&&n[0]&&(t.settings=$.extend(i,n[0]))},!0),t.settings},t.saveSettings=function(n,r){r=defined(r)?r:function(){};ProxyService.send(n,"storesettings","PUT",{},function(n){n&&n[0]&&(t.settings=$.extend(i,n[0]));r()})},t.getProducts=function(n,t,i){var r={};defined(i)&&!!i&&(r.fake=!!i);n=defined(n)?n:{};n.requesttype="items";ProxyService.send(r,"product","GET",n,function(n){t(n)})},t.getCategories=function(n,t){n=defined(n)?n:{};n.requesttype="items";ProxyService.send({},"category","GET",n,function(n){t(n)})},t.getTaxRates=function(n){ProxyService.send({},"taxrate","GET",{requesttype:"items",page:1,count:999},function(t){n(t)})},t.getShippingRates=function(n){ProxyService.send({},"shippingrate","GET",{requesttype:"items",page:1,count:999},function(t){n(t)})},t.checkout=function(n){var u,i,r;UI.getSetting("ispublished")?(u=t.getPaymentAccount("paypal"),u?(i=[],_.forEach(t.getCart(),function(n){i.push({id:n.product.id,count:n.quantity,attributes:Product.optionsToDto(n.product.options)})}),i.length&&(console.log(i),r=new Order({products:i}),console.log({products:r.toDTO().products}),ProxyService.send({products:r.toDTO().products},"order","POST",{},function(i){var r,u;i&&i[0]&&(t.clearCart(),r=UI.getSetting("paymentSiteDomain")+"/Store/CheckoutShippingAddress?orderId="+i[0].id+"&templateId="+UI.getTemplateProperty("templateId")+"&returnUrl="+origin+"/thank-you/"+i[0].number,console.log(r),n(),u=window.open(r),(!u||u.closed||typeof u.closed=="undefined")&&(location.href=r))}))):Application.showOkDialog("Error","Payment Account is not set!")):Application.showOkDialog("Error","Available only on published site!")},t.getPaymentAccount=function(n){switch(n){case"paypal":return t.component.getProperty(PAYPAL_EMAIL).value;default:return""}},t.setPaymentAccount=function(n,i){var r;switch(n){case"paypal":r=PAYPAL_EMAIL;break;default:return}UI.undoManagerAddSimple(t.component,r,i,function(){},!0)},t.getCart=function(){var n=LocalStorageService.GetItem(UI.getTemplateProperty("templateId")),t;return n!=null?n.cart!=null?(t=[],_.forEach(_.keys(n.cart),function(i){if(i){var r=new Product(n.cart[i].product);r.cartKey=i;t.push({product:r,quantity:n.cart[i].count})}}),t):[]:[]},t.cartCount=function(){return t.getCart().length},t.getPageWithGallery=function(){var n=t.getGalleries().firstOrDefault();return n?UI.pager.getPage(n.parentComponent.id):null},t.addToCart=function(n,t,i){typeof i=="string"&&(i=parseInt(i));var r=LocalStorageService.GetItem(UI.getTemplateProperty("templateId"));r==null?r={cart:{}}:r.cart==null&&(r.cart={});r.cart[n]==null?r.cart[n]={count:i,product:t}:r.cart[n].count?(r.cart[n].count=parseInt(r.cart[n].count)+i,r.cart[n].product||(r.cart[n].product=t)):r.cart[n]={count:i,product:t};LocalStorageService.SetItem(UI.getTemplateProperty("templateId"),r)},t.removeFromCart=function(n,t,i){var r=LocalStorageService.GetItem(UI.getTemplateProperty("templateId"));r!=null&&r.cart!=null&&r.cart[n]!=null&&(r.cart[n].count&&!i?(r.cart[n].count=parseInt(r.cart[n].count)-t,r.cart[n]<=0&&delete r.cart[n]):delete r.cart[n],LocalStorageService.SetItem(UI.getTemplateProperty("templateId"),r))},t.clearCart=function(){localStorage.removeItem(UI.getTemplateProperty("templateId"))},t.init=function(){t.getCurrencyOptions();t.getWeightUnitOptions();t.getSettings()},t.init(),t},Product=function(n){var t=this;return t.currency=UI.store.getCurrency().symbol,t.weightUnit=UI.store.getWeightUnit(),t.id="",t.friendlyUrl="",t.dateCreated="",t.title="",t.sku="",t.label="",t.description="",t.manufacturer="",t.visability=!0,t.barCode="",t.weight=0,t.weightUnitTypeId=0,t.outOfStock=!1,t.stockStatus=2,t.images=ko.observableArray([]),t.price=0,t.discount=0,t.isDiscount=!1,t.discountType=2,t.quantity=0,t.calcDiscount=0,t.calcPrice=0,t.options=[],t.cartKey="",t.categories=[],t.іsFake=!1,t.metaKeywords="",t.metaDescription="",t.mainImageUrl=ko.computed(function(){return t.images()&&t.images().length?t.images()[0].url:STORE_PRODUCT_DEFAULT_IMAGE},t),t.alternateImageUrl=ko.computed(function(){return t.images()&&t.images().length&&t.images().length>1?t.images()[1].url:t.mainImageUrl()},t),t.discountPrice=function(){return t.isDiscount?Product.calculateDiscountPrice(t.discountType,t.price,t.discount):0},t.init=function(n){t.currency=UI.store.getCurrency().symbol;n?(t.id=n.id,t.friendlyUrl=n.friendlyUrl,t.dateCreated=n.dateCreated,t.title=n.name,t.sku=n.sku,t.label=n.label,t.description=n.description||"",t.manufacturer=n.manufacturer,t.barCode=n.barCode,t.weight=n.weight,t.visability=n.isVisible,t.stockStatus=n.stockStatus,t.outOfStock=n.stockStatus?n.stockStatus!==2:!1,t.images([]),_.forEach(n.blobs,function(n){t.images.push({id:n.id,url:decodeURIComponent(n.url)})}),t.price=parseFloat(n.price,0),t.quantity=parseInt(n.qty),t.discount=parseFloat(n.discount),t.isDiscount=n.isDiscount?n.isDiscount.toBoolean():!1,t.discountType=n.discountType,t.calcDiscount=parseFloat(n.calcDiscount),t.calcPrice=parseFloat(n.calcPrice),_.forEach(n.categories,function(n){t.categories.push({id:n.id,name:n.name})}),t.options=Product.initOptions(n.attributes),t.isFake=n.isFake||!1,t.metaKeywords=n.metaKeywords,t.metaDescription=n.metaDescription,t.weightUnitTypeId=n.weightUnitTypeId,t.weightUnit=UI.store.getWeightUnit(n.weightUnitTypeId)):t.weightUnit=UI.store.getWeightUnit()},t.toDTO=function(n){n=defined(n)?n:t.options;var i={name:t.title,friendlyUrl:t.friendlyUrl,manufacturer:t.manufacturer,sku:t.sku,label:t.label,barCode:t.barCode,weight:t.weight,isVisible:t.visability,blobs:[],qty:t.quantity,price:t.price,stockStatus:t.stockStatus,description:t.description,attributes:Product.optionsToDto(n),discount:t.discount,isDiscount:t.isDiscount,discountType:t.discountType,weightUnitTypeId:t.weightUnitTypeId,categories:t.categories,metaKeywords:t.metaKeywords,metaDescription:t.metaDescription};return _.forEach(t.images(),function(n){i.blobs.push({id:n.id,url:encodeURIComponent(n.url)})}),t.id&&(i.id=t.id),i},t.getFullPrice=function(n){n=defined(n)?n:t.options;var i=t.price;return _.forEach(n,function(n){_.forEach(n.items,function(n){i+=n.diff})}),i},t.getFullDiscountPrice=function(n){return n=defined(n)?n:t.options,Product.calculateDiscountPrice(t.discountType,t.getFullPrice(n),t.discount)},t.generateLink=function(){return UI.getSetting("ispreview")?Helpers.generateLinkToPage("product",!0,{key:"productId",value:t.friendlyUrl||t.id}):""},t.save=function(n){n=defined(n)?n:function(){};saveEntityData("product",t.toDTO(),n)},t.init(n),t};Product.calculateDiscountPrice=function(n,t,i){var r=n===2?t-i:t*((100-i)/100);return parseFloat(r.toFixed(2))};Product.initOptions=function(n){var t=[];return n!==null&&_.forEach(n,function(n){var i=[];_.forEach(n.values,function(n){i.push({id:n.id,diff:parseFloat(n.diffPrice),value:n.value})});t.push({id:n.id,title:n.name,items:i})}),t};Product.optionsToDto=function(n){var t=[];return n=typeof n=="function"?n():n,_.forEach(n,function(n){var r=[],u=typeof n.values=="function"?n.items():n.items,i;_.forEach(u,function(n){var t={diffPrice:parseFloat(n.diff,0),value:n.value};n.id&&(t.id=n.id);r.push(t)});i={name:n.title,values:r};n.id&&(i.id=n.id);t.push(i)}),t};Category=function(n){var t=this,i;return t.id="",t.tempId="",t.dateCreated="",t.name="",t.hasSubcategories=!1,t.parentCategory="",t.products=[],t.categories=[],t.init=function(n){n&&(t.id=n.id,t.tempId=Guid.new(),t.dateCreated=n.dateCreated,t.name=n.name,t.hasSubcategories=n.hasSubCategories,t.parentCategory=n.parentCategory,_.forEach(n.children,function(n){n.parentCategory=t}),t.categories=t.getSubcategoriesArrayFromObjectsDTO(n.children),t.products=t.getProductsArrayFromObjectsDTO(n.products))},t.hasChildren=function(){return t.categories.length},t.toDTO=function(){return i(t)},i=function(n){var r=ko.utils.unwrapObservable(n.parentCategory),t={name:n.name,hasSubcategories:!1,parentId:r?r.id:"",products:[],children:[]},u,f;return t.hasSubcategories=ko.utils.unwrapObservable(n.hasSubcategories),n.id&&n.id!=""&&(t.id=n.id),u=typeof n.categories=="function"?n.categories():n.categories,f=typeof n.products=="function"?n.products():n.products,_.forEach(f,function(n){t.products.push({id:n.id})}),u.forEach(function(n){t.children.push(i(n))}),t},t.getAllProducts=function(n,i,r){console.log("getting all products");var u={requesttype:"items",count:100};n&&n!=""&&(u["grid-filter"]="Name__2__"+n);ProxyService.send({},"product","GET",u,function(n){if(n){var u=t.getProductsArrayFromObjectsDTO(n);console.log("all products ",u);r(u,i)}})},t.getProductsArrayFromObjectsDTO=function(n){var t=[];return _.forEach(n,function(n){var i=n.blobs.filter(function(n){return n.main==!0})[0];t.push({id:n.id,src:i==null?"":decodeURIComponent(i.url),title:n.name})}),t},t.getSubcategoriesArrayFromObjectsDTO=function(n){var t=[];return _.forEach(n,function(n){var i=new Category(n);t.push(i)}),t},t.save=function(n){n=defined(n)?n:function(){};var r=function(i){i&&i.length&&(t.parentCategory()!=null&&t.parentCategory().id==""&&i[0].children&&i[0].children.length?(t.parentCategory().id=i[0].id,t.id=i[0].children[0].id):t.id=i[0].id);n(i)},i=t.toDTO();t.parentCategory()!=null&&(t.parentCategory().categories().push(t),t.parentCategory().id==""&&(i=t.parentCategory().toDTO()));saveEntityData("category",i,r)},t.init(n),t};Order=function(n){var t=this;return t.id="",t.number="",t.statusId="",t.products=[],t.shippingAddress="",t.isPaid="",t.isShipped="",t.paymentStatus="",t.paymentMethod="PayPal",t.history=[],t.taxCost=0,t.shippingCost=0,t.subTotal=0,t.total=0,t.user=null,t.userProfile=null,t.currency="",t.init=function(n){n&&(t.id=n.id,t.number=n.number,t.statusId=n.statusId,t.products=[],t.shippingAddress=n.shippingAddress,_.forEach(n.products,function(n){var i=n.product?new Product(n.product):null;i&&(t.currency=i.currency);t.products.push({id:n.id,product:i,count:n.count,calcPrice:n.calcPrice?parseFloat(n.calcPrice):0,options:Product.initOptions(n.attributes)})}),t.userProfile=n.userProfile,n.userProfile&&(t.user=new User(n.userProfile)),t.isPaid=n.isPaid,t.isShipped=n.isShipped,t.paymentStatus=n.paymentStatus,t.history=[],_.forEach(n.history,function(n){t.history.push({date:new Date(n.date),status:n.status})}),t.taxCost=n.taxCost||0,t.shippingCost=n.shippingCost||0,t.subTotal=n.subTotal||0,t.total=n.amount||0)},t.toDTO=function(){var i=[],n;return _.forEach(t.products,function(n){i.push({id:n.id,attributes:Product.optionsToDto(n.options),count:n.count})}),n={number:t.number,statusId:t.statusId,shippingAddress:t.shippingAddress,userProfile:t.userProfile,products:i,isPaid:t.isPaid,isShipped:t.isShipped,paymentStatus:t.paymentStatus,history:t.history},t.id&&(n.id=t.id),n},t.getAllStatuses=function(){return UI.store.getOrderStatuses()},t.updateOrderStatus=function(n){UI.store.updateOrder({id:t.id,statusId:t.statusId},n)},t.init(n),t};Product.view=function(n){viewEntity("product",n)};Product.update=function(n,t){updateEntityData("product",n,t)};Product.batchUpdate=function(n,t){batchUpdateEntities("product",n,t)};Product.handleGridRows=function(n){handleGridRows("product",n)};handleGridRows=function(n,t){var i=$(".grid-mvc").find("tbody").find("tr");i.each(function(){var i=$(this).find(".select-"+n+' input[type="checkbox"]'),r=i.prop("checked"),u=t&&!r||!t&&r;u&&i.click()})};Product.duplicate=function(n,t){t=defined(t)?t:function(){};duplicateEntity("product",n,t)};Product.delete=function(n,t){t=defined(t)?t:function(){};deleteEntity("product",n,t)};Category.view=function(n){viewEntity("category",n)};Order.view=function(n){viewEntity("order",n)};Category.delete=function(n,t){t=defined(t)?t:function(){};deleteEntity("category",n,t)};Order.delete=function(n,t){t=defined(t)?t:function(){};deleteEntity("order",n,t)};var batchUpdateEntities=function(n,t,i){i=defined(i)?i:function(){};ProxyService.send({data:t,isArrayBodyRequest:!0},n,"PUT",{},i)},getEntityData=function(n,t,i){i=defined(i)?i:function(){};ProxyService.send({id:t},n,"GET",{},function(t){if(t&&t.length>0){var r=t[0];i(r,n)}})},updateEntityData=function(n,t,i){var r=function(n,t){var u=getEntityObject(t,n),r;u&&(r=u.toDTO(),typeof i=="object"&&($.each(i,function(n){r.hasOwnProperty(n)&&(r[n]=i[n])}),saveEntityData(t,r)))};typeof t=="object"?r(t,n):getEntityData(n,t,r)},saveEntityData=function(n,t,i){i=defined(i)?i:function(){};var r=t.id==null?"POST":"PUT";ProxyService.send(t,n,r,{},function(n){i(n)})},duplicateEntityData=function(n,t,i){i=defined(i)?i:function(){};saveEntityData(n,{id:t.id,webApiAction:"duplicate"},i)},deleteEntityData=function(n,t,i){i=defined(i)?i:function(){};ProxyService.send({id:t},n,"DELETE",{},i)},viewEntity=function(n,t){event.stopPropagation();var i=function(n,t){var i=getEntityModelName(t),r=UI.basicComponentRepository.getAll().where({name:i})[0],u=TemplateFactory.templateFor({proto:r},VIEWER_TEMPLATE).compiledTemplate;$("#manage-store-products-tab-content").html("");$("#manage-store-products-tab-content").html(u).promise().done(function(){setTimeout(function(n,t){ko.cleanNode($("#manage-store-products-tab-content")[0]);var i=UI.getViewModel(n,t);ko.applyBindings(i,$("#manage-store-products-tab-content")[0])},0,i,n)})};typeof t=="object"?i(t,n):getEntityData(n,t,i)},duplicateEntity=function(n,t,i){event.stopPropagation();i=defined(i)?i:function(){};var r=function(t,r){var u=getEntityObject(r,t),f;u&&(f=u.toDTO(),duplicateEntityData(n,f,i))};typeof t=="object"?r(t,name):getEntityData(n,t,r)},deleteEntity=function(n,t,i){event.stopPropagation();i=defined(i)?i:function(){};var r=typeof t=="object"?t.id:t;r&&deleteEntityData(n,r,i)},getEntityObject=function(n,t){switch(n){case"product":return new Product(t);case"category":return new Category(t);case"order":return new Order(t);default:return t}},getEntityModelName=function(n){switch(n){case"product":return"#manage-store-products-product";case"category":return"#manage-store-products-category";case"order":return"#manage-store-products-order";default:return n}},FormMail=function(n){var t=this;return t.id="",t.sender="",t.date="",t.message="",t.subject="",t.init=function(n){n&&(t.id=n.controlFormMailId||"",t.sender=n.sender||"Anonymous",t.date=moment(n.date).format("DD.MM.YYYY hh:mm A"),t.message=n.message||"",t.subject=n.subject||"")},t.init(n),t},LogItem=function(n){var t=this;return t.componentId="",t.controlId="",t.action="",t.parentId="",t.init=function(n){n&&(t.componentId=n.componentId,t.controlId=n.controlId,t.action=n.action,t.parentId=n.parentId)},t.toString=function(){var r=UI.basicComponentRepository.lookupData({id:t.componentId}).displayName,n=UI.siteComponentRepository.lookupData({id:t.parentId}),u=n.componentId===PAGE?'page "'+n.getProperty(TITLE).value+'"':'component "'+n.proto.displayName+'"',i="";switch(t.action){case"add":i="added to";break;case"remove":i="removed from"}return'Component "'+r+'" '+i+" "+u},t.init(n),t},templateDataTmp=null,DataService=function(n,t){var r=this,i=null,u=null;r.getData=function(){return i.components};r.getControls=function(){return i.controls};r.getDeviceObjects=function(){return i.deviceObjects.devices};r.getTemplateData=function(){return{templateVersionId:i.templateVersionId,templateId:i.templateId,entryControlId:null,displayName:i.displayName,name:i.name,templateTypeId:i.templateTypeId,actionType:i.actionType,categories:i.categories,devices:i.devices||[]}};r.setTemplateData=function(n,t,r,u,f,e,o){i.templateVersionId=n;i.templateId=t;i.displayName=r;i.name=u;i.templateTypeId=f;i.categories=e;i.devices=o||[]};var o=function(n){return window.lastEditorTemplateVersionId===n["last-saved-version"]&&n["save-result"]&&n["last-saved-model"]},f=function(n){if(window.lastJsComponentArrayHash===LocalStorageService.GetItem("last-js-component-array-hash")&&LocalStorageService.GetItem("last-components-cashe"))i.components=LocalStorageService.GetItem("last-components-cashe"),typeof n=="function"&&n();else{var t=document.createElement("script");t.setAttribute("src",window.componentsUrl);t.onerror=function(){console.log("Components were not loaded from blob.")};t.onload=function(){window.componentsArray&&(LocalStorageService.SetItem("last-js-component-array-hash",window.lastJsComponentArrayHash),LocalStorageService.SetItem("last-components-cashe",window.componentsArray),i.components=window.componentsArray);typeof n=="function"&&n()};document.head.appendChild(t)}},e=function(){Application.addLocker();var f=undefined;$.ajax({type:"POST",url:"/Editor/Load",data:{templateId:UI.getSetting("templateId")},async:!0,dataType:"json",beforeSend:function(n){n.setRequestHeader("Content-Encoding","gzip")},success:function(f,e,o){if(u=JSON.parse(f),u.errorCode==0&&u.templateVersion!=null){i=u.templateVersion;LocalStorageService.SetItem("last-js-component-array-hash",window.lastJsComponentArrayHash);LocalStorageService.SetItem("last-components-cashe",i.components);var s=o.getResponseHeader("Authorization");s&&UI.getSetting("templateId")&&LocalStorageService.SetItem(UI.getSetting("templateId")+"_token",s);t(r,n);Application.removeLocker()}else Application.removeLocker(),Helpers.showModalDialog("Error",u.errorMessage,TEMPLATE_MASTER_URL)}})},s=function(u){u["last-saved-model"]&&(i=u["last-saved-model"],f(function(){t(r,n)}))},h=function(u){u["auto-saved-model"]&&(i=u["auto-saved-model"],f(function(){t(r,n)}))},c=function(u){u["save-result"]===!1&&(i=u["last-saved-model"],f(function(){t(r,n)}))},l=function(n,t,r){if(window.lastEditorTemplateVersionId!==n["last-saved-version"]){var u=document.createElement("script");u.setAttribute("src",window.lastTemplateVersionDataUrl);u.onerror=function(){console.log("Model was not loaded from blob.");typeof r=="function"&&r()};u.onload=function(){i=window.templateModel||null;typeof t=="function"&&t()};document.head.appendChild(u)}else i=n["last-saved-model"],typeof t=="function"&&t()},a=function(){console.log("loadData");UI.getSetting("ispublished")||window.templateModel?(i=window.templateModel,window.componentsArray&&!i.components&&(i.components=window.componentsArray),t(r,n)):IndexedDBService.getLocalTemplateParam(null,function(u){u["auto-saved-model"]&&confirm("The last time you worked on this site, the session crashed. Do you want to load the last saved local copy? Click 'OK' to download a local copy of the data or Cancel' to download data from the server.")?h(u):u["save-result"]===!1&&confirm("The last time you worked with this site, the data was not correctly stored on the server. Do you want to load the last saved local copy? Click 'OK' to download a local copy of the data or Cancel' to download data from the server.")?c(u):o(u)?s(u):l(u,function(){i!=null?f(function(){t(r,n)}):e()},function(){e()})})};try{a()}catch(v){e();console.log("no templateModel..."+v)}},IndexedDBService=function(){};IndexedDBService.logerr=function(n){console.log("IndexedDBService Error:",n)};IndexedDBService.connect=function(n){var i=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,t=i.open(INDEXEDDB_BASENAME,1);t.onerror=IndexedDBService.logerr;t.onsuccess=function(){n(t.result)};t.onupgradeneeded=function(n){var t=n.currentTarget.result;t.objectStoreNames.contains(INDEXEDDB_STORE_TEMPLATE)||t.createObjectStore(INDEXEDDB_STORE_TEMPLATE,{keyPath:"id"})}};IndexedDBService.getLocalTemplateParam=function(n,t){try{IndexedDBService.connect(function(i){var u=i.transaction([INDEXEDDB_STORE_TEMPLATE],"readonly").objectStore(INDEXEDDB_STORE_TEMPLATE),r=u.get(window.templateId||"");r.onerror=IndexedDBService.logerr;r.onsuccess=function(i){var r=i.target.result!==-1&&i.target.result||{id:window.templateId};n?t(r[n]):t(r)}})}catch(i){IndexedDBService.logerr(i)}};IndexedDBService.setLocalTemplateParam=function(n){try{IndexedDBService.connect(function(t){var i=t.transaction([INDEXEDDB_STORE_TEMPLATE],"readwrite").objectStore(INDEXEDDB_STORE_TEMPLATE),r=i.get(window.templateId||"");r.onerror=IndexedDBService.logerr;r.onsuccess=function(t){var r=t.target.result!==-1&&t.target.result||{id:window.templateId},u;Object.keys(n).forEach(function(t){n[t]==null?delete r[t]:r[t]=n[t]});u=i.put(r);u.onerror=IndexedDBService.logerr;u.onsuccess=function(n){return n.target.result}}})}catch(t){IndexedDBService.logerr(t)}};LocalStorageService=function(){};LocalStorageService.SetLocalTemplateParam=function(n,t){var r="template-values-"+window.templateId,i;try{i=JSON.parse(localStorage.getItem(r))||{};i[n]=t;t==null&&delete i[n];localStorage.setItem(r,JSON.stringify(i))}catch(u){console.log("Error write to localStorage");localStorage.removeItem(r)}};LocalStorageService.SetItem=function(n,t){try{t!==null?localStorage.setItem(n,JSON.stringify(t)):localStorage.removeItem(n)}catch(i){localStorage.removeItem(n);console.log("Error write to localStorage",i)}};LocalStorageService.RemoveItem=function(n){LocalStorageService.SetItem(n,null)};LocalStorageService.GetLocalTemplateParam=function(n){var t="template-values-"+window.templateId,i=JSON.parse(localStorage.getItem(t))||{};return i[n]};LocalStorageService.GetItem=function(n){try{var t=localStorage.getItem(n);return JSON.parse(t)}catch(i){return null}};var EntitiesConstructorService=function(){var n=this;n.constructBasicEntities=function(n){var t=[];return n.forEach(function(n){var i=new BasicComponent(n);t.push(i)}),t};n.constructExistingEntities=function(n,t){t=t||!1;var i=[];return n.forEach(function(n){var r=(new Component).createNew(n,t);i.push(r)}),i}},ComponentService=function(n){var t=this;t.addComponentToForm=function(t,i){var e;i=i||!1;var f=null,u=null,r=null;return u=i?UI.pager.getCurrentPageId():null,e=TemplateFactory.templateFor(t,VIEWER_TEMPLATE).compiledTemplate,t.parentComponent==null?u==null?r=n:(r="#"+u,f=UI.siteComponentRepository.lookupData({id:u})):(r=t.parentComponent.getUISelector(),t.proto.name===STORE_GALLERY_PRODUCT?r+=">.gallery-products":t.parentComponent.proto.name===STORE_GALLERY_PRODUCT?r+=">.content":t.proto.name===STORE_CART_CHECKOUT&&(r+=">.checkout-btn"),f=t.parentElement),$(r).append(e),i&&(Resizer.checkMinSizeHeaderContainer($(".header")[0]),Resizer.checkMinSizePageContainer($("#"+UI.pager.getCurrentPageId())[0])),f};t.addModalContentToForm=function(n,t,i){var u=UI.basicComponentRepository.getAll().where({name:t})[0],f=TemplateFactory.templateFor({proto:u},VIEWER_TEMPLATE,n).compiledTemplate,r;$("#component-modal").html("");$(".modal-backdrop.fade.in").length?$(".modal-backdrop.fade.in")[0].remove():"";$("#component-modal").html(f);r=$("#component-modal .modal");r.modal("show");r.on("shown.bs.modal",function(){ViewerEventsFactory.attachEvents(n,t,i)})};t.buildExistingComponents=function(n,i){defined(i)||(i=!0);var r=function(n,i){defined(i)||(i=!0);UI.getSetting("isrenderpublish")&&(i=!0);defined(n.children)&&n.children.any()&&n.children.forEach(function(n){var u=n.getProperty("hide-component");u!=null&&u.value.toBoolean()||((i||n.componentId===PAGE)&&(t.addComponentToForm(n),n.viewer()),UI.getSetting("ispreview")&&n.componentId==PAGE&&(i=!1),n.complexComponent||r(n,i))})};n.forEach(function(n){var e=UI.basicComponentRepository.getAll().where({id:n.name}),u,f;e.any()&&(u=(new Component).createFromExisting(n),i&&UI.siteComponentRepository.add(u),f=u.getProperty("hide-component"),f!=null&&f.value.toBoolean()||(t.addComponentToForm(u),u.viewer(),r(u)))});UI.unsavedChanges=!1};t.correctComponentsBeforeCloned=function(n,i){return n.any()&&n.forEach(function(n){n.parentComponent=i;n.id=Guid.new();defined(n.children)&&n.children.any()&&t.correctComponentsBeforeCloned(n.children,n)}),n}},ActionService=function(){var n=this;n.actionsData={};n.addAction=function(t){n.actionsData[t]=[]};n.isHaveAction=function(n,t){return n.proto&&n.proto.actions&&n.proto.actions[t]};n.addToActionData=function(t,i){t.parentComponent!=null&&Helpers.isGalleryComponent(t.parentComponent)||(_.forEach(_.keys(n.actionsData),function(i){n.isHaveAction(t,i)&&n.actionsData[i].push(t)}),i&&_.forEach(t.children,function(t){n.addToActionData(t,i)}))};n.removeFromActionData=function(t,i){_.forEach(_.keys(n.actionsData),function(i){n.isHaveAction(t,i)&&(n.actionsData[i]=_.without(n.actionsData[i],t))});i&&_.forEach(t.children,function(t){n.removeFromActionData(t,i)})};n.runActionForComponent=function(t,i,r,u){n.isHaveAction(t,i)&&t.proto.actions[i](t,u);r&&_.forEach(t.children,function(t){n.runActionForComponent(t,i,r)})};n.runAction=function(t){n.actionsData[t].forEach(function(i){n.runActionForComponent(i,t)})}};Array.prototype.firstOrDefault=function(){return this.length>0?this[0]:null};Array.prototype.any=function(){return this.length>0};Array.prototype.indexOfByProperty=function(n){var i=-1,t=Object.keys(n).firstOrDefault(),r=n[t];return this.forEach(function(n,u){n.hasOwnProperty(t)&&n[t]===r&&(i=u)}),i};Array.prototype.addRange=function(n){this.push.apply(this,n)};Array.prototype.orderBy=function(n){var t=function(t,i){if(t.hasOwnProperty(n)&&i.hasOwnProperty(n)){if(t[n]<i[n])return-1;if(t[n]>i[n])return 1}return 0};return this.sort(t)};Array.prototype.orderByDescending=function(n){var t=function(t,i){if(t.hasOwnProperty(n)&&i.hasOwnProperty(n)){if(t[n]>i[n])return-1;if(t[n]<i[n])return 1}return 0};return this.sort(t)};Array.prototype.max=function(n){var t=null;return this.forEach(function(i){i.hasOwnProperty(n)&&_.isNumber(_.parseInt(i[n]))&&(t!=null?_.parseInt(i[n])>_.parseInt(t[n])&&(t=i):t=i)}),t};Array.prototype.remove=function(n,t){var i=this.slice((t||n)+1||this.length);return this.length=n<0?this.length+n:n,this.push.apply(this,i)};Array.prototype.where=function(n){var i=[],t=Object.keys(n).firstOrDefault(),r=n[t];return this.forEach(function(n){n.hasOwnProperty(t)&&(n[t]===r||typeof n[t]=="function"&&n[t]()===r)&&i.push(n)}),i};Array.prototype.whereNot=function(n){var i=[],t=Object.keys(n).firstOrDefault(),r=n[t];return this.forEach(function(n){n.hasOwnProperty(t)&&(n[t]!==r||typeof n[t]=="function"&&n[t]()!==r)&&i.push(n)}),i};String.prototype.capitalize=function(){return this.charAt(0).toUpperCase()+this.slice(1)};var SiteComponentRepository=function(){var n=this,t=[];n.add=function(n){t.push(n)};n.appendTo=function(n,t){defined(n.children)||(t.children=[]);t.children.push(n);n.parentComponent=t;Helpers.bloggingPostCreate(n)};n.getAll=function(){return t};n.getBody=function(){return n.lookupData({displayName:"body"})};n.addRange=function(n){t.addRange(n)};n.remove=function(i,r){var u=null,e,o;r=defined(r)?r:t;var s=Object.keys(i),h=i[s],f=n.lookupData(i,r);return f!=null&&f.parentComponent!=null&&(e=n.lookupData({id:f.parentComponent.id},r),o=e.children.indexOfByProperty({id:f.id}),o!=-1&&(u=e.children[o],e.children.remove(o))),u&&(Helpers.bloggingPostDelete(u),UI.actionService.removeFromActionData(u,!0),UI.actionService.runActionForComponent(u,ACTION_REMOVE_FROM_FORM,!0)),u};n.move=function(t,i){var u=Object.keys(t),f=Object.keys(i),e=t[u],o=i[f],r=n.lookupData({id:e}),s=n.lookupData({id:o});n.remove({id:r.id});n.appendTo(r,s)};n.lookupData=function(n,i){i=defined(i)?i:t;var u=Object.keys(n),o=n[u],f=null,e=!1,r=function(n){e||(Array.isArray(n)?n.forEach(function(n){n[u]===o&&(f=n,e=!0);defined(n.children)&&r(n.children)}):defined(n.children)&&r(n.children))};return r(i),f};n.lookupDataByProperty=function(n,i){i=defined(i)?i:t;var u=Object.keys(n).firstOrDefault(),e=n[u],f=[],r=function(n){Array.isArray(n)?n.forEach(function(n){var t=n.getProperty(u);t!=null&&t.value==e&&f.push(n);defined(n.children)&&r(n.children)}):defined(n.children)&&r(n.children)};return r(i),f};n.lookupDataByPropertyName=function(n,i){i=defined(i)?i:t;var u=null,f=!1,r=function(t){f||(Array.isArray(t)?t.forEach(function(t){var i=t.getProperty(n);i!=null&&(u=t,f=!0);defined(t.children)&&r(t.children)}):defined(t.children)&&r(t.children))};return r(i),u};n.lookupDataSetByPropertyName=function(n,i){i=defined(i)?i:t;var u=[],r=function(t){Array.isArray(t)?t.forEach(function(t){var i=t.getProperty(n);i!=null&&u.push(t);defined(t.children)&&r(t.children)}):defined(t.children)&&r(t.children)};return r(i),u};n.checkExistingRule=function(t,i){var r=n.lookupData({id:i}),u=r&&r.proto.name===PAGE_COMPONENT?r.getProperty(ISSERVICE).value.toBoolean():!1;if(u)return Application.showEmptyDialog("Not Allowed","You cann'ot add component to the service page"),!1;switch(t){case HEADERTEXT_SEO:return f(i);case SIGNIN:case STORE:case STORE_GALLERY:case STORE_CART_LINK:case STORE_CATEGORIES:return e(t);case CAPTCHA:return o(t,r);default:return!0}function f(t){function i(n){return n.proto.name===HEADERTEXT_SEO}return _.findIndex(n.lookupData({displayName:"header"}).children,i)===-1&&_.findIndex(n.lookupData({displayName:"footer"}).children,i)===-1?t?_.findIndex(n.lookupData({id:t}).children,i)===-1?!0:(Application.showEmptyDialog("Already Exist","You already have a Header for this page. You can have only one Header per page."),!1):!0:(Application.showEmptyDialog("Already Exist","You already have a Header for this page. You can have only one Header per page."),!1)}function e(t){return n.lookupData({displayName:t})?(Application.showEmptyDialog("Already Exist","You can add only one component to the site."),!1):!0}function o(n,t){var i=_.findIndex(t.children,function(t){return t.proto.name===n});return i===-1?!0:(Application.showEmptyDialog("Already Exist","You can add only one captcha to the form."),!1)}};n.lookupDataSet=function(n,i){i=defined(i)?i:t;var u=Object.keys(n),e=n[u],f=[],r=function(n){Array.isArray(n)?n.forEach(function(n){n[u]===e&&f.push(n);defined(n.children)&&r(n.children)}):defined(n.children)&&r(n.children)};return r(i),f};n.resolveDependecies=function(){var i=_.cloneDeep(t),r=function(n){Array.isArray(n)?n.forEach(function(n){var t=n.parentComponent!=null?n.parentComponent.id:null;n.setProperty("parentId",t);defined(n.children)&&r(n.children)}):defined(n.children)&&r(n.children)},n;return r(i),n=function(t){Array.isArray(t)?t.forEach(function(t){t.parentComponent=undefined;t.proto=undefined;t.componentId=t.name;t.name=undefined;t.controlId=t.id;t.id=undefined;t.isDockable=undefined;t.isSelectable=undefined;t.isDraggable=undefined;t.displayName=undefined;t.complexComponent=undefined;defined(t.children)&&n(t.children)}):defined(t.children)&&n(t.children)},n(i),i};n.toJson=function(){return JSON.stringify(t,function(n,t){return n=="parentComponent"||n=="proto"?undefined:t})};n.ajaxJsonRequest=function(n,t,i){i=i||function(){};$.ajax({type:"POST",url:n,data:{data:t},success:function(){alert("ok");typeof i=="function"&&i()},error:function(){alert("error");typeof i=="function"&&i()}})};n.save=function(t){n.ajaxJsonRequest("/Editor/Save",n.toJson(),t)};n.publish=function(t){n.ajaxJsonRequest("/Editor/Publish",n.toJson(),t)}},BasicComponentRepository=function(){var n=this,t=[];n.add=function(n){t.push(n)};n.getAll=function(){return t};n.addRange=function(n){t.addRange(n)};n.lookupData=function(n,i){i=defined(i)?i:t;var r=Object.keys(n),o=n[r],u=null,f=!1,e=function(n){f||n.forEach(function(n){n[r]===o&&(u=n,f=!0);defined(n.children)&&e(n.children)})};return e(i),u}},EditorApplication=function(n){var t=this,i;n.ispreview||(n.isadmin=Application.IsSystemAdministrator(),n.isadmin&&window.actionType!==1&&window.actionType!==4&&$("#history-management").show());i=$.extend({},t.defaultParams,n);UI.setSettings(n);UI.configure({wrapper:".wrapper","component-bar":".component-bar",editor:"#editor","select-wrapper":".select-wrapper",html:"html","dock-wrapper":".dock-wrapper"});UI.getSetting("ispublished")||(UI.init(),ClipboardViewModel.init(),UI.getSetting("ispreview")||(Grouping.init(),ace.config.set("basePath","/Content/Editor/js/libs/ace"),window.onbeforeunload=function(n){if(IndexedDBService.setLocalTemplateParam({"auto-saved-model":null,"auto-saved-time":null}),UI.unsavedChanges){var t="Note: Any unsaved changes will be lost";return typeof n=="undefined"&&(n=window.event),n&&(n.returnValue=t),t}}));t.onLoad=t.onLoad||function(n){var u,r,i,f;console.log("application loaded and initialized..."+n.toString());try{for(u=new RegExp(/template-values-(.+)/),r=[],i=0,f=localStorage.length;i<f;++i)u.test(localStorage.key(i))&&r.push(localStorage.key(i));r.forEach(function(n){localStorage.removeItem(n)})}catch(e){}$(document).trigger("appstart",[t,UI,n])};t.eventsystem=eventsystem.subscribe("/dataservice/onServiceInitialized",t.onLoad);window.onerror=function(n,t,i,r){return console.log("Error: remove locker",n,t+":"+i+":"+r),Application.removeLocker(),!0};t.dataServiceContext=new DataService(t,EditorApplication.init)};if(EditorApplication.init=function(n,t){var r=new ActionService,v,u,s,y,f,d,p,h,c;r.addAction(ACTION_SIGN_IN);r.addAction(ACTION_SIGN_OUT);r.addAction(ACTION_ADD_TO_FORM);r.addAction(ACTION_REMOVE_FROM_FORM);UI.injectActionService(r);var e=new ComponentService(UI.getConfigurationValue(WRAPPER)),l=new EntitiesConstructorService,i=new SiteComponentRepository,o=new BasicComponentRepository,w=new PostLoadInit,b=new MediaService,k=n.getData(),a=n.getControls();UI.getSetting("ispreview")||(v=new JsonCompService(a),UI.injectJsonCompareService(v));UI.injectRepositories(i,o);UI.setTemplateData(n.getTemplateData());UI.ajaxSetup();UI.getSetting("ispreview")||UI.getSetting("isThumbnailPreview")?UI.initDevices(n.getDeviceObjects()):(UI.initDevices(Device.getDevices()),u=UI.devices.where({type:DEVICE_MOBILE_TYPE}).firstOrDefault(),u&&(u.isHaveComponentProperties()||Device.setDeviceRequest(u)));UI.injectVideo(b);o.addRange(l.constructBasicEntities(k));e.buildExistingComponents(l.constructExistingEntities(a));s=i.lookupData({displayName:STORE});s&&($("#store").show(),UI.store=new Store(s));UI.getSetting("ispreview")||(y=new RulerGuides,UI.injectRulerGuides(y));f=UI.getBody();(UI.getSetting("actionType")==ACTION_TYPE_CREATE_WEB_SITE||UI.getSetting("actionType")==ACTION_TYPE_CREATE_TEMPLATE)&&(f.setProperty(GOOGLE_ANALYTICS,"0",!0),f.setProperty(SEARCHENGINE,"1",!0),f.setProperty(SITEMAPXML,"1",!0));UI.injectServices(e);UI.injectPostLoadInit(w);UI.getSetting("ispreview")||(UI.handleKeyDown(i),UI.handleKeyUp());UI.getSetting("ispreview")&&(UI.getSetting("ispaid")||(d=new AdvertisementService),p=new AuthService,UI.injectAuthService(p));UI.getSetting("ispublished")?(h=document.location.pathname.replace("\\","").replace("/","").replace(/ /g,"").split("/"),UI.setPager(new Pager(h.shift(),h.shift()))):UI.setPager(new Pager);UI.setSiteSettings(new SiteSettings);UI.getSetting("ispreview")?Designer.refreshBackground():(UI.getTooltips(),UI.setDesigner(new Designer));UI.renderMenus();UI.getSetting("ispreview")||UI.setPaletteId();Pager.renderTopMenuSelect();t.addNewComponent=function(t,r,u){var y,b,f,p,d,s,l,c,a,w,v,h,it,rt,ut;if(u=defined(u)?u:null,r=defined(r)?r:{},i.checkExistingRule(t,u!=null?u.id:null)&&(y=o.getAll().where({name:t}),y.any())){if(b=y.firstOrDefault(),f=(new Component).createNew(b,!0),defined(f.events)?r=f.events:f.events=r,u!=null){var ft=f.getProperty(WIDTH).value,et=f.getProperty(HEIGHT).value,k=Helpers.findFreePositionOnCustomForm(u.id,parseInt(ft),parseInt(et));f.setProperty(TOP,k.y+"px");f.setProperty(LEFT,k.x+"px")}if(defined(r.onComponentCreated)&&_.isFunction(r.onComponentCreated))r.onComponentCreated(f);if(f.getProperty(SUCCESS_PAGE_MASTER_LINK)!==null&&(p=UI.siteComponentRepository.lookupDataByPropertyName(SUCCESS_PAGE_MASTER_LINK),p!==null&&f.setProperty(SUCCESS_PAGE_MASTER_LINK,p.getProperty(SUCCESS_PAGE_MASTER_LINK).value)),d=e.addComponentToForm(f,!0),u!=null?i.appendTo(f,u):i.appendTo(f,d),f.viewer(),defined(r.onComponentProcessed)&&_.isFunction(r.onComponentProcessed))r.onComponentProcessed(f);if(s=i.lookupData({id:f.id}),l=$("#"+s.id),u!=null?(l.detach(),l.appendTo($(u.getUISelector()))):l.hide(),t===STORE_GALLERY){if(h=UI.basicComponentRepository.lookupData({name:STORE_GALLERY_PRODUCT}),h){c=(new Component).createNew(h,!0);UI.siteComponentRepository.appendTo(c,s);h=UI.basicComponentRepository.lookupData({name:STORE_GALLERY_PRODUCT_IMAGE});h&&(a=(new Component).createNew(h,!0),UI.siteComponentRepository.appendTo(a,c),h=UI.basicComponentRepository.lookupData({name:STORE_GALLERY_PRODUCT_LABEL}),h&&(w=(new Component).createNew(h,!0),UI.siteComponentRepository.appendTo(w,a)));var g=UI.basicComponentRepository.lookupData({name:STORE_GALLERY_PRODUCT_TITLE}),nt=UI.basicComponentRepository.lookupData({name:STORE_GALLERY_PRODUCT_PRICE}),tt=UI.basicComponentRepository.lookupData({name:STORE_GALLERY_PRODUCT_DESCRIPTION});g&&UI.siteComponentRepository.appendTo((new Component).createNew(g,!0),c);nt&&UI.siteComponentRepository.appendTo((new Component).createNew(nt,!0),c);tt&&UI.siteComponentRepository.appendTo((new Component).createNew(tt,!0),c);UI.actionService.runActionForComponent(c,ACTION_ADD_TO_FORM,!0)}h=UI.basicComponentRepository.lookupData({name:STORE_GALLERY_SHOW_MORE});h&&(v=(new Component).createNew(h,!0),UI.siteComponentRepository.appendTo(v,s),UI.actionService.runActionForComponent(v,ACTION_ADD_TO_FORM,!0))}UI.addLog("add",s);it=function(){var n=i.lookupData({id:s.parentComponent.id}),u=UI.pager.getCurrentPageId();if(n!=null){if(s.parentComponent.displayName==FORM){var o=f.getProperty(WIDTH).value,h=f.getProperty(HEIGHT).value,e=Helpers.findFreePositionOnCustomForm(n.id,parseInt(o),parseInt(h));f.setProperty(TOP,e.y+"px");f.setProperty(LEFT,e.x+"px")}u=UI.siteComponentRepository.lookupData({id:n.id}).id}if(i.appendTo(s,UI.siteComponentRepository.lookupData({id:u})),t===STORE_GALLERY&&(UI.siteComponentRepository.appendTo(c,s),UI.siteComponentRepository.appendTo(v,s),UI.siteComponentRepository.appendTo(a,c),UI.siteComponentRepository.appendTo(w,a)),TransformFactory.setNewPosition(s),UI.actionService.addToActionData(s,!0),UI.actionService.runActionForComponent(s,ACTION_ADD_TO_FORM,!0),defined(r.onComponentCreated)&&_.isFunction(r.onComponentCreated))r.onComponentCreated(s);UI.addLog("add",s)};rt=function(){UI.removeLog("add",s);i.remove({id:s.id})};eventsystem.publish("/dataservice/onServiceInitialized",n);UI.undoManagerAdd({undo:function(){rt()},redo:function(){it()}});u==null?(ut=[LIST,CONTACT_US],$.inArray(t,ut)!=-1?UI.callPreEditor(f):(t===STORE_GALLERY,eventsystem.publish("/component/create/",s,l))):TransformFactory.setNewPosition(s)}};$(".preview-advertisement").css("display","block");UI.addNewComponent=t.addNewComponent;UI.initializeViewerPaletteController(viewerPaletteController);c=$(".footer")[0];$("#wrapper-footer").css("top",c.offsetTop+c.offsetHeight+10+"px");eventsystem.publish("/dataservice/onServiceInitialized",n);UI.getSetting("ispreview")||UI.RulerGuides==undefined||UI.RulerGuides.init();UI.postLoadInit.execute();UI.getSetting("ispreview")||UI.displayNavigationPanelPopover();Application.removeLocker();UI.getSetting("ispreview")||UI.initAutoSave()},EditorApplication.reBuild=function(){var t,n;UI.getSetting("ispreview")||(Helpers.hideRuler(),UI.actionService.runAction(ACTION_REMOVE_FROM_FORM),Helpers.cleanSelected(),TransformFactory.runTransform(UI.siteComponentRepository.getAll()[0]),UI.actionService.runAction(ACTION_ADD_TO_FORM),UI.getSetting("ispreview")||(UI.handleKeyDown(UI.siteComponentRepository),UI.handleKeyUp()),UI.getSetting("ispreview")&&(UI.getSetting("ispaid")||(t=new AdvertisementService)),UI.pager.goToCurrentPage(),UI.renderMenus(),UI.initializeViewerPaletteController(viewerPaletteController),n=$(".footer")[0],$("#wrapper-footer").css("top",n.offsetTop+n.offsetHeight+10+"px"),UI.getSetting("ispreview")||UI.RulerGuides==undefined||UI.RulerGuides.init(),UI.postLoadInit.execute())},Binding=function(n){this.koDomElements=ko.observableArray(n||[]);this.koAddElement=function(n){this.koDomElements().indexOf(n)<0&&this.koDomElements.push(n)};this.koRemoveElement=function(n){for(var t=this.koDomElements().length-1;t>=0;t--)if(n==this.koDomElements()[t]){this.koDomElements.remove(this.koDomElements()[t]);break}};this.koUnbindAll=function(){while(this.koDomElements().length>0)ko.cleanNode(this.koDomElements()[0]),this.koDomElements.remove(this.koDomElements()[0])};this.koUnbindOrphaned=function(){for(var n=this.koDomElements().length-1;n>=0;n--)this.elementIsRemoved(this.koDomElements()[n])&&(ko.cleanNode(this.koDomElements()[n]),this.koDomElements.remove(this.koDomElements()[n]))};this.elementIsRemoved=function(n){for(;;){if(n==$("html")[0])return!1;if(n==null||n==undefined||n.parentElement==null||n.parentElement==undefined)return!0;n=n.parentElement}}},BindingController=new Binding,window.rangy=function(){function t(n,t){var i=typeof n[t];return i==k||!!(i==p&&n[t])||i=="unknown"}function f(n,t){return!!(typeof n[t]==p&&n[t])}function w(n,t){return typeof n[t]!=r}function s(n){return function(t,i){for(var r=i.length;r--;)if(!n(t,i[r]))return!1;return!0}}function b(n){return n&&h(n,tt)&&c(n,nt)}function i(t){window.alert("Rangy not supported in your browser. Reason: "+t);n.initialized=!0;n.supported=!1}function rt(t){var i="Rangy warning: "+t;n.config.alertOnWarn?window.alert(i):typeof window.console!=r&&typeof window.console.log!=r&&window.console.log(i)}function v(){var r,u,e,o,v,s,y;if(!n.initialized)for(u=!1,e=!1,t(document,"createRange")&&(r=document.createRange(),h(r,g)&&c(r,d)&&(u=!0),r.detach()),o=f(document,"body")?document.body:document.getElementsByTagName("body")[0],o&&t(o,"createTextRange")&&(r=o.createTextRange(),b(r)&&(e=!0)),u||e||i("Neither Range nor TextRange are implemented"),n.initialized=!0,n.features={implementsDomRange:u,implementsTextRange:e},v=a.concat(l),s=0,y=v.length;s<y;++s)try{v[s](n)}catch(p){f(window,"console")&&t(window.console,"log")&&window.console.log("Init listener threw an exception. Continuing.",p)}}function ut(n){n=n||window;v();for(var t=0,i=e.length;t<i;++t)e[t](n)}function u(n){this.name=n;this.initialized=!1;this.supported=!1}var p="object",k="function",r="undefined",d=["startContainer","startOffset","endContainer","endOffset","collapsed","commonAncestorContainer","START_TO_START","START_TO_END","END_TO_START","END_TO_END"],g=["setStart","setStartBefore","setStartAfter","setEnd","setEndBefore","setEndAfter","collapse","selectNode","selectNodeContents","compareBoundaryPoints","deleteContents","extractContents","cloneContents","insertNode","surroundContents","cloneRange","toString","detach"],nt=["boundingHeight","boundingLeft","boundingTop","boundingWidth","htmlText","text"],tt=["collapse","compareEndPoints","duplicate","getBookmark","moveToBookmark","moveToElementText","parentElement","pasteHTML","select","setEndPoint","getBoundingClientRect"],h=s(t),it=s(f),c=s(w),n={version:"1.2.3",initialized:!1,supported:!0,util:{isHostMethod:t,isHostObject:f,isHostProperty:w,areHostMethods:h,areHostObjects:it,areHostProperties:c,isTextRange:b},features:{},modules:{},config:{alertOnWarn:!1,preferTextRange:!1}},l,a,e,y,o;if(n.fail=i,n.warn=rt,{}.hasOwnProperty?n.util.extend=function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])}:i("hasOwnProperty not supported"),l=[],a=[],n.init=v,n.addInitListener=function(t){n.initialized?t(n):l.push(t)},e=[],n.addCreateMissingNativeApiListener=function(n){e.push(n)},n.createMissingNativeApi=ut,u.prototype.fail=function(n){this.initialized=!0;this.supported=!1;throw new Error("Module '"+this.name+"' failed to load: "+n);},u.prototype.warn=function(t){n.warn("Module "+this.name+": "+t)},u.prototype.createError=function(n){return new Error("Error in Rangy "+this.name+" module: "+n)},n.createModule=function(t,i){var r=new u(t);n.modules[t]=r;a.push(function(n){i(n,r);r.initialized=!0;r.supported=!0})},n.requireModules=function(t){for(var f=0,e=t.length,i,r;f<e;++f){if(r=t[f],i=n.modules[r],!i||!(i instanceof u))throw new Error("Module '"+r+"' not found");if(!i.supported)throw new Error("Module '"+r+"' not supported");}},y=!1,o=function(){y||(y=!0,n.initialized||v())},typeof window==r){i("No window found");return}if(typeof document==r){i("No document found");return}return t(document,"addEventListener")&&document.addEventListener("DOMContentLoaded",o,!1),t(window,"addEventListener")?window.addEventListener("load",o,!1):t(window,"attachEvent")?window.attachEvent("onload",o):i("Window does not have required addEventListener or attachEvent method"),n}(),rangy.createModule("DomUtil",function(n,t){function b(n){var t;return typeof n.namespaceURI==i||(t=n.namespaceURI)===null||t=="http://www.w3.org/1999/xhtml"}function k(n){var t=n.parentNode;return t.nodeType==1?t:null}function h(n){for(var t=0;n=n.previousSibling;)t++;return t}function d(n){var t;return c(n)?n.length:(t=n.childNodes)?t.length:0}function a(n,t){for(var r=[],i=n;i;i=i.parentNode)r.push(i);for(i=t;i;i=i.parentNode)if(s(r,i))return i;return null}function g(n,t,i){for(var r=i?t:t.parentNode;r;){if(r===n)return!0;r=r.parentNode}return!1}function f(n,t,i){for(var u,r=i?n:n.parentNode;r;){if(u=r.parentNode,u===t)return r;r=u}return null}function c(n){var t=n.nodeType;return t==3||t==4||t==8}function v(n,t){var i=t.nextSibling,r=t.parentNode;return i?r.insertBefore(n,i):r.appendChild(n),n}function nt(n,t){var i=n.cloneNode(!1);return i.deleteData(0,t),n.deleteData(t,n.length-t),v(i,n),i}function e(n){if(n.nodeType==9)return n;if(typeof n.ownerDocument!=i)return n.ownerDocument;if(typeof n.document!=i)return n.document;if(n.parentNode)return e(n.parentNode);throw new Error("getDocument: no document found for node");}function tt(n){var t=e(n);if(typeof t.defaultView!=i)return t.defaultView;if(typeof t.parentWindow!=i)return t.parentWindow;throw new Error("Cannot get a window object for node");}function it(n){if(typeof n.contentDocument!=i)return n.contentDocument;if(typeof n.contentWindow!=i)return n.contentWindow.document;throw new Error("getIframeWindow: No Document object found for iframe element");}function rt(n){if(typeof n.contentWindow!=i)return n.contentWindow;if(typeof n.contentDocument!=i)return n.contentDocument.defaultView;throw new Error("getIframeWindow: No Window object found for iframe element");}function ut(n){return r.isHostObject(n,"body")?n.body:n.getElementsByTagName("body")[0]}function ft(n){for(var t;t=n.parentNode;)n=t;return n}function et(n,t,i,r){var o,u,s,c,e;if(n==i)return t===r?0:t<r?-1:1;if(o=f(i,n,!0))return t<=h(o)?-1:1;if(o=f(n,i,!0))return h(o)<r?-1:1;if(u=a(n,i),s=n===u?u:f(n,u,!0),c=i===u?u:f(i,u,!0),s===c)throw new Error("comparePoints got to case 4 and childA and childB are the same!");else{for(e=u.firstChild;e;){if(e===s)return-1;if(e===c)return 1;e=e.nextSibling}throw new Error("Should not be here!");}}function ot(n){for(var t=e(n).createDocumentFragment(),i;i=n.firstChild;)t.appendChild(i);return t}function y(n){if(!n)return"[No node]";if(c(n))return'"'+n.data+'"';if(n.nodeType==1){var t=n.id?' id="'+n.id+'"':"";return"<"+n.nodeName+t+">["+n.childNodes.length+"]"}return n.nodeName}function p(n){this.root=n;this._next=n}function st(n){return new p(n)}function w(n,t){this.node=n;this.offset=t}function l(n){this.code=this[n];this.codeName=n;this.message="DOMException: "+this.codeName}var i="undefined",r=n.util,u,o,s;r.areHostMethods(document,["createDocumentFragment","createElement","createTextNode"])||t.fail("document missing a Node creation method");r.isHostMethod(document,"getElementsByTagName")||t.fail("document missing getElementsByTagName method");u=document.createElement("div");r.areHostMethods(u,["insertBefore","appendChild","cloneNode"]||!r.areHostObjects(u,["previousSibling","nextSibling","childNodes","parentNode"]))||t.fail("Incomplete Element implementation");r.isHostProperty(u,"innerHTML")||t.fail("Element is missing innerHTML property");o=document.createTextNode("test");r.areHostMethods(o,["splitText","deleteData","insertData","appendData","cloneNode"]||!r.areHostObjects(u,["previousSibling","nextSibling","childNodes","parentNode"])||!r.areHostProperties(o,["data"]))||t.fail("Incomplete Text Node implementation");s=function(n,t){for(var i=n.length;i--;)if(n[i]===t)return!0;return!1};p.prototype={_current:null,hasNext:function(){return!!this._next},next:function(){var n=this._current=this._next,t,i;if(this._current)if(t=n.firstChild,t)this._next=t;else{for(i=null;n!==this.root&&!(i=n.nextSibling);)n=n.parentNode;this._next=i}return this._current},detach:function(){this._current=this._next=this.root=null}};w.prototype={equals:function(n){return this.node===n.node&this.offset==n.offset},inspect:function(){return"[DomPosition("+y(this.node)+":"+this.offset+")]"}};l.prototype={INDEX_SIZE_ERR:1,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INVALID_STATE_ERR:11};l.prototype.toString=function(){return this.message};n.dom={arrayContains:s,isHtmlNamespace:b,parentElement:k,getNodeIndex:h,getNodeLength:d,getCommonAncestor:a,isAncestorOf:g,getClosestAncestorIn:f,isCharacterDataNode:c,insertAfter:v,splitDataNode:nt,getDocument:e,getWindow:tt,getIframeWindow:rt,getIframeDocument:it,getBody:ut,getRootContainer:ft,comparePoints:et,inspectNode:y,fragmentFromNodeChildren:ot,createIterator:st,DomPosition:w};n.DOMException=l}),rangy.createModule("DomRange",function(n){function c(n,i){return n.nodeType!=3&&(t.isAncestorOf(n,i.startContainer,!0)||t.isAncestorOf(n,i.endContainer,!0))}function r(n){return t.getDocument(n.startContainer)}function ot(n,t,i){var u=n._listeners[t],r,f;if(u)for(r=0,f=u.length;r<f;++r)u[r].call(n,{target:n,args:i})}function st(n){return new et(n.parentNode,t.getNodeIndex(n))}function b(n){return new et(n.parentNode,t.getNodeIndex(n)+1)}function ht(n,i,r){var u=n.nodeType==11?n.firstChild:n;return t.isCharacterDataNode(i)?r==i.length?t.insertAfter(n,i):i.parentNode.insertBefore(n,r==0?i:t.splitDataNode(i,r)):r>=i.childNodes.length?i.appendChild(n):i.insertBefore(n,i.childNodes[r]),u}function ct(n){for(var i,t,e,u=r(n.range).createDocumentFragment();t=n.next();){if(i=n.isPartiallySelectedSubtree(),t=t.cloneNode(!i),i&&(e=n.getSubtreeIterator(),t.appendChild(ct(e)),e.detach(!0)),t.nodeType==10)throw new f("HIERARCHY_REQUEST_ERR");u.appendChild(t)}return u}function y(n,i,r){var e,o,u,f;for(r=r||{stop:!1};u=n.next();)if(n.isPartiallySelectedSubtree()){if(i(u)===!1){r.stop=!0;return}if(f=n.getSubtreeIterator(),y(f,i,r),f.detach(!0),r.stop)return}else for(e=t.createIterator(u);o=e.next();)if(i(o)===!1){r.stop=!0;return}}function lt(n){for(var t;n.next();)n.isPartiallySelectedSubtree()?(t=n.getSubtreeIterator(),lt(t),t.detach(!0)):n.remove()}function at(n){for(var t,u=r(n.range).createDocumentFragment(),i;t=n.next();){if(n.isPartiallySelectedSubtree()?(t=t.cloneNode(!1),i=n.getSubtreeIterator(),t.appendChild(at(i)),i.detach(!0)):n.remove(),t.nodeType==10)throw new f("HIERARCHY_REQUEST_ERR");u.appendChild(t)}return u}function vt(n,t,i){var u=!!(t&&t.length),f,e=!!i,r;return u&&(f=new RegExp("^("+t.join("|")+")$")),r=[],y(new o(n,!1),function(n){(!u||f.test(n.nodeType))&&(!e||i(n))&&r.push(n)}),r}function yt(n){var i=typeof n.getName=="undefined"?"Range":n.getName();return"["+i+"("+t.inspectNode(n.startContainer)+":"+n.startOffset+", "+t.inspectNode(n.endContainer)+":"+n.endOffset+")]"}function o(n,i){if(this.range=n,this.clonePartiallySelectedTextNodes=i,!n.collapsed){this.sc=n.startContainer;this.so=n.startOffset;this.ec=n.endContainer;this.eo=n.endOffset;var r=n.commonAncestorContainer;this.sc===this.ec&&t.isCharacterDataNode(this.sc)?(this.isSingleCharacterDataNode=!0,this._first=this._last=this._next=this.sc):(this._first=this._next=this.sc===r&&!t.isCharacterDataNode(this.sc)?this.sc.childNodes[this.so]:t.getClosestAncestorIn(this.sc,r,!0),this._last=this.ec===r&&!t.isCharacterDataNode(this.ec)?this.ec.childNodes[this.eo-1]:t.getClosestAncestorIn(this.ec,r,!0))}}function s(n){this.code=this[n];this.codeName=n;this.message="RangeException: "+this.codeName}function pt(n,t,i){this.nodes=vt(n,t,i);this._next=this.nodes[0];this._position=0}function k(n){return function(i,r){for(var f,u=r?i:i.parentNode;u;){if(f=u.nodeType,t.arrayContains(n,f))return u;u=u.parentNode}return null}}function a(n,t){if(yi(n,t))throw new s("INVALID_NODE_TYPE_ERR");}function e(n){if(!n.startContainer)throw new f("INVALID_STATE_ERR");}function v(n,i){if(!t.arrayContains(i,n.nodeType))throw new s("INVALID_NODE_TYPE_ERR");}function g(n,i){if(i<0||i>(t.isCharacterDataNode(n)?n.length:n.childNodes.length))throw new f("INDEX_SIZE_ERR");}function nt(n,t){if(d(n,!0)!==d(t,!0))throw new f("WRONG_DOCUMENT_ERR");}function h(n){if(vi(n,!0))throw new f("NO_MODIFICATION_ALLOWED_ERR");}function p(n,t){if(!n)throw new f(t);}function kt(n){return!t.arrayContains(bt,n.nodeType)&&!d(n,!0)}function dt(n,i){return i<=(t.isCharacterDataNode(n)?n.length:n.childNodes.length)}function gt(n){return!!n.startContainer&&!!n.endContainer&&!kt(n.startContainer)&&!kt(n.endContainer)&&dt(n.startContainer,n.startOffset)&&dt(n.endContainer,n.endOffset)}function i(n){if(e(n),!gt(n))throw new Error("Range error: Range is no longer valid after DOM mutation ("+n.inspect()+")");}function ft(){}function fi(n){n.START_TO_START=rt;n.START_TO_END=ni;n.END_TO_END=wi;n.END_TO_START=ti;n.NODE_BEFORE=ii;n.NODE_AFTER=ri;n.NODE_BEFORE_AND_AFTER=ui;n.NODE_INSIDE=ut}function ei(n){fi(n);fi(n.prototype)}function oi(n,r){return function(){var a;i(this);var u=this.startContainer,e=this.startOffset,c=this.commonAncestorContainer,f=new o(this,!0),l,s;return u!==c&&(l=t.getClosestAncestorIn(u,c,!0),s=b(l),u=s.node,e=s.offset),y(f,h),f.reset(),a=n(f),f.detach(),r(this,u,e,u,e),a}}function si(r,u,f){function s(n,t){return function(i){e(this);v(i,wt);v(l(i),bt);var r=(n?st:b)(i);(t?y:p)(this,r.node,r.offset)}}function y(n,i,r){var f=n.endContainer,e=n.endOffset;(i!==n.startContainer||r!==n.startOffset)&&((l(i)!=l(f)||t.comparePoints(i,r,f,e)==1)&&(f=i,e=r),u(n,i,r,f,e))}function p(n,i,r){var f=n.startContainer,e=n.startOffset;(i!==n.endContainer||r!==n.endOffset)&&((l(i)!=l(f)||t.comparePoints(i,r,f,e)==-1)&&(f=i,e=r),u(n,f,e,i,r))}function w(n,t,i){(t!==n.startContainer||i!==n.startOffset||t!==n.endContainer||i!==n.endOffset)&&u(n,t,i,t,i)}r.prototype=new ft;n.util.extend(r.prototype,{setStart:function(n,t){e(this);a(n,!0);g(n,t);y(this,n,t)},setEnd:function(n,t){e(this);a(n,!0);g(n,t);p(this,n,t)},setStartBefore:s(!0,!0),setStartAfter:s(!1,!0),setEndBefore:s(!0,!1),setEndAfter:s(!1,!1),collapse:function(n){i(this);n?u(this,this.startContainer,this.startOffset,this.startContainer,this.startOffset):u(this,this.endContainer,this.endOffset,this.endContainer,this.endOffset)},selectNodeContents:function(n){e(this);a(n,!0);u(this,n,0,n,t.getNodeLength(n))},selectNode:function(n){e(this);a(n,!1);v(n,wt);var t=st(n),i=b(n);u(this,t.node,t.offset,i.node,i.offset)},extractContents:oi(at,u),deleteContents:oi(lt,u),canSurroundContents:function(){i(this);h(this.startContainer);h(this.endContainer);var n=new o(this,!0),t=n._first&&c(n._first,this)||n._last&&c(n._last,this);return n.detach(),!t},detach:function(){f(this)},splitBoundaries:function(){i(this);var n=this.startContainer,e=this.startOffset,r=this.endContainer,f=this.endOffset,o=n===r;t.isCharacterDataNode(r)&&f>0&&f<r.length&&t.splitDataNode(r,f);t.isCharacterDataNode(n)&&e>0&&e<n.length&&(n=t.splitDataNode(n,e),o?(f-=e,r=n):r==n.parentNode&&f>=t.getNodeIndex(n)&&f++,e=0);u(this,n,e,r,f)},normalizeBoundaries:function(){var o,s;i(this);var f=this.startContainer,e=this.startOffset,n=this.endContainer,r=this.endOffset,h=function(t){var i=t.nextSibling;i&&i.nodeType==t.nodeType&&(n=t,r=t.length,t.appendData(i.data),i.parentNode.removeChild(i))},c=function(i){var u=i.previousSibling,s,o;u&&u.nodeType==i.nodeType&&(f=i,s=i.length,e=u.length,i.insertData(0,u.data),u.parentNode.removeChild(u),f==n?(r+=e,n=f):n==i.parentNode&&(o=t.getNodeIndex(i),r==o?(n=i,r=s):r>o&&r--))},l=!0;t.isCharacterDataNode(n)?n.length==r&&h(n):(r>0&&(o=n.childNodes[r-1],o&&t.isCharacterDataNode(o)&&h(o)),l=!this.collapsed);l?t.isCharacterDataNode(f)?e==0&&c(f):e<f.childNodes.length&&(s=f.childNodes[e],s&&t.isCharacterDataNode(s)&&c(s)):(f=n,e=r);u(this,f,e,n,r)},collapseToPoint:function(n,t){e(this);a(n,!0);g(n,t);w(this,n,t)}});ei(r)}function hi(n){n.collapsed=n.startContainer===n.endContainer&&n.startOffset===n.endOffset;n.commonAncestorContainer=n.collapsed?n.startContainer:t.getCommonAncestor(n.startContainer,n.endContainer)}function ci(n,t,i,r,u){var f=n.startContainer!==t||n.startOffset!==i,e=n.endContainer!==r||n.endOffset!==u;n.startContainer=t;n.startOffset=i;n.endContainer=r;n.endOffset=u;hi(n);ot(n,"boundarychange",{startMoved:f,endMoved:e})}function bi(n){e(n);n.startContainer=n.startOffset=n.endContainer=n.endOffset=null;n.collapsed=n.commonAncestorContainer=null;ot(n,"detach",null);n._listeners=null}function u(n){this.startContainer=n;this.startOffset=0;this.endContainer=n;this.endOffset=0;this._listeners={boundarychange:[],detach:[]};hi(this)}var tt,w;n.requireModules(["DomUtil"]);var t=n.dom,et=t.DomPosition,f=n.DOMException;o.prototype={_current:null,_next:null,_first:null,_last:null,isSingleCharacterDataNode:!1,reset:function(){this._current=null;this._next=this._first},hasNext:function(){return!!this._next},next:function(){var n=this._current=this._next;return n&&(this._next=n!==this._last?n.nextSibling:null,t.isCharacterDataNode(n)&&this.clonePartiallySelectedTextNodes&&(n===this.ec&&(n=n.cloneNode(!0)).deleteData(this.eo,n.length-this.eo),this._current===this.sc&&(n=n.cloneNode(!0)).deleteData(0,this.so))),n},remove:function(){var n=this._current,i,r;t.isCharacterDataNode(n)&&(n===this.sc||n===this.ec)?(i=n===this.sc?this.so:0,r=n===this.ec?this.eo:n.length,i!=r&&n.deleteData(i,r-i)):n.parentNode&&n.parentNode.removeChild(n)},isPartiallySelectedSubtree:function(){var n=this._current;return c(n,this.range)},getSubtreeIterator:function(){var n;if(this.isSingleCharacterDataNode)n=this.range.cloneRange(),n.collapse();else{n=new u(r(this.range));var i=this._current,f=i,e=0,s=i,h=t.getNodeLength(i);t.isAncestorOf(i,this.sc,!0)&&(f=this.sc,e=this.so);t.isAncestorOf(i,this.ec,!0)&&(s=this.ec,h=this.eo);ci(n,f,e,s,h)}return new o(n,this.clonePartiallySelectedTextNodes)},detach:function(n){n&&this.range.detach();this.range=this._current=this._next=this._first=this._last=this.sc=this.so=this.ec=this.eo=null}};s.prototype={BAD_BOUNDARYPOINTS_ERR:1,INVALID_NODE_TYPE_ERR:2};s.prototype.toString=function(){return this.message};pt.prototype={_current:null,hasNext:function(){return!!this._next},next:function(){return this._current=this._next,this._next=this.nodes[++this._position],this._current},detach:function(){this._current=this._next=this.nodes=null}};var wt=[1,3,4,5,7,8,10],bt=[2,9,11],li=[1,3,4,5,7,8,10,11],ai=[1,3,4,5,7,8];var l=t.getRootContainer,d=k([9,11]),vi=k([5,6,10,12]),yi=k([6,10,12]);tt=document.createElement("style");w=!1;try{tt.innerHTML="<b>x<\/b>";w=tt.firstChild.nodeType==3}catch(ki){}n.features.htmlParsingConforms=w;var pi=w?function(n){var r=this.startContainer,u=t.getDocument(r),i;if(!r)throw new f("INVALID_STATE_ERR");return i=null,r.nodeType==1?i=r:t.isCharacterDataNode(r)&&(i=t.parentElement(r)),i=i===null||i.nodeName=="HTML"&&t.isHtmlNamespace(t.getDocument(i).documentElement)&&t.isHtmlNamespace(i)?u.createElement("body"):i.cloneNode(!1),i.innerHTML=n,t.fragmentFromNodeChildren(i)}:function(n){e(this);var u=r(this),i=u.createElement("body");return i.innerHTML=n,t.fragmentFromNodeChildren(i)},it=["startContainer","startOffset","endContainer","endOffset","collapsed","commonAncestorContainer"],rt=0,ni=1,wi=2,ti=3,ii=0,ri=1,ui=2,ut=3;ft.prototype={attachListener:function(n,t){this._listeners[n].push(t)},compareBoundaryPoints:function(n,r){i(this);nt(this.startContainer,r.startContainer);var u,f,e,o,s=n==ti||n==rt?"start":"end",h=n==ni||n==rt?"start":"end";return u=this[s+"Container"],f=this[s+"Offset"],e=r[h+"Container"],o=r[h+"Offset"],t.comparePoints(u,f,e,o)},insertNode:function(n){if(i(this),v(n,li),h(this.startContainer),t.isAncestorOf(n,this.startContainer,!0))throw new f("HIERARCHY_REQUEST_ERR");var r=ht(n,this.startContainer,this.startOffset);this.setStartBefore(r)},cloneContents:function(){var n,u,f;return i(this),this.collapsed?r(this).createDocumentFragment():this.startContainer===this.endContainer&&t.isCharacterDataNode(this.startContainer)?(n=this.startContainer.cloneNode(!0),n.data=n.data.slice(this.startOffset,this.endOffset),u=r(this).createDocumentFragment(),u.appendChild(n),u):(f=new o(this,!0),n=ct(f),f.detach(),n)},canSurroundContents:function(){i(this);h(this.startContainer);h(this.endContainer);var n=new o(this,!0),t=n._first&&c(n._first,this)||n._last&&c(n._last,this);return n.detach(),!t},surroundContents:function(n){if(v(n,ai),!this.canSurroundContents())throw new s("BAD_BOUNDARYPOINTS_ERR");var t=this.extractContents();if(n.hasChildNodes())while(n.lastChild)n.removeChild(n.lastChild);ht(n,this.startContainer,this.startOffset);n.appendChild(t);this.selectNode(n)},cloneRange:function(){i(this);for(var t=new u(r(this)),f=it.length,n;f--;)n=it[f],t[n]=this[n];return t},toString:function(){var n,r,u;return i(this),n=this.startContainer,n===this.endContainer&&t.isCharacterDataNode(n)?n.nodeType==3||n.nodeType==4?n.data.slice(this.startOffset,this.endOffset):"":(r=[],u=new o(this,!0),y(u,function(n){(n.nodeType==3||n.nodeType==4)&&r.push(n.data)}),u.detach(),r.join(""))},compareNode:function(n){var r,u,o,e;if(i(this),r=n.parentNode,u=t.getNodeIndex(n),!r)throw new f("NOT_FOUND_ERR");return o=this.comparePoint(r,u),e=this.comparePoint(r,u+1),o<0?e>0?ui:ii:e>0?ri:ut},comparePoint:function(n,r){return(i(this),p(n,"HIERARCHY_REQUEST_ERR"),nt(n,this.startContainer),t.comparePoints(n,r,this.startContainer,this.startOffset)<0)?-1:t.comparePoints(n,r,this.endContainer,this.endOffset)>0?1:0},createContextualFragment:pi,toHtml:function(){i(this);var n=r(this).createElement("div");return n.appendChild(this.cloneContents()),n.innerHTML},intersectsNode:function(n,u){var f,e,o,s;return(i(this),p(n,"NOT_FOUND_ERR"),t.getDocument(n)!==r(this))?!1:(f=n.parentNode,e=t.getNodeIndex(n),p(f,"NOT_FOUND_ERR"),o=t.comparePoints(f,e,this.endContainer,this.endOffset),s=t.comparePoints(f,e+1,this.startContainer,this.startOffset),u?o<=0&&s>=0:o<0&&s>0)},isPointInRange:function(n,r){return i(this),p(n,"HIERARCHY_REQUEST_ERR"),nt(n,this.startContainer),t.comparePoints(n,r,this.startContainer,this.startOffset)>=0&&t.comparePoints(n,r,this.endContainer,this.endOffset)<=0},intersectsRange:function(n,u){if(i(this),r(n)!=r(this))throw new f("WRONG_DOCUMENT_ERR");var e=t.comparePoints(this.startContainer,this.startOffset,n.endContainer,n.endOffset),o=t.comparePoints(this.endContainer,this.endOffset,n.startContainer,n.startOffset);return u?e<=0&&o>=0:e<0&&o>0},intersection:function(n){if(this.intersectsRange(n)){var r=t.comparePoints(this.startContainer,this.startOffset,n.startContainer,n.startOffset),u=t.comparePoints(this.endContainer,this.endOffset,n.endContainer,n.endOffset),i=this.cloneRange();return r==-1&&i.setStart(n.startContainer,n.startOffset),u==1&&i.setEnd(n.endContainer,n.endOffset),i}return null},union:function(n){if(this.intersectsRange(n,!0)){var i=this.cloneRange();return t.comparePoints(n.startContainer,n.startOffset,this.startContainer,this.startOffset)==-1&&i.setStart(n.startContainer,n.startOffset),t.comparePoints(n.endContainer,n.endOffset,this.endContainer,this.endOffset)==1&&i.setEnd(n.endContainer,n.endOffset),i}throw new s("Ranges do not intersect");},containsNode:function(n,t){return t?this.intersectsNode(n,!1):this.compareNode(n)==ut},containsNodeContents:function(n){return this.comparePoint(n,0)>=0&&this.comparePoint(n,t.getNodeLength(n))<=0},containsRange:function(n){return this.intersection(n).equals(n)},containsNodeText:function(n){var t=this.cloneRange(),i,r,u;return t.selectNode(n),i=t.getNodes([3]),i.length>0?(t.setStart(i[0],0),r=i.pop(),t.setEnd(r,r.length),u=this.containsRange(t),t.detach(),u):this.containsNodeContents(n)},createNodeIterator:function(n,t){return i(this),new pt(this,n,t)},getNodes:function(n,t){return i(this),vt(this,n,t)},getDocument:function(){return r(this)},collapseBefore:function(n){e(this);this.setEndBefore(n);this.collapse(!1)},collapseAfter:function(n){e(this);this.setStartAfter(n);this.collapse(!0)},getName:function(){return"DomRange"},equals:function(n){return u.rangesEqual(this,n)},isValid:function(){return gt(this)},inspect:function(){return yt(this)}};si(u,ci,bi);n.rangePrototype=ft.prototype;u.rangeProperties=it;u.RangeIterator=o;u.copyComparisonConstants=ei;u.createPrototypeRange=si;u.inspect=yt;u.getRangeDocument=r;u.rangesEqual=function(n,t){return n.startContainer===t.startContainer&&n.startOffset===t.startOffset&&n.endContainer===t.endContainer&&n.endOffset===t.endOffset};n.DomRange=u;n.RangeException=s}),rangy.createModule("WrappedRange",function(n){function s(n){var e=n.parentElement(),i=n.duplicate(),r,f,u;return i.collapse(!0),r=i.parentElement(),i=n.duplicate(),i.collapse(!1),f=i.parentElement(),u=r==f?r:t.getCommonAncestor(r,f),u==e?u:t.getCommonAncestor(e,u)}function h(n){return n.compareEndPoints("StartToEnd",n)==0}function f(n,i,u,f){var s=n.duplicate(),o,e,y,w,c,a,p,l,v,h,b;if(s.collapse(u),o=s.parentElement(),t.isAncestorOf(i,o,!0)||(o=i),!o.canHaveHTML)return new r(o.parentNode,t.getNodeIndex(o));e=t.getDocument(o).createElement("span");w=u?"StartToStart":"StartToEnd";do o.insertBefore(e,e.previousSibling),s.moveToElementText(e);while((y=s.compareEndPoints(w,n))>0&&e.previousSibling);if(l=e.nextSibling,y==-1&&l&&t.isCharacterDataNode(l)){if(s.setEndPoint(u?"EndToStart":"EndToEnd",n),/[\r\n]/.test(l.data))for(h=s.duplicate(),b=h.text.replace(/\r\n/g,"\r").length,v=h.moveStart("character",b);(y=h.compareEndPoints("StartToEnd",h))==-1;)v++,h.moveStart("character",1);else v=s.text.length;p=new r(l,v)}else c=(f||!u)&&e.previousSibling,a=(f||u)&&e.nextSibling,p=a&&t.isCharacterDataNode(a)?new r(a,0):c&&t.isCharacterDataNode(c)?new r(c,c.length):new r(o,t.getNodeIndex(e));return e.parentNode.removeChild(e),p}function e(n,i){var u,f,o=n.offset,h=t.getDocument(n.node),r,s,e=h.body.createTextRange(),c=t.isCharacterDataNode(n.node);return c?(u=n.node,f=u.parentNode):(s=n.node.childNodes,u=o<s.length?s[o]:null,f=n.node),r=h.createElement("span"),r.innerHTML="&#feff;",u?f.insertBefore(r,u):f.appendChild(r),e.moveToElementText(r),e.collapse(!i),f.removeChild(r),c&&e[i?"moveStart":"moveEnd"]("character",o),e}var o;n.requireModules(["DomUtil","DomRange"]);var i,t=n.dom,r=t.DomPosition,u=n.DomRange;!n.features.implementsDomRange||n.features.implementsTextRange&&n.config.preferTextRange?n.features.implementsTextRange&&(i=function(n){this.textRange=n;this.refresh()},i.prototype=new u(document),i.prototype.refresh=function(){var n,t,i=s(this.textRange);h(this.textRange)?t=n=f(this.textRange,i,!0,!0):(n=f(this.textRange,i,!0,!1),t=f(this.textRange,i,!1,!1));this.setStart(n.node,n.offset);this.setEnd(t.node,t.offset)},u.copyComparisonConstants(i),o=function(){return this}(),typeof o.Range=="undefined"&&(o.Range=i),n.createNativeRange=function(n){return n=n||document,n.body.createTextRange()}):(function(){function o(n){for(var i=c.length,t;i--;)t=c[i],n[t]=n.nativeRange[t]}function a(n,t,i,r,u){var f=n.startContainer!==t||n.startOffset!=i,e=n.endContainer!==r||n.endOffset!=u;(f||e)&&(n.setEnd(r,u),n.setStart(t,i))}function v(n){n.nativeRange.detach();n.detached=!0;for(var t=c.length,i;t--;)i=c[t],n[i]=null}var r,c=u.rangeProperties,l,h,e,f,s;i=function(n){if(!n)throw new Error("Range must be specified");this.nativeRange=n;o(this)};u.createPrototypeRange(i,a,v);r=i.prototype;r.selectNode=function(n){this.nativeRange.selectNode(n);o(this)};r.deleteContents=function(){this.nativeRange.deleteContents();o(this)};r.extractContents=function(){var n=this.nativeRange.extractContents();return o(this),n};r.cloneContents=function(){return this.nativeRange.cloneContents()};r.surroundContents=function(n){this.nativeRange.surroundContents(n);o(this)};r.collapse=function(n){this.nativeRange.collapse(n);o(this)};r.cloneRange=function(){return new i(this.nativeRange.cloneRange())};r.refresh=function(){o(this)};r.toString=function(){return this.nativeRange.toString()};e=document.createTextNode("test");t.getBody(document).appendChild(e);f=document.createRange();f.setStart(e,0);f.setEnd(e,0);try{f.setStart(e,1);l=!0;r.setStart=function(n,t){this.nativeRange.setStart(n,t);o(this)};r.setEnd=function(n,t){this.nativeRange.setEnd(n,t);o(this)};h=function(n){return function(t){this.nativeRange[n](t);o(this)}}}catch(y){l=!1;r.setStart=function(n,t){try{this.nativeRange.setStart(n,t)}catch(i){this.nativeRange.setEnd(n,t);this.nativeRange.setStart(n,t)}o(this)};r.setEnd=function(n,t){try{this.nativeRange.setEnd(n,t)}catch(i){this.nativeRange.setStart(n,t);this.nativeRange.setEnd(n,t)}o(this)};h=function(n,t){return function(i){try{this.nativeRange[n](i)}catch(r){this.nativeRange[t](i);this.nativeRange[n](i)}o(this)}}}r.setStartBefore=h("setStartBefore","setEndBefore");r.setStartAfter=h("setStartAfter","setEndAfter");r.setEndBefore=h("setEndBefore","setStartBefore");r.setEndAfter=h("setEndAfter","setStartAfter");f.selectNodeContents(e);r.selectNodeContents=f.startContainer==e&&f.endContainer==e&&f.startOffset==0&&f.endOffset==e.length?function(n){this.nativeRange.selectNodeContents(n);o(this)}:function(n){this.setStart(n,0);this.setEnd(n,u.getEndOffset(n))};f.selectNodeContents(e);f.setEnd(e,3);s=document.createRange();s.selectNodeContents(e);s.setEnd(e,4);s.setStart(e,2);r.compareBoundaryPoints=f.compareBoundaryPoints(f.START_TO_END,s)==-1&f.compareBoundaryPoints(f.END_TO_START,s)==1?function(n,t){return t=t.nativeRange||t,n==t.START_TO_END?n=t.END_TO_START:n==t.END_TO_START&&(n=t.START_TO_END),this.nativeRange.compareBoundaryPoints(n,t)}:function(n,t){return this.nativeRange.compareBoundaryPoints(n,t.nativeRange||t)};n.util.isHostMethod(f,"createContextualFragment")&&(r.createContextualFragment=function(n){return this.nativeRange.createContextualFragment(n)});t.getBody(document).removeChild(e);f.detach();s.detach()}(),n.createNativeRange=function(n){return n=n||document,n.createRange()});n.features.implementsTextRange&&(i.rangeToTextRange=function(n){if(n.collapsed)return e(new r(n.startContainer,n.startOffset),!0);var u=e(new r(n.startContainer,n.startOffset),!0),f=e(new r(n.endContainer,n.endOffset),!1),i=t.getDocument(n.startContainer).body.createTextRange();return i.setEndPoint("StartToStart",u),i.setEndPoint("EndToEnd",f),i});i.prototype.getName=function(){return"WrappedRange"};n.WrappedRange=i;n.createRange=function(t){return t=t||document,new i(n.createNativeRange(t))};n.createRangyRange=function(n){return n=n||document,new u(n)};n.createIframeRange=function(i){return n.createRange(t.getIframeDocument(i))};n.createIframeRangyRange=function(i){return n.createRangyRange(t.getIframeDocument(i))};n.addCreateMissingNativeApiListener(function(t){var i=t.document;typeof i.createRange=="undefined"&&(i.createRange=function(){return n.createRange(this)});i=t=null})}),rangy.createModule("WrappedSelection",function(n,t){function ri(n){return(n||window).getSelection()}function yt(n){return(n||window).document.selection}function p(n,t,i){var r=i?"end":"start",u=i?"start":"end";n.anchorNode=t[r+"Container"];n.anchorOffset=t[r+"Offset"];n.focusNode=t[u+"Container"];n.focusOffset=t[u+"Offset"]}function ui(n){var t=n.nativeSelection;n.anchorNode=t.anchorNode;n.anchorOffset=t.anchorOffset;n.focusNode=t.focusNode;n.focusOffset=t.focusOffset}function s(n){n.anchorNode=n.focusNode=null;n.anchorOffset=n.focusOffset=0;n.rangeCount=0;n.isCollapsed=!0;n._ranges.length=0}function st(t){var i;return t instanceof h?(i=t._selectionNativeRange,i||(i=n.createNativeRange(r.getDocument(t.startContainer)),i.setEnd(t.endContainer,t.endOffset),i.setStart(t.startContainer,t.startOffset),t._selectionNativeRange=i,t.attachListener("detach",function(){this._selectionNativeRange=null}))):t instanceof k?i=t.nativeRange:n.features.implementsDomRange&&t instanceof r.getWindow(t.startContainer).Range&&(i=t),i}function fi(n){if(!n.length||n[0].nodeType!=1)return!1;for(var t=1,i=n.length;t<i;++t)if(!r.isAncestorOf(n[0],n[t]))return!1;return!0}function ht(n){var t=n.getNodes();if(!fi(t))throw new Error("getSingleElementFromRange: range "+n.inspect()+" did not consist of a single element");return t[0]}function kt(n){return!!n&&typeof n.text!="undefined"}function dt(n,t){var i=new k(t);n._ranges=[i];p(n,i,!1);n.rangeCount=1;n.isCollapsed=i.collapsed}function w(t){var i,f,e,u;if(t._ranges.length=0,t.docSelection.type=="None")s(t);else if(i=t.docSelection.createRange(),kt(i))dt(t,i);else{for(t.rangeCount=i.length,e=r.getDocument(i.item(0)),u=0;u<t.rangeCount;++u)f=n.createRange(e),f.selectNode(i.item(u)),t._ranges.push(f);t.isCollapsed=t.rangeCount==1&&t._ranges[0].collapsed;p(t,t._ranges[t.rangeCount-1],!1)}}function gt(n,t){for(var u=n.docSelection.createRange(),o=ht(t),s=r.getDocument(u.item(0)),f=r.getBody(s).createControlRange(),i=0,e=u.length;i<e;++i)f.add(u.item(i));try{f.add(o)}catch(h){throw new Error("addRange(): Element within the specified Range could not be added to control selection (does it have layout?)");}f.select();w(n)}function rt(n,t,i){this.nativeSelection=n;this.docSelection=t;this._ranges=[];this.win=i;this.refresh()}function ni(n,t){for(var e=r.getDocument(t[0].startContainer),u=r.getBody(e).createControlRange(),f,i=0;i<rangeCount;++i){f=ht(t[i]);try{u.add(f)}catch(o){throw new Error("setRanges(): Element within the one of the specified Ranges could not be added to control selection (does it have layout?)");}}u.select();w(n)}function ti(n,t){if(n.anchorNode&&r.getDocument(n.anchorNode)!==r.getDocument(t))throw new d("WRONG_DOCUMENT_ERR");}function ii(n){var i=[],u=new vt(n.anchorNode,n.anchorOffset),f=new vt(n.focusNode,n.focusOffset),e=typeof n.getName=="function"?n.getName():"Selection",t,r;if(typeof n.rangeCount!="undefined")for(t=0,r=n.rangeCount;t<r;++t)i[t]=h.inspect(n.getRangeAt(t));return"["+e+"(Ranges: "+i.join(", ")+")(anchor: "+u.inspect()+", focus: "+f.inspect()+"]"}var nt,et,tt,ot,e,bt,it,i,ct,ut,lt,b;n.requireModules(["DomUtil","DomRange","WrappedRange"]);n.config.checkSelectionRanges=!0;var at="boolean",ft="_rangySelection",r=n.dom,f=n.util,h=n.DomRange,k=n.WrappedRange,d=n.DOMException,vt=r.DomPosition,l,g,o="Control";var pt=n.util.isHostMethod(window,"getSelection"),a=n.util.isHostObject(document,"selection"),v=a&&(!pt||n.config.preferTextRange);v?(l=yt,n.isSelectionValid=function(n){var t=(n||window).document,i=t.selection;return i.type!="None"||r.getDocument(i.createRange().parentElement())==t}):pt?(l=ri,n.isSelectionValid=function(){return!0}):t.fail("Neither document.selection or window.getSelection() detected.");n.getNativeSelection=l;var u=l(),wt=n.createNativeRange(document),y=r.getBody(document),c=f.areHostObjects(u,["anchorNode","focusNode"]&&f.areHostProperties(u,["anchorOffset","focusOffset"]));if(n.features.selectionHasAnchorAndFocus=c,nt=f.isHostMethod(u,"extend"),n.features.selectionHasExtend=nt,et=typeof u.rangeCount=="number",n.features.selectionHasRangeCount=et,tt=!1,ot=!0,f.areHostMethods(u,["addRange","getRangeAt","removeAllRanges"])&&typeof u.rangeCount=="number"&&n.features.implementsDomRange&&function(){var n=document.createElement("iframe"),i,f;n.frameBorder=0;n.style.position="absolute";n.style.left="-10000px";y.appendChild(n);i=r.getIframeDocument(n);i.open();i.write("<html><head><\/head><body>12<\/body><\/html>");i.close();var u=r.getIframeWindow(n).getSelection(),o=i.documentElement,s=o.lastChild,e=s.firstChild,t=i.createRange();t.setStart(e,1);t.collapse(!0);u.addRange(t);ot=u.rangeCount==1;u.removeAllRanges();f=t.cloneRange();t.setStart(e,0);f.setEnd(e,2);u.addRange(t);u.addRange(f);tt=u.rangeCount==2;t.detach();f.detach();y.removeChild(n)}(),n.features.selectionSupportsMultipleRanges=tt,n.features.collapsedNonEditableSelectionsSupported=ot,e=!1,y&&f.isHostMethod(y,"createControlRange")&&(bt=y.createControlRange(),f.areHostProperties(bt,["item","add"])&&(e=!0)),n.features.implementsControlRange=e,g=c?function(n){return n.anchorNode===n.focusNode&&n.anchorOffset===n.focusOffset}:function(n){return n.rangeCount?n.getRangeAt(n.rangeCount-1).collapsed:!1},f.isHostMethod(u,"getRangeAt")?it=function(n,t){try{return n.getRangeAt(t)}catch(i){return null}}:c&&(it=function(t){var u=r.getDocument(t.anchorNode),i=n.createRange(u);return i.setStart(t.anchorNode,t.anchorOffset),i.setEnd(t.focusNode,t.focusOffset),i.collapsed!==this.isCollapsed&&(i.setStart(t.focusNode,t.focusOffset),i.setEnd(t.anchorNode,t.anchorOffset)),i}),n.getSelection=function(n){n=n||window;var t=n[ft],i=l(n),r=a?yt(n):null;return t?(t.nativeSelection=i,t.docSelection=r,t.refresh(n)):(t=new rt(i,r,n),n[ft]=t),t},n.getIframeSelection=function(t){return n.getSelection(r.getIframeWindow(t))},i=rt.prototype,!v&&c&&f.areHostMethods(u,["removeAllRanges","addRange"]))i.removeAllRanges=function(){this.nativeSelection.removeAllRanges();s(this)},ct=function(t,i){var u=h.getRangeDocument(i),r=n.createRange(u);r.collapseToPoint(i.endContainer,i.endOffset);t.nativeSelection.addRange(st(r));t.nativeSelection.extend(i.startContainer,i.startOffset);t.refresh()},i.addRange=et?function(t,i){var u,r;e&&a&&this.docSelection.type==o?gt(this,t):i&&nt?ct(this,t):(tt?u=this.rangeCount:(this.removeAllRanges(),u=0),this.nativeSelection.addRange(st(t)),this.rangeCount=this.nativeSelection.rangeCount,this.rangeCount==u+1?(n.config.checkSelectionRanges&&(r=it(this.nativeSelection,this.rangeCount-1),r&&!h.rangesEqual(r,t)&&(t=new k(r))),this._ranges[this.rangeCount-1]=t,p(this,t,b(this.nativeSelection)),this.isCollapsed=g(this)):this.refresh())}:function(n,t){t&&nt?ct(this,n):(this.nativeSelection.addRange(st(n)),this.refresh())},i.setRanges=function(n){if(e&&n.length>1)ni(this,n);else{this.removeAllRanges();for(var t=0,i=n.length;t<i;++t)this.addRange(n[t])}};else if(f.isHostMethod(u,"empty")&&f.isHostMethod(wt,"select")&&e&&v)i.removeAllRanges=function(){var n,t,i;try{this.docSelection.empty();this.docSelection.type!="None"&&(this.anchorNode?n=r.getDocument(this.anchorNode):this.docSelection.type==o&&(t=this.docSelection.createRange(),t.length&&(n=r.getDocument(t.item(0)).body.createTextRange())),n&&(i=n.body.createTextRange(),i.select(),this.docSelection.empty()))}catch(u){}s(this)},i.addRange=function(n){this.docSelection.type==o?gt(this,n):(k.rangeToTextRange(n).select(),this._ranges[0]=n,this.rangeCount=1,this.isCollapsed=this._ranges[0].collapsed,p(this,n,!1))},i.setRanges=function(n){this.removeAllRanges();var t=n.length;t>1?ni(this,n):t&&this.addRange(n[0])};else return t.fail("No means of selecting a Range or TextRange was found"),!1;if(i.getRangeAt=function(n){if(n<0||n>=this.rangeCount)throw new d("INDEX_SIZE_ERR");else return this._ranges[n]},v)ut=function(t){var i;n.isSelectionValid(t.win)?i=t.docSelection.createRange():(i=r.getBody(t.win.document).createTextRange(),i.collapse(!0));t.docSelection.type==o?w(t):kt(i)?dt(t,i):s(t)};else if(f.isHostMethod(u,"getRangeAt")&&typeof u.rangeCount=="number")ut=function(t){if(e&&a&&t.docSelection.type==o)w(t);else if(t._ranges.length=t.rangeCount=t.nativeSelection.rangeCount,t.rangeCount){for(var i=0,r=t.rangeCount;i<r;++i)t._ranges[i]=new n.WrappedRange(t.nativeSelection.getRangeAt(i));p(t,t._ranges[t.rangeCount-1],b(t.nativeSelection));t.isCollapsed=g(t)}else s(t)};else if(c&&typeof u.isCollapsed==at&&typeof wt.collapsed==at&&n.features.implementsDomRange)ut=function(n){var t,i=n.nativeSelection;i.anchorNode?(t=it(i,0),n._ranges=[t],n.rangeCount=1,ui(n),n.isCollapsed=g(n)):s(n)};else return t.fail("No means of obtaining a Range or TextRange from the user's selection was found"),!1;i.refresh=function(n){var i=n?this._ranges.slice(0):null,t;if(ut(this),n){if(t=i.length,t!=this._ranges.length)return!1;while(t--)if(!h.rangesEqual(i[t],this._ranges[t]))return!1;return!0}};lt=function(n,t){var r=n.getAllRanges(),u=!1,i,f;for(n.removeAllRanges(),i=0,f=r.length;i<f;++i)u||t!==r[i]?n.addRange(r[i]):u=!0;n.rangeCount||s(n)};i.removeRange=e?function(n){var t,s;if(this.docSelection.type==o){var i=this.docSelection.createRange(),h=ht(n),c=r.getDocument(i.item(0)),u=r.getBody(c).createControlRange(),f,e=!1;for(t=0,s=i.length;t<s;++t)f=i.item(t),f!==h||e?u.add(i.item(t)):e=!0;u.select();w(this)}else lt(this,n)}:function(n){lt(this,n)};!v&&c&&n.features.implementsDomRange?(b=function(n){var t=!1;return n.anchorNode&&(t=r.comparePoints(n.anchorNode,n.anchorOffset,n.focusNode,n.focusOffset)==1),t},i.isBackwards=function(){return b(this)}):b=i.isBackwards=function(){return!1};i.toString=function(){for(var t=[],n=0,i=this.rangeCount;n<i;++n)t[n]=""+this._ranges[n];return t.join("")};i.collapse=function(t,i){ti(this,t);var u=n.createRange(r.getDocument(t));u.collapseToPoint(t,i);this.removeAllRanges();this.addRange(u);this.isCollapsed=!0};i.collapseToStart=function(){if(this.rangeCount){var n=this._ranges[0];this.collapse(n.startContainer,n.startOffset)}else throw new d("INVALID_STATE_ERR");};i.collapseToEnd=function(){if(this.rangeCount){var n=this._ranges[this.rangeCount-1];this.collapse(n.endContainer,n.endOffset)}else throw new d("INVALID_STATE_ERR");};i.selectAllChildren=function(t){ti(this,t);var i=n.createRange(r.getDocument(t));i.selectNodeContents(t);this.removeAllRanges();this.addRange(i)};i.deleteFromDocument=function(){var n,t,i,r,u;if(e&&a&&this.docSelection.type==o){for(n=this.docSelection.createRange();n.length;)t=n.item(0),n.remove(t),t.parentNode.removeChild(t);this.refresh()}else if(this.rangeCount){for(i=this.getAllRanges(),this.removeAllRanges(),r=0,u=i.length;r<u;++r)i[r].deleteContents();this.addRange(i[u-1])}};i.getAllRanges=function(){return this._ranges.slice(0)};i.setSingleRange=function(n){this.setRanges([n])};i.containsNode=function(n,t){for(var i=0,r=this._ranges.length;i<r;++i)if(this._ranges[i].containsNode(n,t))return!0;return!1};i.toHtml=function(){var i="",t,n,r;if(this.rangeCount){for(t=h.getRangeDocument(this._ranges[0]).createElement("div"),n=0,r=this._ranges.length;n<r;++n)t.appendChild(this._ranges[n].cloneContents());i=t.innerHTML}return i};i.getName=function(){return"WrappedSelection"};i.inspect=function(){return ii(this)};i.detach=function(){this.win[ft]=null;this.win=this.anchorNode=this.focusNode=null};rt.inspect=ii;n.Selection=rt;n.selectionPrototype=i;n.addCreateMissingNativeApiListener(function(t){typeof t.getSelection=="undefined"&&(t.getSelection=function(){return n.getSelection(this)});t=null})}),!function(n){"function"==typeof define&&define.amd?define(["jquery"],function(t){n(t)}):"object"==typeof module&&"object"==typeof module.exports?module.exports=n(require("jquery")):n(window.jQuery)}(function(n){"use strict";function t(n){var u,f,e,o,s,h,c,l;void 0===n&&(n=window.navigator.userAgent);n=n.toLowerCase();var r=/(edge)\/([\w.]+)/.exec(n)||/(opr)[\/]([\w.]+)/.exec(n)||/(chrome)[ \/]([\w.]+)/.exec(n)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(n)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(n)||/(webkit)[ \/]([\w.]+)/.exec(n)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(n)||/(msie) ([\w.]+)/.exec(n)||n.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(n)||n.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(n)||[],a=/(ipad)/.exec(n)||/(ipod)/.exec(n)||/(iphone)/.exec(n)||/(kindle)/.exec(n)||/(silk)/.exec(n)||/(android)/.exec(n)||/(windows phone)/.exec(n)||/(win)/.exec(n)||/(mac)/.exec(n)||/(linux)/.exec(n)||/(cros)/.exec(n)||/(playbook)/.exec(n)||/(bb)/.exec(n)||/(blackberry)/.exec(n)||[],t={},i={browser:r[5]||r[3]||r[1]||"",version:r[2]||r[4]||"0",versionNumber:r[4]||r[2]||"0",platform:a[0]||""};return(i.browser&&(t[i.browser]=!0,t.version=i.version,t.versionNumber=parseInt(i.versionNumber,10)),i.platform&&(t[i.platform]=!0),(t.android||t.bb||t.blackberry||t.ipad||t.iphone||t.ipod||t.kindle||t.playbook||t.silk||t["windows phone"])&&(t.mobile=!0),(t.cros||t.mac||t.linux||t.win)&&(t.desktop=!0),(t.chrome||t.opr||t.safari)&&(t.webkit=!0),t.rv||t.edge)&&(u="msie",i.browser=u,t[u]=!0),t.safari&&t.blackberry&&(f="blackberry",i.browser=f,t[f]=!0),t.safari&&t.playbook&&(e="playbook",i.browser=e,t[e]=!0),t.bb&&(o="blackberry",i.browser=o,t[o]=!0),t.opr&&(s="opera",i.browser=s,t[s]=!0),t.safari&&t.android&&(h="android",i.browser=h,t[h]=!0),t.safari&&t.kindle&&(c="kindle",i.browser=c,t[c]=!0),t.safari&&t.silk&&(l="silk",i.browser=l,t[l]=!0),t.name=i.browser,t.platform=i.platform,t}return window.jQBrowser=t(window.navigator.userAgent),window.jQBrowser.uaMatch=t,n&&(n.browser=window.jQBrowser),window.jQBrowser}),function($,n){function h(n){return typeof n=="string"}function e(n){var t=w.call(arguments,1);return function(){return n.apply(this,t.concat(w.call(arguments)))}}function st(n){return n.replace(/^[^#]*#?(.*)$/,"$1")}function ht(n){return n.replace(/(?:^[^?#]*\?([^#]*).*$)?.*/,"$1")}function ut(e,s,c,a,v){var b,y,w,k,d;return a!==t?(w=c.match(e?/^([^#]*)\#?(.*)$/:/^([^#?]*)\??([^#]*)(#?.*)/),d=w[3]||"",v===2&&h(a)?y=a.replace(e?it:tt,""):(k=i(w[2]),a=h(a)?i[e?r:u](a):a,y=v===2?a:v===1?$.extend({},a,k):$.extend({},k,a),y=o(y),e&&(y=y.replace(rt,l))),b=w[1]+(e?"#":y||!w[1]?"?":"")+y+d):b=s(c!==t?c:n[p][f]),b}function ft(n,f,e){return f===t||typeof f=="boolean"?(e=f,f=o[n?r:u]()):f=h(f)?f.replace(n?it:tt,""):f,i(f,e)}function et(n,i,r,u){return h(r)||typeof r=="object"||(u=r,r=i,i=t),this.each(function(){var f=$(this),t=i||d()[(this.nodeName||"").toLowerCase()]||"",e=t&&f.attr(t)||"";f.attr(t,o[n](e,r,u))})}var t,w=Array.prototype.slice,l=decodeURIComponent,o=$.param,s,i,a,v=$.bbq=$.bbq||{},b,k,d,g=$.event.special,nt="hashchange",u="querystring",r="fragment",y="elemUrlAttr",p="location",f="href",c="src",tt=/^.*\?|#.*$/g,it=/^.*\#/,rt,ot={};o[u]=e(ut,0,ht);o[r]=s=e(ut,1,st);s.noEscape=function(n){n=n||"";var t=$.map(n.split(""),encodeURIComponent);rt=new RegExp(t.join("|"),"g")};s.noEscape(",/");$.deparam=i=function(n,i){var r={},u={"true":!0,"false":!1,"null":null};return $.each(n.replace(/\+/g," ").split("&"),function(n,f){var v=f.split("="),s=l(v[0]),e,a=r,c=0,o=s.split("]["),h=o.length-1;if(/\[/.test(o[0])&&/\]$/.test(o[h])?(o[h]=o[h].replace(/\]$/,""),o=o.shift().split("[").concat(o),h=o.length-1):h=0,v.length===2)if(e=l(v[1]),i&&(e=e&&!isNaN(e)?+e:e==="undefined"?t:u[e]!==t?u[e]:e),h)for(;c<=h;c++)s=o[c]===""?a.length:o[c],a=a[s]=c<h?a[s]||(o[c+1]&&isNaN(o[c+1])?{}:[]):e;else $.isArray(r[s])?r[s].push(e):r[s]=r[s]!==t?[r[s],e]:e;else s&&(r[s]=i?t:"")}),r};i[u]=e(ft,0);i[r]=a=e(ft,1);$[y]||($[y]=function(n){return $.extend(ot,n)})({a:f,base:f,iframe:c,img:c,input:c,form:"action",link:f,script:c});d=$[y];$.fn[u]=e(et,u);$.fn[r]=e(et,r);v.pushState=b=function(i,r){h(i)&&/^#/.test(i)&&r===t&&(r=2);var u=i!==t,e=s(n[p][f],u?i:{},u?r:2);n[p][f]=e+(/#/.test(e)?"":"#")};v.getState=k=function(n,i){return n===t||typeof n=="boolean"?a(n):a(i)[n]};v.removeState=function(n){var i={};n!==t&&(i=k(),$.each($.isArray(n)?n:arguments,function(n,t){delete i[t]}));b(i,2)};g[nt]=$.extend(g[nt],{add:function(n){function f(n){var f=n[r]=s();n.getState=function(n,r){return n===t||typeof n=="boolean"?i(f,n):i(f,r)[n]};u.apply(this,arguments)}var u;if($.isFunction(n))return u=n,f;u=n.handler;n.handler=f}})}(jQuery,this),function($,n,t){function f(t){return t=t||n[r][u],t.replace(/^[^#]*#?(.*)$/,"$1")}var e,o=$.event.special,r="location",i="hashchange",u="href",l=$.browser,s=document.documentMode,h=l.msie&&(s===t||s<8),c="on"+i in n&&!h;$[i+"Delay"]=100;o[i]=$.extend(o[i],{setup:function(){if(c)return!1;$(e.start)},teardown:function(){if(c)return!1;$(e.stop)}});e=function(){function l(){e=c=function(n){return n};h&&(o=$('<iframe src="javascript:0"/>').hide().insertAfter("body")[0].contentWindow,c=function(){return f(o.document[r][u])},e=function(n,t){if(n!==t){var i=o.document;i.open().close();i[r].hash="#"+n}},e(f()))}var s={},t,o,e,c;return s.start=function(){if(!t){var o=f();e||l(),function s(){var l=f(),h=c(o);l!==o?(e(o=l,h),$(n).trigger(i)):h!==o&&(n[r][u]=n[r][u].replace(/#.*/,"")+"#"+h);t=setTimeout(s,$[i+"Delay"])}()}},s.stop=function(){o||(t&&clearTimeout(t),t=0)},s}()}(jQuery,this),$(function(){$(".action-close").live("click",function(){Application.removeModal()});$(".modal").live("hidden.bs.modal",function(){Application.removeModal()})}),Application=function(){},Application.IsSystemAdministrator=function(){var n=!1;return $.ajax({url:"/Admin/IsSystemAdministrator",type:"GET",async:!1,success:function(t){n=t.IsSystemAdministrator}}),n},Application.GetHistoryManagement=function(n,t){$.ajax({url:"/Editor/HistoryManagement",data:{templateId:n},type:"GET",success:function(n){t(n)}})},Application.SetTemplateVersionActive=function(n,t){$.ajax({url:"/Editor/SetTemplateVersionAsActive",type:"POST",data:{templateVersionId:n},success:function(n){t(n)},error:function(){t(null)}})},Application.getPartial=function(n,t,i,r,u,f){f=f||!1;u=u||function(){};f||t.html("");var e,s,o=i||null;u=u||function(){};o!=null?(e=o.timeout,s=o.showloader):(e=300,s=!0);setTimeout(function(){$.ajax({url:n,data:{data:JSON.stringify(r)},success:function(n){f?t.append(n):t.html(n);typeof u=="function"&&u()}})},e)},Application.doGet=function(n,t){document.location=n+"?"+t},Application.doPost=function(n,t){var i=$("<form method='POST'>").attr("action",n);$.each(t,function(n,t){$("<input type='hidden'>").attr("name",n).attr("value",t).appendTo(i)});i.appendTo("body");i.submit()},Application.loginToDealerOrUser=function(n,t,i,r,u){function f(){var i="/Account/LoginToDealerOrUser/?rowKey=",u=/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/;$.ajax({url:"/Account/LoginAs",data:{idUser:n},success:function(n){u.test(n)?r?window.open(location.protocol+"//"+t+i+n,"_blank"):location.href=i+n:(console.log("Error: "+n),Application.showOkDialog("Error","Login to user impossible"))}});return}u.toBoolean()==!0?f():Application.showYesNoDialog('Are you sure you want to Login as "<b>'+i+'<\/b>"',"Login to account",function(){f()})},Application.getModal=function(n,t,i,r){function u(n,t,i){i=i||function(){};$.ajax({url:n,data:{data:JSON.stringify(t)},success:function(n){$("body").append(n);$(".modal").modal("toggle");$(".action-close").bind("click",function(){Application.removeModal()});i()}})}Application.fadeOutListTable();t=t||"";r=r||r==undefined||r==null?!0:!1;r?$.ajax({url:"/Account/IsAutorize",success:function(r){r?u(n,t,i):document.location.reload()}}):u(n,t,i)},Application.view=function(n,t,i){$.ajax({url:n,data:{data:JSON.stringify(t)},success:function(n){i(n)}})},Application.fadeOutListTable=function(){$("#listAllSites").is(":visible")&&$("#listAllSites").fadeOut("slow")},Application.removeModal=function(){$(".modal, .modal-backdrop").remove();$("body").removeClass("modal-open")},jQuery.fn.live=function(n,t,i){jQuery(this.context).on(n,this.selector,t,i);return this},Application.callValidateForm=function(n){jQuery.validator.unobtrusive.parse("#"+n)},Application.showYesNoDialog=function(n,t,i){i=i||function(){};var u='<div class="modal fade" id="yes-no-dialog"><div class="modal-dialog" style="width: 400px"><div class="modal-content"><div class="modal-header"><h4 class="pop-up-title modal-title">'+t+'<\/h4><\/div><div class="modal-body"><div class="form-line pop-up-message" style="text-align: center;">'+n+'<\/div><div class="dialog-content-actions text-center"><a class="std-button yes-button">Yes<\/a><a class="std-button no-button">No<\/a><\/div><\/div><\/div><\/div><\/div>',r=$(u).appendTo("body").modal("show");$(".action-close").on("click",function(n){n.preventDefault();n.stopPropagation();$(".modal").length>1?(r.remove(),$(".modal-backdrop.fade.in").length?$(".modal-backdrop.fade.in")[0].remove():""):Application.removeModal()});$("#yes-no-dialog a.yes-button").on("click",function(n){n.preventDefault();n.stopPropagation();$(".modal").length>1?(r.remove(),$(".modal-backdrop.fade.in").length?$(".modal-backdrop.fade.in")[0].remove():""):Application.removeModal();i()});$("#yes-no-dialog a.no-button").on("click",function(n){n.preventDefault();n.stopPropagation();$(".modal").length>1?(r.remove(),$(".modal-backdrop.fade.in").length?$(".modal-backdrop.fade.in")[0].remove():""):Application.removeModal()})},Application.showRemoveConfirmationDialog=function(n,t,i,r,u){var f,e,s,o;i=defined(i)?i:[];e="";n&&typeof n=="object"?(e=n.style,f=n.text):f=n;s='<div class="modal fade" id="confirmation-dialog"><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><p class="pop-up-title modal-title">'+t+'<\/p><a class="position-button close-button" data-dismiss="modal"><i class="fa fa-times"><\/i><\/a><\/div><div class="modal-body"><div class="form-line pop-up-message text-center '+e+'">'+f+"<\/div>"+(defined(r)?'<div class="form-line pop-up-message text-center"><small class="text-muted">'+r+"<\/small><\/div>":"")+'<div class="dialog-content-actions text-center">'+(defined(u)?'<div><small class="text-danger-light">'+u+"<\/small><\/div>":"")+'<a class="service-button inverted" data-dismiss="modal"  style="margin: 10px;">Cancel<\/a><\/div><\/div><\/div><\/div><\/div>';o=$(s).appendTo("body");_.forEach(i,function(n){$('<a style="margin: 10px;width: initial;padding: 0 5px;" class="service-button '+(defined(n.css)?n.css:"danger")+'">'+(defined(n.text)?n.text:"Remove")+"<\/a>"+(defined(n.tooltip)?'<i class="fa fa-info-circle editable-tooltip" data-bind="editable_tooltip: { key: \''+n.tooltip.key+"', name: '"+n.tooltip.name+"', placement: 'top'}\"><\/i>":"")).appendTo(o.find(".dialog-content-actions")).bind("click",defined(n.callback)?n.callback:function(){})});o.modal("show")},Application.showOkDialog=function(n,t){var i='<div class="above modal fade" style="z-index: 1300;" id="ok-dialog"><div class="modal-dialog" style="width: 400px"><div class="modal-content"><div class="modal-header"><h4 class="pop-up modal-title">'+n+'<\/h4><\/div><div class="modal-body"><div class="form-line pop-up-message text-center">'+t+'<\/div><div class="text-center"><a class="std-button ok-button">Ok<\/a><\/div><\/div><\/div><\/div><\/div>',r=$(i).appendTo("body").modal("show");$("#ok-dialog a.ok-button").on("click",function(n){n.preventDefault();n.stopPropagation();$(".modal").length>1?(r.remove(),$(".modal-backdrop.fade.in").length?$(".modal-backdrop.fade.in")[0].remove():""):Application.removeModal()})},Application.showEmptyDialog=function(n,t,i,r){r=r?r:"";i=i?'style="width:'+i+'px"':"";var u='<div class="modal fade" id="empty-dialog"><div class="modal-dialog" '+i+'><div class="modal-content"><div class="modal-header"><h4 class="pop-up modal-title">'+n+'<\/h4><button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">x<\/span><\/button><\/div><div class="modal-body '+r+'">'+t+"<\/div><\/div><\/div><\/div>";$("body").append(u);$(".modal").modal("toggle");$(".action-close").on("click",function(){Application.removeModal()})},Application.confirmMessage=function(n){var t=window.confirm(n);return t==!0?!0:!1},Application.showSuccessPage=function(n,t,i,r,u,f,e,o,s,h,c){var l,a;UI.getDevice().isDesktop()||(f="14px");l="onclick=\"UI.pager.goToPage('"+t+"')\"";UI.getSetting("ispreview")||(l="");a='<div class="modal fade" id="ok-dialog" style="z-index: 100000;"><div class="modal-dialog" style="width: 900px;"><div class="modal-content" style="height: 600px; background-color: '+i+'"><div class="modal-header" style="background-color: '+o+' !important"><h4 class="modal-title">'+h+'<\/h4><\/div><div class="modal-body" style="height: 440px;"><div class="dialog-content-image-logo"><span class="helper"><\/span><img id="logoImage" class="dialog-image-logo" src="'+e+'" /><\/div><div class="form-line dialog-content-message" style="font-size: '+f+"; font-family: "+u+"; color: "+r+'"><div class="dialog-message">'+n+'<\/div><\/div><div class="dialog-content-actions"><a class="custom-button ok-button" style="background-color: '+s+'" '+l+">"+c+"<\/a><\/div><\/div><\/div><\/div><\/div>";$("body").append(a);$(".modal").modal("toggle");$(".action-close").on("click",function(n){UI.getSetting("ispreview")?Application.removeModal():(n.preventDefault(),n.stopPropagation(),$("#ok-dialog").modal("hide"))});$("#ok-dialog a.ok-button").on("click",function(n){UI.getSetting("ispreview")?Application.removeModal():(n.preventDefault(),n.stopPropagation(),$("#ok-dialog").modal("hide"))})},Application.addSpinner=function(n,t){var r=new Spinner({length:0,width:6,radius:28,color:"#fff",opacity:0,speed:.5,trail:60}).spin(),i=$('<div style="background-color: #000;background-color: rgba(0, 0, 0, 0.5);" class="'+n+'"><\/div>');i.append(r.el);$(t).append(i)},Application.disableNewLockers=!1,Application.addLocker=function(){if(!Application.disableNewLockers){var t=new Spinner({length:0,width:18,radius:84,color:"#fff",opacity:0,speed:.5,trail:60}).spin(),n=$('<div id="locker" data-html2canvas-ignore="true"><\/div>');n.append(t.el);$("body").append(n)}},Application.removeLocker=function(){$("#locker").remove()},GridMvcAjax={},GridMvcAjax.demo=function(n,t){var i={updateGridAction:""};return n.init=function(n,r,u){u=u||function(){};t(function(){var f,e;if(i=n,t.ajaxSetup({cache:!1}),f=null,r=="billingAll"&&(f=pageGrids.billingAll),r=="billingDealers"?f=pageGrids.billingDealers:r=="userList"?f=pageGrids.userslist:r=="paymentProfiles"?f=pageGrids.paymentProfiles:r=="sites"?f=pageGrids.sites:r=="sslPackages"?f=pageGrids.sslPackages:r=="TemplateGrid"?f=pageGrids.TemplateGrid:r=="SelectTemplatesGrid"?f=pageGrids.SelectTemplatesGrid:r=="commerceUsersList"?f=pageGrids.commerceUsersList:r=="logsGrid"?f=pageGrids.logsGrid:r=="commerceProductsList"?f=pageGrids.commerceProductsList:r=="adminLogsGrid"?f=pageGrids.adminLogsGrid:r=="commerceCategoriesList"?f=pageGrids.commerceCategoriesList:r=="commerceOrdersList"?f=pageGrids.commerceOrdersList:r=="payments"?f=pageGrids.payments:r=="shippingAnadTax"?f=pageGrids.shippingAnadTax:r=="storeSettings"&&(f=pageGrids.storeSettings),typeof f!="undefined"&&f!=null){f.ajaxify({getPagedData:i.updateGridAction,getData:i.updateGridAction});f.onGridLoaded(function(n){u(n)});r=="TemplateGrid"&&(f.lang.boolTrueLabel="Hide",f.lang.boolFalseLabel="Show");(r=="userList"||r=="sites"||r=="sslPackages")&&t(".grid-mvc").gridmvcstart(r);(r=="commerceProductsList"||r=="commerceCategoriesList"||r=="commerceUsersList"||r=="commerceOrdersList"||r=="payments"||r=="shippingAndTax"||r=="storeSettings")&&t(".grid-mvc").gridmvcstart(r);r=="commerceUsersList"&&(e=t.cookie(f.loadPagedDataAction),!String.isNullOrEmpty(e)&&defined(t.cookie)?(f.clearGridFilters(),f.updateGrid(e,function(){var r,t,n;for(Application.removeLocker(),f.currentPage=i.currentPage||1,r=e.substr(1).split("&"),t=0;t<r.length;t++)n=r[t].split("="),decodeURIComponent(n[0])=="grid-column"?f.gridSort="grid-column="+decodeURIComponent(n[1]):decodeURIComponent(n[0])=="grid-dir"?f.gridSort+="&grid-dir="+decodeURIComponent(n[1]):decodeURIComponent(n[0])=="grid-filter"&&(f.gridColumnFilters="grid-filter="+decodeURIComponent(n[1]));f.loadPage()})):(f.currentPage=i.currentPage||1,f.loadPage()))}})},n}(GridMvcAjax.demo||{},jQuery),typeof jQuery=="undefined")throw new Error("Bootstrap's JavaScript requires jQuery");+function(n){"use strict";function t(){var i=document.createElement("bootstrap"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},n;for(n in t)if(i.style[n]!==undefined)return{end:t[n]};return!1}n.fn.emulateTransitionEnd=function(t){var i=!1,u=this,r;n(this).one("bsTransitionEnd",function(){i=!0});return r=function(){i||n(u).trigger(n.support.transition.end)},setTimeout(r,t),this};n(function(){(n.support.transition=t(),n.support.transition)&&(n.event.special.bsTransitionEnd={bindType:n.support.transition.end,delegateType:n.support.transition.end,handle:function(t){if(n(t.target).is(this))return t.handleObj.handler.apply(this,arguments)}})})}(jQuery);+function(n){"use strict";function u(i){return this.each(function(){var r=n(this),u=r.data("bs.alert");u||r.data("bs.alert",u=new t(this));typeof i=="string"&&u[i].call(r)})}var i='[data-dismiss="alert"]',t=function(t){n(t).on("click",i,this.close)},r;t.VERSION="3.2.0";t.prototype.close=function(t){function f(){i.detach().trigger("closed.bs.alert").remove()}var u=n(this),r=u.attr("data-target"),i;(r||(r=u.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,"")),i=n(r),t&&t.preventDefault(),i.length||(i=u.hasClass("alert")?u:u.parent()),i.trigger(t=n.Event("close.bs.alert")),t.isDefaultPrevented())||(i.removeClass("in"),n.support.transition&&i.hasClass("fade")?i.one("bsTransitionEnd",f).emulateTransitionEnd(150):f())};r=n.fn.alert;n.fn.alert=u;n.fn.alert.Constructor=t;n.fn.alert.noConflict=function(){return n.fn.alert=r,this};n(document).on("click.bs.alert.data-api",i,t.prototype.close)}(jQuery);+function(n){"use strict";function i(i){return this.each(function(){var u=n(this),r=u.data("bs.button"),f=typeof i=="object"&&i;r||u.data("bs.button",r=new t(this,f));i=="toggle"?r.toggle():i&&r.setState(i)})}var t=function(i,r){this.$element=n(i);this.options=n.extend({},t.DEFAULTS,r);this.isLoading=!1},r;t.VERSION="3.2.0";t.DEFAULTS={loadingText:"loading..."};t.prototype.setState=function(t){var r="disabled",i=this.$element,f=i.is("input")?"val":"html",u=i.data();t=t+"Text";u.resetText==null&&i.data("resetText",i[f]());i[f](u[t]==null?this.options[t]:u[t]);setTimeout(n.proxy(function(){t=="loadingText"?(this.isLoading=!0,i.addClass(r).attr(r,r)):this.isLoading&&(this.isLoading=!1,i.removeClass(r).removeAttr(r))},this),0)};t.prototype.toggle=function(){var t=!0,i=this.$element.closest('[data-toggle="buttons"]'),n;i.length&&(n=this.$element.find("input"),n.prop("type")=="radio"&&(n.prop("checked")&&this.$element.hasClass("active")?t=!1:i.find(".active").removeClass("active")),t&&n.prop("checked",!this.$element.hasClass("active")).trigger("change"));t&&this.$element.toggleClass("active")};r=n.fn.button;n.fn.button=i;n.fn.button.Constructor=t;n.fn.button.noConflict=function(){return n.fn.button=r,this};n(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(t){var r=n(t.target);r.hasClass("btn")||(r=r.closest(".btn"));i.call(r,"toggle");t.preventDefault()})}(jQuery);+function(n){"use strict";function i(i){return this.each(function(){var u=n(this),r=u.data("bs.carousel"),f=n.extend({},t.DEFAULTS,u.data(),typeof i=="object"&&i),e=typeof i=="string"?i:f.slide;r||u.data("bs.carousel",r=new t(this,f));typeof i=="number"?r.to(i):e?r[e]():f.interval&&r.pause().cycle()})}var t=function(t,i){this.$element=n(t).on("keydown.bs.carousel",n.proxy(this.keydown,this));this.$indicators=this.$element.find(".carousel-indicators");this.options=i;this.paused=this.sliding=this.interval=this.$active=this.$items=null;this.options.pause=="hover"&&this.$element.on("mouseenter.bs.carousel",n.proxy(this.pause,this)).on("mouseleave.bs.carousel",n.proxy(this.cycle,this))},r;t.VERSION="3.2.0";t.DEFAULTS={interval:5e3,pause:"hover",wrap:!0};t.prototype.keydown=function(n){switch(n.which){case 37:this.prev();break;case 39:this.next();break;default:return}n.preventDefault()};t.prototype.cycle=function(t){return t||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(n.proxy(this.next,this),this.options.interval)),this};t.prototype.getItemIndex=function(n){return this.$items=n.parent().children(".item"),this.$items.index(n||this.$active)};t.prototype.to=function(t){var r=this,i=this.getItemIndex(this.$active=this.$element.find(".item.active"));if(!(t>this.$items.length-1)&&!(t<0))return this.sliding?this.$element.one("slid.bs.carousel",function(){r.to(t)}):i==t?this.pause().cycle():this.slide(t>i?"next":"prev",n(this.$items[t]))};t.prototype.pause=function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&n.support.transition&&(this.$element.trigger(n.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this};t.prototype.next=function(){if(!this.sliding)return this.slide("next")};t.prototype.prev=function(){if(!this.sliding)return this.slide("prev")};t.prototype.slide=function(t,i){var u=this.$element.find(".item.active"),r=i||u[t](),c=this.interval,f=t=="next"?"left":"right",a=t=="next"?"first":"last",l=this,e,o,s,h;if(!r.length){if(!this.options.wrap)return;r=this.$element.find(".item")[a]()}return r.hasClass("active")?this.sliding=!1:(e=r[0],o=n.Event("slide.bs.carousel",{relatedTarget:e,direction:f}),this.$element.trigger(o),o.isDefaultPrevented())?void 0:(this.sliding=!0,c&&this.pause(),this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),s=n(this.$indicators.children()[this.getItemIndex(r)]),s&&s.addClass("active")),h=n.Event("slid.bs.carousel",{relatedTarget:e,direction:f}),n.support.transition&&this.$element.hasClass("slide")?(r.addClass(t),r[0].offsetWidth,u.addClass(f),r.addClass(f),u.one("bsTransitionEnd",function(){r.removeClass([t,f].join(" ")).addClass("active");u.removeClass(["active",f].join(" "));l.sliding=!1;setTimeout(function(){l.$element.trigger(h)},0)}).emulateTransitionEnd(u.css("transition-duration").slice(0,-1)*1e3)):(u.removeClass("active"),r.addClass("active"),this.sliding=!1,this.$element.trigger(h)),c&&this.cycle(),this)};r=n.fn.carousel;n.fn.carousel=i;n.fn.carousel.Constructor=t;n.fn.carousel.noConflict=function(){return n.fn.carousel=r,this};n(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",function(t){var o,r=n(this),u=n(r.attr("data-target")||(o=r.attr("href"))&&o.replace(/.*(?=#[^\s]+$)/,"")),e,f;u.hasClass("carousel")&&(e=n.extend({},u.data(),r.data()),f=r.attr("data-slide-to"),f&&(e.interval=!1),i.call(u,e),f&&u.data("bs.carousel").to(f),t.preventDefault())});n(window).on("load",function(){n('[data-ride="carousel"]').each(function(){var t=n(this);i.call(t,t.data())})})}(jQuery);+function(n){"use strict";function i(i){return this.each(function(){var u=n(this),r=u.data("bs.collapse"),f=n.extend({},t.DEFAULTS,u.data(),typeof i=="object"&&i);!r&&f.toggle&&i=="show"&&(i=!i);r||u.data("bs.collapse",r=new t(this,f));typeof i=="string"&&r[i]()})}var t=function(i,r){this.$element=n(i);this.options=n.extend({},t.DEFAULTS,r);this.transitioning=null;this.options.parent&&(this.$parent=n(this.options.parent));this.options.toggle&&this.toggle()},r;t.VERSION="3.2.0";t.DEFAULTS={toggle:!0};t.prototype.dimension=function(){var n=this.$element.hasClass("width");return n?"width":"height"};t.prototype.show=function(){var f,t,u,r,e,o;if(!this.transitioning&&!this.$element.hasClass("in")&&(f=n.Event("show.bs.collapse"),this.$element.trigger(f),!f.isDefaultPrevented())){if(t=this.$parent&&this.$parent.find("> .panel > .in"),t&&t.length){if(u=t.data("bs.collapse"),u&&u.transitioning)return;i.call(t,"hide");u||t.data("bs.collapse",null)}if(r=this.dimension(),this.$element.removeClass("collapse").addClass("collapsing")[r](0),this.transitioning=1,e=function(){this.$element.removeClass("collapsing").addClass("collapse in")[r]("");this.transitioning=0;this.$element.trigger("shown.bs.collapse")},!n.support.transition)return e.call(this);o=n.camelCase(["scroll",r].join("-"));this.$element.one("bsTransitionEnd",n.proxy(e,this)).emulateTransitionEnd(350)[r](this.$element[0][o])}};t.prototype.hide=function(){var i,t,r;if(!this.transitioning&&this.$element.hasClass("in")&&(i=n.Event("hide.bs.collapse"),this.$element.trigger(i),!i.isDefaultPrevented())){if(t=this.dimension(),this.$element[t](this.$element[t]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1,r=function(){this.transitioning=0;this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")},!n.support.transition)return r.call(this);this.$element[t](0).one("bsTransitionEnd",n.proxy(r,this)).emulateTransitionEnd(350)}};t.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};r=n.fn.collapse;n.fn.collapse=i;n.fn.collapse.Constructor=t;n.fn.collapse.noConflict=function(){return n.fn.collapse=r,this};n(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(t){var o,r=n(this),h=r.attr("data-target")||t.preventDefault()||(o=r.attr("href"))&&o.replace(/.*(?=#[^\s]+$)/,""),u=n(h),f=u.data("bs.collapse"),c=f?"toggle":r.data(),e=r.attr("data-parent"),s=e&&n(e);f&&f.transitioning||(s&&s.find('[data-toggle="collapse"][data-parent="'+e+'"]').not(r).addClass("collapsed"),r[u.hasClass("in")?"addClass":"removeClass"]("collapsed"));i.call(u,c)})}(jQuery);+function(n){"use strict";function r(t){t&&t.which===3||(n(e).remove(),n(i).each(function(){var i=u(n(this)),r={relatedTarget:this};i.hasClass("open")&&((i.trigger(t=n.Event("hide.bs.dropdown",r)),t.isDefaultPrevented())||i.removeClass("open").trigger("hidden.bs.dropdown",r))}))}function u(t){var i=t.attr("data-target"),r;return i||(i=t.attr("href"),i=i&&/#[A-Za-z]/.test(i)&&i.replace(/.*(?=#[^\s]*$)/,"")),r=i&&n(i),r&&r.length?r:t.parent()}function o(i){return this.each(function(){var r=n(this),u=r.data("bs.dropdown");u||r.data("bs.dropdown",u=new t(this));typeof i=="string"&&u[i].call(r)})}var e=".dropdown-backdrop",i='[data-toggle="dropdown"]',t=function(t){n(t).on("click.bs.dropdown",this.toggle)},f;t.VERSION="3.2.0";t.prototype.toggle=function(t){var f=n(this),i,o,e;if(!f.is(".disabled, :disabled")){if(i=u(f),o=i.hasClass("open"),r(),!o){if("ontouchstart"in document.documentElement&&!i.closest(".navbar-nav").length)n('<div class="dropdown-backdrop"/>').insertAfter(n(this)).on("click",r);if(e={relatedTarget:this},i.trigger(t=n.Event("show.bs.dropdown",e)),t.isDefaultPrevented())return;f.trigger("focus");i.toggleClass("open").trigger("shown.bs.dropdown",e)}return!1}};t.prototype.keydown=function(t){var e,o,s,h,f,r;if(/(38|40|27)/.test(t.keyCode)&&(e=n(this),t.preventDefault(),t.stopPropagation(),!e.is(".disabled, :disabled"))){if(o=u(e),s=o.hasClass("open"),!s||s&&t.keyCode==27)return t.which==27&&o.find(i).trigger("focus"),e.trigger("click");(h=" li:not(.divider):visible a",f=o.find('[role="menu"]'+h+', [role="listbox"]'+h),f.length)&&(r=f.index(f.filter(":focus")),t.keyCode==38&&r>0&&r--,t.keyCode==40&&r<f.length-1&&r++,~r||(r=0),f.eq(r).trigger("focus"))}};f=n.fn.dropdown;n.fn.dropdown=o;n.fn.dropdown.Constructor=t;n.fn.dropdown.noConflict=function(){return n.fn.dropdown=f,this};n(document).on("click.bs.dropdown.data-api",r).on("click.bs.dropdown.data-api",".dropdown form",function(n){n.stopPropagation()}).on("click.bs.dropdown.data-api",i,t.prototype.toggle).on("keydown.bs.dropdown.data-api",i+', [role="menu"], [role="listbox"]',t.prototype.keydown)}(jQuery);+function(n){"use strict";function i(i,r){return this.each(function(){var f=n(this),u=f.data("bs.modal"),e=n.extend({},t.DEFAULTS,f.data(),typeof i=="object"&&i);u||f.data("bs.modal",u=new t(this,e));typeof i=="string"?u[i](r):e.show&&u.show(r)})}var t=function(t,i){this.options=i;this.$body=n(document.body);this.$element=n(t);this.$backdrop=this.isShown=null;this.scrollbarWidth=0;this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,n.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))},r;t.VERSION="3.2.0";t.DEFAULTS={backdrop:!0,keyboard:!0,show:!0};t.prototype.toggle=function(n){return this.isShown?this.hide():this.show(n)};t.prototype.show=function(t){var i=this,r=n.Event("show.bs.modal",{relatedTarget:t});if(this.$element.trigger(r),!this.isShown&&!r.isDefaultPrevented()){this.isShown=!0;this.checkScrollbar();this.$body.addClass("modal-open");this.setScrollbar();this.escape();this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',n.proxy(this.hide,this));this.backdrop(function(){var u=n.support.transition&&i.$element.hasClass("fade"),r;i.$element.parent().length||i.$element.appendTo(i.$body);i.$element.show().scrollTop(0);u&&i.$element[0].offsetWidth;i.$element.addClass("in").attr("aria-hidden",!1);i.enforceFocus();r=n.Event("shown.bs.modal",{relatedTarget:t});u?i.$element.find(".modal-dialog").one("bsTransitionEnd",function(){i.$element.trigger("focus").trigger(r)}).emulateTransitionEnd(300):i.$element.trigger("focus").trigger(r)})}};t.prototype.hide=function(t){(t&&t.preventDefault(),t=n.Event("hide.bs.modal"),this.$element.trigger(t),this.isShown&&!t.isDefaultPrevented())&&(this.isShown=!1,this.$body.removeClass("modal-open"),this.resetScrollbar(),this.escape(),n(document).off("focusin.bs.modal"),this.$element.removeClass("in").attr("aria-hidden",!0).off("click.dismiss.bs.modal"),n.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",n.proxy(this.hideModal,this)).emulateTransitionEnd(300):this.hideModal())};t.prototype.enforceFocus=function(){n(document).off("focusin.bs.modal").on("focusin.bs.modal",n.proxy(function(n){this.$element[0]===n.target||this.$element.has(n.target).length||this.$element.trigger("focus")},this))};t.prototype.escape=function(){if(this.isShown&&this.options.keyboard)this.$element.on("keyup.dismiss.bs.modal",n.proxy(function(n){n.which==27&&this.hide()},this));else this.isShown||this.$element.off("keyup.dismiss.bs.modal")};t.prototype.hideModal=function(){var n=this;this.$element.hide();this.backdrop(function(){n.$element.trigger("hidden.bs.modal")})};t.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove();this.$backdrop=null};t.prototype.backdrop=function(t){var f=this,u=this.$element.hasClass("fade")?"fade":"",i,r;if(this.isShown&&this.options.backdrop){i=n.support.transition&&u;this.$backdrop=n('<div class="modal-backdrop '+u+'" />').appendTo(this.$body);this.$element.on("click.dismiss.bs.modal",n.proxy(function(n){n.target===n.currentTarget&&(this.options.backdrop=="static"?this.$element[0].focus.call(this.$element[0]):this.hide.call(this))},this));if(i&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!t)return;i?this.$backdrop.one("bsTransitionEnd",t).emulateTransitionEnd(150):t()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),r=function(){f.removeBackdrop();t&&t()},n.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",r).emulateTransitionEnd(150):r()):t&&t()};t.prototype.checkScrollbar=function(){document.body.clientWidth>=window.innerWidth||(this.scrollbarWidth=this.scrollbarWidth||this.measureScrollbar())};t.prototype.setScrollbar=function(){var n=parseInt(this.$body.css("padding-right")||0,10);this.scrollbarWidth&&this.$body.css("padding-right",n+this.scrollbarWidth)};t.prototype.resetScrollbar=function(){this.$body.css("padding-right","")};t.prototype.measureScrollbar=function(){var n=document.createElement("div"),t;return n.className="modal-scrollbar-measure",this.$body.append(n),t=n.offsetWidth-n.clientWidth,this.$body[0].removeChild(n),t};r=n.fn.modal;n.fn.modal=i;n.fn.modal.Constructor=t;n.fn.modal.noConflict=function(){return n.fn.modal=r,this};n(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(t){var r=n(this),f=r.attr("href"),u=n(r.attr("data-target")||f&&f.replace(/.*(?=#[^\s]+$)/,"")),e=u.data("bs.modal")?"toggle":n.extend({remote:!/#/.test(f)&&f},u.data(),r.data());r.is("a")&&t.preventDefault();u.one("show.bs.modal",function(n){if(!n.isDefaultPrevented())u.one("hidden.bs.modal",function(){r.is(":visible")&&r.trigger("focus")})});i.call(u,e,this)})}(jQuery);+function(n){"use strict";function t(i,r){var u=n.proxy(this.process,this);this.$body=n("body");this.$scrollElement=n(i).is("body")?n(window):n(i);this.options=n.extend({},t.DEFAULTS,r);this.selector=(this.options.target||"")+" .nav li > a";this.offsets=[];this.targets=[];this.activeTarget=null;this.scrollHeight=0;this.$scrollElement.on("scroll.bs.scrollspy",u);this.refresh();this.process()}function i(i){return this.each(function(){var u=n(this),r=u.data("bs.scrollspy"),f=typeof i=="object"&&i;r||u.data("bs.scrollspy",r=new t(this,f));typeof i=="string"&&r[i]()})}t.VERSION="3.2.0";t.DEFAULTS={offset:10};t.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)};t.prototype.refresh=function(){var i="offset",r=0,t;n.isWindow(this.$scrollElement[0])||(i="position",r=this.$scrollElement.scrollTop());this.offsets=[];this.targets=[];this.scrollHeight=this.getScrollHeight();t=this;this.$body.find(this.selector).map(function(){var f=n(this),u=f.data("target")||f.attr("href"),t=/^#./.test(u)&&n(u);return t&&t.length&&t.is(":visible")&&[[t[i]().top+r,u]]||null}).sort(function(n,t){return n[0]-t[0]}).each(function(){t.offsets.push(this[0]);t.targets.push(this[1])})};t.prototype.process=function(){var r=this.$scrollElement.scrollTop()+this.options.offset,f=this.getScrollHeight(),e=this.options.offset+f-this.$scrollElement.height(),t=this.offsets,i=this.targets,u=this.activeTarget,n;if(this.scrollHeight!=f&&this.refresh(),r>=e)return u!=(n=i[i.length-1])&&this.activate(n);if(u&&r<=t[0])return u!=(n=i[0])&&this.activate(n);for(n=t.length;n--;)u!=i[n]&&r>=t[n]&&(!t[n+1]||r<=t[n+1])&&this.activate(i[n])};t.prototype.activate=function(t){this.activeTarget=t;n(this.selector).parentsUntil(this.options.target,".active").removeClass("active");var r=this.selector+'[data-target="'+t+'"],'+this.selector+'[href="'+t+'"]',i=n(r).parents("li").addClass("active");i.parent(".dropdown-menu").length&&(i=i.closest("li.dropdown").addClass("active"));i.trigger("activate.bs.scrollspy")};var r=n.fn.scrollspy;n.fn.scrollspy=i;n.fn.scrollspy.Constructor=t;n.fn.scrollspy.noConflict=function(){return n.fn.scrollspy=r,this};n(window).on("load.bs.scrollspy.data-api",function(){n('[data-spy="scroll"]').each(function(){var t=n(this);i.call(t,t.data())})})}(jQuery);+function(n){"use strict";function i(i){return this.each(function(){var u=n(this),r=u.data("bs.tab");r||u.data("bs.tab",r=new t(this));typeof i=="string"&&r[i]()})}var t=function(t){this.element=n(t)},r;t.VERSION="3.2.0";t.prototype.show=function(){var t=this.element,e=t.closest("ul:not(.dropdown-menu)"),i=t.data("target"),r,u,f;(i||(i=t.attr("href"),i=i&&i.replace(/.*(?=#[^\s]*$)/,"")),t.parent("li").hasClass("active"))||(r=e.find(".active:last a")[0],u=n.Event("show.bs.tab",{relatedTarget:r}),t.trigger(u),u.isDefaultPrevented())||(f=n(i),this.activate(t.closest("li"),e),this.activate(f,f.parent(),function(){t.trigger({type:"shown.bs.tab",relatedTarget:r})}))};t.prototype.activate=function(t,i,r){function e(){u.removeClass("active").find("> .dropdown-menu > .active").removeClass("active");t.addClass("active");f?(t[0].offsetWidth,t.addClass("in")):t.removeClass("fade");t.parent(".dropdown-menu")&&t.closest("li.dropdown").addClass("active");r&&r()}var u=i.find("> .active"),f=r&&n.support.transition&&u.hasClass("fade");f?u.one("bsTransitionEnd",e).emulateTransitionEnd(150):e();u.removeClass("in")};r=n.fn.tab;n.fn.tab=i;n.fn.tab.Constructor=t;n.fn.tab.noConflict=function(){return n.fn.tab=r,this};n(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(t){t.preventDefault();i.call(n(this),"show")})}(jQuery);+function(n){"use strict";function i(i){return this.each(function(){var u=n(this),r=u.data("bs.affix"),f=typeof i=="object"&&i;r||u.data("bs.affix",r=new t(this,f));typeof i=="string"&&r[i]()})}var t=function(i,r){this.options=n.extend({},t.DEFAULTS,r);this.$target=n(this.options.target).on("scroll.bs.affix.data-api",n.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",n.proxy(this.checkPositionWithEventLoop,this));this.$element=n(i);this.affixed=this.unpin=this.pinnedOffset=null;this.checkPosition()},r;t.VERSION="3.2.0";t.RESET="affix affix-top affix-bottom";t.DEFAULTS={offset:0,target:window};t.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(t.RESET).addClass("affix");var n=this.$target.scrollTop(),i=this.$element.offset();return this.pinnedOffset=i.top-n};t.prototype.checkPositionWithEventLoop=function(){setTimeout(n.proxy(this.checkPosition,this),1)};t.prototype.checkPosition=function(){var i,e,o;if(this.$element.is(":visible")){var s=n(document).height(),h=this.$target.scrollTop(),c=this.$element.offset(),r=this.options.offset,f=r.top,u=r.bottom;(typeof r!="object"&&(u=f=r),typeof f=="function"&&(f=r.top(this.$element)),typeof u=="function"&&(u=r.bottom(this.$element)),i=this.unpin!=null&&h+this.unpin<=c.top?!1:u!=null&&c.top+this.$element.height()>=s-u?"bottom":f!=null&&h<=f?"top":!1,this.affixed!==i)&&((this.unpin!=null&&this.$element.css("top",""),e="affix"+(i?"-"+i:""),o=n.Event(e+".bs.affix"),this.$element.trigger(o),o.isDefaultPrevented())||(this.affixed=i,this.unpin=i=="bottom"?this.getPinnedOffset():null,this.$element.removeClass(t.RESET).addClass(e).trigger(n.Event(e.replace("affix","affixed"))),i=="bottom"&&this.$element.offset({top:s-this.$element.height()-u})))}};r=n.fn.affix;n.fn.affix=i;n.fn.affix.Constructor=t;n.fn.affix.noConflict=function(){return n.fn.affix=r,this};n(window).on("load",function(){n('[data-spy="affix"]').each(function(){var r=n(this),t=r.data();t.offset=t.offset||{};t.offsetBottom&&(t.offset.bottom=t.offsetBottom);t.offsetTop&&(t.offset.top=t.offsetTop);i.call(r,t)})})}(jQuery),function(n){"use strict";function i(t,i){this.itemsArray=[];this.$element=n(t);this.$element.hide();this.isSelect=t.tagName==="SELECT";this.multiple=this.isSelect&&t.hasAttribute("multiple");this.objectItems=i&&i.itemValue;this.placeholderText=t.hasAttribute("placeholder")?this.$element.attr("placeholder"):"";this.inputSize=Math.max(1,this.placeholderText.length);this.$container=n('<div class="bootstrap-tagsinput"><\/div>');this.$input=n('<input type="text" placeholder="'+this.placeholderText+'"/>').appendTo(this.$container);this.$element.after(this.$container);var r=(this.inputSize<3?3:this.inputSize)+"em";this.$input.get(0).style.cssText="width: "+r+" !important;";this.build(i)}function u(n,t){if(typeof n[t]!="function"){var i=n[t];n[t]=function(n){return n[i]}}}function f(n,t){if(typeof n[t]!="function"){var i=n[t];n[t]=function(){return i}}}function t(n){return n?e.text(n).html():""}function o(n){var t=0,i;return document.selection?(n.focus(),i=document.selection.createRange(),i.moveStart("character",-n.value.length),t=i.text.length):(n.selectionStart||n.selectionStart=="0")&&(t=n.selectionStart),t}function s(t,i){var r=!1;return n.each(i,function(n,i){if(typeof i=="number"&&t.which===i)return r=!0,!1;if(t.which===i.which){var u=!i.hasOwnProperty("altKey")||t.altKey===i.altKey,f=!i.hasOwnProperty("shiftKey")||t.shiftKey===i.shiftKey,e=!i.hasOwnProperty("ctrlKey")||t.ctrlKey===i.ctrlKey;if(u&&f&&e)return r=!0,!1}}),r}var r={tagClass:function(){return"label label-info"},itemValue:function(n){return n?n.toString():n},itemText:function(n){return this.itemValue(n)},freeInput:!0,addOnBlur:!0,maxTags:undefined,maxChars:undefined,confirmKeys:[13,44],onTagExists:function(n,t){t.hide().fadeIn()},trimValue:!1,allowDuplicates:!1},e;i.prototype={constructor:i,add:function(i,r){var u=this,f,e,v,c,o,s;if((!u.options.maxTags||!(u.itemsArray.length>=u.options.maxTags))&&(i===!1||i)){if(typeof i=="string"&&u.options.trimValue&&(i=n.trim(i)),typeof i=="object"&&!u.objectItems)throw"Can't add objects when itemValue option is not set";if(!i.toString().match(/^\s*$/)){if(u.isSelect&&!u.multiple&&u.itemsArray.length>0&&u.remove(u.itemsArray[0]),typeof i=="string"&&this.$element[0].tagName==="INPUT"&&(f=i.split(","),f.length>1)){for(e=0;e<f.length;e++)this.add(f[e],!0);r||u.pushVal();return}var h=u.options.itemValue(i),l=u.options.itemText(i),y=u.options.tagClass(i),a=n.grep(u.itemsArray,function(n){return u.options.itemValue(n)===h})[0];if(a&&!u.options.allowDuplicates){if(u.options.onTagExists){v=n(".tag",u.$container).filter(function(){return n(this).data("item")===a});u.options.onTagExists(i,v)}return}u.items().toString().length+i.length+1>u.options.maxInputLength||(c=n.Event("beforeItemAdd",{item:i,cancel:!1}),u.$element.trigger(c),c.cancel)||(u.itemsArray.push(i),o=n('<span class="tag '+t(y)+'">'+t(l)+'<span data-role="remove"><\/span><\/span>'),o.data("item",i),u.findInputWrapper().before(o),o.after(" "),u.isSelect&&!n('option[value="'+encodeURIComponent(h)+'"]',u.$element)[0]&&(s=n("<option selected>"+t(l)+"<\/option>"),s.data("item",i),s.attr("value",h),u.$element.append(s)),r||u.pushVal(),(u.options.maxTags===u.itemsArray.length||u.items().toString().length===u.options.maxInputLength)&&u.$container.addClass("bootstrap-tagsinput-max"),u.$element.trigger(n.Event("itemAdded",{item:i})))}}},remove:function(t,i){var r=this,u;if(r.objectItems&&(t=typeof t=="object"?n.grep(r.itemsArray,function(n){return r.options.itemValue(n)==r.options.itemValue(t)}):n.grep(r.itemsArray,function(n){return r.options.itemValue(n)==t}),t=t[t.length-1]),t){if(u=n.Event("beforeItemRemove",{item:t,cancel:!1}),r.$element.trigger(u),u.cancel)return;n(".tag",r.$container).filter(function(){return n(this).data("item")===t}).remove();n("option",r.$element).filter(function(){return n(this).data("item")===t}).remove();n.inArray(t,r.itemsArray)!==-1&&r.itemsArray.splice(n.inArray(t,r.itemsArray),1)}i||r.pushVal();r.options.maxTags>r.itemsArray.length&&r.$container.removeClass("bootstrap-tagsinput-max");r.$element.trigger(n.Event("itemRemoved",{item:t}))},removeAll:function(){var t=this;for(n(".tag",t.$container).remove(),n("option",t.$element).remove();t.itemsArray.length>0;)t.itemsArray.pop();t.pushVal()},refresh:function(){var i=this;n(".tag",i.$container).each(function(){var r=n(this),u=r.data("item"),e=i.options.itemValue(u),o=i.options.itemText(u),s=i.options.tagClass(u),f;r.attr("class",null);r.addClass("tag "+t(s));r.contents().filter(function(){return this.nodeType==3})[0].nodeValue=t(o);i.isSelect&&(f=n("option",i.$element).filter(function(){return n(this).data("item")===u}),f.attr("value",e))})},items:function(){return this.itemsArray},pushVal:function(){var t=this,i=n.map(t.items(),function(n){return t.options.itemValue(n).toString()});t.$element.val(i,!0).trigger("change")},build:function(t){var i=this,e,h;if(i.options=n.extend({},r,t),i.objectItems&&(i.options.freeInput=!1),u(i.options,"itemValue"),u(i.options,"itemText"),f(i.options,"tagClass"),i.options.typeahead&&(e=i.options.typeahead||{},f(e,"source"),i.$input.typeahead(n.extend({},e,{source:function(t,r){function f(n){for(var f=[],u,t=0;t<n.length;t++)u=i.options.itemText(n[t]),o[u]=n[t],f.push(u);r(f)}this.map={};var o=this.map,u=e.source(t);n.isFunction(u.success)?u.success(f):n.isFunction(u.then)?u.then(f):n.when(u).then(f)},updater:function(n){i.add(this.map[n])},matcher:function(n){return n.toLowerCase().indexOf(this.query.trim().toLowerCase())!==-1},sorter:function(n){return n.sort()},highlighter:function(n){var t=new RegExp("("+this.query+")","gi");return n.replace(t,"<strong>$1<\/strong>")}}))),i.options.typeaheadjs){h=i.options.typeaheadjs||{};i.$input.typeahead(null,h).on("typeahead:selected",n.proxy(function(n,t){h.valueKey?i.add(t[h.valueKey]):i.add(t);i.$input.typeahead("val","")},i))}i.$container.on("click",n.proxy(function(){i.$element.attr("disabled")||i.$input.removeAttr("disabled");i.$input.focus()},i));if(i.options.addOnBlur&&i.options.freeInput)i.$input.on("focusout",n.proxy(function(){n(".typeahead, .twitter-typeahead",i.$container).length===0&&(i.add(i.$input.val()),i.$input.val(""))},i));i.$container.on("keydown","input",n.proxy(function(t){var r=n(t.target),u=i.findInputWrapper(),f,e,s,h;if(i.$element.attr("disabled")){i.$input.attr("disabled","disabled");return}switch(t.which){case 8:o(r[0])===0&&(f=u.prev(),f&&i.remove(f.data("item")));break;case 46:o(r[0])===0&&(e=u.next(),e&&i.remove(e.data("item")));break;case 37:s=u.prev();r.val().length===0&&s[0]&&(s.before(u),r.focus());break;case 39:h=u.next();r.val().length===0&&h[0]&&(h.after(u),r.focus())}var c=r.val().length,l=Math.ceil(c/5),a=c+l+1;r.attr("size",Math.max(this.inputSize,r.val().length))},i));i.$container.on("keypress","input",n.proxy(function(t){var r=n(t.target),u,f;if(i.$element.attr("disabled")){i.$input.attr("disabled","disabled");return}u=r.val();f=i.options.maxChars&&u.length>=i.options.maxChars;i.options.freeInput&&(s(t,i.options.confirmKeys)||f)&&(i.add(f?u.substr(0,i.options.maxChars):u),r.val(""),t.preventDefault());var e=r.val().length,o=Math.ceil(e/5),h=e+o+1;r.attr("size",Math.max(this.inputSize,r.val().length))},i));i.$container.on("click","[data-role=remove]",n.proxy(function(t){i.$element.attr("disabled")||i.remove(n(t.target).closest(".tag").data("item"))},i));i.options.itemValue===r.itemValue&&(i.$element[0].tagName==="INPUT"?i.add(i.$element.val()):n("option",i.$element).each(function(){i.add(n(this).attr("value"),!0)}))},destroy:function(){var n=this;n.$container.off("keypress","input");n.$container.off("click","[role=remove]");n.$container.remove();n.$element.removeData("tagsinput");n.$element.show()},focus:function(){this.$input.focus()},input:function(){return this.$input},findInputWrapper:function(){for(var t=this.$input[0],i=this.$container[0];t&&t.parentNode!==i;)t=t.parentNode;return n(t)}};n.fn.tagsinput=function(t,r){var u=[];return this.each(function(){var f=n(this).data("tagsinput"),e;f?t||r?f[t]!==undefined&&(e=f[t](r),e!==undefined&&u.push(e)):u.push(f):(f=new i(this,t),n(this).data("tagsinput",f),u.push(f),this.tagName==="SELECT"&&n("option",n(this)).attr("selected","selected"),n(this).val(n(this).val()))}),typeof t=="string"?u.length>1?u:u[0]:u};n.fn.tagsinput.Constructor=i;e=n("<div />");n(function(){n("input[data-role=tagsinput], select[multiple][data-role=tagsinput]").tagsinput()})}(window.jQuery);!function(n){var r=[],t=[],u;n.fn.doAutosize=function(t){var r=n(this).data("minwidth"),h=n(this).data("maxwidth"),u="",f=n(this),e=n("#"+n(this).data("tester_id")),o;if(u!==(u=f.val())){o=u.replace(/&/g,"&amp;").replace(/\s/g," ").replace(/</g,"&lt;").replace(/>/g,"&gt;");e.html(o);var s=e.width(),i=s+t.comfortZone>=r?s+t.comfortZone:r,c=f.width(),l=c>i&&i>=r||i>r&&h>i;l&&f.width(i)}};n.fn.resetAutosize=function(t){var u=n(this).data("minwidth")||t.minInputWidth||n(this).width(),e=n(this).data("maxwidth")||t.maxInputWidth||n(this).closest(".tagsinput").width()-t.inputPadding,i=n(this),f=n("<tester/>").css({position:"absolute",top:-9999,left:-9999,width:"auto",fontSize:i.css("fontSize"),fontFamily:i.css("fontFamily"),fontWeight:i.css("fontWeight"),letterSpacing:i.css("letterSpacing"),whiteSpace:"nowrap"}),r=n(this).attr("id")+"_autosize_tester";!n("#"+r).length>0&&(f.attr("id",r),f.appendTo("body"));i.data("minwidth",u);i.data("maxwidth",e);i.data("tester_id",r);i.css("width",u)};n.fn.addTag=function(i,u){return u=jQuery.extend({focus:!1,callback:!0},u),this.each(function(){var f=n(this).attr("id"),e=n(this).val().split(r[f]),o,h,s;(""==e[0]&&(e=[]),i=jQuery.trim(i),u.unique)?(o=n(this).tagExist(i),1==o&&n("#"+f+"_tag").addClass("not_valid")):o=!1;""!=i&&1!=o&&((n("<span>").addClass("tag").append(n("<span>").text(i).append("&nbsp;&nbsp;"),n("<a>",{href:"#",title:"Removing tag",text:"x"}).click(function(){return n("#"+f).removeTag(escape(i))})).insertBefore("#"+f+"_addTag"),e.push(i),n("#"+f+"_tag").val(""),u.focus?n("#"+f+"_tag").focus():n("#"+f+"_tag").blur(),n.fn.tagsInput.updateTagsField(this,e),u.callback&&t[f]&&t[f].onAddTag)&&(s=t[f].onAddTag,s.call(this,i)),t[f]&&t[f].onChange&&(h=e.length,s=t[f].onChange,s.call(this,n(this),e[h-1])))}),!1};n.fn.removeTag=function(u){return u=unescape(u),this.each(function(){var f=n(this).attr("id"),e=n(this).val().split(r[f]),o;for(n("#"+f+"_tagsinput .tag").remove(),str="",i=0;i<e.length;i++)e[i]!=u&&(str=str+r[f]+e[i]);(n.fn.tagsInput.importTags(this,str),t[f]&&t[f].onRemoveTag)&&(o=t[f].onRemoveTag,o.call(this,u))}),!1};n.fn.tagExist=function(t){var i=n(this).attr("id"),u=n(this).val().split(r[i]);return jQuery.inArray(t,u)>=0};n.fn.importTags=function(t){var i=n(this).attr("id");n("#"+i+"_tagsinput .tag").remove();n.fn.tagsInput.importTags(this,t)};n.fn.tagsInput=function(i){var f=jQuery.extend({interactive:!0,defaultText:"add a tag",minChars:0,width:"300px",height:"100px",autocomplete:{selectFirst:!1},hide:!0,delimiter:",",unique:!0,removeWithBackspace:!0,placeholderColor:"#666666",autosize:!0,comfortZone:20,inputPadding:12},i),e=0;return this.each(function(){var o,i,s;if("undefined"==typeof n(this).attr("data-tagsinput-init")&&(n(this).attr("data-tagsinput-init",!0),f.hide&&n(this).hide(),o=n(this).attr("id"),(!o||r[n(this).attr("id")])&&(o=n(this).attr("id","tags"+(new Date).getTime()+e++).attr("id")),i=jQuery.extend({pid:o,real_input:"#"+o,holder:"#"+o+"_tagsinput",input_wrapper:"#"+o+"_addTag",fake_input:"#"+o+"_tag"},f),r[o]=i.delimiter,(f.onAddTag||f.onRemoveTag||f.onChange)&&(t[o]=[],t[o].onAddTag=f.onAddTag,t[o].onRemoveTag=f.onRemoveTag,t[o].onChange=f.onChange),s='<div id="'+o+'_tagsinput" class="tagsinput"><div id="'+o+'_addTag">',f.interactive&&(s=s+'<input id="'+o+'_tag" value="" data-default="'+f.defaultText+'" />'),s+='<\/div><div class="tags_clear"><\/div><\/div>',n(s).insertAfter(this),n(i.holder).css("width",f.width),n(i.holder).css("min-height",f.height),n(i.holder).css("height",f.height),""!=n(i.real_input).val()&&n.fn.tagsInput.importTags(n(i.real_input),n(i.real_input).val()),f.interactive)){if(n(i.fake_input).val(n(i.fake_input).attr("data-default")),n(i.fake_input).css("color",f.placeholderColor),n(i.fake_input).resetAutosize(f),n(i.holder).bind("click",i,function(t){n(t.data.fake_input).focus()}),n(i.fake_input).bind("focus",i,function(t){n(t.data.fake_input).val()==n(t.data.fake_input).attr("data-default")&&n(t.data.fake_input).val("");n(t.data.fake_input).css("color","#000000")}),void 0!=f.autocomplete_url){autocomplete_options={source:f.autocomplete_url};for(attrname in f.autocomplete)autocomplete_options[attrname]=f.autocomplete[attrname];void 0!==jQuery.Autocompleter?(n(i.fake_input).autocomplete(f.autocomplete_url,f.autocomplete),n(i.fake_input).bind("result",i,function(t,i){i&&n("#"+o).addTag(i[0]+"",{focus:!0,unique:f.unique})})):void 0!==jQuery.ui.autocomplete&&(n(i.fake_input).autocomplete(autocomplete_options),n(i.fake_input).bind("autocompleteselect",i,function(t,i){return n(t.data.real_input).addTag(i.item.value,{focus:!0,unique:f.unique}),!1}))}else n(i.fake_input).bind("blur",i,function(t){var i=n(this).attr("data-default");return""!=n(t.data.fake_input).val()&&n(t.data.fake_input).val()!=i?t.data.minChars<=n(t.data.fake_input).val().length&&(!t.data.maxChars||t.data.maxChars>=n(t.data.fake_input).val().length)&&n(t.data.real_input).addTag(n(t.data.fake_input).val(),{focus:!0,unique:f.unique}):(n(t.data.fake_input).val(n(t.data.fake_input).attr("data-default")),n(t.data.fake_input).css("color",f.placeholderColor)),!1});n(i.fake_input).bind("keypress",i,function(t){return u(t)?(t.preventDefault(),t.data.minChars<=n(t.data.fake_input).val().length&&(!t.data.maxChars||t.data.maxChars>=n(t.data.fake_input).val().length)&&n(t.data.real_input).addTag(n(t.data.fake_input).val(),{focus:!0,unique:f.unique}),n(t.data.fake_input).resetAutosize(f),!1):void(t.data.autosize&&n(t.data.fake_input).doAutosize(f))});i.removeWithBackspace&&n(i.fake_input).bind("keydown",function(t){if(8==t.keyCode&&""==n(this).val()){t.preventDefault();var i=n(this).closest(".tagsinput").find(".tag:last").text(),r=n(this).attr("id").replace(/_tag$/,"");i=i.replace(/[\s]+x$/,"");n("#"+r).removeTag(escape(i));n(this).trigger("focus")}});n(i.fake_input).blur();i.unique&&n(i.fake_input).keydown(function(t){(8==t.keyCode||String.fromCharCode(t.which).match(/\w+|[áéíóúÁÉÍÓÚñÑ,/]+/))&&n(this).removeClass("not_valid")})}}),this};n.fn.tagsInput.updateTagsField=function(t,i){var u=n(t).attr("id");n(t).val(i.join(r[u]))};n.fn.tagsInput.importTags=function(u,f){var e,o,s;for(n(u).val(""),e=n(u).attr("id"),o=f.split(r[e]),i=0;i<o.length;i++)n(u).addTag(o[i],{focus:!1,callback:!1});t[e]&&t[e].onChange&&(s=t[e].onChange,s.call(u,u,o[i]))};u=function(t){var i=!1;return 13==t.which?!0:("string"==typeof t.data.delimiter?t.which==t.data.delimiter.charCodeAt(0)&&(i=!0):n.each(t.data.delimiter,function(n,r){t.which==r.charCodeAt(0)&&(i=!0)}),i)}}(jQuery);!function(n){"function"==typeof define&&define.amd?define(["jquery"],n):n("object"==typeof exports?require("jquery"):jQuery)}(function(n){var i,t=navigator.userAgent,u=/iphone/i.test(t),f=/chrome/i.test(t),r=/android/i.test(t);n.mask={definitions:{"9":"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"},autoclear:!0,dataName:"rawMaskFn",placeholder:"_"};n.fn.extend({caret:function(n,t){var i;if(0!==this.length&&!this.is(":hidden"))return"number"==typeof n?(t="number"==typeof t?t:n,this.each(function(){this.setSelectionRange?this.setSelectionRange(n,t):this.createTextRange&&(i=this.createTextRange(),i.collapse(!0),i.moveEnd("character",t),i.moveStart("character",n),i.select())})):(this[0].setSelectionRange?(n=this[0].selectionStart,t=this[0].selectionEnd):document.selection&&document.selection.createRange&&(i=document.selection.createRange(),n=0-i.duplicate().moveStart("character",-1e5),t=n+i.text.length),{begin:n,end:t})},unmask:function(){return this.trigger("unmask")},mask:function(t,e){var p,l,o,c,h,v,s,a,y;return!t&&this.length>0?(p=n(this[0]),y=p.data(n.mask.dataName),y?y():void 0):(e=n.extend({autoclear:n.mask.autoclear,placeholder:n.mask.placeholder,completed:null},e),l=n.mask.definitions,o=[],c=s=t.length,h=null,n.each(t.split(""),function(n,t){"?"==t?(s--,c=n):l[t]?(o.push(new RegExp(l[t])),null===h&&(h=o.length-1),c>n&&(v=o.length-1)):o.push(null)}),this.trigger("unmask").each(function(){function nt(){if(e.completed){for(var n=h;v>=n;n++)if(o[n]&&p[n]===w(n))return;e.completed.call(y)}}function w(n){return e.placeholder.charAt(n<e.placeholder.length?n:0)}function b(n){for(;++n<s&&!o[n];);return n}function ut(n){for(;--n>=0&&!o[n];);return n}function it(n,t){var r,i;if(!(0>n)){for(r=n,i=b(t);s>r;r++)if(o[r]){if(!(s>i&&o[r].test(p[i])))break;p[r]=p[i];p[i]=w(i);i=b(i)}d();y.caret(Math.max(h,n))}}function ft(n){for(var r,u,t=n,i=w(n);s>t;t++)if(o[t]){if(r=b(t),u=p[t],p[t]=i,!(s>r&&o[r].test(u)))break;i=u}}function et(){var t=y.val(),n=y.caret();if(a&&a.length&&a.length>t.length){for(k(!0);n.begin>0&&!o[n.begin-1];)n.begin--;if(0===n.begin)for(;n.begin<h&&!o[n.begin];)n.begin++;y.caret(n.begin,n.begin)}else{for(k(!0);n.begin<s&&!o[n.begin];)n.begin++;y.caret(n.begin,n.begin)}nt()}function rt(){k();y.val()!=tt&&y.change()}function ot(n){if(!y.prop("readonly")){var f,i,t,r=n.which||n.keyCode;a=y.val();8===r||46===r||u&&127===r?(f=y.caret(),i=f.begin,t=f.end,t-i==0&&(i=46!==r?ut(i):t=b(i-1),t=46===r?b(t):t),g(i,t),it(i,t-1),n.preventDefault()):13===r?rt.call(this,n):27===r&&(y.val(tt),y.caret(0,k()),n.preventDefault())}}function st(t){var u,e,h,f,i,c;y.prop("readonly")||(f=t.which||t.keyCode,i=y.caret(),t.ctrlKey||t.altKey||t.metaKey||32>f||!f||13===f||((i.end-i.begin!=0&&(g(i.begin,i.end),it(i.begin,i.end-1)),u=b(i.begin-1),s>u&&(e=String.fromCharCode(f),o[u].test(e)))&&((ft(u),p[u]=e,d(),h=b(u),r)?(c=function(){n.proxy(n.fn.caret,y,h)()},setTimeout(c,0)):y.caret(h),i.begin<=v&&nt()),t.preventDefault()))}function g(n,t){for(var i=n;t>i&&s>i;i++)o[i]&&(p[i]=w(i))}function d(){y.val(p.join(""))}function k(n){for(var f,r=y.val(),u=-1,t=0,i=0;s>t;t++)if(o[t]){for(p[t]=w(t);i++<r.length;)if(f=r.charAt(i-1),o[t].test(f)){p[t]=f;u=t;break}if(i>r.length){g(t+1,s);break}}else p[t]===r.charAt(i)&&i++,c>t&&(u=t);return n?d():c>u+1?e.autoclear||p.join("")===ht?(y.val()&&y.val(""),g(0,s)):d():(d(),y.val(y.val().substring(0,u+1))),c?t:h}var y=n(this),p=n.map(t.split(""),function(n,t){if("?"!=n)return l[n]?w(t):n}),ht=p.join(""),tt=y.val();y.data(n.mask.dataName,function(){return n.map(p,function(n,t){return o[t]&&n!=w(t)?n:null}).join("")});y.one("unmask",function(){y.off(".mask").removeData(n.mask.dataName)}).on("focus.mask",function(){if(!y.prop("readonly")){clearTimeout(i);var n;tt=y.val();n=k();i=setTimeout(function(){y.get(0)===document.activeElement&&(d(),n==t.replace("?","").length?y.caret(0,n):y.caret(n))},10)}}).on("blur.mask",rt).on("keydown.mask",ot).on("keypress.mask",st).on("input.mask paste.mask",function(){y.prop("readonly")||setTimeout(function(){var n=k(!0);y.caret(n);nt()},0)});f&&r&&y.off("input.mask").on("input.mask",et);k()}))}})}),function(){var n=ko.bindingProvider.instance;ko.bindingProvider.instance={nodeHasBindings:n.nodeHasBindings,getBindings:function(t,i){var r;try{r=n.getBindings(t,i)}catch(u){window.console&&console.log&&console.log("binding error ",u.message,t,i)}return r}}}();ko.subscribable.fn.subscribeChanged=function(n){var t;this.subscribe(function(n){t=n},this,"beforeChange");this.subscribe(function(i){n(i,t)})};ko.observable.fn.codeUpdate=function(n){this.notifySubscribers=function(){arguments[0]="codeUpdate";ko.subscribable.fn.notifySubscribers.apply(this,arguments)};this(n);this.notifySubscribers=function(){ko.subscribable.fn.notifySubscribers.apply(this,arguments)}};ko.bindingHandlers.stopBinding={init:function(){return{controlsDescendantBindings:!0}}};ko.virtualElements.allowedBindings.stopBinding=!0;ko.bindingHandlers.withProperties={init:function(n,t,i,r,u){var f=u.extend(t);return ko.observable(n).extend({applyBindingsToDescendants:f}),{controlsDescendantBindings:!0}}};ko.bindingHandlers.hidden=function(){function n(n,t){var i=ko.unwrap(t());$(n).css("visibility",i?"hidden":"visible")}return{init:n,update:n}}();ko.bindingHandlers.ckEditor={initialized:ko.observable(!1),initializeCKEditor:function(n){n.config.toolbar_Full=[{name:"clipboard",items:["Cut","Copy","Paste","PasteText","PasteFromWord","-","Undo","Redo"]},{name:"editing",items:["Find","Replace","-","SelectAll"]},{name:"links",items:["Link","Unlink","Anchor"]},"/",{name:"basicstyles",items:["Bold","Italic","Underline","Strike","Subscript","Superscript","-","CopyFormatting","RemoveFormat"]},{name:"paragraph",items:["NumberedList","BulletedList","-","Outdent","Indent","-","Blockquote","/","JustifyLeft","JustifyCenter","JustifyRight","JustifyBlock"]},"/",{name:"styles",items:["Font","FontSize"]},{name:"lineheight",items:["lineheight"]},{name:"colors",items:["TextColor","BGColor"]}];n.disableAutoInline=!0;n.config.extraPlugins="pastetext,smallerselection,lineheight";n.config.forcePasteAsPlainText=!0;n.config.pasteFromWordRemoveFontStyles=!1;n.config.allowedContent=!0;n.config.autoParagraph=!0;n.config.fillEmptyBlocks=!0;n.config.forceEnterMode=!1;n.config.format_h1={element:"h1",name:"Heading 1",styles:{"font-size":"32px"}};n.config.format_h2={element:"h2",name:"Heading 2",styles:{"font-size":"24px"}};n.config.format_h3={element:"h3",name:"Heading 3",styles:{"font-size":"18px"}};n.config.format_h4={element:"h4",name:"Heading 4",styles:{"font-size":"16px"}};n.config.format_h5={element:"h5",name:"Heading 5",styles:{"font-size":"13px"}};n.config.format_h6={element:"h6",name:"Heading 6",styles:{"font-size":"10px"}};CKEDITOR.event.useCapture=!0},init:function(n,t){var e,i,r;ko.bindingHandlers.ckEditor.initializeCKEditor(CKEDITOR);var s=t(),f=ko.utils.unwrapObservable(t()),o=f,u=$(n);if(null!=u.attr("contenteditable")&&"false"!==u.attr("contenteditable")){e=u.attr("id");i=UI.siteComponentRepository.lookupDataSet({id:e}).firstOrDefault();f!=null&&(i!=null&&(f=f!==i.getProperty(TEXT).value?i.getProperty(TEXT).value:f,f=ko.utils.parseHtmlFragment(f),u.highlightSelectedElement(i,!0)),CKEDITOR.config.toolbar_Full[7].items.push("Format"),i.proto.name=="paragraph"?CKEDITOR.config.format_tags="p;h2;h3;h4;h5;h6;pre;address":i.proto.name=="headertext"&&(CKEDITOR.config.format_tags="h1"),u.html(f)),function(n){dragDrop.releaseElement(e);$(n).unbind().find("*").unbind();n.onmouseup=n.onmousedown=n.onclick=null}(n),function(n){for(name in n.instances)n.instances.hasOwnProperty(name)&&n.instances[name].destroy()}(CKEDITOR);enableSelection(n);r=CKEDITOR.inline(n,{enterMode:CKEDITOR.ENTER_P,shiftEnterMode:CKEDITOR.ENTER_BR,allowedContent:!0,toolbar:"Full",font_names:ContextFactory.getComponentFontsInline(),contentsCss:"../Content/font-opensans.css"});r.on("instanceReady",function(n){var i=new CKEDITOR.focusManager(this),t,r;i.add(CKEDITOR.document.getById(e),1);u.data("focusManagerInstance",i);u.on("blur",function(n){return n.preventDefault(),!1});CKEDITOR.env.gecko&&document.execCommand("useCSS",!1,!1);this.dataProcessor.writer.setRules("p",{indent:!0,breakBeforeOpen:!0,breakAfterOpen:!1,breakBeforeClose:!1,breakAfterClose:!0});try{t=n.editor.createRange();t.moveToElementEditablePosition(n.editor.editable(),!0);r=n.editor.getSelection();r.selectRanges([t])}catch(f){console.log(f)}n.editor.focus()});r.on("change",function(){var t=this,n;ko.isWriteableObservable(t)&&t(r.getData());i!=null&&(n=r.getData(),n=n.replace(/\u200B/g,""),i.proto.name==PARAGRAPH_SEO?i.setProperty(TEXT,ko.utils.parseHtmlFragment(n)[0]?ko.utils.parseHtmlFragment(n)[0].innerHTML:n):i.setProperty(TEXT,n))},s,n);r.on("selectionChange",function(){var n,t;try{if(r.readOnly)return;n=r.getSelection();n&&!n.isLocked&&(t=r.checkDirty(),r.fire("saveSnapshot",{contentOnly:1}),r.fire("updateSnapshot"),t||r.resetDirty())}catch(i){console.log(i)}},null,null,1);r.on("blur",function(){var t,f;try{t=r.getData();i.proto.name==PARAGRAPH_SEO&&(t=ko.utils.parseHtmlFragment(t)[0]?ko.utils.parseHtmlFragment(t)[0].innerHTML:t)}catch(e){i!=null&&(t=ko.utils.parseHtmlFragment(i.getProperty(TEXT)))}f={lastValue:o,currentValue:t||o,updateCallback:function(n){i!=null&&(i.setProperty(TEXT,n),$(i.getUISelector()).html(n))}};UI.undoManagerAdd({undo:function(){f.updateCallback(f.lastValue)},redo:function(){f.updateCallback(f.currentValue)}});u.removeAttr("contenteditable");disableSelection(n);u.data("focusManagerInstance",null);try{r.destroy(!1);u.data("ckeditorInstance",null);i.isckeditorworking=!1;UI.isckeditorworking=!1;u.highlightSelectedElement(i,!0)}catch(s){}return CKEDITOR.event.useCapture=!1,i.viewer(),$("#gwf-popup").remove(),!1});ko.utils.domNodeDisposal.addDisposeCallback(n,function(){r.destroy(!1)})}}};ko.bindingHandlers.ckEditorSimple={init:function(n,t,i){var u=ko.utils.extend({toolbar:[{name:"clipboard",items:["Cut","Copy","Paste","PasteText","PasteFromWord","-","Undo","Redo"]},{name:"editing",items:["Find","Replace","-","SelectAll","-","Scayt"]},{name:"basicstyles",items:["Bold","Italic","Underline","Strike","-","RemoveFormat"]},{name:"paragraph",items:["NumberedList","BulletedList","-","Outdent","Indent","-","Blockquote","-","JustifyLeft","JustifyCenter","JustifyRight","JustifyBlock"]},{name:"styles",items:["Styles","Format","Font","Fontsize"]},{name:"colors",items:["TextColor","BGColor"]},{name:"tools",items:["Maximize"]}],removePlugins:"elementspath"},i.get("ckeditorOptions")||{}),f=t(),r=CKEDITOR.replace(n,u);r.on("change",function(){f(r.getData())});ko.utils.domNodeDisposal.addDisposeCallback(n,function(){r&&CKEDITOR.remove(r)})},update:function(n,t){var i=new CKEDITOR.dom.element(n).getEditor();i.setData(ko.unwrap(t()),null,!0)}};StretchingController=function(n,t,i){"use strict";n=n||["fill","crop"];t=t||"fill";var u=function(n){return!!ko.dataFor(n)},r=this,f=function(){this.forceDomUpdate()}.bind(this);this.stretchClass=ko.observable({width:"100%",height:"100%",backgroundSize:"cover"});this.fitClass=i.displayName=="list"?ko.observable({width:"100%",height:"100%",backgroundSize:"contain",backgroundRepeat:"no-repeat",backgroundPosition:"center"}):ko.observable({width:"100%",height:"100%",backgroundSize:"contain"});this.stretchingOptions=ko.observableArray(n);this.stretchingValue=ko.observable(t);this.classToApply=ko.computed(function(){return{fill:"fitwidth",crop:"stretch","":"fitwidth"}[r.stretchingValue()]},this);this.stretchingValue.subscribe(function(){this.component!==null&&this.updateToComponent(r.component)}.bind(this));this.forceDomUpdate=function(n){n||(n=".gallery-list-items");$(n).find("img").each(function(){$("<div/>").css("background-image","url("+$(this).attr("src")+")").prependTo($(this).parent()).data("bind","css: classToApply");$(this).data("bind",'visible: { stretchClass == "stretch" }')});ko.observable($(n)[0]).extend({applyBindingsToDescendants:this});$(n).find(".holder").removeClass("fitwidth","stretch").addClass(r.classToApply())};this.updateToComponent=function(n){var t,i;try{n!==null&&(n.setProperty("image-stretching",r.stretchingValue(),!0),t=n.getProperty("image-stretching"),t!=null&&(t.componentId=n.name,t.controlId=n.id,t.propertyId="74A60096-59B5-4749-8116-07ABAD4B4C95",t.group="common",t.type="common"),n.getProperty(SHOW_OPTIMIZED)!==null&&(i=n.getProperty(SHOW_OPTIMIZED).value.toBoolean(),n.children.forEach(function(n){$("#gallery-editor .gallery-items-list .gallery-item#"+n.id+">div>div").css("background-image",'url("'+ContextFactory.prepareImgSrc(n.getProperty(SRC).value,i)+'")');$("#gallery-editor .gallery-items-list .gallery-item#"+n.id+" img").attr("src",ContextFactory.prepareImgSrc(n.getProperty(SRC).value,i))})))}finally{}};this.updateFromComponent=function(n){try{var t=n.getProperty("image-stretching");if(t!==null&&t.value!=null)r.stretchingOptions().any(t.value)&&r.stretchingValue(t.value);else throw"no stretching property value found!";}catch(i){r.updateToComponent(n)}};i!==null&&(this.component=i,this.updateFromComponent(i),this.updateToComponent(i))};StretchingController.shareInstanceBetweenNodes=function(n,t){"use strict";var i=ko.dataFor(n);return i!=ko.dataFor(t)&&ko.observable(t).extend({applyBindings:i}),i};ClipboardViewModel=function(n){this.items=ko.observableArray(n||[]);this.selectedItem=ko.observable(null);this.itemForClipboard=ko.observable(null);this.isDesktopView=ko.observable(!0)};ko.utils.extend(ClipboardViewModel.prototype,{selectComponent:function(n){this.selectedItem(n)},copyComponent:function(n,t){clipBoard.items=ko.observableArray([]);var i=this.selectedItem()||t;if(i==null)return console.log("clipBoard.js: copyComponent - component is null");switch(n){case GROUP:grouping.clipboardGroup.push(i);break;case COMPONENT:clipBoard.items.push(ko.unwrap(i));break;default:console.log("Error: don't add "+n+" to clipBoard")}(grouping.clipboardGroup.length>0||clipBoard.items().length>0)&&(clipBoard.itemForClipboard(i),PopoverHelper.hidePopovers())},pasteComponent:function(n,t,i,r,u,f){var l,a,p,w,v;defined(r)||(r=!0);var b=n||clipBoard.items().pop()||clipBoard.itemForClipboard(),o=ko.utils.unwrapObservable(b),s=UI.pager.getCurrentPageId();if(o!=null){if(UI.siteComponentRepository.checkExistingRule(o.proto.name,s)){var e=(new Component).createFromExisting(o.proto.name===FORM?_.defaults({children:[]},o):o,!0),c=parseInt(e.getProperty("left").value,10)+5,h=parseInt(e.getProperty("top").value,10)+5,k=parseInt(o.parentComponent.getProperty("height").value),y=$("#"+s+"").height();y<k&&(h=y/2);l=e.parentComponent.displayName;l==null&&(l=UI.siteComponentRepository.lookupData({id:e.parentComponent.id}).displayName);switch(l){case DISPLAY_PAGE:u?(e.parentComponent=UI.siteComponentRepository.lookupData({id:i.id}),s=i.id,c=c-5,h=h-5):e.parentComponent=UI.siteComponentRepository.lookupData({id:UI.pager.getCurrentPageId()});break;case FORM:i!=null?(e.parentComponent=i,s=i.id,c=c-5,h=h-5):(e.displayName==LABEL&&e.getProperty(CAPTION_COMPONENTS_TO_LABEL)&&e.getProperty(CAPTION_COMPONENTS_TO_LABEL).value!=""&&e.setProperty(CAPTION_COMPONENTS_TO_LABEL,""),e.getProperty(SELECTEDLABEL)&&e.getProperty(SELECTEDLABEL).value!=""&&e.setProperty(SELECTEDLABEL,""),s=o.parentComponent.id)}try{Helpers.setNewGuid(e)}catch(d){clipBoard.itemForClipboard(null);return window.onerror(d.message,"clipBoard.is -> pasteComponent: ",141,0)}return e.setProperty(LEFT,c+"px"),e.setProperty(TOP,h+"px"),a=e.getProperty(IS_PINED),a!=null&&a.value.toBoolean()&&(p=parseInt(e.getProperty(OFFSET_X).value)+5,w=parseInt(e.getProperty(OFFSET_Y).value)+5,e.setProperty(OFFSET_X,p+"px"),e.setProperty(OFFSET_Y,w+"px")),t?e.setProperty(GROUPID,t,!0):e.setProperty(GROUPID,"",!0),UI.siteComponentRepository.appendTo(e,UI.siteComponentRepository.lookupData({id:s})),UI.actionService.runActionForComponent(e,ACTION_ADD_TO_FORM),TransformFactory.setNewPosition(e),e.parentComponent.displayName==FORM&&ClipboardViewModel.attachToParentComponent($(e.getUISelector()),s),ClipboardViewModel.bindEventsForComponent(e),paletteBindingProvider.subscribed()&&(console.log("wire palette..."),paletteBindingProvider.appliedComponents.push(e),ko.observable($(e.getUISelector())[0]).extend({applyBindings:paletteBindingProvider.colors}),$(e.getUISelector()).trigger("click")),i==null&&ClipboardViewModel.clipboardUndoRedoManager(e),e.displayName===FORM&&(e.children=[],_.forEach(o.children,function(n){n.parentComponent.displayName=e.displayName;clipBoard.pasteComponent(n,!1,e,!1)}),e.children.any()&&(v=UI.siteComponentRepository.lookupData({id:e.id}).children,_.forEach(v.where({displayName:LABEL}),function(n){var i=n.getProperty(CAPTION_COMPONENTS_TO_LABEL).value,t=Grouping.generateGuid();n.setProperty(CAPTION_COMPONENTS_TO_LABEL,t);_.forEach(v.whereNot({displayName:LABEL}),function(n){var r=n.getProperty(SELECTEDLABEL);r!=null&&r.value===i&&n.setProperty(SELECTEDLABEL,t)})}))),f&&$(window).scrollTo($("#"+e.id+""),{over:-2}),clipBoard.itemForClipboard(null),grouping.clipboardGroup.length==0&&r?$($(e.getUISelector())).highlightSelectedElement(e,!0):clipBoard.selectedItem(null),grouping.clipboardGroup.length>0&&grouping.queueToSelectAfterPaste.push(e.getUISelector()),UI.renderMenus(),!0}clipBoard.itemForClipboard(null)}},duplicateComponent:function(){return clipBoard.copyComponent(COMPONENT),clipBoard.pasteComponent(),!0},deleteComponent:function(n,t,i){if(ClipboardViewModel.isActive()||Grouping.isActive()||i){var r=$.Event("keydown");r.which=46;r.keyCode=46;$(UI.getConfigurationValue(HTML)).trigger(r);this.selectedItem(null);this.itemForClipboard(null);grouping.showGroupingOptions(!1);Resizer.recalculateSizeFooterContainer($(".footer")[0])}return!0},toggleShowHideComponent:function(n,t,i){if(ClipboardViewModel.isActive()||Grouping.isActive()||i){var r=$.Event("keydown");r.which=0;r.keyCode=0;$(UI.getConfigurationValue(HTML)).trigger(r);this.selectedItem(null);this.itemForClipboard(null);grouping.showGroupingOptions(!1)}return!0}});ClipboardViewModel.bindEventsForComponent=function(n){if(defined(n.events)&&n.events!=null){if(defined(n.events.onComponentProcessed)&&_.isFunction(n.events.onComponentProcessed))n.events.onComponentProcessed(n);if(defined(n.events.onComponentCreated)&&_.isFunction(n.events.onComponentCreated))n.events.onComponentCreated(n)}};ClipboardViewModel.isActive=function(){return UI.getSetting("ispreview")?!1:clipBoard.selectedItem()!==null};ClipboardViewModel.attachToParentComponent=function(n,t){n.detach();n.appendTo("#"+t)};ClipboardViewModel.clipboardUndoRedoManager=function(n){var t=UI.pager.getCurrentPageId(),i=n.id,r,u;UI.addLog("add",n);r=function(){n.parentComponent.displayName==FORM&&(t=n.parentComponent.id);UI.siteComponentRepository.appendTo(n,UI.siteComponentRepository.lookupData({id:t}));UI.actionService.runActionForComponent(n,ACTION_ADD_TO_FORM,!1,t);ClipboardViewModel.bindEventsForComponent(n);_.forEach(n.children,function(t){UI.actionService.runActionForComponent(t,ACTION_ADD_TO_FORM,!1,n.id);ClipboardViewModel.bindEventsForComponent(t);ClipboardViewModel.attachToParentComponent($(t.getUISelector()),n.id);return});n.parentComponent.displayName==FORM&&ClipboardViewModel.attachToParentComponent($(n.getUISelector()),n.parentComponent.id);n.viewer();UI.addLog("add",n)};u=function(){UI.removeLog("add",UI.siteComponentRepository.lookupData({id:i}));UI.siteComponentRepository.remove({id:i})};UI.undoManagerAdd({undo:function(){u()},redo:function(){r()}})};ClipboardViewModel.init=function(){$(".wrapper").on("click",function(n){UI.getSetting("ispreview")||(n.preventDefault(),clipBoard.selectedItem(null))});UI.getSetting("ispreview")||ko.applyBindings(clipBoard)};ClipboardViewModel.distributionClipboard=function(n){var i=grouping.showGroupingOptions()||grouping.clipboardGroup.length>0?!0:!1,t=clipBoard.selectedItem()||clipBoard.items()[0],u=[SIGNIN,STORE_CATEGORIES,STORE_CART_LINK,STORE_GALLERY],r;if(UI.getDevice().isDesktop()){switch(n){case COPY:i?Grouping.copyGroup():t&&u.indexOf(t.proto.name)===-1&&clipBoard.copyComponent(COMPONENT);break;case DUPLICATE:i?Grouping.duplicateGroup():t&&clipBoard.duplicateComponent();break;case PASTE:r=!0;i?Grouping.pasteGroup(r):t&&clipBoard.pasteComponent(null,!1,null,!0,!1,r)}return}};ClipboardViewModel.getMinMaxZIndexValue=function(n){var t=undefined,i=aligning.getCurrentArea();return i==undefined?t:(i.children().each(function(){var i=Number($(this).css("z-index"));t=t==undefined?i:n?Math.min(t,i):Math.max(t,i)}),t)};ClipboardViewModel.getMaxMinZindexCount=function(n){var i=aligning.getCurrentArea(),t=0;return i==undefined?t:(i.children().each(function(){var i=Number($(this).css("z-index"));i===n&&t++}),t)};ClipboardViewModel.zIndex=function(n){var r=clipBoard.selectedItem(),u=Grouping.isActive(),f,o,t,e,s,i;switch(n){case"bringFrontAheadOfAll":if(t=ClipboardViewModel.isLayeringEnabled(),f=ClipboardViewModel.getMinMaxZIndexValue(!1),!t)break;r?new LayeringController(clipBoard.selectedItem()).setZIndex(f+1):u&&(o=Grouping.getGroupZIndexValue(),i=f+1-o,ko.utils.arrayForEach(grouping.selectedItems(),function(n){var t=Grouping.getComponent(n.id),r=Number($(n).css("z-index"))+i;new LayeringController(t).setZIndex(r)}));break;case"bringFront":if(t=ClipboardViewModel.isLayeringEnabled(),!t)break;r?new LayeringController(clipBoard.selectedItem()).bringFront():u&&ko.utils.arrayForEach(grouping.selectedItems(),function(n){var t=Grouping.getComponent(n.id);new LayeringController(t).bringFront()});break;case"sendBack":if(t=ClipboardViewModel.isLayeringEnabled(!0),!t)break;r?new LayeringController(clipBoard.selectedItem()).sendBack():u&&ko.utils.arrayForEach(grouping.selectedItems(),function(n){var t=Grouping.getComponent(n.id);new LayeringController(t).sendBack()});break;case"sendBackBehindAll":if(t=ClipboardViewModel.isLayeringEnabled(!0),e=ClipboardViewModel.getMinMaxZIndexValue(!0),!t)break;r?new LayeringController(clipBoard.selectedItem()).setZIndex(e-1):u&&(s=Grouping.getGroupZIndexValue(!0),i=s-(e-1),ko.utils.arrayForEach(grouping.selectedItems(),function(n){var t=Grouping.getComponent(n.id),r=Number($(n).css("z-index"))-i;new LayeringController(t).setZIndex(r)}))}ClipboardViewModel.setElementsAccess("layer-bring-front",ClipboardViewModel.isLayeringEnabled());ClipboardViewModel.setElementsAccess("layer-bring-back",ClipboardViewModel.isLayeringEnabled(!0))};ClipboardViewModel.isLayeringEnabled=function(n){n=n||!1;var i=clipBoard.selectedItem(),f=Grouping.isActive(),r=ClipboardViewModel.getMinMaxZIndexValue(n),e=ClipboardViewModel.getMaxMinZindexCount(r),t=0,u=1;return(f?(t=Grouping.getGroupZIndexValue(n),u=Grouping.getGroupItemsCountByZindex(t)):i&&(t=parseInt(i.getProperty("z-index").value)),t!==r||e>u)?!0:!1};ClipboardViewModel.disabledEnabledLayreDown=function(n,t){var i=document.querySelector(n);t?i.classList.remove("disabled"):i.classList.add("disabled")};ClipboardViewModel.setElementsAccess=function(n,t,r){var f=document.getElementsByClassName(n),u;for(i=0;i<f.length;i++)u=f[i],t&&(r&&u.classList.value.indexOf(r)!==-1||!r)?u.classList.remove("disabled"):u.classList.add("disabled")};ClipboardViewModel.setElementsVisability=function(){var t=document.getElementById("copied-item"),n;t!=null&&(t.style.display=clipBoard.itemForClipboard()?"none":"block");n=document.getElementById("pasted-item");n!=null&&(n.style.display=clipBoard.itemForClipboard()?"block":"none")};clipBoard=new ClipboardViewModel([]);EventsComponents=function(){};EventsComponents.initEvents=function(n){UI.getSetting("ispreview")||typeof n.eventComponent!="function"&&(n.eventComponent=function(){})};window.YT||(YT={loading:0,loaded:0});window.YTConfig||(YTConfig={host:"http://www.youtube.com"});YT.loading||(YT.loading=1,function(){var t=[],n,i;YT.ready=function(n){YT.loaded?n():t.push(n)};window.onYTReady=function(){YT.loaded=1;for(var n=0;n<t.length;n++)try{t[n]()}catch(i){}};YT.setConfig=function(n){for(var t in n)n.hasOwnProperty(t)&&(YTConfig[t]=n[t])};n=document.createElement("script");n.type="text/javascript";n.id="www-widgetapi-script";n.src="https://s.ytimg.com/yts/jsbin/www-widgetapi-vfliZmGBd/www-widgetapi.js";n.async=!0;i=document.getElementsByTagName("script")[0];i.parentNode.insertBefore(n,i)}());window.YT||(YT={loading:0,loaded:0});window.YTConfig||(YTConfig={host:"http://www.youtube.com"});YT.loading||(YT.loading=1,function(){var t=[],n,i;YT.ready=function(n){YT.loaded?n():t.push(n)};window.onYTReady=function(){YT.loaded=1;for(var n=0;n<t.length;n++)try{t[n]()}catch(i){}};YT.setConfig=function(n){for(var t in n)n.hasOwnProperty(t)&&(YTConfig[t]=n[t])};n=document.createElement("script");n.type="text/javascript";n.id="www-widgetapi-script";n.src="https://s.ytimg.com/yts/jsbin/www-widgetapi-vfliZmGBd/www-widgetapi.js";n.async=!0;i=document.getElementsByTagName("script")[0];i.parentNode.insertBefore(n,i)}());Froogaloop=function(){function t(n){return new t.fn.init(n)}function u(n,t,i){if(!i.contentWindow.postMessage)return!1;var u=JSON.stringify({method:n,value:t});i.contentWindow.postMessage(u,r)}function f(n){var t,e;try{t=JSON.parse(n.data);e=t.event||t.method}catch(l){}if(e!="ready"||i||(i=!0),!/^https?:\/\/player.vimeo.com/.test(n.origin))return!1;r==="*"&&(r=n.origin);var h=t.value,c=t.data,f=f===""?null:t.player_id,o=s(e,f),u=[];return o?(h!==undefined&&u.push(h),c&&u.push(c),f&&u.push(f),u.length>0?o.apply(null,u):o.call()):!1}function e(t,i,r){r?(n[r]||(n[r]={}),n[r][t]=i):n[t]=i}function s(t,i){return i?n[i][t]:n[t]}function h(t,i){if(i&&n[i]){if(!n[i][t])return!1;n[i][t]=null}else{if(!n[t])return!1;n[t]=null}return!0}function o(n){return!!(n&&n.constructor&&n.call&&n.apply)}var n={},i=!1,c=Array.prototype.slice,r="*";return t.fn=t.prototype={element:null,init:function(n){return typeof n=="string"&&(n=document.getElementById(n)),this.element=n,this},api:function(n,t){if(!this.element||!n)return!1;var r=this,i=r.element,s=i.id!==""?i.id:null,h=o(t)?null:t,f=o(t)?t:null;return f&&e(n,f,s),u(n,h,i),r},addEvent:function(n,t){if(!this.element)return!1;var f=this,r=f.element,o=r.id!==""?r.id:null;return e(n,t,o),n!="ready"?u("addEventListener",n,r):n=="ready"&&i&&t.call(null,o),f},removeEvent:function(n){if(!this.element)return!1;var i=this,t=i.element,r=t.id!==""?t.id:null,f=h(n,r);n!="ready"&&f&&u("removeEventListener",n,t)}},t.fn.init.prototype=t.fn,window.addEventListener?window.addEventListener("message",f,!1):window.attachEvent("onmessage",f),window.Froogaloop=window.$f=t}(),function(n,t){typeof define=="function"&&define.amd?define(["jquery"],t):typeof exports=="object"?t(require("jquery")):n.jQuery?t(n.jQuery):t(n.Zepto)}(this,function(n,t){var r,f,u,i,e;n.fn.jPlayer=function(i){var r="jPlayer",u=typeof i=="string",f=Array.prototype.slice.call(arguments,1),e=this;return(i=!u&&f.length?n.extend.apply(null,[!0,i].concat(f)):i,u&&i.charAt(0)==="_")?e:(u?this.each(function(){var u=n(this).data(r),o=u&&n.isFunction(u[i])?u[i].apply(u,f):u;if(o!==u&&o!==t)return e=o,!1}):this.each(function(){var t=n(this).data(r);t?t.option(i||{}):n(this).data(r,new n.jPlayer(i,this))}),e)};n.jPlayer=function(t,i){if(arguments.length){this.element=n(i);this.options=n.extend(!0,{},this.options,t);var r=this;this.element.bind("remove.jPlayer",function(){r.destroy()});this._init()}};typeof n.fn.stop!="function"&&(n.fn.stop=function(){});n.jPlayer.emulateMethods="load play pause";n.jPlayer.emulateStatus="src readyState networkState currentTime duration paused ended playbackRate";n.jPlayer.emulateOptions="muted volume";n.jPlayer.reservedEvent="ready flashreset resize repeat error warning";n.jPlayer.event={};n.each(["ready","setmedia","flashreset","resize","repeat","click","error","warning","loadstart","progress","suspend","abort","emptied","stalled","play","pause","loadedmetadata","loadeddata","waiting","playing","canplay","canplaythrough","seeking","seeked","timeupdate","ended","ratechange","durationchange","volumechange"],function(){n.jPlayer.event[this]="jPlayer_"+this});n.jPlayer.htmlEvent=["loadstart","abort","emptied","stalled","loadedmetadata","canplay","canplaythrough"];n.jPlayer.pause=function(){n.jPlayer.prototype.destroyRemoved();n.each(n.jPlayer.prototype.instances,function(n,t){t.data("jPlayer").status.srcSet&&t.jPlayer("pause")})};n.jPlayer.timeFormat={showHour:!1,showMin:!0,showSec:!0,padHour:!1,padMin:!0,padSec:!0,sepHour:":",sepMin:":",sepSec:""};r=function(){this.init()};r.prototype={init:function(){this.options={timeFormat:n.jPlayer.timeFormat}},time:function(n){n=n&&typeof n=="number"?n:0;var t=new Date(n*1e3),i=t.getUTCHours(),r=this.options.timeFormat.showHour?t.getUTCMinutes():t.getUTCMinutes()+i*60,u=this.options.timeFormat.showMin?t.getUTCSeconds():t.getUTCSeconds()+r*60,e=this.options.timeFormat.padHour&&i<10?"0"+i:i,o=this.options.timeFormat.padMin&&r<10?"0"+r:r,s=this.options.timeFormat.padSec&&u<10?"0"+u:u,f="";return f+=this.options.timeFormat.showHour?e+this.options.timeFormat.sepHour:"",f+=this.options.timeFormat.showMin?o+this.options.timeFormat.sepMin:"",f+(this.options.timeFormat.showSec?s+this.options.timeFormat.sepSec:"")}};f=new r;n.jPlayer.convertTime=function(n){return f.time(n)};n.jPlayer.uaBrowser=function(n){var t=n.toLowerCase(),i=/(webkit)[ \/]([\w.]+)/.exec(t)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(t)||/(msie) ([\w.]+)/.exec(t)||t.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(t)||[];return{browser:i[1]||"",version:i[2]||"0"}};n.jPlayer.uaPlatform=function(n){var t=n.toLowerCase(),i=/(ipad|iphone|ipod|android|blackberry|playbook|windows ce|webos)/.exec(t)||[],r=/(ipad|playbook)/.exec(t)||!/(mobile)/.exec(t)&&/(android)/.exec(t)||[];return i[1]&&(i[1]=i[1].replace(/\s/g,"_")),{platform:i[1]||"",tablet:r[1]||""}};n.jPlayer.browser={};n.jPlayer.platform={};u=n.jPlayer.uaBrowser(navigator.userAgent);u.browser&&(n.jPlayer.browser[u.browser]=!0,n.jPlayer.browser.version=u.version);i=n.jPlayer.uaPlatform(navigator.userAgent);i.platform&&(n.jPlayer.platform[i.platform]=!0,n.jPlayer.platform.mobile=!i.tablet,n.jPlayer.platform.tablet=!!i.tablet);n.jPlayer.getDocMode=function(){var t;return n.jPlayer.browser.msie&&(document.documentMode?t=document.documentMode:(t=5,document.compatMode&&document.compatMode==="CSS1Compat"&&(t=7))),t};n.jPlayer.browser.documentMode=n.jPlayer.getDocMode();n.jPlayer.nativeFeatures={init:function(){var t=document,e=t.createElement("video"),i={w3c:["fullscreenEnabled","fullscreenElement","requestFullscreen","exitFullscreen","fullscreenchange","fullscreenerror"],moz:["mozFullScreenEnabled","mozFullScreenElement","mozRequestFullScreen","mozCancelFullScreen","mozfullscreenchange","mozfullscreenerror"],webkit:["","webkitCurrentFullScreenElement","webkitRequestFullScreen","webkitCancelFullScreen","webkitfullscreenchange",""],webkitVideo:["webkitSupportsFullscreen","webkitDisplayingFullscreen","webkitEnterFullscreen","webkitExitFullscreen","",""],ms:["","msFullscreenElement","msRequestFullscreen","msExitFullscreen","MSFullscreenChange","MSFullscreenError"]},o=["w3c","moz","webkit","webkitVideo","ms"],n,u,s,f,r;for(this.fullscreen=n={support:{w3c:!!t[i.w3c[0]],moz:!!t[i.moz[0]],webkit:typeof t[i.webkit[3]]=="function",webkitVideo:typeof e[i.webkitVideo[2]]=="function",ms:typeof e[i.ms[2]]=="function"},used:{}},u=0,s=o.length;u<s;u++)if(f=o[u],n.support[f]){n.spec=f;n.used[f]=!0;break}n.spec?(r=i[n.spec],n.api={fullscreenEnabled:!0,fullscreenElement:function(n){return n=n?n:t,n[r[1]]},requestFullscreen:function(n){return n[r[2]]()},exitFullscreen:function(n){return n=n?n:t,n[r[3]]()}},n.event={fullscreenchange:r[4],fullscreenerror:r[5]}):(n.api={fullscreenEnabled:!1,fullscreenElement:function(){return null},requestFullscreen:function(){},exitFullscreen:function(){}},n.event={})}};n.jPlayer.nativeFeatures.init();n.jPlayer.focus=null;n.jPlayer.keyIgnoreElementNames="A INPUT TEXTAREA SELECT BUTTON";e=function(t){var i=n.jPlayer.focus,r;i&&(n.each(n.jPlayer.keyIgnoreElementNames.split(/\s+/g),function(n,i){if(t.target.nodeName.toUpperCase()===i.toUpperCase())return r=!0,!1}),r||n.each(i.options.keyBindings,function(r,u){if(u&&n.isFunction(u.fn)&&(typeof u.key=="number"&&t.which===u.key||typeof u.key=="string"&&t.key===u.key))return t.preventDefault(),u.fn(i),!1}))};n.jPlayer.keys=function(t){var i="keydown.jPlayer";n(document.documentElement).unbind(i);t&&n(document.documentElement).bind(i,e)};n.jPlayer.keys(!0);n.jPlayer.prototype={count:0,version:{script:"2.9.2",needFlash:"2.9.0",flash:"unknown"},options:{swfPath:"js",solution:"html, flash",supplied:"mp3",auroraFormats:"wav",preload:"metadata",volume:.8,muted:!1,remainingDuration:!1,toggleDuration:!1,captureDuration:!0,playbackRate:1,defaultPlaybackRate:1,minPlaybackRate:.5,maxPlaybackRate:4,wmode:"opaque",backgroundColor:"#000000",cssSelectorAncestor:"#jp_container_1",cssSelector:{videoPlay:".jp-video-play",play:".jp-play",pause:".jp-pause",stop:".jp-stop",seekBar:".jp-seek-bar",playBar:".jp-play-bar",mute:".jp-mute",unmute:".jp-unmute",volumeBar:".jp-volume-bar",volumeBarValue:".jp-volume-bar-value",volumeMax:".jp-volume-max",playbackRateBar:".jp-playback-rate-bar",playbackRateBarValue:".jp-playback-rate-bar-value",currentTime:".jp-current-time",duration:".jp-duration",title:".jp-title",fullScreen:".jp-full-screen",restoreScreen:".jp-restore-screen",repeat:".jp-repeat",repeatOff:".jp-repeat-off",gui:".jp-gui",noSolution:".jp-no-solution"},stateClass:{playing:"jp-state-playing",seeking:"jp-state-seeking",muted:"jp-state-muted",looped:"jp-state-looped",fullScreen:"jp-state-full-screen",noVolume:"jp-state-no-volume"},useStateClassSkin:!1,autoBlur:!0,smoothPlayBar:!1,fullScreen:!1,fullWindow:!1,autohide:{restored:!1,full:!0,fadeIn:200,fadeOut:600,hold:1e3},loop:!1,repeat:function(t){t.jPlayer.options.loop?n(this).unbind(".jPlayerRepeat").bind(n.jPlayer.event.ended+".jPlayer.jPlayerRepeat",function(){n(this).jPlayer("play")}):n(this).unbind(".jPlayerRepeat")},nativeVideoControls:{},noFullWindow:{msie:/msie [0-6]\./,ipad:/ipad.*?os [0-4]\./,iphone:/iphone/,ipod:/ipod/,android_pad:/android [0-3]\.(?!.*?mobile)/,android_phone:/(?=.*android)(?!.*chrome)(?=.*mobile)/,blackberry:/blackberry/,windows_ce:/windows ce/,iemobile:/iemobile/,webos:/webos/},noVolume:{ipad:/ipad/,iphone:/iphone/,ipod:/ipod/,android_pad:/android(?!.*?mobile)/,android_phone:/android.*?mobile/,blackberry:/blackberry/,windows_ce:/windows ce/,iemobile:/iemobile/,webos:/webos/,playbook:/playbook/},timeFormat:{},keyEnabled:!1,audioFullScreen:!1,keyBindings:{play:{key:80,fn:function(n){n.status.paused?n.play():n.pause()}},fullScreen:{key:70,fn:function(n){(n.status.video||n.options.audioFullScreen)&&n._setOption("fullScreen",!n.options.fullScreen)}},muted:{key:77,fn:function(n){n._muted(!n.options.muted)}},volumeUp:{key:190,fn:function(n){n.volume(n.options.volume+.1)}},volumeDown:{key:188,fn:function(n){n.volume(n.options.volume-.1)}},loop:{key:76,fn:function(n){n._loop(!n.options.loop)}}},verticalVolume:!1,verticalPlaybackRate:!1,globalVolume:!1,idPrefix:"jp",noConflict:"jQuery",emulateHtml:!1,consoleAlerts:!0,errorAlerts:!1,warningAlerts:!1},optionsAudio:{size:{width:"0px",height:"0px",cssClass:""},sizeFull:{width:"0px",height:"0px",cssClass:""}},optionsVideo:{size:{width:"480px",height:"270px",cssClass:"jp-video-270p"},sizeFull:{width:"100%",height:"100%",cssClass:"jp-video-full"}},instances:{},status:{src:"",media:{},paused:!0,format:{},formatType:"",waitForPlay:!0,waitForLoad:!0,srcSet:!1,video:!1,seekPercent:0,currentPercentRelative:0,currentPercentAbsolute:0,currentTime:0,duration:0,remaining:0,videoWidth:0,videoHeight:0,readyState:0,networkState:0,playbackRate:1,ended:0},internal:{ready:!1},solution:{html:!0,aurora:!0,flash:!0},format:{mp3:{codec:"audio/mpeg",flashCanPlay:!0,media:"audio"},m4a:{codec:'audio/mp4; codecs="mp4a.40.2"',flashCanPlay:!0,media:"audio"},m3u8a:{codec:'application/vnd.apple.mpegurl; codecs="mp4a.40.2"',flashCanPlay:!1,media:"audio"},m3ua:{codec:"audio/mpegurl",flashCanPlay:!1,media:"audio"},oga:{codec:'audio/ogg; codecs="vorbis, opus"',flashCanPlay:!1,media:"audio"},flac:{codec:"audio/x-flac",flashCanPlay:!1,media:"audio"},wav:{codec:'audio/wav; codecs="1"',flashCanPlay:!1,media:"audio"},webma:{codec:'audio/webm; codecs="vorbis"',flashCanPlay:!1,media:"audio"},fla:{codec:"audio/x-flv",flashCanPlay:!0,media:"audio"},rtmpa:{codec:'audio/rtmp; codecs="rtmp"',flashCanPlay:!0,media:"audio"},m4v:{codec:'video/mp4; codecs="avc1.42E01E, mp4a.40.2"',flashCanPlay:!0,media:"video"},m3u8v:{codec:'application/vnd.apple.mpegurl; codecs="avc1.42E01E, mp4a.40.2"',flashCanPlay:!1,media:"video"},m3uv:{codec:"audio/mpegurl",flashCanPlay:!1,media:"video"},ogv:{codec:'video/ogg; codecs="theora, vorbis"',flashCanPlay:!1,media:"video"},webmv:{codec:'video/webm; codecs="vorbis, vp8"',flashCanPlay:!1,media:"video"},flv:{codec:"video/x-flv",flashCanPlay:!0,media:"video"},rtmpv:{codec:'video/rtmp; codecs="rtmp"',flashCanPlay:!0,media:"video"}},_init:function(){var i=this,r,e,s,o,f,u;if(this.element.empty(),this.status=n.extend({},this.status),this.internal=n.extend({},this.internal),this.options.timeFormat=n.extend({},n.jPlayer.timeFormat,this.options.timeFormat),this.internal.cmdsIgnored=n.jPlayer.platform.ipad||n.jPlayer.platform.iphone||n.jPlayer.platform.ipod,this.internal.domNode=this.element.get(0),this.options.keyEnabled&&!n.jPlayer.focus&&(n.jPlayer.focus=this),this.androidFix={setMedia:!1,play:!1,pause:!1,time:NaN},n.jPlayer.platform.android&&(this.options.preload=this.options.preload!=="auto"?"metadata":"auto"),this.formats=[],this.solutions=[],this.require={},this.htmlElement={},this.html={},this.html.audio={},this.html.video={},this.aurora={},this.aurora.formats=[],this.aurora.properties=[],this.flash={},this.css={},this.css.cs={},this.css.jq={},this.ancestorJq=[],this.options.volume=this._limitValue(this.options.volume,0,1),n.each(this.options.supplied.toLowerCase().split(","),function(t,r){var u=r.replace(/^\s+|\s+$/g,""),f;i.format[u]&&(f=!1,n.each(i.formats,function(n,t){if(u===t)return f=!0,!1}),f||i.formats.push(u))}),n.each(this.options.solution.toLowerCase().split(","),function(t,r){var u=r.replace(/^\s+|\s+$/g,""),f;i.solution[u]&&(f=!1,n.each(i.solutions,function(n,t){if(u===t)return f=!0,!1}),f||i.solutions.push(u))}),n.each(this.options.auroraFormats.toLowerCase().split(","),function(t,r){var u=r.replace(/^\s+|\s+$/g,""),f;i.format[u]&&(f=!1,n.each(i.aurora.formats,function(n,t){if(u===t)return f=!0,!1}),f||i.aurora.formats.push(u))}),this.internal.instance="jp_"+this.count,this.instances[this.internal.instance]=this.element,this.element.attr("id")||this.element.attr("id",this.options.idPrefix+"_jplayer_"+this.count),this.internal.self=n.extend({},{id:this.element.attr("id"),jq:this.element}),this.internal.audio=n.extend({},{id:this.options.idPrefix+"_audio_"+this.count,jq:t}),this.internal.video=n.extend({},{id:this.options.idPrefix+"_video_"+this.count,jq:t}),this.internal.flash=n.extend({},{id:this.options.idPrefix+"_flash_"+this.count,jq:t,swf:this.options.swfPath+(this.options.swfPath.toLowerCase().slice(-4)!==".swf"?(this.options.swfPath&&this.options.swfPath.slice(-1)!=="/"?"/":"")+"jquery.jplayer.swf":"")}),this.internal.poster=n.extend({},{id:this.options.idPrefix+"_poster_"+this.count,jq:t}),n.each(n.jPlayer.event,function(n,r){i.options[n]!==t&&(i.element.bind(r+".jPlayer",i.options[n]),i.options[n]=t)}),this.require.audio=!1,this.require.video=!1,n.each(this.formats,function(n,t){i.require[i.format[t].media]=!0}),this.options=this.require.video?n.extend(!0,{},this.optionsVideo,this.options):n.extend(!0,{},this.optionsAudio,this.options),this._setSize(),this.status.nativeVideoControls=this._uaBlocklist(this.options.nativeVideoControls),this.status.noFullWindow=this._uaBlocklist(this.options.noFullWindow),this.status.noVolume=this._uaBlocklist(this.options.noVolume),n.jPlayer.nativeFeatures.fullscreen.api.fullscreenEnabled&&this._fullscreenAddEventListeners(),this._restrictNativeVideoControls(),this.htmlElement.poster=document.createElement("img"),this.htmlElement.poster.id=this.internal.poster.id,this.htmlElement.poster.onload=function(){(!i.status.video||i.status.waitForPlay)&&i.internal.poster.jq.show()},this.element.append(this.htmlElement.poster),this.internal.poster.jq=n("#"+this.internal.poster.id),this.internal.poster.jq.css({width:this.status.width,height:this.status.height}),this.internal.poster.jq.hide(),this.internal.poster.jq.bind("click.jPlayer",function(){i._trigger(n.jPlayer.event.click)}),this.html.audio.available=!1,this.require.audio&&(this.htmlElement.audio=document.createElement("audio"),this.htmlElement.audio.id=this.internal.audio.id,this.html.audio.available=!!this.htmlElement.audio.canPlayType&&this._testCanPlayType(this.htmlElement.audio)),this.html.video.available=!1,this.require.video&&(this.htmlElement.video=document.createElement("video"),this.htmlElement.video.id=this.internal.video.id,this.html.video.available=!!this.htmlElement.video.canPlayType&&this._testCanPlayType(this.htmlElement.video)),this.flash.available=this._checkForFlash(10.1),this.html.canPlay={},this.aurora.canPlay={},this.flash.canPlay={},n.each(this.formats,function(t,r){i.html.canPlay[r]=i.html[i.format[r].media].available&&""!==i.htmlElement[i.format[r].media].canPlayType(i.format[r].codec);i.aurora.canPlay[r]=n.inArray(r,i.aurora.formats)>-1;i.flash.canPlay[r]=i.format[r].flashCanPlay&&i.flash.available}),this.html.desired=!1,this.aurora.desired=!1,this.flash.desired=!1,n.each(this.solutions,function(t,r){if(t===0)i[r].desired=!0;else{var u=!1,f=!1;n.each(i.formats,function(n,t){i[i.solutions[0]].canPlay[t]&&(i.format[t].media==="video"?f=!0:u=!0)});i[r].desired=i.require.audio&&!u||i.require.video&&!f}}),this.html.support={},this.aurora.support={},this.flash.support={},n.each(this.formats,function(n,t){i.html.support[t]=i.html.canPlay[t]&&i.html.desired;i.aurora.support[t]=i.aurora.canPlay[t]&&i.aurora.desired;i.flash.support[t]=i.flash.canPlay[t]&&i.flash.desired}),this.html.used=!1,this.aurora.used=!1,this.flash.used=!1,n.each(this.solutions,function(t,r){n.each(i.formats,function(n,t){if(i[r].support[t])return i[r].used=!0,!1})}),this._resetActive(),this._resetGate(),this._cssSelectorAncestor(this.options.cssSelectorAncestor),this.html.used||this.aurora.used||this.flash.used?this.css.jq.noSolution.length&&this.css.jq.noSolution.hide():(this._error({type:n.jPlayer.error.NO_SOLUTION,context:"{solution:'"+this.options.solution+"', supplied:'"+this.options.supplied+"'}",message:n.jPlayer.errorMsg.NO_SOLUTION,hint:n.jPlayer.errorHint.NO_SOLUTION}),this.css.jq.noSolution.length&&this.css.jq.noSolution.show()),this.flash.used){if(e="jQuery="+encodeURI(this.options.noConflict)+"&id="+encodeURI(this.internal.self.id)+"&vol="+this.options.volume+"&muted="+this.options.muted,n.jPlayer.browser.msie&&(Number(n.jPlayer.browser.version)<9||n.jPlayer.browser.documentMode<9))for(s='<object id="'+this.internal.flash.id+'" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="0" height="0" tabindex="-1"><\/object>',o=['<param name="movie" value="'+this.internal.flash.swf+'" />','<param name="FlashVars" value="'+e+'" />','<param name="allowScriptAccess" value="always" />','<param name="bgcolor" value="'+this.options.backgroundColor+'" />','<param name="wmode" value="'+this.options.wmode+'" />'],r=document.createElement(s),f=0;f<o.length;f++)r.appendChild(document.createElement(o[f]));else u=function(n,t,i){var r=document.createElement("param");r.setAttribute("name",t);r.setAttribute("value",i);n.appendChild(r)},r=document.createElement("object"),r.setAttribute("id",this.internal.flash.id),r.setAttribute("name",this.internal.flash.id),r.setAttribute("data",this.internal.flash.swf),r.setAttribute("type","application/x-shockwave-flash"),r.setAttribute("width","1"),r.setAttribute("height","1"),r.setAttribute("tabindex","-1"),u(r,"flashvars",e),u(r,"allowscriptaccess","always"),u(r,"bgcolor",this.options.backgroundColor),u(r,"wmode",this.options.wmode);this.element.append(r);this.internal.flash.jq=n(r)}this.status.playbackRateEnabled=this.html.used&&!this.flash.used?this._testPlaybackRate("audio"):!1;this._updatePlaybackRate();this.html.used&&(this.html.audio.available&&(this._addHtmlEventListeners(this.htmlElement.audio,this.html.audio),this.element.append(this.htmlElement.audio),this.internal.audio.jq=n("#"+this.internal.audio.id)),this.html.video.available&&(this._addHtmlEventListeners(this.htmlElement.video,this.html.video),this.element.append(this.htmlElement.video),this.internal.video.jq=n("#"+this.internal.video.id),this.status.nativeVideoControls?this.internal.video.jq.css({width:this.status.width,height:this.status.height}):this.internal.video.jq.css({width:"0px",height:"0px"}),this.internal.video.jq.bind("click.jPlayer",function(){i._trigger(n.jPlayer.event.click)})));this.aurora.used;this.options.emulateHtml&&this._emulateHtmlBridge();(this.html.used||this.aurora.used)&&!this.flash.used&&setTimeout(function(){i.internal.ready=!0;i.version.flash="n/a";i._trigger(n.jPlayer.event.repeat);i._trigger(n.jPlayer.event.ready)},100);this._updateNativeVideoControls();this.css.jq.videoPlay.length&&this.css.jq.videoPlay.hide();n.jPlayer.prototype.count++},destroy:function(){this.clearMedia();this._removeUiClass();this.css.jq.currentTime.length&&this.css.jq.currentTime.text("");this.css.jq.duration.length&&this.css.jq.duration.text("");n.each(this.css.jq,function(n,t){t.length&&t.unbind(".jPlayer")});this.internal.poster.jq.unbind(".jPlayer");this.internal.video.jq&&this.internal.video.jq.unbind(".jPlayer");this._fullscreenRemoveEventListeners();this===n.jPlayer.focus&&(n.jPlayer.focus=null);this.options.emulateHtml&&this._destroyHtmlBridge();this.element.removeData("jPlayer");this.element.unbind(".jPlayer");this.element.empty();delete this.instances[this.internal.instance]},destroyRemoved:function(){var t=this;n.each(this.instances,function(n,i){t.element!==i&&(i.data("jPlayer")||(i.jPlayer("destroy"),delete t.instances[n]))})},enable:function(){},disable:function(){},_testCanPlayType:function(n){try{return n.canPlayType(this.format.mp3.codec),!0}catch(t){return!1}},_testPlaybackRate:function(n){var t,i=.5;n=typeof n=="string"?n:"audio";t=document.createElement(n);try{return"playbackRate"in t?(t.playbackRate=i,t.playbackRate===i):!1}catch(r){return!1}},_uaBlocklist:function(t){var r=navigator.userAgent.toLowerCase(),i=!1;return n.each(t,function(n,t){if(t&&t.test(r))return i=!0,!1}),i},_restrictNativeVideoControls:function(){this.require.audio&&this.status.nativeVideoControls&&(this.status.nativeVideoControls=!1,this.status.noFullWindow=!0)},_updateNativeVideoControls:function(){this.html.video.available&&this.html.used&&(this.htmlElement.video.controls=this.status.nativeVideoControls,this._updateAutohide(),this.status.nativeVideoControls&&this.require.video?(this.internal.poster.jq.hide(),this.internal.video.jq.css({width:this.status.width,height:this.status.height})):this.status.waitForPlay&&this.status.video&&(this.internal.poster.jq.show(),this.internal.video.jq.css({width:"0px",height:"0px"})))},_addHtmlEventListeners:function(t,i){var r=this;t.preload=this.options.preload;t.muted=this.options.muted;t.volume=this.options.volume;this.status.playbackRateEnabled&&(t.defaultPlaybackRate=this.options.defaultPlaybackRate,t.playbackRate=this.options.playbackRate);t.addEventListener("progress",function(){i.gate&&(r.internal.cmdsIgnored&&this.readyState>0&&(r.internal.cmdsIgnored=!1),r._getHtmlStatus(t),r._updateInterface(),r._trigger(n.jPlayer.event.progress))},!1);t.addEventListener("loadeddata",function(){i.gate&&(r.androidFix.setMedia=!1,r.androidFix.play&&(r.androidFix.play=!1,r.play(r.androidFix.time)),r.androidFix.pause&&(r.androidFix.pause=!1,r.pause(r.androidFix.time)),r._trigger(n.jPlayer.event.loadeddata))},!1);t.addEventListener("timeupdate",function(){i.gate&&(r._getHtmlStatus(t),r._updateInterface(),r._trigger(n.jPlayer.event.timeupdate))},!1);t.addEventListener("durationchange",function(){i.gate&&(r._getHtmlStatus(t),r._updateInterface(),r._trigger(n.jPlayer.event.durationchange))},!1);t.addEventListener("play",function(){i.gate&&(r._updateButtons(!0),r._html_checkWaitForPlay(),r._trigger(n.jPlayer.event.play))},!1);t.addEventListener("playing",function(){i.gate&&(r._updateButtons(!0),r._seeked(),r._trigger(n.jPlayer.event.playing))},!1);t.addEventListener("pause",function(){i.gate&&(r._updateButtons(!1),r._trigger(n.jPlayer.event.pause))},!1);t.addEventListener("waiting",function(){i.gate&&(r._seeking(),r._trigger(n.jPlayer.event.waiting))},!1);t.addEventListener("seeking",function(){i.gate&&(r._seeking(),r._trigger(n.jPlayer.event.seeking))},!1);t.addEventListener("seeked",function(){i.gate&&(r._seeked(),r._trigger(n.jPlayer.event.seeked))},!1);t.addEventListener("volumechange",function(){i.gate&&(r.options.volume=t.volume,r.options.muted=t.muted,r._updateMute(),r._updateVolume(),r._trigger(n.jPlayer.event.volumechange))},!1);t.addEventListener("ratechange",function(){i.gate&&(r.options.defaultPlaybackRate=t.defaultPlaybackRate,r.options.playbackRate=t.playbackRate,r._updatePlaybackRate(),r._trigger(n.jPlayer.event.ratechange))},!1);t.addEventListener("suspend",function(){i.gate&&(r._seeked(),r._trigger(n.jPlayer.event.suspend))},!1);t.addEventListener("ended",function(){i.gate&&(n.jPlayer.browser.webkit||(r.htmlElement.media.currentTime=0),r.htmlElement.media.pause(),r._updateButtons(!1),r._getHtmlStatus(t,!0),r._updateInterface(),r._trigger(n.jPlayer.event.ended))},!1);t.addEventListener("error",function(){i.gate&&(r._updateButtons(!1),r._seeked(),r.status.srcSet&&(clearTimeout(r.internal.htmlDlyCmdId),r.status.waitForLoad=!0,r.status.waitForPlay=!0,r.status.video&&!r.status.nativeVideoControls&&r.internal.video.jq.css({width:"0px",height:"0px"}),r._validString(r.status.media.poster)&&!r.status.nativeVideoControls&&r.internal.poster.jq.show(),r.css.jq.videoPlay.length&&r.css.jq.videoPlay.show(),r._error({type:n.jPlayer.error.URL,context:r.status.src,message:n.jPlayer.errorMsg.URL,hint:n.jPlayer.errorHint.URL})))},!1);n.each(n.jPlayer.htmlEvent,function(u,f){t.addEventListener(this,function(){i.gate&&r._trigger(n.jPlayer.event[f])},!1)})},_addAuroraEventListeners:function(t,i){var r=this;t.volume=this.options.volume*100;t.on("progress",function(){i.gate&&(r.internal.cmdsIgnored&&this.readyState>0&&(r.internal.cmdsIgnored=!1),r._getAuroraStatus(t),r._updateInterface(),r._trigger(n.jPlayer.event.progress),t.duration>0&&r._trigger(n.jPlayer.event.timeupdate))},!1);t.on("ready",function(){i.gate&&r._trigger(n.jPlayer.event.loadeddata)},!1);t.on("duration",function(){i.gate&&(r._getAuroraStatus(t),r._updateInterface(),r._trigger(n.jPlayer.event.durationchange))},!1);t.on("end",function(){i.gate&&(r._updateButtons(!1),r._getAuroraStatus(t,!0),r._updateInterface(),r._trigger(n.jPlayer.event.ended))},!1);t.on("error",function(){i.gate&&(r._updateButtons(!1),r._seeked(),r.status.srcSet&&(r.status.waitForLoad=!0,r.status.waitForPlay=!0,r.status.video&&!r.status.nativeVideoControls&&r.internal.video.jq.css({width:"0px",height:"0px"}),r._validString(r.status.media.poster)&&!r.status.nativeVideoControls&&r.internal.poster.jq.show(),r.css.jq.videoPlay.length&&r.css.jq.videoPlay.show(),r._error({type:n.jPlayer.error.URL,context:r.status.src,message:n.jPlayer.errorMsg.URL,hint:n.jPlayer.errorHint.URL})))},!1)},_getHtmlStatus:function(n,t){var i=0,r=0,f=0,u=0;isFinite(n.duration)&&(this.status.duration=n.duration);i=n.currentTime;r=this.status.duration>0?100*i/this.status.duration:0;typeof n.seekable=="object"&&n.seekable.length>0?(f=this.status.duration>0?100*n.seekable.end(n.seekable.length-1)/this.status.duration:100,u=this.status.duration>0?100*n.currentTime/n.seekable.end(n.seekable.length-1):0):(f=100,u=r);t&&(i=0,u=0,r=0);this.status.seekPercent=f;this.status.currentPercentRelative=u;this.status.currentPercentAbsolute=r;this.status.currentTime=i;this.status.remaining=this.status.duration-this.status.currentTime;this.status.videoWidth=n.videoWidth;this.status.videoHeight=n.videoHeight;this.status.readyState=n.readyState;this.status.networkState=n.networkState;this.status.playbackRate=n.playbackRate;this.status.ended=n.ended},_getAuroraStatus:function(n,t){var i=0,r=0,f=0,u=0;this.status.duration=n.duration/1e3;i=n.currentTime/1e3;r=this.status.duration>0?100*i/this.status.duration:0;n.buffered>0?(f=this.status.duration>0?n.buffered*this.status.duration/this.status.duration:100,u=this.status.duration>0?i/(n.buffered*this.status.duration):0):(f=100,u=r);t&&(i=0,u=0,r=0);this.status.seekPercent=f;this.status.currentPercentRelative=u;this.status.currentPercentAbsolute=r;this.status.currentTime=i;this.status.remaining=this.status.duration-this.status.currentTime;this.status.readyState=4;this.status.networkState=0;this.status.playbackRate=1;this.status.ended=!1},_resetStatus:function(){this.status=n.extend({},this.status,n.jPlayer.prototype.status)},_trigger:function(t,i,r){var u=n.Event(t);u.jPlayer={};u.jPlayer.version=n.extend({},this.version);u.jPlayer.options=n.extend(!0,{},this.options);u.jPlayer.status=n.extend(!0,{},this.status);u.jPlayer.html=n.extend(!0,{},this.html);u.jPlayer.aurora=n.extend(!0,{},this.aurora);u.jPlayer.flash=n.extend(!0,{},this.flash);i&&(u.jPlayer.error=n.extend({},i));r&&(u.jPlayer.warning=n.extend({},r));this.element.trigger(u)},jPlayerFlashEvent:function(t,i){if(t===n.jPlayer.event.ready)if(this.internal.ready){if(this.flash.gate){if(this.status.srcSet){var r=this.status.currentTime,u=this.status.paused;this.setMedia(this.status.media);this.volumeWorker(this.options.volume);r>0&&(u?this.pause(r):this.play(r))}this._trigger(n.jPlayer.event.flashreset)}}else this.internal.ready=!0,this.internal.flash.jq.css({width:"0px",height:"0px"}),this.version.flash=i.version,this.version.needFlash!==this.version.flash&&this._error({type:n.jPlayer.error.VERSION,context:this.version.flash,message:n.jPlayer.errorMsg.VERSION+this.version.flash,hint:n.jPlayer.errorHint.VERSION}),this._trigger(n.jPlayer.event.repeat),this._trigger(t);if(this.flash.gate)switch(t){case n.jPlayer.event.progress:this._getFlashStatus(i);this._updateInterface();this._trigger(t);break;case n.jPlayer.event.timeupdate:this._getFlashStatus(i);this._updateInterface();this._trigger(t);break;case n.jPlayer.event.play:this._seeked();this._updateButtons(!0);this._trigger(t);break;case n.jPlayer.event.pause:this._updateButtons(!1);this._trigger(t);break;case n.jPlayer.event.ended:this._updateButtons(!1);this._trigger(t);break;case n.jPlayer.event.click:this._trigger(t);break;case n.jPlayer.event.error:this.status.waitForLoad=!0;this.status.waitForPlay=!0;this.status.video&&this.internal.flash.jq.css({width:"0px",height:"0px"});this._validString(this.status.media.poster)&&this.internal.poster.jq.show();this.css.jq.videoPlay.length&&this.status.video&&this.css.jq.videoPlay.show();this.status.video?this._flash_setVideo(this.status.media):this._flash_setAudio(this.status.media);this._updateButtons(!1);this._error({type:n.jPlayer.error.URL,context:i.src,message:n.jPlayer.errorMsg.URL,hint:n.jPlayer.errorHint.URL});break;case n.jPlayer.event.seeking:this._seeking();this._trigger(t);break;case n.jPlayer.event.seeked:this._seeked();this._trigger(t);break;case n.jPlayer.event.ready:break;default:this._trigger(t)}return!1},_getFlashStatus:function(n){this.status.seekPercent=n.seekPercent;this.status.currentPercentRelative=n.currentPercentRelative;this.status.currentPercentAbsolute=n.currentPercentAbsolute;this.status.currentTime=n.currentTime;this.status.duration=n.duration;this.status.remaining=n.duration-n.currentTime;this.status.videoWidth=n.videoWidth;this.status.videoHeight=n.videoHeight;this.status.readyState=4;this.status.networkState=0;this.status.playbackRate=1;this.status.ended=!1},_updateButtons:function(n){n===t?n=!this.status.paused:this.status.paused=!n;n?this.addStateClass("playing"):this.removeStateClass("playing");!this.status.noFullWindow&&this.options.fullWindow?this.addStateClass("fullScreen"):this.removeStateClass("fullScreen");this.options.loop?this.addStateClass("looped"):this.removeStateClass("looped");this.css.jq.play.length&&this.css.jq.pause.length&&(n?(this.css.jq.play.hide(),this.css.jq.pause.show()):(this.css.jq.play.show(),this.css.jq.pause.hide()));this.css.jq.restoreScreen.length&&this.css.jq.fullScreen.length&&(this.status.noFullWindow?(this.css.jq.fullScreen.hide(),this.css.jq.restoreScreen.hide()):this.options.fullWindow?(this.css.jq.fullScreen.hide(),this.css.jq.restoreScreen.show()):(this.css.jq.fullScreen.show(),this.css.jq.restoreScreen.hide()));this.css.jq.repeat.length&&this.css.jq.repeatOff.length&&(this.options.loop?(this.css.jq.repeat.hide(),this.css.jq.repeatOff.show()):(this.css.jq.repeat.show(),this.css.jq.repeatOff.hide()))},_updateInterface:function(){var t;this.css.jq.seekBar.length&&this.css.jq.seekBar.width(this.status.seekPercent+"%");this.css.jq.playBar.length&&(this.options.smoothPlayBar?this.css.jq.playBar.stop().animate({width:this.status.currentPercentAbsolute+"%"},250,"linear"):this.css.jq.playBar.width(this.status.currentPercentRelative+"%"));t="";this.css.jq.currentTime.length&&(t=this._convertTime(this.status.currentTime),t!==this.css.jq.currentTime.text()&&this.css.jq.currentTime.text(this._convertTime(this.status.currentTime)));var n="",i=this.status.duration,r=this.status.remaining;this.css.jq.duration.length&&(typeof this.status.media.duration=="string"?n=this.status.media.duration:(typeof this.status.media.duration=="number"&&(i=this.status.media.duration,r=i-this.status.currentTime),n=this.options.remainingDuration?(r>0?"-":"")+this._convertTime(r):this._convertTime(i)),n!==this.css.jq.duration.text()&&this.css.jq.duration.text(n))},_convertTime:r.prototype.time,_seeking:function(){this.css.jq.seekBar.length&&this.css.jq.seekBar.addClass("jp-seeking-bg");this.addStateClass("seeking")},_seeked:function(){this.css.jq.seekBar.length&&this.css.jq.seekBar.removeClass("jp-seeking-bg");this.removeStateClass("seeking")},_resetGate:function(){this.html.audio.gate=!1;this.html.video.gate=!1;this.aurora.gate=!1;this.flash.gate=!1},_resetActive:function(){this.html.active=!1;this.aurora.active=!1;this.flash.active=!1},_escapeHtml:function(n){return n.split("&").join("&amp;").split("<").join("&lt;").split(">").join("&gt;").split('"').join("&quot;")},_qualifyURL:function(n){var t=document.createElement("div");return t.innerHTML='<a href="'+this._escapeHtml(n)+'">x<\/a>',t.firstChild.href},_absoluteMediaUrls:function(t){var i=this;return n.each(t,function(n,r){r&&i.format[n]&&r.substr(0,5)!=="data:"&&(t[n]=i._qualifyURL(r))}),t},addStateClass:function(n){this.ancestorJq.length&&this.ancestorJq.addClass(this.options.stateClass[n])},removeStateClass:function(n){this.ancestorJq.length&&this.ancestorJq.removeClass(this.options.stateClass[n])},setMedia:function(t){var i=this,r=!1,u=this.status.media.poster!==t.poster;this._resetMedia();this._resetGate();this._resetActive();this.androidFix.setMedia=!1;this.androidFix.play=!1;this.androidFix.pause=!1;t=this._absoluteMediaUrls(t);n.each(this.formats,function(u,f){var e=i.format[f].media==="video";return n.each(i.solutions,function(u,o){if(i[o].support[f]&&i._validString(t[f])){var s=o==="html",h=o==="aurora";return e?(s?(i.html.video.gate=!0,i._html_setVideo(t),i.html.active=!0):(i.flash.gate=!0,i._flash_setVideo(t),i.flash.active=!0),i.css.jq.videoPlay.length&&i.css.jq.videoPlay.show(),i.status.video=!0):(s?(i.html.audio.gate=!0,i._html_setAudio(t),i.html.active=!0,n.jPlayer.platform.android&&(i.androidFix.setMedia=!0)):h?(i.aurora.gate=!0,i._aurora_setAudio(t),i.aurora.active=!0):(i.flash.gate=!0,i._flash_setAudio(t),i.flash.active=!0),i.css.jq.videoPlay.length&&i.css.jq.videoPlay.hide(),i.status.video=!1),r=!0,!1}}),r?!1:void 0});r?(this.status.nativeVideoControls&&this.html.video.gate||this._validString(t.poster)&&(u?this.htmlElement.poster.src=t.poster:this.internal.poster.jq.show()),typeof t.title=="string"&&(this.css.jq.title.length&&this.css.jq.title.html(t.title),this.htmlElement.audio&&this.htmlElement.audio.setAttribute("title",t.title),this.htmlElement.video&&this.htmlElement.video.setAttribute("title",t.title)),this.status.srcSet=!0,this.status.media=n.extend({},t),this._updateButtons(!1),this._updateInterface(),this._trigger(n.jPlayer.event.setmedia)):this._error({type:n.jPlayer.error.NO_SUPPORT,context:"{supplied:'"+this.options.supplied+"'}",message:n.jPlayer.errorMsg.NO_SUPPORT,hint:n.jPlayer.errorHint.NO_SUPPORT})},_resetMedia:function(){this._resetStatus();this._updateButtons(!1);this._updateInterface();this._seeked();this.internal.poster.jq.hide();clearTimeout(this.internal.htmlDlyCmdId);this.html.active?this._html_resetMedia():this.aurora.active?this._aurora_resetMedia():this.flash.active&&this._flash_resetMedia()},clearMedia:function(){this._resetMedia();this.html.active?this._html_clearMedia():this.aurora.active?this._aurora_clearMedia():this.flash.active&&this._flash_clearMedia();this._resetGate();this._resetActive()},load:function(){this.status.srcSet?this.html.active?this._html_load():this.aurora.active?this._aurora_load():this.flash.active&&this._flash_load():this._urlNotSetError("load")},focus:function(){this.options.keyEnabled&&(n.jPlayer.focus=this)},play:function(n){var t=typeof n=="object";t&&this.options.useStateClassSkin&&!this.status.paused?this.pause(n):(n=typeof n=="number"?n:NaN,this.status.srcSet?(this.focus(),this.html.active?this._html_play(n):this.aurora.active?this._aurora_play(n):this.flash.active&&this._flash_play(n)):this._urlNotSetError("play"))},videoPlay:function(){this.play()},pause:function(n){n=typeof n=="number"?n:NaN;this.status.srcSet?this.html.active?this._html_pause(n):this.aurora.active?this._aurora_pause(n):this.flash.active&&this._flash_pause(n):this._urlNotSetError("pause")},tellOthers:function(t,i){var r=this,u=typeof i=="function",f=Array.prototype.slice.call(arguments);typeof t=="string"&&(u&&f.splice(1,1),n.jPlayer.prototype.destroyRemoved(),n.each(this.instances,function(){r.element!==this&&(!u||i.call(this.data("jPlayer"),r))&&this.jPlayer.apply(this,f)}))},pauseOthers:function(n){this.tellOthers("pause",function(){return this.status.srcSet},n)},stop:function(){this.status.srcSet?this.html.active?this._html_pause(0):this.aurora.active?this._aurora_pause(0):this.flash.active&&this._flash_pause(0):this._urlNotSetError("stop")},playHead:function(n){n=this._limitValue(n,0,100);this.status.srcSet?this.html.active?this._html_playHead(n):this.aurora.active?this._aurora_playHead(n):this.flash.active&&this._flash_playHead(n):this._urlNotSetError("playHead")},_muted:function(n){this.mutedWorker(n);this.options.globalVolume&&this.tellOthers("mutedWorker",function(){return this.options.globalVolume},n)},mutedWorker:function(t){this.options.muted=t;this.html.used&&this._html_setProperty("muted",t);this.aurora.used&&this._aurora_mute(t);this.flash.used&&this._flash_mute(t);this.html.video.gate||this.html.audio.gate||(this._updateMute(t),this._updateVolume(this.options.volume),this._trigger(n.jPlayer.event.volumechange))},mute:function(n){var i=typeof n=="object";i&&this.options.useStateClassSkin&&this.options.muted?this._muted(!1):(n=n===t?!0:!!n,this._muted(n))},unmute:function(n){n=n===t?!0:!!n;this._muted(!n)},_updateMute:function(n){n===t&&(n=this.options.muted);n?this.addStateClass("muted"):this.removeStateClass("muted");this.css.jq.mute.length&&this.css.jq.unmute.length&&(this.status.noVolume?(this.css.jq.mute.hide(),this.css.jq.unmute.hide()):n?(this.css.jq.mute.hide(),this.css.jq.unmute.show()):(this.css.jq.mute.show(),this.css.jq.unmute.hide()))},volume:function(n){this.volumeWorker(n);this.options.globalVolume&&this.tellOthers("volumeWorker",function(){return this.options.globalVolume},n)},volumeWorker:function(t){t=this._limitValue(t,0,1);this.options.volume=t;this.html.used&&this._html_setProperty("volume",t);this.aurora.used&&this._aurora_volume(t);this.flash.used&&this._flash_volume(t);this.html.video.gate||this.html.audio.gate||(this._updateVolume(t),this._trigger(n.jPlayer.event.volumechange))},volumeBar:function(t){if(this.css.jq.volumeBar.length){var i=n(t.currentTarget),r=i.offset(),u=t.pageX-r.left,f=i.width(),e=i.height()-t.pageY+r.top,o=i.height();this.options.verticalVolume?this.volume(e/o):this.volume(u/f)}this.options.muted&&this._muted(!1)},_updateVolume:function(n){n===t&&(n=this.options.volume);n=this.options.muted?0:n;this.status.noVolume?(this.addStateClass("noVolume"),this.css.jq.volumeBar.length&&this.css.jq.volumeBar.hide(),this.css.jq.volumeBarValue.length&&this.css.jq.volumeBarValue.hide(),this.css.jq.volumeMax.length&&this.css.jq.volumeMax.hide()):(this.removeStateClass("noVolume"),this.css.jq.volumeBar.length&&this.css.jq.volumeBar.show(),this.css.jq.volumeBarValue.length&&(this.css.jq.volumeBarValue.show(),this.css.jq.volumeBarValue[this.options.verticalVolume?"height":"width"](n*100+"%")),this.css.jq.volumeMax.length&&this.css.jq.volumeMax.show())},volumeMax:function(){this.volume(1);this.options.muted&&this._muted(!1)},_cssSelectorAncestor:function(t){var i=this;this.options.cssSelectorAncestor=t;this._removeUiClass();this.ancestorJq=t?n(t):[];t&&this.ancestorJq.length!==1&&this._warning({type:n.jPlayer.warning.CSS_SELECTOR_COUNT,context:t,message:n.jPlayer.warningMsg.CSS_SELECTOR_COUNT+this.ancestorJq.length+" found for cssSelectorAncestor.",hint:n.jPlayer.warningHint.CSS_SELECTOR_COUNT});this._addUiClass();n.each(this.options.cssSelector,function(n,t){i._cssSelector(n,t)});this._updateInterface();this._updateButtons();this._updateAutohide();this._updateVolume();this._updateMute()},_cssSelector:function(t,i){var r=this,u;typeof i=="string"?n.jPlayer.prototype.options.cssSelector[t]?(this.css.jq[t]&&this.css.jq[t].length&&this.css.jq[t].unbind(".jPlayer"),this.options.cssSelector[t]=i,this.css.cs[t]=this.options.cssSelectorAncestor+" "+i,this.css.jq[t]=i?n(this.css.cs[t]):[],this.css.jq[t].length&&this[t]&&(u=function(i){i.preventDefault();r[t](i);r.options.autoBlur?n(this).blur():n(this).focus()},this.css.jq[t].bind("click.jPlayer",u)),i&&this.css.jq[t].length!==1&&this._warning({type:n.jPlayer.warning.CSS_SELECTOR_COUNT,context:this.css.cs[t],message:n.jPlayer.warningMsg.CSS_SELECTOR_COUNT+this.css.jq[t].length+" found for "+t+" method.",hint:n.jPlayer.warningHint.CSS_SELECTOR_COUNT})):this._warning({type:n.jPlayer.warning.CSS_SELECTOR_METHOD,context:t,message:n.jPlayer.warningMsg.CSS_SELECTOR_METHOD,hint:n.jPlayer.warningHint.CSS_SELECTOR_METHOD}):this._warning({type:n.jPlayer.warning.CSS_SELECTOR_STRING,context:i,message:n.jPlayer.warningMsg.CSS_SELECTOR_STRING,hint:n.jPlayer.warningHint.CSS_SELECTOR_STRING})},duration:function(n){this.options.toggleDuration&&(this.options.captureDuration&&n.stopPropagation(),this._setOption("remainingDuration",!this.options.remainingDuration))},seekBar:function(t){if(this.css.jq.seekBar.length){var i=n(t.currentTarget),r=i.offset(),u=t.pageX-r.left,f=i.width(),e=100*u/f;this.playHead(e)}},playbackRate:function(n){this._setOption("playbackRate",n)},playbackRateBar:function(t){if(this.css.jq.playbackRateBar.length){var i=n(t.currentTarget),r=i.offset(),e=t.pageX-r.left,o=i.width(),s=i.height()-t.pageY+r.top,h=i.height(),u,f;u=this.options.verticalPlaybackRate?s/h:e/o;f=u*(this.options.maxPlaybackRate-this.options.minPlaybackRate)+this.options.minPlaybackRate;this.playbackRate(f)}},_updatePlaybackRate:function(){var n=this.options.playbackRate,t=(n-this.options.minPlaybackRate)/(this.options.maxPlaybackRate-this.options.minPlaybackRate);this.status.playbackRateEnabled?(this.css.jq.playbackRateBar.length&&this.css.jq.playbackRateBar.show(),this.css.jq.playbackRateBarValue.length&&(this.css.jq.playbackRateBarValue.show(),this.css.jq.playbackRateBarValue[this.options.verticalPlaybackRate?"height":"width"](t*100+"%"))):(this.css.jq.playbackRateBar.length&&this.css.jq.playbackRateBar.hide(),this.css.jq.playbackRateBarValue.length&&this.css.jq.playbackRateBarValue.hide())},repeat:function(n){var t=typeof n=="object";t&&this.options.useStateClassSkin&&this.options.loop?this._loop(!1):this._loop(!0)},repeatOff:function(){this._loop(!1)},_loop:function(t){this.options.loop!==t&&(this.options.loop=t,this._updateButtons(),this._trigger(n.jPlayer.event.repeat))},option:function(i,r){var h=i,u,e,o,s,f;if(arguments.length===0)return n.extend(!0,{},this.options);if(typeof i=="string"){if(u=i.split("."),r===t){for(e=n.extend(!0,{},this.options),o=0;o<u.length;o++)if(e[u[o]]!==t)e=e[u[o]];else return this._warning({type:n.jPlayer.warning.OPTION_KEY,context:i,message:n.jPlayer.warningMsg.OPTION_KEY,hint:n.jPlayer.warningHint.OPTION_KEY}),t;return e}for(h={},s=h,f=0;f<u.length;f++)f<u.length-1?(s[u[f]]={},s=s[u[f]]):s[u[f]]=r}return this._setOptions(h),this},_setOptions:function(t){var i=this;return n.each(t,function(n,t){i._setOption(n,t)}),this},_setOption:function(t,i){var u=this,r;switch(t){case"volume":this.volume(i);break;case"muted":this._muted(i);break;case"globalVolume":this.options[t]=i;break;case"cssSelectorAncestor":this._cssSelectorAncestor(i);break;case"cssSelector":n.each(i,function(n,t){u._cssSelector(n,t)});break;case"playbackRate":this.options[t]=i=this._limitValue(i,this.options.minPlaybackRate,this.options.maxPlaybackRate);this.html.used&&this._html_setProperty("playbackRate",i);this._updatePlaybackRate();break;case"defaultPlaybackRate":this.options[t]=i=this._limitValue(i,this.options.minPlaybackRate,this.options.maxPlaybackRate);this.html.used&&this._html_setProperty("defaultPlaybackRate",i);this._updatePlaybackRate();break;case"minPlaybackRate":this.options[t]=i=this._limitValue(i,.1,this.options.maxPlaybackRate-.1);this._updatePlaybackRate();break;case"maxPlaybackRate":this.options[t]=i=this._limitValue(i,this.options.minPlaybackRate+.1,16);this._updatePlaybackRate();break;case"fullScreen":this.options[t]!==i&&(r=n.jPlayer.nativeFeatures.fullscreen.used.webkitVideo,r&&(!r||this.status.waitForPlay)||(r||(this.options[t]=i),i?this._requestFullscreen():this._exitFullscreen(),r||this._setOption("fullWindow",i)));break;case"fullWindow":this.options[t]!==i&&(this._removeUiClass(),this.options[t]=i,this._refreshSize());break;case"size":this.options.fullWindow||this.options[t].cssClass===i.cssClass||this._removeUiClass();this.options[t]=n.extend({},this.options[t],i);this._refreshSize();break;case"sizeFull":this.options.fullWindow&&this.options[t].cssClass!==i.cssClass&&this._removeUiClass();this.options[t]=n.extend({},this.options[t],i);this._refreshSize();break;case"autohide":this.options[t]=n.extend({},this.options[t],i);this._updateAutohide();break;case"loop":this._loop(i);break;case"remainingDuration":this.options[t]=i;this._updateInterface();break;case"toggleDuration":this.options[t]=i;break;case"nativeVideoControls":this.options[t]=n.extend({},this.options[t],i);this.status.nativeVideoControls=this._uaBlocklist(this.options.nativeVideoControls);this._restrictNativeVideoControls();this._updateNativeVideoControls();break;case"noFullWindow":this.options[t]=n.extend({},this.options[t],i);this.status.nativeVideoControls=this._uaBlocklist(this.options.nativeVideoControls);this.status.noFullWindow=this._uaBlocklist(this.options.noFullWindow);this._restrictNativeVideoControls();this._updateButtons();break;case"noVolume":this.options[t]=n.extend({},this.options[t],i);this.status.noVolume=this._uaBlocklist(this.options.noVolume);this._updateVolume();this._updateMute();break;case"emulateHtml":this.options[t]!==i&&(this.options[t]=i,i?this._emulateHtmlBridge():this._destroyHtmlBridge());break;case"timeFormat":this.options[t]=n.extend({},this.options[t],i);break;case"keyEnabled":this.options[t]=i;i||this!==n.jPlayer.focus||(n.jPlayer.focus=null);break;case"keyBindings":this.options[t]=n.extend(!0,{},this.options[t],i);break;case"audioFullScreen":this.options[t]=i;break;case"autoBlur":this.options[t]=i}return this},_refreshSize:function(){this._setSize();this._addUiClass();this._updateSize();this._updateButtons();this._updateAutohide();this._trigger(n.jPlayer.event.resize)},_setSize:function(){this.options.fullWindow?(this.status.width=this.options.sizeFull.width,this.status.height=this.options.sizeFull.height,this.status.cssClass=this.options.sizeFull.cssClass):(this.status.width=this.options.size.width,this.status.height=this.options.size.height,this.status.cssClass=this.options.size.cssClass);this.element.css({width:this.status.width,height:this.status.height})},_addUiClass:function(){this.ancestorJq.length&&this.ancestorJq.addClass(this.status.cssClass)},_removeUiClass:function(){this.ancestorJq.length&&this.ancestorJq.removeClass(this.status.cssClass)},_updateSize:function(){this.internal.poster.jq.css({width:this.status.width,height:this.status.height});!this.status.waitForPlay&&this.html.active&&this.status.video||this.html.video.available&&this.html.used&&this.status.nativeVideoControls?this.internal.video.jq.css({width:this.status.width,height:this.status.height}):!this.status.waitForPlay&&this.flash.active&&this.status.video&&this.internal.flash.jq.css({width:this.status.width,height:this.status.height})},_updateAutohide:function(){var n=this,t=".jPlayerAutohide",i="mousemove.jPlayer"+t,r=function(t){var i=!1,r,u;typeof n.internal.mouse!="undefined"?(r=n.internal.mouse.x-t.pageX,u=n.internal.mouse.y-t.pageY,i=Math.floor(r)>0||Math.floor(u)>0):i=!0;n.internal.mouse={x:t.pageX,y:t.pageY};i&&n.css.jq.gui.fadeIn(n.options.autohide.fadeIn,function(){clearTimeout(n.internal.autohideId);n.internal.autohideId=setTimeout(function(){n.css.jq.gui.fadeOut(n.options.autohide.fadeOut)},n.options.autohide.hold)})};this.css.jq.gui.length&&(this.css.jq.gui.stop(!0,!0),clearTimeout(this.internal.autohideId),delete this.internal.mouse,this.element.unbind(t),this.css.jq.gui.unbind(t),this.status.nativeVideoControls?this.css.jq.gui.hide():this.options.fullWindow&&this.options.autohide.full||!this.options.fullWindow&&this.options.autohide.restored?(this.element.bind(i,r),this.css.jq.gui.bind(i,r),this.css.jq.gui.hide()):this.css.jq.gui.show())},fullScreen:function(n){var t=typeof n=="object";t&&this.options.useStateClassSkin&&this.options.fullScreen?this._setOption("fullScreen",!1):this._setOption("fullScreen",!0)},restoreScreen:function(){this._setOption("fullScreen",!1)},_fullscreenAddEventListeners:function(){var i=this,t=n.jPlayer.nativeFeatures.fullscreen;t.api.fullscreenEnabled&&t.event.fullscreenchange&&(typeof this.internal.fullscreenchangeHandler!="function"&&(this.internal.fullscreenchangeHandler=function(){i._fullscreenchange()}),document.addEventListener(t.event.fullscreenchange,this.internal.fullscreenchangeHandler,!1))},_fullscreenRemoveEventListeners:function(){var t=n.jPlayer.nativeFeatures.fullscreen;this.internal.fullscreenchangeHandler&&document.removeEventListener(t.event.fullscreenchange,this.internal.fullscreenchangeHandler,!1)},_fullscreenchange:function(){this.options.fullScreen&&!n.jPlayer.nativeFeatures.fullscreen.api.fullscreenElement()&&this._setOption("fullScreen",!1)},_requestFullscreen:function(){var i=this.ancestorJq.length?this.ancestorJq[0]:this.element[0],t=n.jPlayer.nativeFeatures.fullscreen;t.used.webkitVideo&&(i=this.htmlElement.video);t.api.fullscreenEnabled&&t.api.requestFullscreen(i)},_exitFullscreen:function(){var t=n.jPlayer.nativeFeatures.fullscreen,i;t.used.webkitVideo&&(i=this.htmlElement.video);t.api.fullscreenEnabled&&t.api.exitFullscreen(i)},_html_initMedia:function(t){var i=n(this.htmlElement.media).empty();n.each(t.track||[],function(n,t){var r=document.createElement("track");r.setAttribute("kind",t.kind?t.kind:"");r.setAttribute("src",t.src?t.src:"");r.setAttribute("srclang",t.srclang?t.srclang:"");r.setAttribute("label",t.label?t.label:"");t.def&&r.setAttribute("default",t.def);i.append(r)});this.htmlElement.media.src=this.status.src;this.options.preload!=="none"&&this._html_load();this._trigger(n.jPlayer.event.timeupdate)},_html_setFormat:function(t){var i=this;n.each(this.formats,function(n,r){if(i.html.support[r]&&t[r])return i.status.src=t[r],i.status.format[r]=!0,i.status.formatType=r,!1})},_html_setAudio:function(n){this._html_setFormat(n);this.htmlElement.media=this.htmlElement.audio;this._html_initMedia(n)},_html_setVideo:function(n){this._html_setFormat(n);this.status.nativeVideoControls&&(this.htmlElement.video.poster=this._validString(n.poster)?n.poster:"");this.htmlElement.media=this.htmlElement.video;this._html_initMedia(n)},_html_resetMedia:function(){this.htmlElement.media&&(this.htmlElement.media.id!==this.internal.video.id||this.status.nativeVideoControls||this.internal.video.jq.css({width:"0px",height:"0px"}),this.htmlElement.media.pause())},_html_clearMedia:function(){this.htmlElement.media&&(this.htmlElement.media.src="about:blank",this.htmlElement.media.load())},_html_load:function(){this.status.waitForLoad&&(this.status.waitForLoad=!1,this.htmlElement.media.load());clearTimeout(this.internal.htmlDlyCmdId)},_html_play:function(n){var i=this,t=this.htmlElement.media;if(this.androidFix.pause=!1,this._html_load(),this.androidFix.setMedia)this.androidFix.play=!0,this.androidFix.time=n;else if(isNaN(n))t.play();else{this.internal.cmdsIgnored&&t.play();try{if(!t.seekable||typeof t.seekable=="object"&&t.seekable.length>0)t.currentTime=n,t.play();else throw 1;}catch(r){this.internal.htmlDlyCmdId=setTimeout(function(){i.play(n)},250);return}}this._html_checkWaitForPlay()},_html_pause:function(n){var i=this,t=this.htmlElement.media;if(this.androidFix.play=!1,n>0?this._html_load():clearTimeout(this.internal.htmlDlyCmdId),t.pause(),this.androidFix.setMedia)this.androidFix.pause=!0,this.androidFix.time=n;else if(!isNaN(n))try{if(!t.seekable||typeof t.seekable=="object"&&t.seekable.length>0)t.currentTime=n;else throw 1;}catch(r){this.internal.htmlDlyCmdId=setTimeout(function(){i.pause(n)},250);return}n>0&&this._html_checkWaitForPlay()},_html_playHead:function(n){var i=this,t=this.htmlElement.media;this._html_load();try{if(typeof t.seekable=="object"&&t.seekable.length>0)t.currentTime=n*t.seekable.end(t.seekable.length-1)/100;else if(t.duration>0&&!isNaN(t.duration))t.currentTime=n*t.duration/100;else throw"e";}catch(r){this.internal.htmlDlyCmdId=setTimeout(function(){i.playHead(n)},250);return}this.status.waitForLoad||this._html_checkWaitForPlay()},_html_checkWaitForPlay:function(){this.status.waitForPlay&&(this.status.waitForPlay=!1,this.css.jq.videoPlay.length&&this.css.jq.videoPlay.hide(),this.status.video&&(this.internal.poster.jq.hide(),this.internal.video.jq.css({width:this.status.width,height:this.status.height})))},_html_setProperty:function(n,t){this.html.audio.available&&(this.htmlElement.audio[n]=t);this.html.video.available&&(this.htmlElement.video[n]=t)},_aurora_setAudio:function(t){var i=this;n.each(this.formats,function(n,r){if(i.aurora.support[r]&&t[r])return i.status.src=t[r],i.status.format[r]=!0,i.status.formatType=r,!1});this.aurora.player=new AV.Player.fromURL(this.status.src);this._addAuroraEventListeners(this.aurora.player,this.aurora);this.options.preload==="auto"&&(this._aurora_load(),this.status.waitForLoad=!1)},_aurora_resetMedia:function(){this.aurora.player&&this.aurora.player.stop()},_aurora_clearMedia:function(){},_aurora_load:function(){this.status.waitForLoad&&(this.status.waitForLoad=!1,this.aurora.player.preload())},_aurora_play:function(t){this.status.waitForLoad||isNaN(t)||this.aurora.player.seek(t);this.aurora.player.playing||this.aurora.player.play();this.status.waitForLoad=!1;this._aurora_checkWaitForPlay();this._updateButtons(!0);this._trigger(n.jPlayer.event.play)},_aurora_pause:function(t){isNaN(t)||this.aurora.player.seek(t*1e3);this.aurora.player.pause();t>0&&this._aurora_checkWaitForPlay();this._updateButtons(!1);this._trigger(n.jPlayer.event.pause)},_aurora_playHead:function(n){this.aurora.player.duration>0&&this.aurora.player.seek(n*this.aurora.player.duration/100);this.status.waitForLoad||this._aurora_checkWaitForPlay()},_aurora_checkWaitForPlay:function(){this.status.waitForPlay&&(this.status.waitForPlay=!1)},_aurora_volume:function(n){this.aurora.player.volume=n*100},_aurora_mute:function(n){n?(this.aurora.properties.lastvolume=this.aurora.player.volume,this.aurora.player.volume=0):this.aurora.player.volume=this.aurora.properties.lastvolume;this.aurora.properties.muted=n},_flash_setAudio:function(t){var i=this;try{n.each(this.formats,function(n,r){if(i.flash.support[r]&&t[r]){switch(r){case"m4a":case"fla":i._getMovie().fl_setAudio_m4a(t[r]);break;case"mp3":i._getMovie().fl_setAudio_mp3(t[r]);break;case"rtmpa":i._getMovie().fl_setAudio_rtmp(t[r])}return i.status.src=t[r],i.status.format[r]=!0,i.status.formatType=r,!1}});this.options.preload==="auto"&&(this._flash_load(),this.status.waitForLoad=!1)}catch(r){this._flashError(r)}},_flash_setVideo:function(t){var i=this;try{n.each(this.formats,function(n,r){if(i.flash.support[r]&&t[r]){switch(r){case"m4v":case"flv":i._getMovie().fl_setVideo_m4v(t[r]);break;case"rtmpv":i._getMovie().fl_setVideo_rtmp(t[r])}return i.status.src=t[r],i.status.format[r]=!0,i.status.formatType=r,!1}});this.options.preload==="auto"&&(this._flash_load(),this.status.waitForLoad=!1)}catch(r){this._flashError(r)}},_flash_resetMedia:function(){this.internal.flash.jq.css({width:"0px",height:"0px"});this._flash_pause(NaN)},_flash_clearMedia:function(){try{this._getMovie().fl_clearMedia()}catch(n){this._flashError(n)}},_flash_load:function(){try{this._getMovie().fl_load()}catch(n){this._flashError(n)}this.status.waitForLoad=!1},_flash_play:function(n){try{this._getMovie().fl_play(n)}catch(t){this._flashError(t)}this.status.waitForLoad=!1;this._flash_checkWaitForPlay()},_flash_pause:function(n){try{this._getMovie().fl_pause(n)}catch(t){this._flashError(t)}n>0&&(this.status.waitForLoad=!1,this._flash_checkWaitForPlay())},_flash_playHead:function(n){try{this._getMovie().fl_play_head(n)}catch(t){this._flashError(t)}this.status.waitForLoad||this._flash_checkWaitForPlay()},_flash_checkWaitForPlay:function(){this.status.waitForPlay&&(this.status.waitForPlay=!1,this.css.jq.videoPlay.length&&this.css.jq.videoPlay.hide(),this.status.video&&(this.internal.poster.jq.hide(),this.internal.flash.jq.css({width:this.status.width,height:this.status.height})))},_flash_volume:function(n){try{this._getMovie().fl_volume(n)}catch(t){this._flashError(t)}},_flash_mute:function(n){try{this._getMovie().fl_mute(n)}catch(t){this._flashError(t)}},_getMovie:function(){return document[this.internal.flash.id]},_getFlashPluginVersion:function(){var i=0,t,n;if(window.ActiveXObject)try{t=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");t&&(n=t.GetVariable("$version"),n&&(n=n.split(" ")[1].split(","),i=parseInt(n[0],10)+"."+parseInt(n[1],10)))}catch(r){}else navigator.plugins&&navigator.mimeTypes.length>0&&(t=navigator.plugins["Shockwave Flash"],t&&(i=navigator.plugins["Shockwave Flash"].description.replace(/.*\s(\d+\.\d+).*/,"$1")));return i*1},_checkForFlash:function(n){var t=!1;return this._getFlashPluginVersion()>=n&&(t=!0),t},_validString:function(n){return n&&typeof n=="string"},_limitValue:function(n,t,i){return n<t?t:n>i?i:n},_urlNotSetError:function(t){this._error({type:n.jPlayer.error.URL_NOT_SET,context:t,message:n.jPlayer.errorMsg.URL_NOT_SET,hint:n.jPlayer.errorHint.URL_NOT_SET})},_flashError:function(t){var i;i=this.internal.ready?"FLASH_DISABLED":"FLASH";this._error({type:n.jPlayer.error[i],context:this.internal.flash.swf,message:n.jPlayer.errorMsg[i]+t.message,hint:n.jPlayer.errorHint[i]});this.internal.flash.jq.css({width:"1px",height:"1px"})},_error:function(t){this._trigger(n.jPlayer.event.error,t);this.options.errorAlerts&&this._alert("Error!"+(t.message?"\n"+t.message:"")+(t.hint?"\n"+t.hint:"")+"\nContext: "+t.context)},_warning:function(i){this._trigger(n.jPlayer.event.warning,t,i);this.options.warningAlerts&&this._alert("Warning!"+(i.message?"\n"+i.message:"")+(i.hint?"\n"+i.hint:"")+"\nContext: "+i.context)},_alert:function(n){var t="jPlayer "+this.version.script+" : id='"+this.internal.self.id+"' : "+n;this.options.consoleAlerts?window.console&&window.console.log&&window.console.log(t):alert(t)},_emulateHtmlBridge:function(){var t=this;n.each(n.jPlayer.emulateMethods.split(/\s+/g),function(n,i){t.internal.domNode[i]=function(n){t[i](n)}});n.each(n.jPlayer.event,function(i,r){var u=!0;n.each(n.jPlayer.reservedEvent.split(/\s+/g),function(n,t){if(t===i)return u=!1,!1});u&&t.element.bind(r+".jPlayer.jPlayerHtml",function(){t._emulateHtmlUpdate();var n=document.createEvent("Event");n.initEvent(i,!1,!0);t.internal.domNode.dispatchEvent(n)})})},_emulateHtmlUpdate:function(){var t=this;n.each(n.jPlayer.emulateStatus.split(/\s+/g),function(n,i){t.internal.domNode[i]=t.status[i]});n.each(n.jPlayer.emulateOptions.split(/\s+/g),function(n,i){t.internal.domNode[i]=t.options[i]})},_destroyHtmlBridge:function(){var i=this,t;this.element.unbind(".jPlayerHtml");t=n.jPlayer.emulateMethods+" "+n.jPlayer.emulateStatus+" "+n.jPlayer.emulateOptions;n.each(t.split(/\s+/g),function(n,t){delete i.internal.domNode[t]})}};n.jPlayer.error={FLASH:"e_flash",FLASH_DISABLED:"e_flash_disabled",NO_SOLUTION:"e_no_solution",NO_SUPPORT:"e_no_support",URL:"e_url",URL_NOT_SET:"e_url_not_set",VERSION:"e_version"};n.jPlayer.errorMsg={FLASH:"jPlayer's Flash fallback is not configured correctly, or a command was issued before the jPlayer Ready event. Details: ",FLASH_DISABLED:"jPlayer's Flash fallback has been disabled by the browser due to the CSS rules you have used. Details: ",NO_SOLUTION:"No solution can be found by jPlayer in this browser. Neither HTML nor Flash can be used.",NO_SUPPORT:"It is not possible to play any media format provided in setMedia() on this browser using your current options.",URL:"Media URL could not be loaded.",URL_NOT_SET:"Attempt to issue media playback commands, while no media url is set.",VERSION:"jPlayer "+n.jPlayer.prototype.version.script+" needs Jplayer.swf version "+n.jPlayer.prototype.version.needFlash+" but found "};n.jPlayer.errorHint={FLASH:"Check your swfPath option and that Jplayer.swf is there.",FLASH_DISABLED:"Check that you have not display:none; the jPlayer entity or any ancestor.",NO_SOLUTION:"Review the jPlayer options: support and supplied.",NO_SUPPORT:"Video or audio formats defined in the supplied option are missing.",URL:"Check media URL is valid.",URL_NOT_SET:"Use setMedia() to set the media URL.",VERSION:"Update jPlayer files."};n.jPlayer.warning={CSS_SELECTOR_COUNT:"e_css_selector_count",CSS_SELECTOR_METHOD:"e_css_selector_method",CSS_SELECTOR_STRING:"e_css_selector_string",OPTION_KEY:"e_option_key"};n.jPlayer.warningMsg={CSS_SELECTOR_COUNT:"The number of css selectors found did not equal one: ",CSS_SELECTOR_METHOD:"The methodName given in jPlayer('cssSelector') is not a valid jPlayer method.",CSS_SELECTOR_STRING:"The methodCssSelector given in jPlayer('cssSelector') is not a String or is empty.",OPTION_KEY:"The option requested in jPlayer('option') is undefined."};n.jPlayer.warningHint={CSS_SELECTOR_COUNT:"Check your css selector and the ancestor.",CSS_SELECTOR_METHOD:"Check your method name.",CSS_SELECTOR_STRING:"Check your css selector is a string.",OPTION_KEY:"Check your option name."}});jQuery.fn.extend({zIndex:function(n){if(n!==undefined)return this.css("zIndex",n);if(this.length)for(var t=$(this[0]),i,r;t.length&&t[0]!==document;){if(i=t.css("position"),(i==="absolute"||i==="relative"||i==="fixed")&&(r=parseInt(t.css("zIndex"),10),!isNaN(r)&&r!==0))return r;t=t.parent()}return 0}});jQuery.fn.extend({getMinZ:function(){return Math.min.apply(null,jQuery(this).map(function(){var n;return isNaN(n=parseInt(jQuery(this).css("z-index"),10))?0:n}).get())},getMaxZ:function(){return Math.max.apply(null,jQuery(this).map(function(){var n;return isNaN(n=parseInt(jQuery(this).css("z-index"),10))?0:n}).get())}});LayeringConstraints=function(n){var t={min:function(){return $(UI.getConfigurationValue(WRAPPER)).getMinZ()},max:function(){return $(UI.getConfigurationValue(WRAPPER),$(n)).getMaxZ()}};return this.min=t.min(),this.max=t.max(),t};ko.extenders.stringNumeric=function(n){var t=ko.dependentObservable({read:function(){return n().toString()},write:n});return t.raw=n,t};LayeringController=function(n){"use strict";var t=this;this.zIndex=ko.observable(0).extend({stringNumeric:1});this.layeringStyle=ko.computed(function(){return{zIndex:this.zIndex()}}.bind(this));this.zIndex.subscribe(function(){this.component!==null&&(this.updateToComponent(t.component),this.updateElement())}.bind(this));this.bringFront=function(){var n=this.zIndex();this.zIndex(++n)}.bind(this);this.sendBack=function(){var n=this.zIndex();this.zIndex(--n)}.bind(this);this.setZIndex=function(n){this.zIndex(n)}.bind(this);this.updateToComponent=function(n){try{if(n!==null){n.setProperty("z-index",t.zIndex(),!0);var i=n.getProperty("z-index");i!=null&&(i.componentId=n.name,i.controlId=n.id,i.propertyId="66ffaa9b-e079-4f6f-8495-a2b7db3ef7a2",i.group="style",i.type="common")}}finally{}};this.updateFromComponent=function(n){try{var i=n.getProperty("z-index");i!==null&&t.zIndex(parseInt(i.value,10))}catch(r){t.updateToComponent(n)}};this.updateElement=function(){if(this.component!==null){var n=$(this.component.getUISelector());n.length>0&&(n.zIndex(t.zIndex()),console.log("element z-index:"+$(n).zIndex()))}};this.bindElement=function(n){$(n).length>0&&($(n).data("bind","style: layeringStyle"),ko.observable($(n)[0]).extend({applyBindings:t}))};n!==null&&(this.component=n,this.layeringConstraints=new LayeringConstraints(this.component.getUISelector()),this.updateFromComponent(n),this.updateToComponent(n))};ko.bindingHandlers.tooltip={update:function(n,t){var i,r,f,u,e;if(r=ko.utils.unwrapObservable(t()),i=$(n),ko.isObservable(r.title)){u=!1;i.on("show.bs.tooltip",function(){u=!0});i.on("hide.bs.tooltip",function(){u=!1});e=r.animation||!0;r.title.subscribe(function(){u&&(i.data("bs.tooltip").options.animation=!1,i.tooltip("fixTitle").tooltip("show"),i.data("bs.tooltip").options.animation=e)})}f=i.data("bs.tooltip");f?$.extend(f.options,r):i.tooltip(r)}};ko.bindingHandlers.editable_tooltip={init:function(n,t){var r=$(n),i=ko.utils.unwrapObservable(t());UI.tooltips&&(UI.getSetting("isadmin")&&r.bind("dblclick",function(n){var f,t,e,u;n.stopPropagation();$(".editable-tooltip").popover("destroy");f=Helpers.loadServiceTemplate("tooltip-management-template");PopoverHelper.bind(r,f,i.key,"");t=$(".popover."+i.key);e=parseInt(t.css("top"))-18;t.css("top",e+"px");t.css("z-index",99999);u=UI.tooltips.getViewModel({key:i.key,name:i.name,element:r});u?(ko.cleanNode(t[0]),ko.applyBindings(u,t[0]),t.draggable(),t.click(function(n){n.stopPropagation()})):t.popover("destroy")}),r.tooltip({title:UI.tooltips.data[i.key],placement:i.placement}))}},function(n){typeof define=="function"&&define.amd?define(["knockout","jquery","jquery.ui.sortable"],n):n(window.ko,jQuery)}(function(n,t){var o="ko_sortItem",h="ko_sourceIndex",s="ko_sortList",c="ko_parentList",l="ko_dragItem",i=n.utils.unwrapObservable,r=n.utils.domData.get,u=n.utils.domData.set,f=t.ui&&t.ui.version,y=f&&f.indexOf("1.6.")&&f.indexOf("1.7.")&&(f.indexOf("1.8.")||f==="1.8.24"),a=function(t,i){n.utils.arrayForEach(t,function(n){n.nodeType===1&&(u(n,o,i),u(n,c,r(n.parentNode,s)))})},e=function(t,r){var u={},f=i(t())||{},e;return f.data?(u[r]=f.data,u.name=f.template):u[r]=t(),n.utils.arrayForEach(["afterAdd","afterRender","as","beforeRemove","includeDestroyed","templateEngine","templateOptions"],function(t){u[t]=f[t]||n.bindingHandlers.sortable[t]}),r==="foreach"&&(u.afterRender?(e=u.afterRender,u.afterRender=function(n,t){a.call(t,n,t);e.call(t,n,t)}):u.afterRender=a),u},v=function(n,t){var u=i(t),r;if(u)for(r=0;r<n;r++)u[r]&&i(u[r]._destroy)&&n++;return n},p=function(i,r){var u,f;r?(f=document.getElementById(r),f&&(u=new n.templateSources.domElement(f),u.text(t.trim(u.text())))):t(i).contents().each(function(){this&&this.nodeType!==1&&i.removeChild(this)})};n.bindingHandlers.sortable={init:function(f,a,w,b,k){var g=t(f),nt=i(a())||{},tt=e(a,"foreach"),d={},it,rt,ut;return p(f,tt.name),t.extend(!0,d,n.bindingHandlers.sortable),nt.options&&d.options&&(n.utils.extend(d.options,nt.options),delete nt.options),n.utils.extend(d,nt),d.connectClass&&(n.isObservable(d.allowDrop)||typeof d.allowDrop=="function")?n.computed({read:function(){var t=i(d.allowDrop),r=typeof t=="function"?t.call(this,tt.foreach):t;n.utils.toggleDomNodeCssClass(f,d.connectClass,r)},disposeWhenNodeIsRemoved:f},this):n.utils.toggleDomNodeCssClass(f,d.connectClass,d.allowDrop),n.bindingHandlers.template.init(f,function(){return tt},w,b,k),it=d.options.start,rt=d.options.update,ut=setTimeout(function(){var e;g.sortable(n.utils.extend(d.options,{start:function(t,i){var r=i.item[0];u(r,h,n.utils.arrayIndexOf(i.item.parent().children(),r));i.item.find("input:focus").change();it&&it.apply(this,arguments)},receive:function(n,t){e=r(t.item[0],l);e&&(e.clone&&(e=e.clone()),d.dragged&&(e=d.dragged.call(this,e,n,t)||e))},update:function(i,f){var l,w,b,p,k,a=f.item[0],nt=f.item.parent()[0],g=r(a,o)||e;if(e=null,g&&this===nt||!y&&t.contains(this,nt)){if(l=r(a,c),b=r(a,h),w=r(a.parentNode,s),p=n.utils.arrayIndexOf(f.item.parent().children(),a),tt.includeDestroyed||(b=v(b,l),p=v(p,w)),(d.beforeMove||d.afterMove)&&(k={item:g,sourceParent:l,sourceParentNode:l&&f.sender||a.parentNode,sourceIndex:b,targetParent:w,targetIndex:p,cancelDrop:!1},d.beforeMove&&d.beforeMove.call(this,k,i,f)),l?t(l===w?this:f.sender||this).sortable("cancel"):t(a).remove(),k&&k.cancelDrop)return;p>=0&&(l&&(l.splice(b,1),n.processAllDeferredBindingUpdates&&n.processAllDeferredBindingUpdates()),w.splice(p,0,g));u(a,o,null);n.processAllDeferredBindingUpdates&&n.processAllDeferredBindingUpdates();d.afterMove&&d.afterMove.call(this,k,i,f)}rt&&rt.apply(this,arguments)},connectWith:d.connectClass?"."+d.connectClass:!1}));d.isEnabled!==undefined&&n.computed({read:function(){g.sortable(i(d.isEnabled)?"enable":"disable")},disposeWhenNodeIsRemoved:f})},0),n.utils.domNodeDisposal.addDisposeCallback(f,function(){(g.data("ui-sortable")||g.data("sortable"))&&g.sortable("destroy");clearTimeout(ut)}),{controlsDescendantBindings:!0}},update:function(t,i,r,f,o){var h=e(i,"foreach");u(t,s,h.foreach);n.bindingHandlers.template.update(t,function(){return h},r,f,o)},connectClass:"ko_container",allowDrop:!0,afterMove:null,beforeMove:null,options:{}};n.bindingHandlers.draggable={init:function(r,f,o,s,h){var c=i(f())||{},p=c.options||{},a=n.utils.extend({},n.bindingHandlers.draggable.options),w=e(f,"data"),v=c.connectClass||n.bindingHandlers.draggable.connectClass,y=c.isEnabled!==undefined?c.isEnabled:n.bindingHandlers.draggable.isEnabled;return c="data"in c?c.data:c,u(r,l,c),n.utils.extend(a,p),a.connectToSortable=v?"."+v:!1,t(r).draggable(a),y!==undefined&&n.computed({read:function(){t(r).draggable(i(y)?"enable":"disable")},disposeWhenNodeIsRemoved:r}),n.bindingHandlers.template.init(r,function(){return w},o,s,h)},update:function(t,i,r,u,f){var o=e(i,"data");return n.bindingHandlers.template.update(t,function(){return o},r,u,f)},connectClass:n.bindingHandlers.sortable.connectClass,options:{helper:"clone"}}});ko.bindingHandlers.colorPicker={init:function(n,t,i){var u=t(),r,f;$(n).val(ko.unwrap(u));r=i()!==null&&"format"in i()?i().format:"toRgbString";f=function(n){return tinycolor.prototype.hasOwnProperty(r)?n[r]():n.toRgbString()};$(n).spectrum({preferredFormat:"rgb",showAlpha:!0,showInput:!0,showInitial:!0,showPalette:!0,hideAfterPaletteSelect:!0,showSelectionPalette:!1,beforeShow:function(){return $(this).spectrum("option","palette",[UI.getSiteColors()]),!0}});$(n).addClass("sp-color-input").show().change(function(n){var t=$(this);t.spectrum("set",n.target.value);u(f(t.spectrum("get")))})},update:function(){}};ko.extenders.async=function(n,t){var i=ko.observable(t),r;return i.inProgress=ko.observable(!1),ko.computed(function(){r&&(r.reject(),r=null);var t=n();t&&typeof t.done=="function"?(i.inProgress(!0),r=$.Deferred().done(function(n){i.inProgress(!1);i(n)}),t.done(r.resolve)):i(t)}),i};ko.extenders.applyBindings=function(n,t){ko.applyBindings(t,n());BindingController.koAddElement(n())};ko.extenders.applyBindingsToDescendants=function(n,t){ko.applyBindingsToDescendants(t,n());BindingController.koAddElement(n())};ko.extenders.applyBindingsToNode=function(n,t){ko.applyBindingsToNode(n(),t.model,t.extension);BindingController.koAddElement(n())};ko.extenders.cleanNode=function(n){BindingController.koRemoveElement(n());ko.cleanNode(n())};var paletteBindingProvider=function(n){return n=n||function(){},n.palette=ko.observable(),n.appliedComponents=ko.observableArray([]),n.subscribed=ko.observable(!1),n.colorsMapIndex=[{0:["body","main"]},{1:["header","footer"]},{2:["div"]},{3:["button","menu"]},{4:["text","paragraph","headertext","heading"]}],n.initColors=function(){n.colors={body:ko.observable(),main:ko.observable(),header:ko.observable(),footer:ko.observable(),div:ko.observable(),button:ko.observable(),menu:ko.observable(),text:ko.observable(),paragraph:ko.observable(),headertext:ko.observable(),heading:ko.observable()}},n.initColors(),n.PaleteChangeCallback=function(n,t,i){$("#"+n.id).css(t,i)},n.colorsChangeSubscriber=function(t){var r,i,u,f;if(t)for(r=t.Colors(),i=0;i<r.length;i++)u=r[i],f=_.filter(_.flatten(n.colorsMapIndex,i),_.isString),ko.utils.arrayForEach(f,function(t){n.colors[t](u)});else n.initColors(),n.applyBind=!1,ko.cleanNode($(".site-wrapper")[0])},n.getAllComponents=ko.computed(function(){return function(){return UI.siteComponentRepository.getAll()}}),n.flatForNestedChildren=function(n){var i=[],t=function(n){Array.isArray(n)?n.forEach(function(n){i.push(n);defined(n.children)&&t(n.children)}):defined(n.children)&&t(n.children)};return t(n),i},n.applyBind=!1,n.bindPalette=function(t){if(n.subscribed())n.palette(t);else{n.subscribable!==null&&ko.isSubscribable(n.subscribable)&&n.subscribable.dispose();n.subscribable=n.palette.subscribe(function(t){!t||t.isInit||n.applyBind||setTimeout(function(){try{n.applyBind=!0;ko.observable($(".site-wrapper")[0]).extend({applyBindings:n.colors})}catch(t){}},1);n.colorsChangeSubscriber(t)});n.palette(t);var i=eventsystem.subscribe("/component/create/",function(t){n.subscribed()&&(n.appliedComponents.push(t),ko.observable($(t.getUISelector())[0]).extend({applyBindings:n.colors}))});n.subscribed(!0)}},n}(paletteBindingProvider),Color=function(n){this.color=ko.observable(tinycolor(n).toRgbString())},Palette=function(n){var t=this,i;this.editMode=ko.observable(!1);n!==null&&(ko.utils.extend(this,n),i="",this.Colors!=0&&(i=JSON.parse(this.Colors)),ko.utils.extend(this,i),this.Title=ko.observable(this.Title),this.Colors=ko.observableArray([]),ko.utils.arrayMap(t.colors,function(n){t.Colors.push(new Color(n))}),console.log(this.Colors()),this.ImageUrl=ko.computed({read:function(){var n=ko.toJSON({colors:ko.utils.arrayMap(t.Colors(),function(n){return tinycolor(n.color()).toHexString()})});return"palettes/image/?colors="+encodeURIComponent(n)},deferEvaluation:!0}));t.newColor=function(){if(!(t.Colors().length>=5)){var n=t.Colors(),i=n[n.length-1];t.Colors.push(new Color(i.color()))}};t.removeColor=function(n){t.Colors().length-1<=0||t.Colors.remove(n)}},PaletteController=function(n){var t=this;this.palettes=ko.observableArray([]);t.loading=ko.observable(!1);t.error=ko.observable(!1);t.canShow=ko.computed(function(){return!t.loading()});t.loadPalettes(n);PaletteController.prototype.replacePalette=function(n,i){t.palettes.replace(n,i)};PaletteController.prototype.getPalette=function(n){return ko.utils.arrayFirst(t.palettes(),function(t){if(t.Id===n)return t})}};PaletteController.prototype.hideError=function(){this.error(!1)};PaletteController.prototype.resetPalettes=function(){var n=this;n.loading(!0);n.hideError();$.getJSON("/palettes/resetall").done(function(){Designer.paletteController.loadPalettes("")})};PaletteController.prototype.activePaletteId=function(n){var t=UI.siteComponentRepository.getBody();if(defined(n))t.setProperty(ACTIVE_PALETTE,n);else return t.getProperty(ACTIVE_PALETTE).value};PaletteController.prototype.loadPalettes=function(n){var t=this,i;t.loading(!0);t.hideError();t.editMode(!1);defined(n)&&!String.isNullOrEmpty(n)?(i=t.getPalette(n),defined(i)?this.postJson("/palettes/details",ko.toJSON({Id:n}),function(n){if(defined(n)){var r=new Palette(n);t.replacePalette(i,r);t.isApplied(i)&&t.applyPalette(r)}t.loading(!1)}):t.loading(!1)):$.getJSON("/palettes/getall").done(function(n){try{n!==null&&n.length>0&&(t.palettes.removeAll(),ko.utils.arrayMap(n,function(n){n.Id===PaletteController.prototype.activePaletteId()&&(t.applied(new Palette(n)),paletteBindingProvider.bindPalette(ko.utils.extend(new Palette(n),{isInit:!0})));t.palettes.push(new Palette(n))}))}catch(i){t.error(!0)}t.loading(!1)}).fail(function(){t.error(!0)}).always(function(){t.loading(!1)})};PaletteController.prototype.addPalette=function(n,t){var i=this;return t.preventDefault(),console.log("adding palette"),$.getJSON("/Palettes/Create",function(n){var t=new Palette(n);i.palettes.push(t);i.toggleEdit(t);i.toggleDuplicate(t)}),!1};PaletteController.prototype.unwrapPalette=function(n){var t=null,i;return defined(n)?(i=ko.unwrap(n),t={Id:"00000000-0000-0000-0000-000000000000",Title:H.duplicateNameValue(ko.unwrap(i.Title)),Description:ko.unwrap(i.Description),Colors:'{"colors":["'+i.colors.join('","')+'"]}'}):t={Id:"00000000-0000-0000-0000-000000000000",Title:"def",Description:"def",Colors:'{"colors":["#000000","#000000","#000000","#000000","#000000"]}'},new Palette(t)};paletteCount=0;ko.utils.extend(PaletteController.prototype,{editMode:ko.observable(!1),duplicateMode:ko.observable(!1),palette:ko.observable(null),applied:ko.observable(null),duplicatePalette:ko.observable(PaletteController.prototype.unwrapPalette(this.palette)),originPalette:null,toggleDelete:function(n){var t=ko.unwrap(n.Id);this.postJson("/Palettes/Delete",ko.toJSON({Id:t}),function(){Designer.paletteController.loadPalettes("")},function(){})}.bind(PaletteController.prototype),toggleDuplicate:function(n){if(console.log("duplicate palette:"+JSON.stringify(ko.toJS(n))),this.editPaletteIsSet())this.updatePaletteChanges(),this.duplicateMode(!1);else{var t=PaletteController.prototype.unwrapPalette(n);this.duplicatePalette(t);this.setEditPalette(t);this.duplicateMode(!0)}}.bind(PaletteController.prototype),toggleEdit:function(n){console.log("edit palette:"+JSON.stringify(ko.toJS(n)));n.editMode()&&this.editMode(!0);this.editMode()===!1&&n.editMode()===!0&&this.editMode(!0);this.editPaletteIsSet()?(this.updatePaletteChanges(),this.editMode(!1)):(this.setEditPalette(n),this.originPalette=ko.unwrap(n),n.editMode(!0),this.editMode(!0))}.bind(PaletteController.prototype),setEditPalette:function(n){this.palette(n)}.bind(PaletteController.prototype),applyPalette:function(n){var t,u;paletteCount++;$("#palete-undo").removeClass("not-active");var r=this.applied(),i=n,f=function(n){PaletteController.prototype.applied(n);PaletteController.prototype.activePaletteId(n?n.Id:"");paletteBindingProvider.bindPalette(n)};UI.undoManagerAddUpdatedStructSimpleArr(paletteBindingProvider.PaleteChangeCallback,paletteBindingProvider.PaleteChangeCallback);t=UI.undoManagerGetLatestCommand();!t.structs&&t.callbackredo&&t.callbackundo&&(t=null);u={action:f,oldvalue:r,newvalue:i};console.log(r);console.log(i);UI.undoManagerAddNewItemToUpdatedStructSimpleArr(t,u,!0);paletteBindingProvider.bindPalette(i)}.bind(PaletteController.prototype),editPaletteIsSet:function(){return this.palette()!==null}.bind(PaletteController.prototype),updatePaletteChanges:function(){var i;if(this.palette()!==null){var n=ko.toJS(ko.unwrap(this.palette())),t=ko.toJSON({Id:n.Id,Title:n.Title,DateCreated:n.DateCreated,Description:n.Description,Colors:ko.utils.arrayMap(n.Colors,function(n){return tinycolor(n.color).toRgbString()})});this.duplicateMode()==!0&&(t=ko.toJSON({Id:"00000000-0000-0000-0000-000000000000",Title:n.Title,Description:n.Description,Colors:ko.utils.arrayMap(n.Colors,function(n){return tinycolor(n.color).toRgbString()})}));console.log(t);n&&n.Colors&&n.Colors.forEach(function(n){console.log(n.color);UI.addSiteColor(n.color)});i=this;this.postJson("/Palettes/UpdatePalette",t,function(n){console.log(ko.toJSON(n));Designer.paletteController.loadPalettes("")},function(){});this.palette().editMode(!1);this.palette(null)}}.bind(PaletteController.prototype),postJson:function(n,t,i,r){$.ajax({url:n,type:"POST",dataType:"json",data:t,contentType:"application/json; charset=utf-8",success:function(n){i!==null&&typeof i=="function"&&i(n)},error:function(n,t){var i=n.responseText;console.log(t);r!==null&&typeof r=="function"&&r(i)}})},getSearchString:function(){return this.search()}.bind(PaletteController.prototype),toggleCancel:function(n){console.log("cancel edit palette");this.duplicateMode()==!1&&Designer.paletteController.loadPalettes(n.Id);this.editMode(!1);this.duplicateMode(!1);this.palette(null);this.duplicatePalette(PaletteController.prototype.unwrapPalette())}.bind(PaletteController.prototype),isApplied:function(n){return this.applied()==null?!1:this.applied().Id===n.Id},getApplied:function(){return this.applied()},undoPalette:function(n){var t=this;this.postJson("/palettes/undo",ko.toJSON({Id:n.Id}),function(i){var r=new Palette(i);r.editMode(!0);t.replacePalette(n,r);t.palette(r);t.isApplied(n)&&t.applyPalette(r)},function(){t.error(!0)})}.bind(PaletteController.prototype)});ko.bindingHandlers.palette={propertyIds:{"background-color":"F7CFBF29-6780-475E-80A3-8FB8CA471547",color:"4A40A145-C5A9-4F81-8AD8-04356FD0BA22"},init:function(n,t,i,r){var c=ko.utils.unwrapObservable(t()),l,f,a,e,s,u,v,h,y,o;if(c!=null&&(l=c.element,f=c.property,r!=null&&l in r)){a=r[l];e=UI.undoManagerGetLatestCommand();e&&!e.structs&&e.callbackredo&&e.callbackundo&&(e=null);s=ko.utils.unwrapObservable(a()?a().color:null);e==null&&$(n).css(f,s);try{u=UI.siteComponentRepository.lookupDataSet({id:n.getAttribute("id")}).firstOrDefault();v=$(n).css(f);u!=null&&(h=s?s:u.getProperty(f)?u.getProperty(f).value:"",y={component:u,property:f,oldvalue:v,newvalue:h},e==null||v==h?u!=null&&u.setProperty(f,h,!0):UI.undoManagerAddNewItemToUpdatedStructSimpleArr(e,y,!0),o=u.getProperty(f).value,o!=null&&(o.componentId=u.name,o.controlId=u.id,o.propertyId=ko.bindingHandlers.palette.propertyIds[f],o.group="common",o.type="common",console.log(ko.toJSON(o))))}catch(p){console.log("palette binding handler:"+p)}}return{controlsDescendantBindings:!1}},update:function(n,t,i,r){var h=ko.utils.unwrapObservable(t()),c,f,l,u,o,e,a,s,v;if(h!=null&&(c=h.element,f=h.property,r!=null&&c in r)){l=r[c];u=UI.undoManagerGetLatestCommand();u&&!u.structs&&u.callbackredo&&u.callbackundo&&(u=null);o=ko.utils.unwrapObservable(l()?l().color:null);u==null&&$(n).css(f,o);try{e=UI.siteComponentRepository.lookupDataSet({id:n.getAttribute("id")}).firstOrDefault();a=$(n).css(f);e!=null&&(s=o?o:e.getProperty(f)?e.getProperty(f).value:"",v={component:e,property:f,oldvalue:a,newvalue:s},u==null||a==s?e.setProperty(f,s,!0):UI.undoManagerAddNewItemToUpdatedStructSimpleArr(u,v,!0))}catch(y){console.log("palette binding handler:"+y)}}return{controlsDescendantBindings:!1}}};ko.bindingHandlers.colorMapName={update:function(n,t,i,r,u){var o=["Content area","Header, Footer","Panels","Buttons and Menu","Text"],f=ko.utils.unwrapObservable(t()),e;f>=0&&f<=5&&(e=function(){return o[f]},ko.bindingHandlers.text.update(n,e,i,r,u))}};viewerPaletteController=function(){return viewerPaletteController.assignedPalette=ko.computed(function(){var n=UI.settings.hasOwnProperty("templateId")?UI.settings.templateId:$("[data-templateid]").attr("data-templateid");return n?$.getJSON("/palettes/template/"+n):null}).extend({async:null}),viewerPaletteController.assignedPalette.subscribe(function(n){n!==null&&(console.log(ko.toJSON(n)),paletteBindingProvider.bindPalette(new Palette(n)))}),viewerPaletteController};AdvertisementService=function(){var t=this,n=null;t.load=function(){try{n=dealerAdvTemplate}catch(t){console.log("no adv..."+t)}};t.buildAdvTop=function(){var t="",i=parseInt(UI.getDevice().getWidth()),r=parseInt(i*90/960),u,f;n!=null&&n.pictureUrl&&(u="",n.openInNewTab!=null&&n.openInNewTab&&(u=' target="_blank"'),t='<div><img src="'+n.pictureUrl+'" usemap="#agentmap" width="'+i+'" height="'+r+'">',n.areas!=null&&(t=t+'<map name="agentmap">',n.areas.forEach(function(n){UI.getDevice().isDesktop()||(n.x0*=i/960,n.x1*=i/960,n.y0*=r/90,n.y1*=r/90);t=t+'<area shape="rect" coords="'+n.x0+","+n.y0+","+n.x1+","+n.y1+'" href="'+n.url+'"'+u+">"}),t=t+"<\/map>"),t=t+"<\/div>");f=$(".sitepreview .site .adv");f.length!=0&&(n!=null&&$(".site-wrapper").css({"margin-top":r}),f.html(t))};t.buildAdvBottom=function(){var n=$(".site-wrapper #wrapper-footer");UI.getDevice().isDesktop()?n.html(""):n.html("")};this.load();this.buildAdvTop();this.buildAdvBottom()}