var _____WB$wombat$assign$function_____=function(name){return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name))||self[name];};if(!self.__WB_pmw){self.__WB_pmw=function(obj){this.__WB_source=obj;return this;}}{
let window = _____WB$wombat$assign$function_____("window");
let self = _____WB$wombat$assign$function_____("self");
let document = _____WB$wombat$assign$function_____("document");
let location = _____WB$wombat$assign$function_____("location");
let top = _____WB$wombat$assign$function_____("top");
let parent = _____WB$wombat$assign$function_____("parent");
let frames = _____WB$wombat$assign$function_____("frames");
let opens = _____WB$wombat$assign$function_____("opens");
webpackJsonp([21],{0:function(l,n,d){d(1218);d(633);d(553);d(632);d(1265);d(1267);d(1266);d(1269);d(1272);d(1264);d(1271);d(1273);d(1268);d(1270);d(1275);d(1213);d(1214);d(1157);d(1242);d(1243);d(1257);d(1277);d(1278);d(1279);d(1215);d(1222);d(1219)},90:function(l,n){l.exports={globalGrid:22,globalUiPadding:33,animationDurationInMs:500}},553:function(l,n){YUI.add("datatype-date-format",function(d,e){var c=function(a,b,c){"undefined"===typeof c&&(c=10);for(b+="";parseInt(a,10)<c&&1<c;c/=10)a=b+a;return a.toString()},
b={formats:{a:function(a,b){return b.a[a.getDay()]},A:function(a,b){return b.A[a.getDay()]},b:function(a,b){return b.b[a.getMonth()]},B:function(a,b){return b.B[a.getMonth()]},C:function(a){return c(parseInt(a.getFullYear()/100,10),0)},d:["getDate","0"],e:["getDate"," "],g:function(a){return c(parseInt(b.formats.G(a)%100,10),0)},G:function(a){var f=a.getFullYear(),c=parseInt(b.formats.V(a),10);a=parseInt(b.formats.W(a),10);a>c?f++:0===a&&52<=c&&f--;return f},H:["getHours","0"],I:function(a){a=a.getHours()%
12;return c(0===a?12:a,0)},j:function(a){var b=new Date(""+a.getFullYear()+"/1/1 GMT");a=new Date(""+a.getFullYear()+"/"+(a.getMonth()+1)+"/"+a.getDate()+" GMT")-b;a=parseInt(a/6E4/60/24,10)+1;return c(a,0,100)},k:["getHours"," "],l:function(a){a=a.getHours()%12;return c(0===a?12:a," ")},m:function(a){return c(a.getMonth()+1,0)},M:["getMinutes","0"],p:function(a,b){return b.p[12<=a.getHours()?1:0]},P:function(a,b){return b.P[12<=a.getHours()?1:0]},s:function(a,b){return parseInt(a.getTime()/1E3,10)},
S:["getSeconds","0"],u:function(a){a=a.getDay();return 0===a?7:a},U:function(a){var f=parseInt(b.formats.j(a),10);a=6-a.getDay();f=parseInt((f+a)/7,10);return c(f,0)},V:function(a){var f=parseInt(b.formats.W(a),10),d=(new Date(""+a.getFullYear()+"/1/1")).getDay(),f=f+(4<d||1>=d?0:1);53===f&&4>(new Date(""+a.getFullYear()+"/12/31")).getDay()?f=1:0===f&&(f=b.formats.V(new Date(""+(a.getFullYear()-1)+"/12/31")));return c(f,0)},w:"getDay",W:function(a){var f=parseInt(b.formats.j(a),10);a=7-b.formats.u(a);
f=parseInt((f+a)/7,10);return c(f,0,10)},y:function(a){return c(a.getFullYear()%100,0)},Y:"getFullYear",z:function(a){a=a.getTimezoneOffset();var b=c(parseInt(Math.abs(a/60),10),0),d=c(Math.abs(a%60),0);return(0<a?"-":"+")+b+d},Z:function(a){var f=a.toString().replace(/^.*:\d\d( GMT[+-]\d+)? \(?([A-Za-z ]+)\)?\d*$/,"$2").replace(/[a-z ]/g,"");4<f.length&&(f=b.formats.z(a));return f},"%":function(a){return"%"}},aggregates:{c:"locale",D:"%m/%d/%y",F:"%Y-%m-%d",h:"%b",n:"\n",r:"%I:%M:%S %p",R:"%H:%M",
t:"\t",T:"%H:%M:%S",x:"locale",X:"locale"},format:function(a,f){f=f||{};if(!d.Lang.isDate(a))return d.Lang.isValue(a)?a:"";var k,g;k=f.format||"%Y-%m-%d";g=d.Intl.get("datatype-date-format");for(var h=function(a,f){var c=b.aggregates[f];return"locale"===c?g[f]:c},m=function(f,k){var h=b.formats[k];switch(d.Lang.type(h)){case "string":return a[h]();case "function":return h.call(a,a,g);case "array":if("string"===d.Lang.type(h[0]))return c(a[h[0]](),h[1]);default:return k}};k.match(/%[cDFhnrRtTxX]/);)k=
k.replace(/%([cDFhnrRtTxX])/g,h);k=k.replace(/%([aAbBCdegGHIjklmMpPsSuUVwWyYzZ%])/g,m);h=m=void 0;return k}};d.mix(d.namespace("Date"),b);d.namespace("DataType");d.DataType.Date=d.Date},"3.17.2",{lang:"ar ar-JO ca ca-ES da da-DK de de-AT de-DE el el-GR en en-AU en-CA en-GB en-IE en-IN en-JO en-MY en-NZ en-PH en-SG en-US es es-AR es-BO es-CL es-CO es-EC es-ES es-MX es-PE es-PY es-US es-UY es-VE fi fi-FI fr fr-BE fr-CA fr-FR hi hi-IN hu id id-ID it it-IT ja ja-JP ko ko-KR ms ms-MY nb nb-NO nl nl-BE nl-NL pl pl-PL pt pt-BR ro ro-RO ru ru-RU sv sv-SE th th-TH tr tr-TR vi vi-VN zh-Hans zh-Hans-CN zh-Hant zh-Hant-HK zh-Hant-TW".split(" ")})},
632:function(l,n){YUI.add("datatype-date-math",function(d,e){var c=d.Lang;d.mix(d.namespace("Date"),{isValidDate:function(b){return c.isDate(b)&&isFinite(b)&&"Invalid Date"!=b&&!isNaN(b)&&null!=b?!0:!1},areEqual:function(b,a){return this.isValidDate(b)&&this.isValidDate(a)&&b.getTime()==a.getTime()},isGreater:function(b,a){return this.isValidDate(b)&&this.isValidDate(a)&&b.getTime()>a.getTime()},isGreaterOrEqual:function(b,a){return this.isValidDate(b)&&this.isValidDate(a)&&b.getTime()>=a.getTime()},
isInRange:function(b,a,f){return this.isGreaterOrEqual(b,a)&&this.isGreaterOrEqual(f,b)},addDays:function(b,a){return new Date(b.getTime()+864E5*a)},addMonths:function(b,a){var f=b.getFullYear(),c=b.getMonth()+a,f=Math.floor(f+c/12),c=(c%12+12)%12,d=new Date(b.getTime());d.setFullYear(f);d.setMonth(c);return d},addYears:function(b,a){var f=b.getFullYear()+a,c=new Date(b.getTime());c.setFullYear(f);return c},listOfDatesInMonth:function(b){if(!this.isValidDate(b))return[];var a=this.daysInMonth(b),
f=b.getFullYear();b=b.getMonth();for(var c=[],d=1;d<=a;d++)c.push(new Date(f,b,d,12,0,0));return c},daysInMonth:function(b){if(!this.isValidDate(b))return 0;var a=b.getMonth(),f=[31,28,31,30,31,30,31,31,30,31,30,31];if(1!=a)return f[a];b=b.getFullYear();return 0===b%400?29:0===b%100?28:0===b%4?29:28}});d.namespace("DataType");d.DataType.Date=d.Date},"3.17.2",{requires:["yui-base"]})},633:function(l,n){YUI.add("datatype-date-parse",function(d,e){d.mix(d.namespace("Date"),{parse:function(c){c=new Date(+c||
c);return d.Lang.isDate(c)?c:null}});d.namespace("Parsers").date=d.Date.parse;d.namespace("DataType");d.DataType.Date=d.Date},"3.17.2")},1157:function(l,n){YUI.add("squarespace-flyout-error-message-template",function(d){var e=d.Handlebars;(function(){var c=e.template;(e.templates=e.templates||{})["flyout-error-message.html"]=c(function(b,a,f,c,d){this.compilerInfo=[4,">= 1.0.0"];f=this.merge(f,b.helpers);d=d||{};b='<div class="sqs-flyout-error-message">';(f=f.message)?f=f.call(a,{hash:{},data:d}):
(f=a.message,f="function"===typeof f?f.apply(a):f);if(f||0===f)b+=f;return b+"</div>"})})();d.Handlebars.registerPartial("flyout-error-message.html".replace("/","."),e.templates["flyout-error-message.html"])},"1.0",{requires:["handlebars-base"]})},1213:function(l,n){YUI.add("squarespace-dialog-field-2",function(d){d.namespace("Squarespace.Widgets").DialogField2=d.namespace("Squarespace").DialogField2=d.Base.create("dialogField",d.Squarespace.Widgets.DataWidget,[d.Squarespace.DialogFieldLegacyInterface,
d.WidgetParent,d.WidgetChild],{initializer:function(d){this._saveInitialData(d?d.data:null);this.publish("error-shown",{broadcast:2});this.publish("edited")},destructor:function(){this._destroyError();this.unplug(d.Plugin.WidgetAnim);this._initialData=void 0;this._errorFlyoutSub&&this._errorFlyoutSub.detach()},_destroyError:function(){this._errorNode&&(this._errorNode.remove(!0),this._errorNode=null)},_saveInitialData:function(e){e=!d.Lang.isValue(e)?this.get("data"):e;d.Lang.isArray(e)&&this.get("cloneInitialData")?
this._initialData=e.slice():d.Lang.isObject(e)&&this.get("cloneInitialData")?this._initialData=d.clone(e,!0):this._initialData=e},setCurrentDataAsInitial:function(){this._saveInitialData()},renderUI:function(){d.Squarespace.DialogField2.superclass.renderUI.call(this);var e=this.get("name");e&&this.get("boundingBox").addClass("name-"+e)},scrollIntoView:function(){this.get("contentBox").scrollIntoView()},toggleError:function(e){var c=this.get("boundingBox");this._errorHoverAnchor&&(c.removeClass("has-error"),
this._errorHoverAnchor.remove(),this._errorHoverAnchor.destroy(!0),this._errorHoverEvent.detach(),this._errorHoverAnchor=this._errorHoverEvent=null);e?(c.addClass("has-error"),this._errorHoverAnchor=d.Node.create('<div class="error-hover">&#33;</div>'),this._errorHoverAnchor.appendTo(c),this._errorHoverEvent=this._errorHoverAnchor.on("mouseenter",function(){c.addClass("error-is-hovering");this.showError(e)},this)):this.hideError()},showError:function(e){if(e&&this.get("rendered")){var c=this.get("boundingBox"),
b=this.get("contentBox"),a=this.get("errorFlyoutAnchor")||b,b=this.get("errorFlyoutAnimationTime");a.hasPlugin("flyoutPlugin")||a.plug(d.Squarespace.Animations.Flyout,{duration:b,renderTarget:this.get("errorFlyoutRenderTarget")});var f=a.flyoutPlugin,k=d.bind(function(){c.addClass("error");this._destroyError();this._errorNode=d.Node.create('<div class="sqs-flyout-error-message">'+e+"</div>");var b=this.get("dialog");b&&this._errorNode.setStyle("zIndex",b.zIndex+10);this._errorNode.on(this.get("id")+
"|click",function(a){a.halt();this.hideError()},this);var k=d.one(window).get("region"),m=d.Squarespace.NodeUtils.measureNode(this._errorNode).width,b=a.get("region");b.right+m<=k.right?(k="rt",this._errorNode.addClass("out-from-right")):b.left-m>k.left?(k="lt",this._errorNode.addClass("out-from-left")):(k="bl",this._errorNode.addClass("out-from-bottom"),this._errorNode.setStyle("width",b.width));f.setAttrs({node:this._errorNode,alignment:k});this._clearErrorSub=d.on(this.get("id")+"|click",this.hideError,
this);b=this.get("id");f.once(b+"|shown",function(a){this.fire("error-shown",{message:e})},this);this._errorFlyoutSub=a.once("flyout-shown",function(a){this._errorNode.setStyle("width","100%")},this);f.show()},this);f.get("visible")?(this._isHiding=!0,this._showErrorSub&&this._showErrorSub.detach(),this._showErrorSub=f.once(this.get("id")+"|hidden",function(){this._showErrorSub=null;this._isHiding=!1;k()},this),f.hide()):k()}},hideError:function(){if(this.get("rendered")&&!this._isHiding&&this.get("boundingBox").getDOMNode()){var d=
this.get("boundingBox");d&&d.removeClass("error-is-hovering");var d=this.get("boundingBox"),c=this.get("contentBox"),c=this.get("errorFlyoutAnchor")||c;c.hasPlugin("flyoutPlugin")&&c.flyoutPlugin.get("visible")&&(this._clearErrorSub&&(this._clearErrorSub.detach(),this._clearErrorSub=null),c=c.flyoutPlugin,c.once(this.get("id")+"|hidden",function(b){d.removeClass("error");this.fire("error-hidden");this._destroyError()},this),c.hide())}},didDataChange:function(){var e=this.get("data");if(this.get("readOnly"))return!1;
if(d.Lang.isArray(this._initialData))return d.JSON.stringify(this._initialData)!==d.JSON.stringify(e);if(d.Lang.isObject(this._initialData))throw Error("DialogField base class will not compare objects. Define didDataChange for this field.");return this._initialData!==e},isEmpty:function(){var d=this.get("data");return""===d||0===d},revert:function(){this.set("data",this._initialData,{revert:!0})},_getErrors:function(){return[]},isValid:function(){return!d.Lang.isArray(this.get("errors"))||0===this.get("errors").length}},
{CSS_PREFIX:"sqs-dialog-field",ATTRS:{cloneInitialData:{value:!0},strings:{},name:{value:null,validator:d.Squarespace.AttrValidators.isNullOrString},dialog:{value:null,validator:function(e){if(d.Lang.isNull(e)||e instanceof d.Squarespace.EditingDialog||e.constructor instanceof d.Squarespace.EditingDialog.constructor)return!0;console.warn(this.name+": Not an EditingDialog");return!1}},readOnly:{value:!1,validator:d.Squarespace.AttrValidators.isBoolean},required:{value:!1,validator:d.Squarespace.AttrValidators.isBoolean},
errors:{value:[],readOnly:!0,getter:"_getErrors",validator:d.Squarespace.AttrValidators.isArray},errorFlyoutAnchor:{value:null,readOnly:!0,validator:d.Squarespace.AttrValidators.isNullOrInstanceOf(d.Node)},errorFlyoutRenderTarget:{value:void 0},errorFlyoutAnimationTime:{value:0.3},focusable:{value:!0,validator:d.Lang.isBoolean}}})},"1.0",{requires:"base json-stringify squarespace-animations squarespace-attr-validators squarespace-dialog-field-legacy-interface squarespace-flyout-error-message-template squarespace-node-flyout squarespace-node-utils squarespace-widgets-data-widget widget-anim widget-child widget-parent".split(" ")})},
1214:function(l,n){YUI.add("squarespace-dialog-field-legacy-interface",function(d){var e=d.namespace("Squarespace").DialogFieldLegacyInterface=function(c){this.inActiveFrame=!0;d.Lang.isFunction(this.hideError)&&d.Do.after(function(){var b=c.dialog;b&&b.clearError(this)},this,"hideError",this);d.Do.after(function(){this.after(this.get("id")+"|dataChange",function(b){var a=c.dialog;a&&!b.silent&&a.fire("datachange",this);(a=this.get("name"))&&this.fire("value-changed",{name:a,value:b.newVal,oldValue:b.prevVal,
field:this})},this)},this,"bindUI",this);d.Do.after(function(){c&&c.defaultHidden&&this.hide(!0)},this,"syncUI",this)};e.NAME="dialogFieldLegacyInterface";e.prototype={temporaryHide:function(){this.hide()},temporaryShow:function(){this.show()},getName:function(){return this.get("name")},getType:function(){return this.name},getValue:function(){return this.get("data")},getErrors:function(){return this.get("errors")},getNode:function(){return this.get("boundingBox")},setValue:function(c,b){this.set("data",
c,b)},clearError:function(){this.hideError()}}},"1.0")},1215:function(l,n){YUI.add("squarespace-dialog-fields",function(d){d.namespace("Squarespace");d.Squarespace.DialogField=Class.extend(d.Squarespace.Gizmo,{_name:"DialogField",initialize:function(e,c,b){this._super();this.config=d.merge({defaultHidden:!1},e);this.dialog=this.panel=b;this.initialData=d.merge({},c);this.className="";this.inActiveFrame=!0;this.config&&("undefined"!==typeof this.config.name&&this.config.name in c)&&(this.value=c[this.config.name])},
hide:function(d){this.temporaryHide(d)},getTakenHeight:function(){return this.html.get("offsetHeight")},show:function(d){this.temporaryShow(d)},getName:function(){return this.config.name},getType:function(){return this.type},getDialog:function(){return this.dialog},append:function(d){d.append(this.html);this.config.defaultHidden&&this.temporaryHide(!1)},resize:function(){},isValid:function(){return 0<this.getErrors().length},getErrors:function(){return this.config.validator&&this.config.validationErrorMsg&&
!this.config.validator.call(this,this.dialog)?[this.config.validationErrorMsg]:[]},showError:function(e){if(e){var c=this.errorFlyoutAnchor||this.control;c||console.error("dialog-field: [DialogField] No control or error flyout anchor set to throw form field error on. Set this.control or this.errorFlyoutAnchor to a node.");c.hasPlugin("flyoutPlugin")||c.plug(d.Squarespace.Animations.Flyout,{duration:0.3});c=c.flyoutPlugin;c.get("visible")?(this._showErrorSub&&this._showErrorSub.detach(),this._showErrorSub=
c.once(this.getId()+"|hidden",function(){this._showErrorSub=null;this._doShowErrorFlyout(e)},this),c.hide()):this._doShowErrorFlyout(e)}},_doShowErrorFlyout:function(e){var c=this.errorFlyoutAnchor||this.control,b=c.flyoutPlugin;this.html.addClass("error");this._errorEl||(this._errorEl=d.Node.create('<div class="flyout-error-message">'+e+"</div>"),this._errorEl.setStyle("zIndex",this.dialog.zIndex+10),this._errorEl.on(this.getId()+"|click",function(a){a.halt()},this));this._errorEl.setContent(e);
e=d.Squarespace.NodeUtils.measureNode(this._errorEl).width;c=c.getX()+c.get("offsetWidth")-(this.html.hasClass("thin")?-10:1)+e;e=d.one(window).get("region").right;(c=c>e)&&this._errorEl.addClass("out-from-left");b.setAttrs({node:this._errorEl,alignment:c?"lt":"rt"});this._clearErrorSub=d.on(this.getId()+"|click",this.clearError,this.errorEl,this);b.show()},hideError:function(){var d=this.errorFlyoutAnchor||this.control;d&&(d.hasPlugin("flyoutPlugin")&&d.flyoutPlugin.get("visible"))&&(this._clearErrorSub&&
this._clearErrorSub.detach(),d=d.flyoutPlugin,this._subscribeOnce(d,this.getId()+"|hidden",function(c){this.html.removeClass("error")},this),d.hide())},clearError:function(){this.dialog.clearError(this);this.hideError()},scrollIntoView:function(){this.html.scrollIntoView()},updateInlineTitle:function(){},setHeight:function(d){this.control&&this.control.setStyle("height",d+"px")},getValue:function(){return this.value},setValue:function(d){var c=this.value;this.value=d;"config"in this&&"name"in this.config&&
this.fire("value-changed",{name:this.config.name,value:d,oldValue:c,field:this})},temporaryHide:function(e){this.fire("hide",this);this.hidden=!0;this.hideAnim&&this.hideAnim.stop();e?(this.html.setStyle("display","none"),this.fire("hidden",this)):(this.hideAnim=this._anim({node:this.html,to:{opacity:0},duration:0.35,easing:d.Easing.easeOutStrong}),this.hideAnim.on("end",function(){this.html.setStyle("display","none");this.fire("hidden",this)},this),this.hideAnim.run())},temporaryShow:function(){this.fire("show",
this);this.hidden=!1;this.hideAnim&&this.hideAnim.stop();this.html.setStyle("display","block");this.hideAnim=this._anim({node:this.html,to:{opacity:1},duration:0.35,easing:d.Easing.easeOutStrong});this.hideAnim.on("end",function(){d.fire("shown",this);d.fire("showing",this);this.fire("shown")},this);this.hideAnim.run()},getNode:function(){return this.html},didDataChange:function(){return this.config.ignoreChanges?!1:!this.initialData||d.Lang.isUndefined(this.initialData[this.getName()])&&""===this.getValue()?
!1:d.Lang.isArray(this.initialData[this.getName()])?d.JSON.stringify(this.initialData[this.getName()])!==d.JSON.stringify(this.getValue()):this.getValue()!==this.initialData[this.getName()]}})},"1.0",{requires:"anim json squarespace-gizmo squarespace-node-flyout squarespace-node-utils squarespace-util widget".split(" ")})},1218:function(l,n,d){var e=d(90);YUI.add("squarespace-dialog",function(c){c.namespace("Squarespace");c.Squarespace.OPEN_DIALOGS=[];c.Squarespace.DialogStates={CLOSED:1,EDITING:2,
LOADING:3,CLOSING:4,SAVING:5,MOVING:6};c.Squarespace.EditingDialog=Class.extend(c.Squarespace.ZombieGizmo,{_name:"EditingDialog",_events:{show:{},shown:{},aftershowanim:{},"align-to-anchor":{},"aligned-to-anchor":{},loading:{},"cancel-loading":{},"loading-ready":{},ready:{},drag:{},hide:{},hidden:{},close:{},closed:{},canceled:{},"cancel-clicked":{},"overlay-click":{},"render-anchor":{},datachange:{},datachanged:{},"send-requested":{emitFacade:!0},"remove-requested":{},"data-saved":{},"auto-save":{},
"auto-save-requested":{emitFacade:!0},"allow-editing":{},"editing-allowed":{},"show-errors":{},"local-errors":{}},initialize:function(b){this._super(b);this.setParams(b);this._setState("CLOSED");this.bodyEvents=[];this.buttonEvents=[];this.globalEvents=[];this.childDialogs=[];this.verticalFields=[];this.timers=[];this.fields={};this.sections={};this._noNameFields=[];this._setEdited(!1);this.NOTCH_WIDTH=20;this.BUTTONS_BASE_IDX=100;this.NOTCH_HEIGHT=11;this.lastTabIndex=1;this.on("datachange",this.onDataChange,
this);this._debug=new c.Squarespace.Debugger({name:"EditingDialog",output:!1});this.publish("show",{prefix:"EditingDialog",broadcast:2,emitFacade:!0});this.publish("dismiss",{prefix:"EditingDialog",broadcast:2,emitFacade:!0});this.publish("tab-shown",{prefix:"EditingDialog",broadcast:2,emitFacade:!0});this.publish("button-click",{prefix:"EditingDialog",broadcast:2,emitFacade:!0,preventable:!1})},defaultOpts:{tabs:[],initialData:{},buttons:[],style:"standard",colorScheme:"light",buttonAlign:"right",
position:"center",verticalHeight:"fixed",flyoutPointerDirection:"left",closingText:"Canceled...",savingText:"Saving...",top:60,closeOthers:!0,disableTips:!0,closeable:!0,autoFocus:!0,discardChangesConfirmation:!0,overlay:!1,validateActiveTabOnly:!1,edgeMargin:11,initialDataByReference:!1,frameless:!1},getName:function(){return this.params.name},getInitialData:function(){return this.params.initialData},setParams:function(b){if(b){this.params=c.merge(this.defaultOpts,b);this.params.primaryTabs&&(this.params.tabs=
this.params.tabs.concat(this.params.primaryTabs),delete this.params.primaryTabs);this.params.secondaryTabs&&(this.params.tabs=this.params.tabs.concat(this.params.secondaryTabs),delete this.params.secondaryTabs);if((!this.params.tabs||0===this.params.tabs.length)&&this.params.fields)this.params.tabs=[{fields:this.params.fields}];this.params.tabs[0].tabTitle||(this.params.tabs[0].tabTitle="Item");this.params.tabs[0].name||(this.params.tabs[0].name="item");"transparent"===this.params.style&&(this.params.disableSaveOverlay=
!0);!b.discardChangesConfirmation&&0===this.params.buttons.length&&(this.params.discardChangesConfirmation=!1);this.definitionChanged=!0}},show:function(b){this.fire("show");this._debug.log("Showing",["showParams",b],["this.params",this.params]);this.moving&&(this._setState("EDITING"),this.animation&&this.animation.stop(),this.fire("cancel-loading"));if(!this.destroyTimer&&!this._isState("LOADING")&&!this._isState("CLOSING"))if(c.Squarespace.ToolTipManager&&this.params.disableTips&&c.Squarespace.ToolTipManager.disableTooltips(),
this.anchorEl&&this.anchorEl.removeClass("targeted"),b&&this._setShowParams(b),this.params.parentDialog&&this.params.parentDialog.addChildDialog(this),this._isState("CLOSED")){this.definitionChanged=!1;if(this.params.closeOthers){b=0;for(var a=c.Squarespace.OPEN_DIALOGS.length;b<a;++b)c.Squarespace.OPEN_DIALOGS[b].cancel()}c.Squarespace.OPEN_DIALOGS.push(this);c.one(document.body).addClass("dialog-open");this.fire("loading");this._setState("LOADING");this.timers.push(c.later(100,this,function(){this.params.closeable&&
c.Squarespace.EscManager.addTarget(this);this.globalEvents.push(c.on("resize",this.onResize,c.one(window),this))}));c.one(document).get("winWidth");c.one(document).get("winHeight");this._addTitleEl();this._addBodyEl();this.mainEl=c.Node.create('<div class="main-container"></div>').append(this.titleEl).append(this.bodyEl).append(this.controlsEl);b="";this.params.frameless?b+="frameless-dialog-wrapper ":this.params.disableStandardDialogWrapperClass||(b+="standard-dialog-wrapper ");b+="squarespace-managed-ui "+
this.params.style+" "+this.params.colorScheme+" buttons-"+this.params.buttonAlign;this.params.name&&(b+=" dialog-"+c.Squarespace.Utils.slugify(this.params.name));this.el=c.Node.create('<div class="'+b+'"></div>').append(this.mainEl);this.bodyEvents.push(this.el.on("click",function(a){a.target.ancestor(".sqs-button",!0)||(this.cancelChildDialogs(),this.fire("click",a))},this));this.params.zIndex?this.zIndex=this.params.zIndex:(c.Squarespace.DIALOG_ZINDEX_BASE+=10,this.zIndex=c.Squarespace.DIALOG_ZINDEX_BASE);
this.el.setStyle("zIndex",this.zIndex);this.params.draggable&&this.enableDragging();this.params.hidable&&this._addHideEl();this.params.headerButton&&this._addHeaderButtonEl();this.buttonHolder=c.Node.create("<div>").addClass("button-holder");this.autosaveEl=c.Node.create("<div>").addClass("autosave-state");this.controlsEl&&(this.controlsEl.append(this.autosaveEl),this.controlsEl.append(this.buttonHolder));b=this.anchorEl?this._positionWithAnchorEl():this._positionWithDefault();this.params.loadingState?
(b=this._anim({node:this.el,to:b[1]?{opacity:0.9,top:b[1]}:{opacity:0.9},duration:0.15,easing:c.Easing.easeOutStrong}),b.on("end",function(){this.fire("loading-ready")},this),b.run()):this.dataReady();if("full"==this.params.verticalHeight||"fit"==this.params.verticalHeight)this.el.setStyles({top:this.params.edgeMargin+"px",bottom:this.params.edgeMargin+"px"}),this.params.top=this.params.edgeMargin;this.params.overlay&&(this.overlayEl=c.Node.create("<div>").addClass("dialog-screen-overlay"),this.overlayEl.setStyle("zIndex",
this.zIndex-1),this.overlayEl.addClass("hidden"),c.one(document.body).append(this.overlayEl),c.soon(function(){this.overlayEl.removeClass("hidden")}.bind(this)),this.globalEvents.push(c.on("click",this.onOverlayClick,this.overlayEl,this)));this.moveIntoView();c.later(300,this,function(){this._shown=!0;this.fire("shown",this)})}else this.anchorEl&&(this.anchorEl.addClass("targeted"),this._setState("LOADING"),this.moving=!0,this.updateTitle(),this.fire("loading"),this._updatePosition(!1),this.position&&
(this.animation=this._anim({node:this.el,to:{left:this.position.getX()+"px",top:this.position.getY()+"px"},duration:0.25,easing:c.Easing.easeOutStrong}),this.animation.on("end",function(){this.fire("loading-ready");this.dataReady()},this),this.animation.run()))},_setShowParams:function(b){b.data&&(this.data=b.data);b.anchor&&(this.anchorEl=b.anchor);b.top&&(this.params.top=b.top);b.flyoutPointerDirection&&(this.params.flyoutPointerDirection=b.flyoutPointerDirection)},_addHeaderButtonEl:function(){var b=
c.Node.create('<div class="header-button"></div>'),a=c.Node.create('<input type="button" value="'+this.params.headerButton.title+'" />');a.setData("type",this.params.headerButton.type);c.on("click",this.params.headerButton.onclick,a,this);this.el.append(b.append(a))},_addBodyEl:function(){this.bodyEl=c.Node.create('<div class="body-block"></div>');0!==this.params.buttons.length?this.controlsEl=c.Node.create('<div class="controls-block"></div>'):this.bodyEl.addClass("bottom")},_addTitleEl:function(){this.titleEl=
c.Node.create('<div class="title-block loading"></div>');this.titleTextEl=c.Node.create('<div class="text-holder"></div>');this.titleEl.append(this.titleTextEl);this.tabsEl=c.Node.create('<div class="configuration-container-tabs"></div>');c.Lang.isNumber(this.currentTabIndex)||(this.currentTabIndex=0);this.titleEl.append(this.tabsEl);this.updateTitle()},_addHideEl:function(){var b=c.Node.create('<div class="dialog-close"></div>');this.el.prepend(b);b.on("click",function(){this.fire("user-close");
this.close()},this)},mount:function(){c.one(this.params.mountNode||c.config.doc.body).append(this.el)},_positionWithAnchorEl:function(){var b,a,f,c,d=this.params.width;this.el.setStyle("position",this.params.forcePosition||"absolute");this.anchorEl.addClass("targeted");"left"===this.params.flyoutPointerDirection||"right"===this.params.flyoutPointerDirection?(this.el.setStyle("width",d+this.NOTCH_HEIGHT+"px"),this.mainEl.setStyle("width",d+"px"),this.el.addClass("flyout")):"hidden"===this.params.flyoutPointerDirection?
(this.el.setStyle("width",d+"px"),this.mainEl.setStyle("width",d+"px")):"top"===this.params.flyoutPointerDirection?(this._initNotchEl("top"),this.el.insertBefore(this.notchEl,this.mainEl),f=this.anchorEl.get("offsetWidth"),a=this.anchorEl.get("offsetHeight"),b=this.anchorEl.getX(),a=this.anchorEl.getY()+a,d>f&&(b-=(d-f)/2),this.currentXY=[b,a-3],this.notchEl.setStyle("marginLeft",(d-30)/2+"px"),f=this.params.left||this.currentXY[0],c=this.params.top||this.currentXY[1],this.el.setStyles({left:f+"px",
top:c+"px",width:d+"px"}),this.mainEl.setStyle("width",d+"px")):"bottom"===this.params.flyoutPointerDirection?(this._initNotchEl("top","bottom"),this.el.append(this.notchEl),f=this.anchorEl.get("offsetWidth"),a=this.anchorEl.get("offsetHeight"),b=this.anchorEl.getX(),a=this.anchorEl.getY()+a,d>f&&(b-=(d-f)/2),this.currentXY=[b,a-3],this.notchEl.setStyle("marginLeft",(d-30)/2+"px"),f=this.params.left||this.currentXY[0],c=this.params.top||this.currentXY[1],this.el.setStyles({left:f+"px",top:c+"px",
width:d+"px"}),this.mainEl.setStyle("width",d+"px")):(this.currentXY=[this.anchorEl.getX()+(this.anchorEl.get("offsetWidth")-d)/2,this.anchorEl.getY()+(this.anchorEl.get("offsetHeight")-this.params.height)/2-15],this.el.setStyles({left:this.currentXY[0]+"px",top:this.currentXY[1]+"px",width:d+"px"}),this.el.setStyle(),this.mainEl.setStyle("width",d+"px"),a=this.currentXY[1]);this.mount();return[b,a]},_positionWithDefault:function(){var b,a=c.one(document).get("winWidth");c.one(document).get("winHeight");
this.el.setStyle("position","fixed");"right"===this.params.position?(this.el.setStyles({right:this.params.edgeMargin+"px",top:"0px"}),0===this.params.edgeMargin&&(this.titleEl.setStyle("border-radius","0px"),this.controlsEl.setStyle("border-radius","0px"))):"undefined"!==typeof this.params.left?this.currentXY=[this.params.left,this.params.top]:(this.currentXY=[(a-this.params.width)/2,this.params.top],this.el.setStyle("position","fixed"));this.currentXY&&(this.el.setStyles({left:this.currentXY[0]+
"px",top:this.currentXY[1]+"px"}),b=this.currentXY[1]);this.el.setStyle("width",this.params.width+"px");this.mainEl.setStyle("width",this.params.width+"px");this.mount();return[void 0,b]},isOpen:function(){return this._isState("LOADING")||this._isState("EDITING")},disableBodyScroll:function(){this.oldBodyScroll=c.one("body").getStyle("overflow");c.one("body").setStyle("overflow","hidden")},restoreBodyScroll:function(){this.hasOwnProperty("oldBodyScroll")&&(this.oldBodyScroll?c.one("body").setStyle("overflow",
this.oldBodyScroll):c.one("body").setStyle("overflow",null))},getAnchorEl:function(){return this.anchorEl},getChildDialogs:function(){return this.childDialogs},addChildDialog:function(b){0>this.childDialogs.indexOf(b)&&(this.cancelChildDialogs(),this._debug.log("addChildDialog",b),this.childDialogs.push(b));b.params.parentDialog=this},removeChildDialog:function(b){this.childDialogs=c.Array.filter(this.childDialogs,function(a){return a!==b},this)},enableDragging:function(){this.titleEl.setStyle("cursor",
"move");this.dd=new c.DD.Drag({node:this.el});this.dd.on("drag:mouseDown",function(b){c.Squarespace.Help&&c.Squarespace.Help.active&&b.halt();b.ev.target.ancestor(".body-block",!0)&&b.halt()},this);this.dd.on("drag:start",this.cancelChildDialogs,this);this.dd.on("drag:drag",function(b){this.fire("drag",b)},this);this.dd.on("drag:end",function(b){this.moveIntoView()},this)},temporaryHide:function(b){this.fire("hide");c.Array.each(this.childDialogs,function(a){a.temporaryHide()},this);this.hideAnim&&
this.hideAnim.stop();this._hideAnimEvent&&this._hideAnimEvent.detach();this.overlayHideAnim&&this.overlayHideAnim.stop();this._overlayHideAnimEvent&&this._overlayHideAnimEvent.detach();this.hideAnim=this._anim({node:this.el,to:{opacity:0},duration:0.35,easing:c.Easing.easeOutStrong});this.overlayEl&&(this.overlayHideAnim=this._anim({node:this.overlayEl,to:{opacity:0},duration:0.35,easing:c.Easing.easeOutStrong}),this._overlayHideAnimEvent=this._subscribe(this.overlayHideAnim,"end",function(){this.overlayEl.setStyle("display",
"none")}));this._hideAnimEvent=this._subscribe(this.hideAnim,"end",function(){this.el.setStyle("display","none");this.fire("hidden",this)});b?(this.el.setStyle("display","none"),this.overlayEl&&this.overlayEl.setStyle("display","none"),this.fire("hidden",this)):(this.hideAnim.run(),this.overlayEl&&this.overlayHideAnim.run())},temporaryShow:function(b){this.fire("show",this);b&&this._setShowParams(b);this.hideAnim&&this.hideAnim.stop();this._hideAnimEvent&&this._hideAnimEvent.detach();this.overlayHideAnim&&
this.overlayHideAnim.stop();this.overlayEl&&(this.overlayEl.setStyle("display","block"),this.overlayHideAnim=this._anim({node:this.overlayEl,to:{opacity:this.params.overlay},duration:0.35,easing:c.Easing.easeOutStrong}),this.overlayHideAnim.run());this.el.setStyle("display","block");this.hideAnim=this._anim({node:this.el,to:{opacity:1},duration:0.35,easing:c.Easing.easeOutStrong});this._hideAnimEvent=this._subscribeOnce(this.hideAnim,"end",function(){this.fire("shown",this)});this.hideAnim.run();
this._showChildren();this.moveIntoView()},_applyMethodToChildren:function(){var b=arguments[0],a=Array.prototype.slice.call(arguments,1);c.Array.each(this.childDialogs,function(f){f[b].apply(f,a)},this)},_showChildren:function(){this._applyMethodToChildren("temporaryShow")},_hideChildren:function(){this._applyMethodToChildren("temporaryHide")},cancelChildDialogs:function(){this._applyMethodToChildren("cancel");this.childDialogs=[]},isVisible:function(){return!this._isState("CLOSED")},_updatePosition:function(b){if(this.el&&
this.anchorEl){var a=this.el.get("offsetHeight"),f=this.params.flyoutPointerDirection;if(!("top"===f||"bottom"===f)){if("centered"===f){var d=this.anchorEl.getXY();this.position=new c.Squarespace.Position({x:d[0]+(this.anchorEl.get("offsetWidth")-this.params.width)/2,y:d[1]+(this.anchorEl.get("offsetHeight")-a)/2,w:this.params.width,h:a});this.position.nudgeFix()}else this.position=new c.Squarespace.Position({avoidElX:this.anchorEl,avoidElY:this.anchorEl,xdir:"right",ydir:"bottom",x:this.anchorEl.getX(),
y:this.anchorEl.getY(),xo:2,yo:0,w:this.params.width+this.NOTCH_HEIGHT,h:a}),this.position.reflectFix();"hidden"!==f&&"centered"!==f&&this._reattachNotchEl();b&&(this.el.setXY(this.position.getXY()),this._alignNotch(this.anchorEl))}}},_reattachNotchEl:function(){var b="right"===this.position.xdir?"left":"right";this.notchEl?(this.notchEl.set("className","flyout-notch-"+b),this.notchEl.inDoc()&&this.notchEl.remove()):this._initNotchEl(b);"right"===this.position.xdir?this.el.insertBefore(this.notchEl,
this.mainEl):this.el.append(this.notchEl)},_initNotchEl:function(b,a){this.notchEl=c.Node.create('<div class="flyout-notch-'+b+'">&nbsp;</div>');c.Lang.isString(a)&&this.notchEl.addClass(a)},_alignNotch:function(b){if(this.notchEl){var a=this.el.get("offsetHeight"),a=Math.max(a-36,220),f=12,c=this.el.get("region");b=b.get("region");var d=b.top+b.height/2;b.top>c.top&&(f=d-c.top-11,f=Math.min(a,Math.max(12,f)));this.notchEl.setStyle("marginTop",f+"px")}},onDataChange:function(b){this.fire("render-anchor",
this.getData());this.setEdited();this._debug.log("onDataChange");this.fire("datachanged")},onOverlayClick:function(b){b.halt();this.fire("overlay-click");this.params.disableOverlayCancel||this.close()},setEdited:function(){this._isState("SAVING")||(this.params.discardChangesConfirmation&&!this._onBeforeUnloadEvt&&(this._onBeforeUnloadEvt=c.on("beforeunload",function(b){this.isVisible()&&(b.returnValue="You have unsaved changes.")},this)),this._setEdited(!0))},clearEdited:function(){this._onBeforeUnloadEvt&&
this._onBeforeUnloadEvt.detach();this._setEdited(!1)},_setEdited:function(b){this.edited=!!b;this.editedSinceLastSave=!!b},getEditedSinceLastSave:function(){return this.editedSinceLastSave},getNextTabIndex:function(){return this.lastTabIndex++},getEdited:function(){return this.edited},isState:function(b){return this.getState()===b},getState:function(){return this.state},setInitialData:function(b){this.params.initialData=this.params.initialDataByReference?b:c.clone(b,!0);this.fields&&c.Object.each(this.fields,
function(a,b){this._isDialogField2(a)&&(a.get("name")&&!c.Lang.isUndefined(this.params.initialData[a.get("name")]))&&(a.set("data",this.params.initialData[a.get("name")],{source:"setInitialData"}),a.setCurrentDataAsInitial())},this)},getBodyHeight:function(){return this.params.height?this.params.height:this._getFullHeight()},setActiveFlyout:function(b){this.activeFlyout&&this.activeFlyout.field.closeFlyout();c.later(10,this,function(){this.activeFlyout=b})},clearActiveFlyout:function(){this.activeFlyout=
null},onResize:function(){var b=c.one(document).get("winWidth");c.one(document).get("winHeight");if(!this.anchorEl&&!this.params.draggable){var a={};if("full"==this.params.verticalHeight||"fit"==this.params.verticalHeight)this.bodyHeight=this.getBodyHeight(),"fit"==this.params.verticalHeight&&this.bodyHeight>this.observedHeight&&(this.bodyHeight=this.observedHeight),this.bodyEl.setStyle("height",this.bodyHeight+"px"),this.bodyEl.all(".scrollable-body").each(function(a){a.setStyles({height:this.bodyHeight-
30+"px",paddingBottom:"30px"})},this),this.resizeVerticalFields();"right"!==this.params.position&&(this.hideErrors(),a.left=(b-this.params.width)/2,a.top=this.params.top,this.params.left&&(a.left=this.params.left));this.currentXY=[a.left,a.top];this.moveAnim&&this.moveAnim.stop();this.moveAnim=this._anim({node:this.el,to:a,duration:0.15,easing:c.Easing.easeOutStrong});this.moveAnim.run()}this.moveIntoView()},moveIntoView:function(b){if(this.params.draggable){b&&(!this.anchorEl&&!this.position)&&(b=
!1);var a={},f=this.el.get("docScrollX"),d=this.el.get("docScrollY"),g=this.el.get("winWidth")+f,h=this.el.get("winHeight"),m=h+d,e=this.el.getY(),p=this.el.getX();e<d&&(a.top=d);e+this.el.get("offsetHeight")>m&&(a.top=m-this.el.get("offsetHeight"));p+this.el.get("offsetWidth")>g&&(a.left=g-this.el.get("offsetWidth"));p<f&&(a.left=f);b&&(a.top=a.top?Math.max(a.top,this.position.getY()):this.position.getY());"fixed"===this.params.forcePosition&&(c.Lang.isValue(a.top)&&a.top>this.el.get("winHeight"))&&
(a.top=Math.max(0,h-this.el.get("offsetHeight")));0!==c.Object.size(a)&&this._anim({node:this.el,to:a,duration:0.3,easing:c.Easing.easeOutStrong}).run();this.preferredHeight+120>h?(this.bodyHeight=h-120,this.bodyEl.setHeight(this.bodyHeight)):this.bodyHeight!=this.preferredHeight&&(this.bodyHeight=this.preferredHeight,this.bodyEl.setHeight(this.preferredHeight))}},scrollIntoView:function(b){this.el.scrollIntoView(b)},showErrors:function(b){this.fire("show-errors",b);this.allowEditing();this.currentErrors=
b;this.errorCount=c.Object.size(b);this.errorsByTab={};c.Object.each(b,function(a,b){var c=this.getField(b);c?(c.tab.tabNavigationObj&&c.tab.tabNavigationObj.addClass("error"),this.errorsByTab[c.tab.name]?this.errorsByTab[c.tab.name]++:this.errorsByTab[c.tab.name]=1):console.error("Server error returned for a missing dialog field: "+b)},this);this.activateErrors()},clearError:function(b){this.currentErrors&&this.currentErrors[b.getName()]&&(this.errorsByTab[b.tab.name]--,delete this.currentErrors[b.getName()],
this.errorCount--,b.tab.tabNavigationObj&&0===this.errorsByTab[b.tab.name]&&b.tab.tabNavigationObj.removeClass("error"))},activateErrors:function(){if(this.errorCount){var b=null;c.Array.each(this.currentTab.tabFields,function(a){this.currentErrors[a.getName()]&&(b||(b=a,b.scrollIntoView()),a.showError(this.currentErrors[a.getName()]))},this);b&&c.Lang.isFunction(b.focus)&&b.focus()}},hideErrors:function(){this.currentTab&&c.Array.each(this.currentTab.tabFields||[],function(b){c.Lang.isFunction(b.hideError)&&
b.hideError()},this)},updateTitle:function(b){var a=this.params.tabs[this.currentTabIndex];a&&(this.currentTab&&a.title!=this.currentTab.title)&&(this.currentTab.title=a.title);c.Lang.isUndefined(b)&&(b=this.state);var a=this.currentTab&&this.currentTab.title?this.currentTab.title:this.params.title,f="";this.params.subtext&&(f='<div class="title-subtext">'+this.params.subtext+"</div>");switch(b){case c.Squarespace.DialogStates.LOADING:this.params.loadingText&&this.setTitleHtml('<div class="title-text">'+
this.params.loadingText+"</div>"+f);break;case c.Squarespace.DialogStates.EDITING:a&&this.setTitleHtml('<div class="title-text">'+a+"</div>"+f);break;case c.Squarespace.DialogStates.SAVING:this.params.savingText&&this.setTitleHtml('<div class="title-text">'+this.params.savingText+"</div>"+f)}},setTitleHtml:function(b){this.titleTextEl.setHTML(b)},setData:function(b){c.Array.each(this.currentTab.tabFields,function(a,f){if(a.setValue){var d=b[a.getName()];a.setValue(c.Lang.isValue(d)?d:null);this.fire("datachange",
a)}},this)},focusTab:function(){this.currentTab&&(this.fire("tab-focused",{tabName:this.currentTab.name}),c.Array.some(this.currentTab.tabFields,function(b,a){var f=!(!b.setValue||!b.focus),c=this._isDialogField2(b),d=!(!c||!b.get("focusable"));if(f&&!c||d)return b.focus(),!0},this))},_getFullHeight:function(){return c.one(document).get("winHeight")-2*this.params.edgeMargin-this.controlsHeight-this.titleEl.get("offsetHeight")},dataReady:function(){var b;this.clearEdited();this._setState("EDITING");
this.titleEl.removeClass("loading");this.params.initialData||(this.params.initialData={});this.bodyHeight=this.params.height;this.controlsHeight="standard"===this.params.style?65:60;if("full"===this.params.verticalHeight||"fit"===this.params.verticalHeight)this.bodyHeight=this._getFullHeight();this.preferredHeight=this.bodyHeight;this.bodyEl.setStyle("width",this.params.width+"px");this.params.overlay&&!this.params.doNotDisableBodyScroll&&this.disableBodyScroll();if(this.moving){this.moving=!1;this.updateTitle();
if(this.definitionChanged)this.definitionChanged=!1,this.destroyBody(),this.destroyButtons(),this.render(),b=this._anim({node:this.bodyEl,duration:0.25,easing:c.Easing.easeOutStrong,to:{height:this.bodyHeight}}),b.on("end",function(){this.fire("ready")},this),b.run();else{if(this.rendered)this.setData(this.params.initialData),this.params.autoFocus&&this.focusTab();else this.once("rendered",function(){this.setData(this.params.initialData);this.params.autoFocus&&this.focusTab()},this);this.fire("ready")}this.clearEdited()}else if(this.currentTabIndex=
0,this.currentTab=this.params.tabs[0],this.updateTitle(),this.params.loadingState)b=this._anim({node:this.el,to:{opacity:1},duration:0.15,easing:c.Easing.easeOutStrong}),b.run(),this.controlsEl&&(b=this._anim({node:this.controlsEl,to:{height:this.controlsHeight},duration:0.15,easing:c.Easing.easeOutStrong}),b.run()),b=this._anim({node:this.bodyEl,to:{height:this.bodyHeight},duration:0.25,easing:c.Easing.easeOutStrong}),b.on("end",function(){this.render();this.fire("ready")},this),b.run();else{this.render();
this.currentData=this.params.initialData;var a=this;switch(this.params.showAnim){case "custom":this.params.customShowAnim(this.el,function(){a.fire("ready")});break;case "fade":this.el.transition({opacity:{duration:0.2,value:1},easing:"ease-out"},function(){a.fire("ready");a.el&&a.el.setStyle("transform",null)});break;case "noshow":this.el.setStyles({display:"none"});a.fire("ready");break;default:a.fire("ready"),this.el.addClass("visible")}}},containsNode:function(b){return this.bodyEl&&this.bodyEl.contains(b)},
activateTab:function(b,a){this.hideErrors();var f=a||b.target.getData(),d=parseInt(f.index,10);this.currentTab||(this.currentTab=f);c.Array.each(this.params.tabs,function(a,b){a.tabNavigationObj.toggleClass("active",b===d);b===d&&this._showPanelByIndex(d)},this)},_showField:function(b){(this._isDialogField2(b)&&b.get("visible")||!this._isDialogField2(b)&&!b.config.hidden)&&b.show(!0)},_showPanelByIndex:function(b){if(b!=this.currentTabIndex){var a,f=c.Easing.easeBothStrong,d=this.params.tabs[b],g=
this.params.tabs[this.currentTabIndex];this.params.noTabAnim||(d.tabPanelObj.animation&&d.tabPanelObj.animation.stop(!0),g.tabPanelObj.animation&&g.tabPanelObj.animation.stop(!0));a=g.tabFields;this.params.noTabAnim?(g.tabPanelObj.setStyles({opacity:1,zIndex:"300"}),g.tabPanelObj.addClass("hidden")):(d.tabPanelObj.setStyles({left:(d.index>g.index?1:-1)*this.params.width+"px",opacity:1,zIndex:"300"}),g.tabPanelObj.setStyle("zIndex","0"),a=this._anim({node:g.tabPanelObj,to:{left:(d.index<g.index?1:
-1)*this.params.width+"px"},duration:0.5,easing:f}),a.on("end",function(){this.tab.addClass("hidden")},{tab:g.tabPanelObj}),a.run(),g.tabPanelObj.animation=a);this.currentTab=d;this.currentTabIndex=b;this.updateTitle();d.tabPanelObj.removeClass("hidden");this.params.noTabAnim?(a=this.currentTab.tabFields,c.Array.forEach(a,function(a){this._showField(a)},this),this.focusTab(),this.activateErrors()):(a=this._anim({node:d.tabPanelObj,to:{left:0},duration:0.5,easing:f}),a.on("end",function(){c.Array.forEach(this.currentTab.tabFields,
function(a){this._showField(a)},this);this.focusTab();this.activateErrors()},this),a.run(),d.tabPanelObj.animation=a);this.currentTab.height&&(this.currentTab.tabPanelObj.setStyle("height",g.height-50),this._anim({node:this.bodyEl,to:{height:this.currentTab.height},duration:0.5,easing:f}).run());this.bodyEl.toggleClass("scrollable",!!this.currentTab.scroll);this.currentTab.scroll?this.bodyEl.plug(c.Squarespace.Plugin.ScrollLock):this.bodyEl.unplug(c.Squarespace.Plugin.ScrollLock);this.fire("tab-shown",
{name:this.currentTab.name,title:this.currentTab.title})}},render:function(){var b;this.rendered||(this.observedHeight=0,this.tabs=[],this.tabsEl.setContent(""),c.Array.each(this.params.tabs,function(a,f){b=c.Node.create('<a href="javascript:noop();" class="configuration-container-tab">'+a.tabTitle+"</a>");b.setData("index",f);0===f&&b.addClass("active");1<this.params.tabs.length&&(this.params.tabs[f].noTabTitle&&b.addClass("noTabTitle"),this.bodyEvents.push(b.on("click",function(a){a.preventDefault();
this.activateTab.apply(this,arguments)},this)),this.tabsEl.append(b));this.params.tabs[f].tabNavigationObj=b;this.params.tabs[f].index=f;this.renderTab(this.params.tabs[f],0==f)},this),this.renderButtons(),this.bodyHeight||(this.preferredHeight=this.bodyHeight=this.observedHeight+14),"fit"==this.params.verticalHeight&&this.bodyHeight>this.observedHeight&&(this.bodyHeight=this.observedHeight),this.fire("rendered"),this.rendered=!0,this.bodyEl.setStyle("height",this.bodyHeight+"px"),this.controlsEl&&
this.controlsEl.setStyle("height",this.controlsHeight+"px"),this._updatePosition(!0),this.params.autoFocus&&this.focusTab())},getButtons:function(){return this.params.buttons},setButtons:function(){var b=arguments;1===arguments.length&&c.Lang.isArray(arguments[0])&&(b=arguments[0]);this.params.buttons=[];this.destroyButtons();b.forEach(function(a){this.params.buttons.push(a)},this);this.isVisible()&&this.renderButtons()},_removeButton:function(b){var a=c.Array.filter(this.getButtons(),function(a,
c){return a!==b&&a.type!==b},this);this.setButtons(a)},_getNextTabIndex:function(){return this.BUTTONS_BASE_IDX+this.lastTabIndex++},_disableButton:function(b){b.addClass("disabled").one("input").set("disabled","disabled")},renderButtons:function(){this.saveAndCloseButton=c.Node.create(c.Lang.sub('<input class="saveAndClose" tabIndex="{tabIndex}" type="button" value="Save &amp; Close" />',{tabIndex:this._getNextTabIndex()}));this.saveButton=c.Node.create(c.Lang.sub('<input class="save" tabIndex="{tabIndex}" type="button" value="Save" />',
{tabIndex:this._getNextTabIndex()}));this.cancelButton=c.Node.create(c.Lang.sub('<a class="cancel" href={href} tabIndex="{tabIndex}">Cancel</a>',{tabIndex:this._getNextTabIndex(),href:"javascript:noop();"}));this.removeButton=c.Node.create(c.Lang.sub('<input class="remove" tabIndex="{tabIndex}" type="button" value="Remove" />',{tabIndex:this._getNextTabIndex()}));this.buttonEvents.push(c.on("click",function(a){a.halt();this._getButtonClickHandler("saveAndClose",this.saveAndClose)(a)},this.saveAndCloseButton,
this),c.on("click",this._getButtonClickHandler("save",this.save),this.saveButton),c.on("click",this._getButtonClickHandler("remove",this.remove),this.removeButton),c.on("click",this._getButtonClickHandler("close",this.close),this.cancelButton),c.on("click",this._getButtonClickHandler("cancel",this.cancelClick),this.cancelButton));var b,a=c.clone(this.params.buttons);i=this.params.buttons.length;for(0<i&&a.reverse();0<=--i;){var f;if(b=a[i]){switch(b.type){case "cancel":this.cancelButton.set("innerHTML",
b.title);f=c.Node.create('<div class="cancel-block"></div>');f.append(this.cancelButton);break;case "save":this.saveButton.set("value",b.title);f=c.Node.create('<div class="button-block"></div>');f.append(this.saveButton);break;case "remove":this.removeButton.set("value",b.title);f=c.Node.create('<div class="button-block"></div>');f.append(this.removeButton);break;case "saveAndClose":this.saveAndCloseButton.set("value",b.title);f=c.Node.create('<div class="button-block"></div>');f.append(this.saveAndCloseButton);
break;default:var d;"text"===b.style?(d='<a href="javascript:noop();">'+b.title+"</a>",f=c.Node.create('<div class="cancel-block"></div>')):(d=c.Node.create('<input type="button" value="'+b.title+'" />'),b.className&&d.addClass(b.className),f=c.Node.create('<div class="button-block"></div>'));f.append(d);this.publish("button-"+b.type,{emitFacade:!0,prefix:"EditingDialog",broadcast:2});this.buttonEvents.push(c.on("click",this._getButtonClickHandler(b.type),d))}this.buttonHolder.append(f);b.disabled&&
this._disableButton(f)}}},cancelClick:function(b){this.fire("cancel-click")},_getButtonClickHandler:function(b,a){return c.bind(function(f){this.fire("button-"+b)?c.Lang.isFunction(a)&&a.call(this,f):f.halt();this.fire("button-click",{type:b})},this)},showSaveOverlay:function(b){this.params.disableSaveOverlay||(this.saveOverlay&&(this.saveOverlay.remove(),this.saveOverlay=null),b=this.titleEl.get("offsetHeight"),this.saveOverlay=c.Node.create('<div class="save-overlay">&nbsp;</div>'),this.saveOverlay.on("mousedown",
function(a){a.halt()}),this.saveOverlay.setStyles({height:this.mainEl.get("offsetHeight")-b-10+"px",marginTop:b+5+"px",width:this.bodyEl.get("offsetWidth")+"px"}),this.mainEl.append(this.saveOverlay),this.tabsEl.addClass("hidden"),this.saveOverlay.addClass("visible"))},hideSaveOverlay:function(){this.saveOverlay?(this.saveOverlay.addClass("hidden"),this.tabsEl.removeClass("hidden"),c.later(300,this,function(){this.saveOverlay.remove();this.saveOverlay=null}),this._setState("EDITING"),this.updateTitle()):
this._setState("EDITING")},allowEditing:function(){this.hideSaveOverlay();this.clearEdited();this.fire("editing-allowed");this._setState("EDITING")},save:function(){this._showLocalErrors()||(this._debug.log("save"),this.closeOnSend=!1,this._saveData())},_showLocalErrors:function(){this.hideErrors();var b=function(a){return a.inActiveFrame},a=this.currentTab,f=function(b){return b.inActiveFrame&&b.tab.name===a.name},d=c.Object.values(this.fields),d=this.params.validateActiveTabOnly?d.filter(f,this):
d.filter(b,this),g=!1,h={};c.Array.map(d,function(a){return{field:a,errors:a.getErrors()}}).forEach(function(a){var b=a.errors;b[b.length-1]&&(h[a.field.getName()]=b[b.length-1],g=!0)},this);g&&this.showErrors(h);return g},saveAndShow:function(){this._showLocalErrors()||(this._debug.log("saveAndShow"),this.closeOnSend=!1,this._saveData(),this.show())},saveAndClose:function(){this._showLocalErrors()||(this.fire("preClose"),this._debug.log("saveAndClose"),this.params.closeable&&(this.closeOnSend=!0),
this._saveData())},_saveData:function(){this._debug.log("_saveData");this._isState("SAVING")?this._debug.log("_saveData","Exiting because dialog state is in SAVING"):(this.clearEdited(),this.hideErrors(),this._setState("SAVING"),this.updateTitle(),this.showSaveOverlay(),this._debug.log("_saveData","fire","send-requested"),this.fire("send-requested"))},remove:function(b){b&&b.halt();this.fire("remove-requested")},canClose:function(b,a){if(!this._shown)return console.log("not yet shown!"),!1;if(!c.Array.every(this.childDialogs,
function(a){return a.canClose(this.saveAndClose,this.cancel)},this))return!1;if((this.edited||this.editedSinceLastSave)&&this.params.discardChangesConfirmation){var f=!1,d;for(d in this.fields)this.fields[d].didDataChange()&&(f=!0);if(f)return f=new c.Squarespace.Widgets.Confirmation({render:this.el.ancestor("body")||!0,style:c.Squarespace.Widgets.Confirmation.TYPE.CONFIRM_OR_REJECT,showOverlay:!0,"strings.confirm":"Save","strings.reject":"Discard","strings.title":"Review Changes","strings.message":"You have made changes. Do you want to save or discard them?"}),
f.on("confirm",function(){this.clearEdited();this._debug.log("canClose","calling onSuccess()",b);b.call(this)},this),f.on("reject",function(){this.clearEdited();this._debug.log("canClose","calling onReject()",a);a.call(this)},this),f.on("cancel",function(){c.Squarespace.EscManager.addTarget(this);this._debug.log("canClose","onCancel");this.fire("cancel-close")},this),this._debug.log("canClose",!1,"Showing confirmation dialog"),!1}this._debug.log("canClose",!0);return!0},close:function(b,a){this._debug.log("close",
b);if(!this._isState("EDITING")&&!this._isState("SAVING"))this._debug.log("close","Exiting because state is in Editing or Saving.");else{if(a)this._debug.log("canClose skipped due to force = true");else if(!1===this.canClose(this.saveAndClose,this.cancel)){this._debug.log("close","Exiting because canClose came back false");return}this.fire("close");this.dismiss(!0)}},cancel:function(b){this._debug.log("cancel",b);if(this._isState("EDITING")||this._isState("SAVING"))this.clearEdited(),this.fire("cancel"),
this.dismiss(!1)},dismiss:function(b){b=b?c.bind(this.destroy,this):c.bind(this._finishCancelation,this);this.fire("dismiss");this._setState("CLOSING");this.updateTitle();this.clearEdited();this._preDestroy();this.hideErrors();this.params.overlay&&this.restoreBodyScroll();switch(this.params.hideAnim){case "noHideAnimation":b();break;case "custom":this.params.customHideAnim(this.el,b);break;default:this.el.removeClass("visible"),c.later(e.animationDurationInMs,this,b)}this.params.overlay&&this.overlayEl&&
(this.overlayEl.destroying=!0,this.overlayEl.addClass("hidden"),c.later(300,this,function(){this.overlayEl.remove();this.overlayEl=null}))},_finishCancelation:function(){this.fire("render-anchor",this.getInitialData());this.destroy();this._setState("CLOSED");this.fire("canceled")},_preDestroy:function(){var b=0,a;this._preDestroyCalled=!0;b=c.Squarespace.OPEN_DIALOGS.indexOf(this);-1!==b&&c.Squarespace.OPEN_DIALOGS.splice(b,1);0===c.Squarespace.OPEN_DIALOGS.length&&c.one(document.body).removeClass("dialog-open");
this._applyMethodToChildren("close");b=0;for(a=this.timers.length;b<a;++b)this.timers[b].cancel();this.timers=[];c.Squarespace.EscManager&&c.Squarespace.EscManager.removeTarget(this);this.activeFlyout&&this.activeFlyout.field.closeFlyout();c.Squarespace.ToolTipManager&&this.params.disableTips&&c.Squarespace.ToolTipManager.enableTooltips();this.firstShowEvent&&(this.firstShowEvent.detach(),this.firstShowEvent=null);this.anchorEl&&this.anchorEl._node&&this.anchorEl.removeClass("targeted")},getErrors:function(){var b=
0,a={},f;for(f in this.fields){var c=this.fields[f],d=!1;if(d=this._isDialogField2(c)?c.get("required")&&c.isEmpty():c.config.required&&(""===c.getValue()||0===c.getValue()))a[c.getName()]="This is a required field.",b++}return{errors:b,errorSet:a}},send:function(){var b=this.getErrors(),a=b.errorSet;b.errors?(this.showErrors(a),this.fire("local-errors")):(this.closeOnSend&&(this.saved=!0,this.closeOnSend=!1,this.close()),this.fire("sent"))},updateAutoSave:function(b,a){if(this.autosaveEl.inDoc()){this.autosaveEl.setStyle("display",
"block");var f=this._anim({node:this.autosaveEl,from:{opacity:1},to:{opacity:0.5},duration:0.25,easing:c.Easing.easeOutStrong});f.on("end",function(){b?this.autosaveEl.set("innerHTML",b):(this.autosaveEl.set("innerHTML",'Last saved <span class="time"></span>.'),this.autosaveEl.one(".time").plug(c.Squarespace.RelativeTimeDisplay));a?this.autosaveEl.addClass("error"):this.autosaveEl.removeClass("error");this.autosaveEl.ancestor("body")&&this._anim({node:this.autosaveEl,from:{opacity:0.5},to:{opacity:1},
duration:0.25,easing:c.Easing.easeOutStrong}).run()},this);f.run()}this.editedSinceLastSave=!1},_recordFieldData:function(b,a){c.Object.each(a.fields,function(a){if(c.Lang.isFunction(a.getValue)){var d=a.getValue();b[a.getName()]=d;if(void 0!==a.getAssociatedVars)for(var d=a.getAssociatedVars(),g=0;g<d.length;g++)b[d[g].name]=d[g].value}a.fields&&this._recordFieldData(b,a)},this)},getData:function(){var b={},a;for(a in this.params.initialData)b[a]=this.params.initialData[a];this._recordFieldData(b,
this);return b},getField:function(b){var a=this.fields[b];if(c.Lang.isValue(a))return a;for(var f in this.fields)if(this.fields[f].getField&&(a=this.fields[f].getField(b),c.Lang.isValue(a)))return a},getSection:function(b){return this.sections[b]},_renderFields:function(b,a,f,d){c.Array.each(a,function(g,h){var m;if(g){var e=g.type;!d&&!this.params.dontSetWidthOnFields&&(d=this.params.width-60);d&&!isNaN(d)&&(this._debug.log("availableWidth: ",d),this._debug.log("fieldConfig.width: ",g.width),m=(g.ctor&&
g.config?g.config.width:g.width)||1,m=1>=m?Math.floor(m*d):m);"splitter"===e?this._renderSplitter(g,h,a,b,f,d,m):"multi-frame"===e?this._renderMultiFrame(g,h,a,b,f,d,m):"section"===e?this._renderSection(g,h,a,b,f,d,m):"stack"===e?this._renderStack(g,h,a,b,f,d,m):g.ctor&&g.ctor===c.Squarespace.DialogFields.MultiFrame?this._renderDF2MultiFrame(g,h,a,b,f,d,m):this._renderField(g,h,a,b,f,d,m)}},this)},_renderSplitter:function(b,a,f,d,g,h,m){a=c.Node.create('<div class="split-field clear '+(1<b.fields.length?
"padding-adjust":"")+'"></div>');b.width||(b.width=1);h&&!isNaN(h)?(a.setStyle("width",Math.round(b.width*h)+30+"px"),h-=30*(b.fields.length-1)):h=g.get("offsetWidth")-30*(b.fields.length-1)-60;g.append(a);this._renderFields(d,b.fields,a,h);b.countHeight&&(this._takenHeight+=a.get("offsetHeight"));b.hidden&&a.hide()},_renderMultiFrame:function(b,a,f,d,g,h,m){a=new c.Squarespace.DialogFieldGenerators["multi-frame"](b,this.params.initialData,this);a.type=b.type;a.append(d,f,g,h);a.getName()?this.fields[a.getName()]=
a:this._noNameFields.push(a)},_renderDF2MultiFrame:function(b,a,f,d,g,h,m){a=c.merge(b,b.config,{dialog:this,data:this.params.initialData[b.config.name],render:g});b=new b.ctor(a);h&&b.get("boundingBox").setStyle("width",m+"px");(h=b.getName()||b.get("name"))?this.fields[h]=b:this._noNameFields.push(b);b.each(function(a){var b=a.getName()||a.get("name");b?this.fields[b]=a:this._noNameFields.push(a);d.tabFields.push(a);a.tab=d},this)},_renderSection:function(b,a,f,d,g,h,m){a=c.Node.create('<div class="section-inner clear"></div>');
f="section-field container-field-wrapper field-wrapper clear ";void 0!==b.style&&(f+=b.style);f=c.Node.create('<div class="'+f+'"></div>');f.append(a);g.append(f);b.width||(b.width=1);(g=Math.round(b.width*h))&&f.setStyle("width",g+"px");h=Math.round(b.width*h);this._renderFields(d,b.fields,a,h);b.hidden&&f.hide();b.name&&(this.sections[b.name]=f)},_renderStack:function(b,a,f,d,g,h,m){(m=h)||(m=this.params.width-60);h=c.Node.create('<div class="stack-field stack-field-wrapper clear"></div>');g.append(h);
b.width||(b.width=1);b["float"]&&h.setStyle("float",b["float"]);h.setStyle("width",Math.round(b.width*m)+"px");a!==f.length-1&&h.setStyle("paddingRight","30px");a=Math.round(b.width*m);this._renderFields(d,b.fields,h,a);b.hidden&&h.hide();b.name&&(this.sections[b.name]=h)},_renderField:function(b,a,f,d,g,h,m){var e;a=c.merge(b,b.config||{},{dialog:this,render:g});f=a.name||b.name;this._debug.isTimingEnabled()&&this._debug.time("render field: "+f);c.Lang.isUndefined(a.data)&&(this.params.initialData&&
!c.Lang.isUndefined(f))&&(a.data=this.params.initialData[f],a.panel=this);if(b.ctor)e=new b.ctor(a);else{if(!b.type)throw console.error("dialog: field type was",b.type,", and constructor was",b.ctor),console.error("dialog: config was",b),Error("Could not find field constructor or field type.");var p=this._convertToDialogField2Name(b.type),p=c.namespace("Squarespace.DialogFields")[p];if(!p&&!c.Squarespace.DialogFieldGenerators[b.type])throw Error("Unknown field type: "+b.type);this._debug.log("Generating field type: ",
b.type);p?e=new p(a):(console.log("Attempting to use DFG: ",b.type),e=new c.Squarespace.DialogFieldGenerators[b.type](b,this.params.initialData,this),e.type=b.type,e.append(g))}b.verticalSpan&&(this._verticalEl=e);b.countHeight&&!b.verticalSpan&&(e.getTakenHeight?this._takenHeight+=e.getTakenHeight():(this._takenHeight+=e.get("boundingBox").get("offsetHeight"),this._takenHeight+=parseInt(e.get("boundingBox").getStyle("marginTop"),10),this._takenHeight+=parseInt(e.get("boundingBox").getStyle("marginBottom"),
10)));h&&(this._isDialogField2(e)?(this._debug.log("setting width",m),e.get("boundingBox").setStyle("width",m+"px")):e.html&&(this._debug.log("setting width",m),e.html.setStyle("width",m+"px")));e.resize&&e.resize();b.hidden&&e.temporaryHide(!0);this._isDialogField2(e)?this.bodyEvents.push(e.on("dataStateChange",function(a){a=a.newVal;e.getProperty("DATA_STATES");this.fire("field-loading-change",{field:e,loading:a===a.LOADING})},this)):this.bodyEvents.push(e.on("loadingChange",function(a){this.fire("field-loading-change",
{field:e,loading:a.newVal})},this));e.getName()?this.fields[e.getName()]=e:this._noNameFields.push(e);d.tabFields.push(e);e.tab=d;this._debug.isTimingEnabled()&&this._debug.timeEnd("render field: "+f)},_isDialogField2:function(b){return c.Lang.isValue(b)&&c.Lang.isValue(c.Squarespace.DialogField2)&&b instanceof c.Squarespace.DialogField2},_setState:function(b){c.Lang.isValue(c.Squarespace.DialogStates[b])?this.state=c.Squarespace.DialogStates[b]:console.warn("[Dialog] Invalid state.")},_isState:function(b){return c.Lang.isString(b)?
this.state===c.Squarespace.DialogStates[b]:this.state===b},resizeVerticalFields:function(){c.Array.each(this.verticalFields,function(b,a){var f=this.getBodyHeight()-b._takenHeight;this._isDialogField2(b)?(f-=parseInt(b.get("boundingBox").getStyle("marginTop"),10),f-=parseInt(b.get("boundingBox").getStyle("marginBottom"),10),b.set("height",f)):b.setHeight(f)},this)},renderTab:function(b,a){var f=c.Node.create('<div class="tab-wrapper"></div>');c.Lang.isValue(b.name)&&f.addClass("dialog-tab-"+b.name);
f.setStyles({width:this.params.width+"px",left:a?"0px":this.params.width+"px"});this.bodyEl.append(f);b.tabFields=[];this._verticalEl=null;this._takenHeight=0;this._renderFields(b,b.fields||[],f);b.noTabTitle&&f.addClass("noTabTitle");if(this._verticalEl){var d=parseInt(f.getStyle("paddingTop"),10);isNaN(parseInt(f.getStyle("marginTop"),10))||(d+=parseInt(f.getStyle("marginTop"),10));this._takenHeight+=d;var g=this._isDialogField2(this._verticalEl);!g&&!this._verticalEl.setHeight&&console.error("No setHeight for vertical el: ",
this._verticalEl);d=this.getBodyHeight()-this._takenHeight;g?(g=this._verticalEl.get("boundingBox"),d-=parseInt(g.getStyle("marginTop"),10),d-=parseInt(g.getStyle("marginBottom"),10),this._verticalEl.set("height",d)):this._verticalEl.setHeight(d);this._verticalEl._takenHeight=this._takenHeight;this.verticalFields.push(this._verticalEl)}b.tabPanelObj=f;this.observedHeight+=f.get("offsetHeight");a&&b.tabFields&&c.Array.forEach(b.tabFields,function(a){this._showField(a)},this);this.bodyEl.toggleClass("scrollable",
!!b.scroll);a||f.addClass("hidden");return f},_convertToDialogField2Name:function(b){b=c.Squarespace.Utils.slugify(b).split("-");for(var a=b.length-1;0<=a;a--)b[a].capitalize&&(b[a]=b[a].capitalize());return b.join("")+"Field"},_destroyFields:function(){this.fields&&(c.Object.each(this.fields,function(b,a){b.destroy()},this),this._destroyNoNameFields());this.fields={}},_destroyNoNameFields:function(){c.Array.each(this._noNameFields,function(b){b&&b.destroy()},this);this._noNameFields=[]},destroyBody:function(){this.rendered=
!1;this._destroyFields();this.bodyEl&&this.bodyEl._node&&this.bodyEl.empty();c.Array.each(this.params.tabs,function(b){b.tabPanelObj=null;b.tabNavigationObj=null;b.tabFields=null});this._detachEventArray(this.bodyEvents);this.bodyEvents=[]},_detachEventArray:function(b){c.Array.each(b,function(a){a.detach()})},destroyButtons:function(){this._detachEventArray(this.buttonEvents);this.buttonEvents=[];this.buttonHolder&&this.buttonHolder._node&&this.buttonHolder.set("innerHTML","")},_destroy:function(){this.preDestroyCalled||
this._preDestroy();this.bodyHeight=this.currentErrors=this.destroyTimer=null;this.destroyBody();this.destroyButtons();this.overlayEl&&!this.overlayEl.destroying&&(this.overlayEl.remove(),this.overlayEl=null);this._onBeforeUnloadEvt&&this._onBeforeUnloadEvt.detach();this._detachEventArray(this.globalEvents);this.dd&&(this.dd.destroy(),this.dd=null);this.globalEvents=[];this.el&&(this.el.remove(!0),this.bodyEl=this.el=null);this.params.parentDialog&&(this.params.parentDialog.removeChildDialog(this),
this.params.parentDialog=null);this._setState("CLOSED");this.anchorEl=this.position=null}})},"1.0",{requires:"anim attribute datatype-date dd json node node-event-simulate node-focusmanager squarespace-beforeunload squarespace-debugger squarespace-dialog-field-2 squarespace-dialog-fields squarespace-dialog-legacy-multi-frame squarespace-escmanager squarespace-gizmo squarespace-plugin-scroll-lock squarespace-ui-base squarespace-util squarespace-widgets-confirmation transition".split(" ")})},1219:function(l,
n){YUI.add("squarespace-dialog-legacy-multi-frame",function(d){d.namespace("Squarespace.DialogFieldGenerators");d.Squarespace.DialogFieldGenerators["multi-frame"]=Class.extend(d.Squarespace.DialogField,{initialize:function(e,c,b){this._super(e,c,b);this.frames={};this.activeEl=null;this.value=this.config.initialFrame;this.panel.bodyEvents.push(d.on("click",this.onClick,this.html,this))},onClick:function(d){this.panel.fire("datachange",this)},show:function(e){var c=this.frames[e];if(!(c&&c===this.activeEl)){if(this.activeEl){this.activeEl.a&&
this.activeEl.a.stop();var b=this.activeEl.fields;this.activeEl.a=this._anim({node:this.activeEl.el,to:{height:0},duration:0.3,easing:d.Easing.easeOutStrong});b.forEach(this.setInActiveFrame(!1),this);this.activeEl.a.on("end",function(a){a.target.get("node").addClass("hidden")},this);this.activeEl.a.run()}c.a&&c.a.stop();this.activeEl&&c.el.ancestor().insertBefore(c.el,this.activeEl.el.next());c.el.removeClass("hidden");b=c.el.getStyle("height");c.el.setStyles({height:null});c.realHeight=c.el.get("offsetHeight");
c.el.setStyles({height:b});c.a=this._anim({node:c.el,to:{height:c.realHeight},duration:0.3,easing:d.Easing.easeOutStrong});c.a.on("end",function(a,b){for(var c=0;c<b.fields.length;++c){var d=this.panel.fields[b.fields[c].name];d&&d.updateInlineTitle&&d.updateInlineTitle()}this.focusCurrentFrame()},this,c);c.a.run();c.fields.forEach(this.setInActiveFrame(!0),this);this.activeEl=c;this.value=e}},focusCurrentFrame:function(){for(var e,c=0;c<this.activeEl.fields.length;++c)if(e=this.activeEl.fields[c],
e=this.panel.fields[e.name||d.Object.getValue(e,["config","name"])],d.Lang.isValue(e)&&e.getNode){e.getNode().focus();break}},setInActiveFrame:function(d){return function(c){c.name&&(c=this.panel.getField(c.name),c.inActiveFrame=d,c.fire("mutli-frame-focus"))}},append:function(e,c,b,a){for(var f in this.config.frames){c=this.config.frames[f];var k=d.Node.create('<div class="frame-wrapper clear"></div>');b.append(k);this.panel._renderFields(e,c.fields,k,a);this.frames[f]=this.config.frames[f];this.frames[f].el=
k;this.frames[f].realHeight=k.get("offsetHeight");f!=this.config.initialFrame?(k.setStyle("height","0px"),k.addClass("hidden"),this.frames[f].visible=!1,this.config.frames[f].fields.forEach(this.setInActiveFrame(!1),this)):(this.activeEl=this.frames[f],this.frames[f].visible=!0,this.config.frames[f].fields.forEach(this.setInActiveFrame(!0),this))}}})},"1.0.0",{requires:["anim","squarespace-dialog-fields","squarespace-util","widget"]})},1222:function(l,n){YUI.add("squarespace-gizmo",function(d){d.namespace("Squarespace");
var e=/[ ]+/g,c=/[^a-zA-Z0-9\-]/g,b=function(a,b,c,h,e){return(e?d.Array.reject:d.Array.filter)(a,function(a){for(var f=0;f<c.length;++f)if(a[c[f]]!==h[f])return!1;b&&b(a);return!0})},a=function(b,c,g,h,e){if(!this._destroyed){if(d.Lang.isArray(c))return d.Array.map(c,function(c){return a.apply(this,[b].concat(d.Array(c)))},this);if(d.Lang.isObject(c)&&d.Lang.isFunction(c[b])){var q=[g,h,e||this],q=q.concat(Array.prototype.slice.call(arguments,5)),q=c[b].apply(c,q);this._eventSubList.push({object:c,
event:g,eventSub:q});return q}throw"Gizmo["+this._name+"]: Could not subscribe to event: "+g;}};d.Squarespace.Gizmo=Class.create({_name:"Gizmo",_events:{render:{},rendered:{},destroy:{},destroyed:{}},initialize:function(a){d.augment(this,d.EventTarget,!0,null,{prefix:this._name});this.params=d.merge(a);this._initState();a=this;for(var b=function(a,b){this.publish(b,a)};null!==a&&void 0!==a;)d.Object.each(a._events,b,this),a=a.superclass},getClassNames:function(){for(var a=this,b=[];;a=a.superclass){if(!a)return b;
b.push(a.getClassName())}},_initState:function(){this._parentEl=this._el=null;this._eventSubList=[];this._anims=[];this._timers=[];this.destroyed=this._destroyed=!1;this._children=[];this._guid=d.guid();this._name||(this._name="No Name")},getClassName:function(){return this._name},getId:function(){return this._guid},getCssClassName:function(){var a=this._name,a=a.trim().replace(e,"-").replace(c,"").toLowerCase();return"squarespace-"+a},getElement:function(){return this._el},render:function(a){this.fire("render");
a=a||this._parentEl;this.params.noBoundingBox?this._el=this._render():(this._el=d.Node.create("<div></div>"),this._el.addClass(this.getCssClassName()+"-bbox"),this._el.append(this._render()));a&&d.Lang.isFunction(a.append)&&a.append(this._el);this._parentEl=a;this.fire("rendered")},_render:function(){},_subscribe:function(b,c,g,h){var e=["on"].concat(d.Array(arguments));return a.apply(this,e)},_subscribeOnce:function(b,c,g,h){var e=["once"].concat(d.Array(arguments));return a.apply(this,e)},_subscribeBefore:function(b,
c,g,h){var e=["before"].concat(d.Array(arguments));return a.apply(this,e)},_subscribeAfter:function(b,c,g,h){var e=["after"].concat(d.Array(arguments));return a.apply(this,e)},_unsubscribe:function(a,c){this._eventSubList=b(this._eventSubList,function(a){a.eventSub.detach()},c?["object","event"]:["object"],d.Array(arguments),!0)},_detach:function(a){this._eventSubList=b(this._eventSubList,function(a){a.eventSub.detach()},["eventSub"],[a],!0)},_clearEvents:function(){for(var a=this._eventSubList,b=
0;b<a.length;++b)a[b].eventSub.detach();this._eventSubList=[]},destroy:function(){if(this._destroyed)console.warn("Gizmo["+this._name+"] already destroyed.");else{if(!this._eventSubList)throw console.error("Gizmo not initialized for...",this),"Gizmo["+this._name+"] was never initialzed.  Missing _super?";this.fire("destroy");this._destroy();var a=0;this._clearEvents();this._eventSubList=[];var b=[];d.Array.each(this._anims,function(a){b.push(a)},this);d.Array.each(b,function(a){a.get("running")&&
a.stop(!1);a.destroy()});this._anims=null;for(a=this._children;0<a.length;){var c=a[0];c._removeParent();c.destroy()}this._children=null;c=this._timers;for(a=0;a<c.length;++a)c[a].cancel();this._timers=null;this._el&&d.Lang.isFunction(this._el.remove)&&(this._el.remove(),this._el=null);this.destroyed=this._destroyed=!0;this.fire("destroyed")}},_destroy:function(){},isDestroyed:function(){return this._destroyed},_setParent:function(a){this._parentGizmo=a},_removeParent:function(){this._parentGizmo&&
(this._parentGizmo._removeChild(this),this._parentGizmo=null)},_addChild:function(a){this._children&&(a._setParent&&a._setParent(this),this._children.push(a))},_removeChild:function(a){this._children.splice(this._children.indexOf(a),1)},_getChildren:function(){return this._children},_anim:function(a){if(!this._destroyed){if(!a.node)throw Error("Gizmo["+this._name+"]: Animation must specify a node!");var b;a.node.ancestor("body",!0)?a.node._node?(b=new d.Anim(a),b.on("end",function(a){this._removeAnim(b)},
this),this._anims.push(b)):(console.warn("Gizmo["+this._name+"]: _anim passed a YUI node with _node = null! Returning an empty animation."),console.trace(),b=new d.Anim):(console.warn("Gizmo["+this._name+"]: _anim passed a YUI node not in the DOM! Returning an empty animation."),b=new d.Anim);return b}},_removeAnim:function(a){a=this._anims.indexOf(a);-1!==a&&this._anims.splice(a,1)},_trace:function(a){for(var b=this.getEvent(a).getSubs(),c=[],h=function(a,b){if(a.context&&a.context.getName)c.push(a.context.getName());
else{var d={};d[a.fn.name]=a.fn.toString();c.push(d)}},e=0;e<b.length;++e)d.Object.each(b[e],h);console.log("[trace] Event",a,"is notifying the following:",c);this.fire(a)},_later:function(a,b,c,h,e){if(!this._destroyed)return a=d.later(a,c||this,b,h,e),this._timers.push(a),a},_cb:function(a){return d.bind(function(){if(!this._destroyed)return a.apply(this,arguments)},this)}});d.augment(d.Squarespace.Gizmo,d.EventTarget);d.Squarespace.ZombieGizmo=Class.extend(d.Squarespace.Gizmo,{_name:"ZombieGizmo",
_events:{resurrect:{},resurrected:{}},initialize:function(a){this._super(a)},destroy:function(){this._super();this.resurrect()},resurrect:function(){this.fire("resurrect");this._initState();this.fire("resurrected")}})},"1.0",{requires:["array-extras","node","event-custom"]})},1242:function(l,n,d){YUI.add("squarespace-node-flyout",function(d){d.namespace("Squarespace.Animations").Flyout=d.Base.create("flyoutPlugin",d.Plugin.Base,[],{initializer:function(c){this._mask=d.Node.create('<div class="flyout-animation-wrapper sqs-flyout-mask"></div>');
this._mask.setStyles({position:"fixed",overflow:this.get("overflow")});this._mask.setStyle("z-index","300001");this._mask.setStyle("zIndex","300001");this._isHiding=this._isShowing=!1},destructor:function(){this._anim&&this._anim.stop().destroy();this._mask.remove(!0);d.detachAll(this.get("id")+"|*")},_onScroll:function(c){var b=this.get("host");(c.target.contains(b)||c.currentTarget.contains(b))&&this._updateMaskPosition()},_onResize:function(){this._updateMaskPosition()},show:function(){!this.get("visible")&&
!this._isShowing&&this._animateFlyout(!0)},hide:function(){this.get("visible")&&!this._isHiding&&this._animateFlyout(!1)},_measureNode:function(c){return d.Squarespace.NodeUtils.measureNode(c)},_animateFlyout:function(c){var b=this._mask,a=this.get("node");a.get("region");var f=this._measureNode(a),k=this._getInitialFlyoutOffset();this._updateMaskPosition();this._anim&&(this._anim.stop(!0),this._anim=null);c&&(b.setStyles({height:f.height,width:f.width+1}),a.setStyles({position:"absolute",top:k.yOffset,
left:k.xOffset}),b.appendChild(a),(this.get("renderTarget")||d.one("body")).appendChild(b));this._anim=new d.Anim({duration:this.get("duration"),easing:this.get("easing"),node:a,to:{top:c?0:k.yOffset,left:c?0:k.xOffset}});this.get("animateOpacity")&&(this._anim.set("from.opacity",c?0:1),this._anim.set("to.opacity",c?1:0));this._anim.on(this._yuid+"|end",function(){this._anim=null;c?(this._isShowing=!1,this._mousewheelEvent=d.on(this.get("id")+"|mousewheel",this._onScroll,this),this._resizeEvent=d.one(window).on(this.get("id")+
"|resize",this._onResize,this)):(this._isHiding=!1,a.remove(),b.remove(),this._mousewheelEvent&&(this._mousewheelEvent.detach(),this._mousewheelEvent=null),this._resizeEvent&&(this._resizeEvent.detach(),this._resizeEvent=null));this.set("visible",c);this.fire(c?"shown":"hidden",{flyout:a});this.get("host").fire("shown",{flyout:a})},this);c?this._isShowing=!0:this._isHiding=!0;a.inDoc()&&this._anim.run()},_updateMaskPosition:function(){if(this._mask){var c=this._mask,b=this._getIntendedMaskPosition();
c.setStyles({left:b.x,top:b.y});return b}},_getInitialFlyoutOffset:function(){var c=d.Squarespace.Animations.Flyout,b=this.get("alignment"),a=this._measureNode(this.get("node")),f;switch(b){case c.LT:case c.LC:case c.LR:f=a.width;break;case c.TL:case c.TC:case c.TR:case c.BL:case c.BC:case c.BC:f=0;break;case c.RT:case c.RC:case c.RB:f=-1*a.width;break;default:throw Error("Flyout: This should never happened, check your alignment settings");}switch(b){case c.LT:case c.LC:case c.LB:case c.RT:case c.RC:case c.RB:c=
0;break;case c.BL:case c.BC:case c.BR:c=-1*a.height;break;case c.TL:case c.TC:case c.TR:c=a.height;break;default:throw Error("Flyout: This should never happened, check your alignment settings");}return{xOffset:f,yOffset:c}},_getIntendedMaskPosition:function(){var c=d.Squarespace.Animations.Flyout,b=this.get("alignment"),a=this.get("host").get("region"),f=this._measureNode(this.get("node")),k;k=d.DOM.docScrollY();var g=d.DOM.docScrollX();a.top-=k;a.bottom-=k;a.left-=g;a.right-=g;switch(b){case c.RT:case c.RC:case c.RB:k=
a.right;break;case c.LT:case c.LC:case c.LB:k=a.left-f.width;break;case c.TL:case c.BL:k=a.left;break;case c.TC:case c.BC:k=a.left+a.width/2-f.width/2;break;case c.TR:case c.BR:k=a.right-f.width;break;default:throw Error("Flyout: This should never happened, check your alignment settings");}switch(b){case c.TL:case c.TC:case c.TR:c=a.top-f.height;break;case c.LT:case c.RT:c=a.top;break;case c.LC:case c.RC:c=a.top+a.height/2-f.height/2;break;case c.LB:case c.RB:c=a.bottom-f.height;break;case c.BL:case c.BC:case c.BR:c=
a.bottom;break;default:throw Error("Flyout: This should never happened, check your alignment settings");}return{x:k,y:c}}},{NS:"flyoutPlugin",TL:"tl",TC:"tc",TR:"tr",RT:"rt",RC:"rc",RB:"rb",BC:"bc",BL:"bl",BR:"br",LT:"lt",LC:"lc",Lb:"lb",ATTRS:{duration:{value:0.3,validator:d.Lang.isNumber},easing:{value:d.Easing.easeOutStrong},alignment:{value:"rt",validator:function(c){var b=d.Squarespace.Animations.Flyout;switch(c){case b.TL:case b.TC:case b.TR:case b.LT:case b.RT:case b.LC:case b.RC:case b.LB:case b.RB:case b.BL:case b.BC:case b.BR:return!0;
default:return console.warn(this.name+": Invalid alignment value ("+c+")"),!1}}},node:{value:null},animateOpacity:{value:!0},renderTarget:{valueFn:function(){var c=this.get("host");return c instanceof d.Node&&c.ancestor("body")?c.ancestor("body"):d.one("body")}},overflow:{value:"hidden"},visible:{value:!1}}})},"1.0",{requires:["base","node","plugin","squarespace-node-utils"]})},1243:function(l,n){YUI.add("squarespace-node-utils",function(d){d.namespace("Squarespace.NodeUtils");d.Squarespace.NodeUtils=
{measureNode:function(e){var c=e.inDoc();c||(e.setStyle("visibility","hidden"),d.one("body").appendChild(e));var b=e.cloneNode(!0);b.setStyles({visibility:"hidden",display:"block",position:"absolute"});e.insert(b,"after");var a=b.get("offsetHeight"),f=b.get("offsetWidth");b.remove(!0);c||(e.remove(),e.setStyle("visibility",null));return{height:a,width:f}},getClosestScrollingAncestor:function(e){return e.ancestor(d.Squarespace.NodeUtils.isScrollable,!0,"body")},isScrollable:function(d){d=d.getStyle("overflowY");
return"auto"===d||"scroll"===d}}},"1.0")},1257:function(l,n){YUI.add("squarespace-widgets-data-widget",function(d){d.namespace("Squarespace.Widgets");var e=d.Squarespace.Widgets.DataWidget=d.Base.create("dataWidget",d.Squarespace.Widgets.SSWidget,[],{initializer:function(c){c.dataState||(this.getProperty("ASYNC_DATA")?this.set("dataState",this.getProperty("DATA_STATES").INITIALIZED):this.set("dataState",this.getProperty("DATA_STATES").LOADED))},renderUI:function(){e.superclass.renderUI.call(this);
this._updateDataStateClassName()},bindUI:function(){e.superclass.bindUI.call(this);var c=this.get("id");this.after(c+"|dataChange",function(b){b.noSyncUI||this.syncUI()},this);this.after(c+"|dataStateChange",this._updateDataStateClassName,this)},_updateDataStateClassName:function(){var c=this.get("boundingBox"),b=this.get("dataState");d.Object.each(this.getProperty("DATA_STATES"),function(a){c.removeClass("data-state-"+a)});c.addClass("data-state-"+b)},setLoadingState:function(){return this.set("dataState",
this.getProperty("DATA_STATES").LOADING)},setLoadedState:function(){return this.set("dataState",this.getProperty("DATA_STATES").LOADED)},setLoadFailedState:function(){return this.set("dataState",this.getProperty("DATA_STATES").LOAD_FAILED)},loadedSuccessfully:function(){return this.get("dataState")===this.getProperty("DATA_STATES").LOADED},isLoading:function(){return this.get("dataState")===this.getProperty("DATA_STATES").LOADING},loadFailed:function(){return this.get("dataState")===this.getProperty("DATA_STATES").LOAD_FAILED}},
{CSS_PREFIX:"sqs-data-widget",ASYNC_DATA:!1,DATA_STATES:{INITIALIZED:"initialized",LOADING:"loading",LOADED:"loaded",LOAD_FAILED:"load-failed"},ATTRS:{data:{value:null,validator:function(c){return d.Lang.isUndefined(c)?(console.warn(this.name+": Will not set data to undefined."),!1):!0}},dataState:{valueFn:function(){return this.getProperty("DATA_STATES").INITIALIZED}},preventRenderTemplate:{value:!1,validator:d.Squarespace.AttrValidators.isBoolean}}})},"1.0",{requires:["base","node","widget","squarespace-ss-widget",
"squarespace-attr-validators"]})},1264:function(l,n){YUI.add("dd-constrain",function(d,e){var c=d.DD.DDM,b=null,a=function(){this._lazyAddAttrs=!1;a.superclass.constructor.apply(this,arguments)};a.NAME="ddConstrained";a.NS="con";a.ATTRS={host:{},stickX:{value:!1},stickY:{value:!1},tickX:{value:!1},tickY:{value:!1},tickXArray:{value:!1},tickYArray:{value:!1},gutter:{value:"0",setter:function(a){return d.DD.DDM.cssSizestoObject(a)}},constrain:{value:"view",setter:function(a){var b=d.one(a);b&&(a=b);
return a}},constrain2region:{setter:function(a){return this.set("constrain",a)}},constrain2node:{setter:function(a){return this.set("constrain",d.one(a))}},constrain2view:{setter:function(){return this.set("constrain","view")}},cacheRegion:{value:!0}};b={_lastTickXFired:null,_lastTickYFired:null,initializer:function(){this._createEvents();this._eventHandles=[this.get("host").on("drag:end",d.bind(this._handleEnd,this)),this.get("host").on("drag:start",d.bind(this._handleStart,this)),this.get("host").after("drag:align",
d.bind(this.align,this)),this.get("host").after("drag:drag",d.bind(this.drag,this))]},destructor:function(){d.Array.each(this._eventHandles,function(a){a.detach()});this._eventHandles.length=0},_createEvents:function(){d.Array.each(["drag:tickAlignX","drag:tickAlignY"],function(a){this.publish(a,{type:a,emitFacade:!0,bubbles:!0,queuable:!1,prefix:"drag"})},this)},_handleEnd:function(){this._lastTickXFired=this._lastTickYFired=null},_handleStart:function(){this.resetCache()},_regionCache:null,_cacheRegion:function(){this._regionCache=
this.get("constrain").get("region")},resetCache:function(){this._regionCache=null},_getConstraint:function(){var a=this.get("constrain"),b=this.get("gutter"),c;a&&(a instanceof d.Node?(this._regionCache||(this._eventHandles.push(d.on("resize",d.bind(this._cacheRegion,this),d.config.win)),this._cacheRegion()),c=d.clone(this._regionCache),this.get("cacheRegion")||this.resetCache()):d.Lang.isObject(a)&&(c=d.clone(a)));if(!a||!c)a="view";"view"===a&&(c=this.get("host").get("dragNode").get("viewportRegion"));
d.Object.each(b,function(a,b){c[b]="right"===b||"bottom"===b?c[b]-a:c[b]+a});return c},getRegion:function(a){var b={},c=null,d=null,d=this.get("host"),b=this._getConstraint();a&&(c=d.get("dragNode").get("offsetHeight"),d=d.get("dragNode").get("offsetWidth"),b.right-=d,b.bottom-=c);return b},_checkRegion:function(a){var b=this.getRegion(),c=this.get("host"),d=c.get("dragNode").get("offsetHeight"),c=c.get("dragNode").get("offsetWidth");a[1]>b.bottom-d&&(a[1]=b.bottom-d);b.top>a[1]&&(a[1]=b.top);a[0]>
b.right-c&&(a[0]=b.right-c);b.left>a[0]&&(a[0]=b.left);return a},inRegion:function(a){a=a||this.get("host").get("dragNode").getXY();var b=this._checkRegion([a[0],a[1]]),c=!1;a[0]===b[0]&&a[1]===b[1]&&(c=!0);return c},align:function(){var a=this.get("host"),b=[a.actXY[0],a.actXY[1]],c=this.getRegion(!0);this.get("stickX")&&(b[1]=a.startXY[1]-a.deltaXY[1]);this.get("stickY")&&(b[0]=a.startXY[0]-a.deltaXY[0]);c&&(b=this._checkRegion(b));b=this._checkTicks(b,c);a.actXY=b},drag:function(){var a=this.get("host"),
b=this.get("tickX"),c=this.get("tickY"),a=[a.actXY[0],a.actXY[1]];if((d.Lang.isNumber(b)||this.get("tickXArray"))&&this._lastTickXFired!==a[0])this._tickAlignX(),this._lastTickXFired=a[0];if((d.Lang.isNumber(c)||this.get("tickYArray"))&&this._lastTickYFired!==a[1])this._tickAlignY(),this._lastTickYFired=a[1]},_checkTicks:function(a,b){var d=this.get("host"),h=d.startXY[0]-d.deltaXY[0],d=d.startXY[1]-d.deltaXY[1],e=this.get("tickX"),q=this.get("tickY");e&&!this.get("tickXArray")&&(a[0]=c._calcTicks(a[0],
h,e,b.left,b.right));q&&!this.get("tickYArray")&&(a[1]=c._calcTicks(a[1],d,q,b.top,b.bottom));this.get("tickXArray")&&(a[0]=c._calcTickArray(a[0],this.get("tickXArray"),b.left,b.right));this.get("tickYArray")&&(a[1]=c._calcTickArray(a[1],this.get("tickYArray"),b.top,b.bottom));return a},_tickAlignX:function(){this.fire("drag:tickAlignX")},_tickAlignY:function(){this.fire("drag:tickAlignY")}};d.namespace("Plugin");d.extend(a,d.Base,b);d.Plugin.DDConstrained=a;d.mix(c,{_calcTicks:function(a,b,c,d,e){var q=
(a-b)/c,p=Math.floor(q),r=Math.ceil(q);if((0!==p||0!==r)&&q>=p&&q<=r)a=b+c*p,d&&e&&(a<d&&(a=b+c*(p+1)),a>e&&(a=b+c*(p-1)));return a},_calcTickArray:function(a,b,c,d){var e=0,q=b.length,p=0,r;if(!b||0===b.length)return a;if(b[0]>=a)return b[0];for(e=0;e<q;e++)if(p=e+1,b[p]&&b[p]>=a)return r=a-b[e],a=b[p]-a,p=a>r?b[e]:b[p],c&&d&&p>d&&(p=b[e]?b[e]:b[q-1]),p;return b[b.length-1]}})},"3.17.2",{requires:["dd-drag"]})},1265:function(l,n){YUI.add("dd-ddm-base",function(d,e){var c=function(){c.superclass.constructor.apply(this,
arguments)};c.NAME="ddm";c.ATTRS={dragCursor:{value:"move"},clickPixelThresh:{value:3},clickTimeThresh:{value:1E3},throttleTime:{value:-1},dragMode:{value:"point",setter:function(b){this._setDragMode(b);return b}}};d.extend(c,d.Base,{_createPG:function(){},_active:null,_setDragMode:function(b){null===b&&(b=d.DD.DDM.get("dragMode"));switch(b){case 1:case "intersect":return 1;case 2:case "strict":return 2}return 0},CSS_PREFIX:d.ClassNameManager.getClassName("dd"),_activateTargets:function(){},_drags:[],
activeDrag:!1,_regDrag:function(b){if(this.getDrag(b.get("node")))return!1;this._active||this._setupListeners();this._drags.push(b);return!0},_unregDrag:function(b){var a=[];d.Array.each(this._drags,function(c){c!==b&&(a[a.length]=c)});this._drags=a},_setupListeners:function(){this._createPG();this._active=!0;var b=d.one(d.config.doc);b.on("mousemove",d.throttle(d.bind(this._docMove,this),this.get("throttleTime")));b.on("mouseup",d.bind(this._end,this))},_start:function(){this.fire("ddm:start");this._startDrag()},
_startDrag:function(){},_endDrag:function(){},_dropMove:function(){},_end:function(){this.activeDrag&&(this._shimming=!1,this._endDrag(),this.fire("ddm:end"),this.activeDrag.end.call(this.activeDrag),this.activeDrag=null)},stopDrag:function(){this.activeDrag&&this._end();return this},_shimming:!1,_docMove:function(b){this._shimming||this._move(b)},_move:function(b){this.activeDrag&&(this.activeDrag._move.call(this.activeDrag,b),this._dropMove())},cssSizestoObject:function(b){b=b.split(" ");switch(b.length){case 1:b[1]=
b[2]=b[3]=b[0];break;case 2:b[2]=b[0];b[3]=b[1];break;case 3:b[3]=b[1]}return{top:parseInt(b[0],10),right:parseInt(b[1],10),bottom:parseInt(b[2],10),left:parseInt(b[3],10)}},getDrag:function(b){var a=!1,c=d.one(b);c instanceof d.Node&&d.Array.each(this._drags,function(b){c.compareTo(b.get("node"))&&(a=b)});return a},swapPosition:function(b,a){b=d.DD.DDM.getNode(b);a=d.DD.DDM.getNode(a);var c=b.getXY(),k=a.getXY();b.setXY(k);a.setXY(c);return b},getNode:function(b){return b instanceof d.Node?b:b=b&&
b.get?d.Widget&&b instanceof d.Widget?b.get("boundingBox"):b.get("node"):d.one(b)},swapNode:function(b,a){b=d.DD.DDM.getNode(b);a=d.DD.DDM.getNode(a);var c=a.get("parentNode"),k=a.get("nextSibling");k===b?c.insertBefore(b,a):a===b.get("nextSibling")?c.insertBefore(a,b):(b.get("parentNode").replaceChild(a,b),c.insertBefore(b,k));return b}});d.namespace("DD");d.DD.DDM=new c},"3.17.2",{requires:["node","base","yui-throttle","classnamemanager"]})},1266:function(l,n){YUI.add("dd-ddm-drop",function(d,e){d.mix(d.DD.DDM,
{_noShim:!1,_activeShims:[],_hasActiveShim:function(){return this._noShim?!0:this._activeShims.length},_addActiveShim:function(c){this._activeShims.push(c)},_removeActiveShim:function(c){var b=[];d.Array.each(this._activeShims,function(a){a._yuid!==c._yuid&&b.push(a)});this._activeShims=b},syncActiveShims:function(c){d.later(0,this,function(b){b=b?this.targets:this._lookup();d.Array.each(b,function(a){a.sizeShim.call(a)},this)},c)},mode:0,POINT:0,INTERSECT:1,STRICT:2,useHash:!0,activeDrop:null,validDrops:[],
otherDrops:{},targets:[],_addValid:function(c){this.validDrops.push(c);return this},_removeValid:function(c){var b=[];d.Array.each(this.validDrops,function(a){a!==c&&b.push(a)});this.validDrops=b;return this},isOverTarget:function(c){if(this.activeDrag&&c){var b=this.activeDrag.mouseXY,a=this.activeDrag.get("dragMode"),d,k=c.shim;if(b&&this.activeDrag){d=this.activeDrag.region;if(a===this.STRICT)return this.activeDrag.get("dragNode").inRegion(c.region,!0,d);if(c&&c.shim){if(a===this.INTERSECT&&this._noShim)return b=
d||this.activeDrag.get("node"),c.get("node").intersect(b,c.region).inRegion;this._noShim&&(k=c.get("node"));return k.intersect({top:b[1],bottom:b[1],left:b[0],right:b[0]},c.region).inRegion}}}return!1},clearCache:function(){this.validDrops=[];this.otherDrops={};this._activeShims=[]},_activateTargets:function(){this._noShim=!0;this.clearCache();d.Array.each(this.targets,function(c){c._activateShim([]);!0===c.get("noShim")&&(this._noShim=!1)},this);this._handleTargetOver()},getBestMatch:function(c,
b){var a=null,f=0,k;d.Object.each(c,function(b){var c=this.activeDrag.get("dragNode").intersect(b.get("node"));b.region.area=c.area;c.inRegion&&c.area>f&&(f=c.area,a=b)},this);return b?(k=[],d.Object.each(c,function(b){b!==a&&k.push(b)},this),[a,k]):a},_deactivateTargets:function(){var c=[],b=this.activeDrag,a=this.activeDrop;b&&a&&this.otherDrops[a]?(b.get("dragMode")?(c=this.getBestMatch(this.otherDrops,!0),a=c[0],c=c[1]):(c=this.otherDrops,delete c[a]),b.get("node").removeClass(this.CSS_PREFIX+
"-drag-over"),a&&(a.fire("drop:hit",{drag:b,drop:a,others:c}),b.fire("drag:drophit",{drag:b,drop:a,others:c}))):b&&b.get("dragging")&&(b.get("node").removeClass(this.CSS_PREFIX+"-drag-over"),b.fire("drag:dropmiss",{pageX:b.lastXY[0],pageY:b.lastXY[1]}));this.activeDrop=null;d.Array.each(this.targets,function(a){a._deactivateShim([])},this)},_dropMove:function(){this._hasActiveShim()?this._handleTargetOver():d.Object.each(this.otherDrops,function(c){c._handleOut.apply(c,[])})},_lookup:function(){if(!this.useHash||
this._noShim)return this.validDrops;var c=[];d.Array.each(this.validDrops,function(b){b.shim&&b.shim.inViewportRegion(!1,b.region)&&c.push(b)});return c},_handleTargetOver:function(){var c=this._lookup();d.Array.each(c,function(b){b._handleTargetOver.call(b)},this)},_regTarget:function(c){this.targets.push(c)},_unregTarget:function(c){var b=[],a;d.Array.each(this.targets,function(a){a!==c&&b.push(a)},this);this.targets=b;a=[];d.Array.each(this.validDrops,function(b){b!==c&&a.push(b)});this.validDrops=
a},getDrop:function(c){var b=!1,a=d.one(c);a instanceof d.Node&&d.Array.each(this.targets,function(c){a.compareTo(c.get("node"))&&(b=c)});return b}},!0)},"3.17.2",{requires:["dd-ddm"]})},1267:function(l,n){YUI.add("dd-ddm",function(d,e){d.mix(d.DD.DDM,{_pg:null,_debugShim:!1,_activateTargets:function(){},_deactivateTargets:function(){},_startDrag:function(){this.activeDrag&&this.activeDrag.get("useShim")&&(this._shimming=!0,this._pg_activate(),this._activateTargets())},_endDrag:function(){this._pg_deactivate();
this._deactivateTargets()},_pg_deactivate:function(){this._pg.setStyle("display","none")},_pg_activate:function(){this._pg||this._createPG();var c=this.activeDrag.get("activeHandle"),b="auto";c&&(b=c.getStyle("cursor"));"auto"===b&&(b=this.get("dragCursor"));this._pg_size();this._pg.setStyles({top:0,left:0,display:"block",opacity:this._debugShim?".5":"0",cursor:b})},_pg_size:function(){if(this.activeDrag){var c=d.one("body"),b=c.get("docHeight"),c=c.get("docWidth");this._pg.setStyles({height:b+"px",
width:c+"px"})}},_createPG:function(){var c=d.Node.create("<div></div>"),b=d.one("body");c.setStyles({top:"0",left:"0",position:"absolute",zIndex:"9999",overflow:"hidden",backgroundColor:"red",display:"none",height:"5px",width:"5px"});c.set("id",d.stamp(c));c.addClass(d.DD.DDM.CSS_PREFIX+"-shim");b.prepend(c);this._pg=c;this._pg.on("mousemove",d.throttle(d.bind(this._move,this),this.get("throttleTime")));this._pg.on("mouseup",d.bind(this._end,this));c=d.one("win");d.on("window:resize",d.bind(this._pg_size,
this));c.on("scroll",d.bind(this._pg_size,this))}},!0)},"3.17.2",{requires:["dd-ddm-base","event-resize"]})},1268:function(l,n){YUI.add("dd-delegate",function(d,e){var c=function(){c.superclass.constructor.apply(this,arguments)},b=d.Node.create("<div>Temp Node</div>");d.extend(c,d.Base,{_bubbleTargets:d.DD.DDM,dd:null,_shimState:null,_handles:null,_onNodeChange:function(a){this.set("dragNode",a.newVal)},_afterDragEnd:function(){d.DD.DDM._noShim=this._shimState;this.set("lastNode",this.dd.get("node"));
this.get("lastNode").removeClass(d.DD.DDM.CSS_PREFIX+"-dragging");this.dd._unprep();this.dd.set("node",b)},_delMouseDown:function(a){var b=a.currentTarget,c=this.dd,g=b,e=this.get("dragConfig");b.test(this.get("nodes"))&&!b.test(this.get("invalid"))&&(this._shimState=d.DD.DDM._noShim,d.DD.DDM._noShim=!0,this.set("currentNode",b),c.set("node",b),e&&e.dragNode?g=e.dragNode:c.proxy&&(g=d.DD.DDM._proxy),c.set("dragNode",g),c._prep(),c.fire("drag:mouseDown",{ev:a}))},_onMouseEnter:function(){this._shimState=
d.DD.DDM._noShim;d.DD.DDM._noShim=!0},_onMouseLeave:function(){d.DD.DDM._noShim=this._shimState},initializer:function(){this._handles=[];var a=this.get("dragConfig")||{},c=this.get("container");a.node=b.cloneNode(!0);a.bubbleTargets=this;this.get("handles")&&(a.handles=this.get("handles"));this.dd=new d.DD.Drag(a);this.dd.after("drag:end",d.bind(this._afterDragEnd,this));this.dd.on("dragNodeChange",d.bind(this._onNodeChange,this));this.dd.after("drag:mouseup",function(){this._unprep()});this._handles.push(d.delegate(d.DD.Drag.START_EVENT,
d.bind(this._delMouseDown,this),c,this.get("nodes")));this._handles.push(d.on("mouseenter",d.bind(this._onMouseEnter,this),c));this._handles.push(d.on("mouseleave",d.bind(this._onMouseLeave,this),c));d.later(50,this,this.syncTargets);d.DD.DDM.regDelegate(this)},syncTargets:function(){if(d.Plugin.Drop&&!this.get("destroyed")){var a,b,c;if(this.get("target")){a=d.one(this.get("container")).all(this.get("nodes"));b=this.dd.get("groups");if((c=this.get("dragConfig"))&&c.groups)b=c.groups;a.each(function(a){this.createDrop(a,
b)},this)}return this}},createDrop:function(a,b){var c={useShim:!1,bubbleTargets:this};a.drop||a.plug(d.Plugin.Drop,c);a.drop.set("groups",b);return a},destructor:function(){this.dd&&this.dd.destroy();d.Plugin.Drop&&d.one(this.get("container")).all(this.get("nodes")).unplug(d.Plugin.Drop);d.Array.each(this._handles,function(a){a.detach()})}},{NAME:"delegate",ATTRS:{container:{value:"body"},nodes:{value:".dd-draggable"},invalid:{value:"input, select, button, a, textarea"},lastNode:{value:b},currentNode:{value:b},
dragNode:{value:b},over:{value:!1},target:{value:!1},dragConfig:{value:null},handles:{value:null}}});d.mix(d.DD.DDM,{_delegates:[],regDelegate:function(a){this._delegates.push(a)},getDelegate:function(a){var b=null;a=d.one(a);d.Array.each(this._delegates,function(c){a.test(c.get("container"))&&(b=c)},this);return b}});d.namespace("DD");d.DD.Delegate=c},"3.17.2",{requires:["dd-drag","dd-drop-plugin","event-mouseenter"]})},1269:function(l,n){YUI.add("dd-drag",function(d,e){var c=d.DD.DDM,b=function(a){this._lazyAddAttrs=
!1;b.superclass.constructor.apply(this,arguments);c._regDrag(this)||d.error("Failed to register node, already in use: "+a.node)};b.NAME="drag";b.START_EVENT="mousedown";b.ATTRS={node:{setter:function(a){if(this._canDrag(a))return a;var b=d.one(a);b||d.error("DD.Drag: Invalid Node Given: "+a);return b}},dragNode:{setter:function(a){if(this._canDrag(a))return a;var b=d.one(a);b||d.error("DD.Drag: Invalid dragNode Given: "+a);return b}},offsetNode:{value:!0},startCentered:{value:!1},clickPixelThresh:{value:c.get("clickPixelThresh")},
clickTimeThresh:{value:c.get("clickTimeThresh")},lock:{value:!1,setter:function(a){a?this.get("node").addClass(c.CSS_PREFIX+"-locked"):this.get("node").removeClass(c.CSS_PREFIX+"-locked");return a}},data:{value:!1},move:{value:!0},useShim:{value:!0},activeHandle:{value:!1},primaryButtonOnly:{value:!0},dragging:{value:!1},parent:{value:!1},target:{value:!1,setter:function(a){this._handleTarget(a);return a}},dragMode:{value:null,setter:function(a){return c._setDragMode(a)}},groups:{value:["default"],
getter:function(){return!this._groups?(this._groups={},[]):d.Object.keys(this._groups)},setter:function(a){this._groups=d.Array.hash(a);return a}},handles:{value:null,setter:function(a){a?(this._handles={},d.Array.each(a,function(a){var b=a;if(a instanceof d.Node||a instanceof d.NodeList)b=a._yuid;this._handles[b]=a},this)):this._handles=null;return a}},bubbles:{setter:function(a){this.addTarget(a);return a}},haltDown:{value:!0}};d.extend(b,d.Base,{_canDrag:function(a){return a&&a.setXY&&a.getXY&&
a.test&&a.contains?!0:!1},_bubbleTargets:d.DD.DDM,addToGroup:function(a){this._groups[a]=!0;c._activateTargets();return this},removeFromGroup:function(a){delete this._groups[a];c._activateTargets();return this},target:null,_handleTarget:function(a){d.DD.Drop&&(!1===a?this.target&&(c._unregTarget(this.target),this.target=null):(d.Lang.isObject(a)||(a={}),a.bubbleTargets=a.bubbleTargets||this.getTargets(),a.node=this.get("node"),a.groups=a.groups||this.get("groups"),this.target=new d.DD.Drop(a)))},
_groups:null,_createEvents:function(){this.publish("drag:mouseDown",{defaultFn:this._defMouseDownFn,queuable:!1,emitFacade:!0,bubbles:!0,prefix:"drag"});this.publish("drag:align",{defaultFn:this._defAlignFn,queuable:!1,emitFacade:!0,bubbles:!0,prefix:"drag"});this.publish("drag:drag",{defaultFn:this._defDragFn,queuable:!1,emitFacade:!0,bubbles:!0,prefix:"drag"});this.publish("drag:end",{defaultFn:this._defEndFn,preventedFn:this._prevEndFn,queuable:!1,emitFacade:!0,bubbles:!0,prefix:"drag"});d.Array.each("drag:afterMouseDown drag:removeHandle drag:addHandle drag:removeInvalid drag:addInvalid drag:start drag:drophit drag:dropmiss drag:over drag:enter drag:exit".split(" "),
function(a){this.publish(a,{type:a,emitFacade:!0,bubbles:!0,preventable:!1,queuable:!1,prefix:"drag"})},this)},_ev_md:null,_startTime:null,_endTime:null,_handles:null,_invalids:null,_invalidsDefault:{textarea:!0,input:!0,a:!0,button:!0,select:!0},_dragThreshMet:null,_fromTimeout:null,_clickTimeout:null,deltaXY:null,startXY:null,nodeXY:null,lastXY:null,actXY:null,realXY:null,mouseXY:null,region:null,_handleMouseUp:function(){this.fire("drag:mouseup");this._fixIEMouseUp();c.activeDrag&&c._end()},_fixDragStart:function(a){this.validClick(a)&&
a.preventDefault()},_ieSelectFix:function(){return!1},_ieSelectBack:null,_fixIEMouseDown:function(){d.UA.ie&&(this._ieSelectBack=d.config.doc.body.onselectstart,d.config.doc.body.onselectstart=this._ieSelectFix)},_fixIEMouseUp:function(){d.UA.ie&&(d.config.doc.body.onselectstart=this._ieSelectBack)},_handleMouseDownEvent:function(a){this.validClick(a)&&a.preventDefault();this.fire("drag:mouseDown",{ev:a})},_defMouseDownFn:function(a){a=a.ev;this._dragThreshMet=!1;this._ev_md=a;if(this.get("primaryButtonOnly")&&
1<a.button)return!1;this.validClick(a)&&(this._fixIEMouseDown(a),0!==b.START_EVENT.indexOf("gesture")&&(this.get("haltDown")?a.halt():a.preventDefault()),this._setStartPosition([a.pageX,a.pageY]),c.activeDrag=this,this._clickTimeout=d.later(this.get("clickTimeThresh"),this,this._timeoutCheck));this.fire("drag:afterMouseDown",{ev:a})},validClick:function(a){var b=!1,c=!1,g=a.target,e=null,m=c=null,q=!1;if(this._handles)d.Object.each(this._handles,function(a,c){a instanceof d.Node||a instanceof d.NodeList?
b||(m=a,m instanceof d.Node&&(m=new d.NodeList(a._node)),m.each(function(a){a.contains(g)&&(b=!0)})):d.Lang.isString(c)&&(g.test(c+", "+c+" *")&&!e)&&(e=c,b=!0)});else if(c=this.get("node"),c.contains(g)||c.compareTo(g))b=!0;b&&this._invalids&&d.Object.each(this._invalids,function(a,c){d.Lang.isString(c)&&g.test(c+", "+c+" *")&&(b=!1)});b&&(e?(c=a.currentTarget.all(e),q=!1,c.each(function(a){if((a.contains(g)||a.compareTo(g))&&!q)q=!0,this.set("activeHandle",a)},this)):this.set("activeHandle",this.get("node")));
return b},_setStartPosition:function(a){this.startXY=a;this.nodeXY=this.lastXY=this.realXY=this.get("node").getXY();this.get("offsetNode")?this.deltaXY=[this.startXY[0]-this.nodeXY[0],this.startXY[1]-this.nodeXY[1]]:this.deltaXY=[0,0]},_timeoutCheck:function(){!this.get("lock")&&(!this._dragThreshMet&&this._ev_md)&&(this._fromTimeout=this._dragThreshMet=!0,this.start(),this._alignNode([this._ev_md.pageX,this._ev_md.pageY],!0))},removeHandle:function(a){var b=a;if(a instanceof d.Node||a instanceof
d.NodeList)b=a._yuid;this._handles[b]&&(delete this._handles[b],this.fire("drag:removeHandle",{handle:a}));return this},addHandle:function(a){this._handles||(this._handles={});var b=a;if(a instanceof d.Node||a instanceof d.NodeList)b=a._yuid;this._handles[b]=a;this.fire("drag:addHandle",{handle:a});return this},removeInvalid:function(a){this._invalids[a]&&(this._invalids[a]=null,delete this._invalids[a],this.fire("drag:removeInvalid",{handle:a}));return this},addInvalid:function(a){d.Lang.isString(a)&&
(this._invalids[a]=!0,this.fire("drag:addInvalid",{handle:a}));return this},initializer:function(){this.get("node").dd=this;if(!this.get("node").get("id")){var a=d.stamp(this.get("node"));this.get("node").set("id",a)}this.actXY=[];this._invalids=d.clone(this._invalidsDefault,!0);this._createEvents();this.get("dragNode")||this.set("dragNode",this.get("node"));this.on("initializedChange",d.bind(this._prep,this));this.set("groups",this.get("groups"))},_prep:function(){this._dragThreshMet=!1;var a=this.get("node");
a.addClass(c.CSS_PREFIX+"-draggable");a.on(b.START_EVENT,d.bind(this._handleMouseDownEvent,this));a.on("mouseup",d.bind(this._handleMouseUp,this));a.on("dragstart",d.bind(this._fixDragStart,this))},_unprep:function(){var a=this.get("node");a.removeClass(c.CSS_PREFIX+"-draggable");a.detachAll("mouseup");a.detachAll("dragstart");a.detachAll(b.START_EVENT);this.mouseXY=[];this.deltaXY=[0,0];this.startXY=[];this.nodeXY=[];this.lastXY=[];this.actXY=[];this.realXY=[]},start:function(){if(!this.get("lock")&&
!this.get("dragging")){var a=this.get("node"),b,d;this._startTime=(new Date).getTime();c._start();a.addClass(c.CSS_PREFIX+"-dragging");this.fire("drag:start",{pageX:this.nodeXY[0],pageY:this.nodeXY[1],startTime:this._startTime});a=this.get("dragNode");d=this.nodeXY;b=a.get("offsetWidth");a=a.get("offsetHeight");this.get("startCentered")&&this._setStartPosition([d[0]+b/2,d[1]+a/2]);this.region={0:d[0],1:d[1],area:0,top:d[1],right:d[0]+b,bottom:d[1]+a,left:d[0]};this.set("dragging",!0)}return this},
end:function(){this._endTime=(new Date).getTime();this._clickTimeout&&this._clickTimeout.cancel();this._dragThreshMet=this._fromTimeout=!1;!this.get("lock")&&this.get("dragging")&&this.fire("drag:end",{pageX:this.lastXY[0],pageY:this.lastXY[1],startTime:this._startTime,endTime:this._endTime});this.get("node").removeClass(c.CSS_PREFIX+"-dragging");this.set("dragging",!1);this.deltaXY=[0,0];return this},_defEndFn:function(){this._fixIEMouseUp();this._ev_md=null},_prevEndFn:function(){this._fixIEMouseUp();
this.get("dragNode").setXY(this.nodeXY);this.region=this._ev_md=null},_align:function(a){this.fire("drag:align",{pageX:a[0],pageY:a[1]})},_defAlignFn:function(a){this.actXY=[a.pageX-this.deltaXY[0],a.pageY-this.deltaXY[1]]},_alignNode:function(a,b){this._align(a);b||this._moveNode()},_moveNode:function(a){var b=[],c=[],d=this.nodeXY,e=this.actXY;b[0]=e[0]-this.lastXY[0];b[1]=e[1]-this.lastXY[1];c[0]=e[0]-this.nodeXY[0];c[1]=e[1]-this.nodeXY[1];this.region={0:e[0],1:e[1],area:0,top:e[1],right:e[0]+
this.get("dragNode").get("offsetWidth"),bottom:e[1]+this.get("dragNode").get("offsetHeight"),left:e[0]};this.fire("drag:drag",{pageX:e[0],pageY:e[1],scroll:a,info:{start:d,xy:e,delta:b,offset:c}});this.lastXY=e},_defDragFn:function(a){if(this.get("move")){if(a.scroll&&a.scroll.node){var b=a.scroll.node.getDOMNode();b===d.config.win?b.scrollTo(a.scroll.left,a.scroll.top):(a.scroll.node.set("scrollTop",a.scroll.top),a.scroll.node.set("scrollLeft",a.scroll.left))}this.get("dragNode").setXY([a.pageX,
a.pageY]);this.realXY=[a.pageX,a.pageY]}},_move:function(a){if(this.get("lock"))return!1;this.mouseXY=[a.pageX,a.pageY];if(this._dragThreshMet)this._clickTimeout&&this._clickTimeout.cancel(),this._alignNode([a.pageX,a.pageY]);else{var b=Math.abs(this.startXY[0]-a.pageX),c=Math.abs(this.startXY[1]-a.pageY);if(b>this.get("clickPixelThresh")||c>this.get("clickPixelThresh"))this._dragThreshMet=!0,this.start(),a&&a.preventDefault&&a.preventDefault(),this._alignNode([a.pageX,a.pageY])}},stopDrag:function(){this.get("dragging")&&
c._end();return this},destructor:function(){this._unprep();this.target&&this.target.destroy();c._unregDrag(this)}});d.namespace("DD");d.DD.Drag=b},"3.17.2",{requires:["dd-ddm-base"]})},1270:function(l,n){YUI.add("dd-drop-plugin",function(d,e){var c=function(b){b.node=b.host;c.superclass.constructor.apply(this,arguments)};c.NAME="dd-drop-plugin";c.NS="drop";d.extend(c,d.DD.Drop);d.namespace("Plugin");d.Plugin.Drop=c},"3.17.2",{requires:["dd-drop"]})},1271:function(l,n){YUI.add("dd-drop",function(d,
e){var c=d.DD.DDM,b=function(){this._lazyAddAttrs=!1;b.superclass.constructor.apply(this,arguments);d.on("domready",d.bind(function(){d.later(100,this,this._createShim)},this));c._regTarget(this)};b.NAME="drop";b.ATTRS={node:{setter:function(a){var b=d.one(a);b||d.error("DD.Drop: Invalid Node Given: "+a);return b}},groups:{value:["default"],getter:function(){return!this._groups?(this._groups={},[]):d.Object.keys(this._groups)},setter:function(a){this._groups=d.Array.hash(a);return a}},padding:{value:"0",
setter:function(a){return c.cssSizestoObject(a)}},lock:{value:!1,setter:function(a){a?this.get("node").addClass(c.CSS_PREFIX+"-drop-locked"):this.get("node").removeClass(c.CSS_PREFIX+"-drop-locked");return a}},bubbles:{setter:function(a){this.addTarget(a);return a}},useShim:{value:!0,setter:function(a){d.DD.DDM._noShim=!a;return a}}};d.extend(b,d.Base,{_bubbleTargets:d.DD.DDM,addToGroup:function(a){this._groups[a]=!0;return this},removeFromGroup:function(a){delete this._groups[a];return this},_createEvents:function(){d.Array.each(["drop:over",
"drop:enter","drop:exit","drop:hit"],function(a){this.publish(a,{type:a,emitFacade:!0,preventable:!1,bubbles:!0,queuable:!1,prefix:"drop"})},this)},_valid:null,_groups:null,shim:null,region:null,overTarget:null,inGroup:function(a){var b=this._valid=!1;d.Array.each(a,function(a){this._groups[a]&&(this._valid=b=!0)},this);return b},initializer:function(){d.later(100,this,this._createEvents);var a=this.get("node"),b;a.get("id")||(b=d.stamp(a),a.set("id",b));a.addClass(c.CSS_PREFIX+"-drop");this.set("groups",
this.get("groups"))},destructor:function(){c._unregTarget(this);this.shim&&this.shim!==this.get("node")&&(this.shim.detachAll(),this.shim.remove(),this.shim=null);this.get("node").removeClass(c.CSS_PREFIX+"-drop");this.detachAll()},_deactivateShim:function(){if(!this.shim)return!1;this.get("node").removeClass(c.CSS_PREFIX+"-drop-active-valid");this.get("node").removeClass(c.CSS_PREFIX+"-drop-active-invalid");this.get("node").removeClass(c.CSS_PREFIX+"-drop-over");this.get("useShim")&&this.shim.setStyles({top:"-999px",
left:"-999px",zIndex:"1"});this.overTarget=!1},_activateShim:function(){if(!c.activeDrag||this.get("node")===c.activeDrag.get("node")||this.get("lock"))return!1;var a=this.get("node");this.inGroup(c.activeDrag.get("groups"))?(a.removeClass(c.CSS_PREFIX+"-drop-active-invalid"),a.addClass(c.CSS_PREFIX+"-drop-active-valid"),c._addValid(this),this.overTarget=!1,this.get("useShim")||(this.shim=this.get("node")),this.sizeShim()):(c._removeValid(this),a.removeClass(c.CSS_PREFIX+"-drop-active-valid"),a.addClass(c.CSS_PREFIX+
"-drop-active-invalid"))},sizeShim:function(){if(!c.activeDrag||this.get("node")===c.activeDrag.get("node")||this.get("lock"))return!1;if(!this.shim)return d.later(100,this,this.sizeShim),!1;var a=this.get("node"),b=a.get("offsetHeight"),e=a.get("offsetWidth"),a=a.getXY(),g=this.get("padding"),h,m,e=e+g.left+g.right,b=b+g.top+g.bottom;a[0]-=g.left;a[1]-=g.top;c.activeDrag.get("dragMode")===c.INTERSECT&&(g=c.activeDrag,h=g.get("node").get("offsetHeight"),m=g.get("node").get("offsetWidth"),b+=h,e+=
m,a[0]-=m-g.deltaXY[0],a[1]-=h-g.deltaXY[1]);this.get("useShim")&&this.shim.setStyles({height:b+"px",width:e+"px",top:a[1]+"px",left:a[0]+"px"});this.region={0:a[0],1:a[1],area:0,top:a[1],right:a[0]+e,bottom:a[1]+b,left:a[0]}},_createShim:function(){if(c._pg){if(!this.shim){var a=this.get("node");this.get("useShim")&&(a=d.Node.create('<div id="'+this.get("node").get("id")+'_shim"></div>'),a.setStyles({height:this.get("node").get("offsetHeight")+"px",width:this.get("node").get("offsetWidth")+"px",
backgroundColor:"yellow",opacity:".5",zIndex:"1",overflow:"hidden",top:"-900px",left:"-900px",position:"absolute"}),c._pg.appendChild(a),a.on("mouseover",d.bind(this._handleOverEvent,this)),a.on("mouseout",d.bind(this._handleOutEvent,this)));this.shim=a}}else d.later(10,this,this._createShim)},_handleTargetOver:function(){c.isOverTarget(this)?(this.get("node").addClass(c.CSS_PREFIX+"-drop-over"),c.activeDrop=this,c.otherDrops[this]=this,this.overTarget?(c.activeDrag.fire("drag:over",{drop:this,drag:c.activeDrag}),
this.fire("drop:over",{drop:this,drag:c.activeDrag})):c.activeDrag.get("dragging")&&(this.overTarget=!0,this.fire("drop:enter",{drop:this,drag:c.activeDrag}),c.activeDrag.fire("drag:enter",{drop:this,drag:c.activeDrag}),c.activeDrag.get("node").addClass(c.CSS_PREFIX+"-drag-over"))):this._handleOut()},_handleOverEvent:function(){this.shim.setStyle("zIndex","999");c._addActiveShim(this)},_handleOutEvent:function(){this.shim.setStyle("zIndex","1");c._removeActiveShim(this)},_handleOut:function(a){if((!c.isOverTarget(this)||
a)&&this.overTarget)this.overTarget=!1,a||c._removeActiveShim(this),c.activeDrag&&(this.get("node").removeClass(c.CSS_PREFIX+"-drop-over"),c.activeDrag.get("node").removeClass(c.CSS_PREFIX+"-drag-over"),this.fire("drop:exit",{drop:this,drag:c.activeDrag}),c.activeDrag.fire("drag:exit",{drop:this,drag:c.activeDrag}),delete c.otherDrops[this])}});d.DD.Drop=b},"3.17.2",{requires:["dd-drag","dd-ddm-drop"]})},1272:function(l,n){YUI.add("dd-proxy",function(d,e){var c=d.DD.DDM,b=function(){b.superclass.constructor.apply(this,
arguments)};b.NAME="DDProxy";b.NS="proxy";b.ATTRS={host:{},moveOnEnd:{value:!0},hideOnEnd:{value:!0},resizeFrame:{value:!0},positionProxy:{value:!0},borderStyle:{value:"1px solid #808080"},cloneNode:{value:!1}};d.namespace("Plugin");d.extend(b,d.Base,{_hands:null,_init:function(){if(c._proxy){this._hands||(this._hands=[]);var a,b,e=this.get("host");e.get("dragNode").compareTo(e.get("node"))&&c._proxy&&e.set("dragNode",c._proxy);d.Array.each(this._hands,function(a){a.detach()});a=c.on("ddm:start",
d.bind(function(){c.activeDrag===e&&c._setFrame(e)},this));b=c.on("ddm:end",d.bind(function(){e.get("dragging")&&(this.get("moveOnEnd")&&e.get("node").setXY(e.lastXY),this.get("hideOnEnd")&&e.get("dragNode").setStyle("display","none"),this.get("cloneNode")&&(e.get("dragNode").remove(),e.set("dragNode",c._proxy)))},this));this._hands=[a,b]}else c._createFrame(),d.on("domready",d.bind(this._init,this))},initializer:function(){this._init()},destructor:function(){var a=this.get("host");d.Array.each(this._hands,
function(a){a.detach()});a.set("dragNode",a.get("node"))},clone:function(){var a=this.get("host"),b=a.get("node"),c=b.cloneNode(!0);c.all('input[type="radio"]').removeAttribute("name");delete c._yuid;c.setAttribute("id",d.guid());c.setStyle("position","absolute");b.get("parentNode").appendChild(c);a.set("dragNode",c);return c}});d.Plugin.DDProxy=b;d.mix(c,{_createFrame:function(){if(!c._proxy){c._proxy=!0;var a=d.Node.create("<div></div>"),b=d.one("body");a.setStyles({position:"absolute",display:"none",
zIndex:"999",top:"-999px",left:"-999px"});b.prepend(a);a.set("id",d.guid());a.addClass(c.CSS_PREFIX+"-proxy");c._proxy=a}},_setFrame:function(a){var b=a.get("node"),d=a.get("dragNode"),g,e="auto";(g=c.activeDrag.get("activeHandle"))&&(e=g.getStyle("cursor"));"auto"===e&&(e=c.get("dragCursor"));d.setStyles({visibility:"hidden",display:"block",cursor:e,border:a.proxy.get("borderStyle")});a.proxy.get("cloneNode")&&(d=a.proxy.clone());a.proxy.get("resizeFrame")&&d.setStyles({height:b.get("offsetHeight")+
"px",width:b.get("offsetWidth")+"px"});a.proxy.get("positionProxy")&&d.setXY(a.nodeXY);d.setStyle("visibility","visible")}})},"3.17.2",{requires:["dd-drag"]})},1273:function(l,n){YUI.add("dd-scroll",function(d,e){var c=function(){c.superclass.constructor.apply(this,arguments)},b,a;c.ATTRS={parentScroll:{value:!1,setter:function(a){return a?a:!1}},buffer:{value:30,validator:d.Lang.isNumber},scrollDelay:{value:235,validator:d.Lang.isNumber},host:{value:null},windowScroll:{value:!1,validator:d.Lang.isBoolean},
vertical:{value:!0,validator:d.Lang.isBoolean},horizontal:{value:!0,validator:d.Lang.isBoolean}};d.extend(c,d.Base,{_scrolling:null,_vpRegionCache:null,_dimCache:null,_scrollTimer:null,_getVPRegion:function(){var a={},a=this.get("parentScroll"),b=this.get("buffer"),c=this.get("windowScroll"),d=c?[]:a.getXY(),e=c?"winWidth":"offsetWidth",q=c?"winHeight":"offsetHeight",p=c?a.get("scrollTop"):d[1],c=c?a.get("scrollLeft"):d[0];return this._vpRegionCache=a={top:p+b,right:a.get(e)+c-b,bottom:a.get(q)+p-
b,left:c+b}},initializer:function(){var a=this.get("host");a.after("drag:start",d.bind(this.start,this));a.after("drag:end",d.bind(this.end,this));a.on("drag:align",d.bind(this.align,this));d.one("win").on("scroll",d.bind(function(){this._vpRegionCache=null},this))},_checkWinScroll:function(a){var b=this._getVPRegion(),c=this.get("host"),d=this.get("windowScroll"),e=c.lastXY,q=!1,p=this.get("buffer"),r=this.get("parentScroll"),l=r.get("scrollTop"),n=r.get("scrollLeft"),z=e[1]+this._dimCache.h,x=e[1],
A=e[0]+this._dimCache.w,y=e[0],s=x,t=y,v=l,w=n;this.get("horizontal")&&(y<=b.left&&(q=!0,t=e[0]-(d?p:0),w=n-p),A>=b.right&&(q=!0,t=e[0]+(d?p:0),w=n+p));this.get("vertical")&&(z>=b.bottom&&(q=!0,s=e[1]+(d?p:0),v=l+p),x<=b.top&&(q=!0,s=e[1]-(d?p:0),v=l-p));0>v&&(v=0,s=e[1]);0>w&&(w=0,t=e[0]);0>s&&(s=e[1]);0>t&&(t=e[0]);a?(c.actXY=[t,s],c._alignNode([t,s],!0),c.actXY=[t,s],c._moveNode({node:r,top:v,left:w}),!v&&!w&&this._cancelScroll()):q?this._initScroll():this._cancelScroll()},_initScroll:function(){this._cancelScroll();
this._scrollTimer=d.Lang.later(this.get("scrollDelay"),this,this._checkWinScroll,[!0],!0)},_cancelScroll:function(){this._scrolling=!1;this._scrollTimer&&(this._scrollTimer.cancel(),delete this._scrollTimer)},align:function(a){this._scrolling&&(this._cancelScroll(),a.preventDefault());this._scrolling||this._checkWinScroll()},_setDimCache:function(){var a=this.get("host").get("dragNode");this._dimCache={h:a.get("offsetHeight"),w:a.get("offsetWidth")}},start:function(){this._setDimCache()},end:function(){this._dimCache=
null;this._cancelScroll()}});d.namespace("Plugin");b=function(){b.superclass.constructor.apply(this,arguments)};b.ATTRS=d.merge(c.ATTRS,{windowScroll:{value:!0,setter:function(a){a&&this.set("parentScroll",d.one("win"));return a}}});d.extend(b,c,{initializer:function(){this.set("windowScroll",this.get("windowScroll"))}});b.NAME=b.NS="winscroll";d.Plugin.DDWinScroll=b;a=function(){a.superclass.constructor.apply(this,arguments)};a.ATTRS=d.merge(c.ATTRS,{node:{value:!1,setter:function(a){var b=d.one(a);
b?this.set("parentScroll",b):!1!==a&&d.error("DDNodeScroll: Invalid Node Given: "+a);return b}}});d.extend(a,c,{initializer:function(){this.set("node",this.get("node"))}});a.NAME=a.NS="nodescroll";d.Plugin.DDNodeScroll=a;d.DD.Scroll=c},"3.17.2",{requires:["dd-drag"]})},1275:function(l,n){YUI.add("node-focusmanager",function(d,e){var c={37:!0,38:!0,39:!0,40:!0},b={a:!0,button:!0,input:!0,object:!0},a=d.Lang,f=d.UA,k=function(){k.superclass.constructor.apply(this,arguments)};k.ATTRS={focused:{value:!1,
readOnly:!0},descendants:{getter:function(a){return this.get("host").all(a)}},activeDescendant:{setter:function(b){var c=a.isNumber,f=d.Attribute.INVALID_VALUE,e=this._descendantsMap,k=this._descendants,l;c(b)?b=l=b:b instanceof d.Node&&e?(l=e[b.get("id")],b=c(l)?l:f):b=f;k&&(k=k.item(l))&&k.get("disabled")&&(b=f);return b}},keys:{value:{next:null,previous:null}},focusClass:{},circular:{value:!0}};d.extend(k,d.Plugin.Base,{_stopped:!0,_descendants:null,_descendantsMap:null,_focusedNode:null,_lastNodeIndex:0,
_eventHandlers:null,_initDescendants:function(){var b=this.get("descendants"),c={},f=-1,e,k=this.get("activeDescendant"),l,n,u=0;a.isUndefined(k)&&(k=-1);if(b){e=b.size();for(u=0;u<e;u++)l=b.item(u),-1===f&&!l.get("disabled")&&(f=u),0>k&&0===parseInt(l.getAttribute("tabIndex",2),10)&&(k=u),l&&l.set("tabIndex",-1),n=l.get("id"),n||(n=d.guid(),l.set("id",n)),c[n]=u;0>k&&(k=0);l=b.item(k);if(!l||l.get("disabled"))l=b.item(f),k=f;this._lastNodeIndex=e-1;this._descendants=b;this._descendantsMap=c;this.set("activeDescendant",
k);l&&l.set("tabIndex",0)}},_isDescendant:function(a){return a.get("id")in this._descendantsMap},_removeFocusClass:function(){var b=this._focusedNode,c=this.get("focusClass"),d;c&&(d=a.isString(c)?c:c.className);b&&d&&b.removeClass(d)},_detachKeyHandler:function(){var a=this._prevKeyHandler,b=this._nextKeyHandler;a&&a.detach();b&&b.detach()},_preventScroll:function(a){c[a.keyCode]&&this._isDescendant(a.target)&&a.preventDefault()},_fireClick:function(a){var c=a.target,d=c.get("nodeName").toLowerCase();
13===a.keyCode&&(!b[d]||"a"===d&&!c.getAttribute("href"))&&c.simulate("click")},_attachKeyHandler:function(){this._detachKeyHandler();var a=this.get("keys.next"),b=this.get("keys.previous"),c=this.get("host"),e=this._eventHandlers;b&&(this._prevKeyHandler=d.on("key",d.bind(this._focusPrevious,this),c,b));a&&(this._nextKeyHandler=d.on("key",d.bind(this._focusNext,this),c,a));f.opera&&e.push(c.on("keypress",this._preventScroll,this));f.opera||e.push(c.on("keypress",this._fireClick,this))},_detachEventHandlers:function(){this._detachKeyHandler();
var a=this._eventHandlers;a&&(d.Array.each(a,function(a){a.detach()}),this._eventHandlers=null)},_attachEventHandlers:function(){var a=this._descendants,b,c;a&&a.size()&&(a=this._eventHandlers||[],b=this.get("host").get("ownerDocument"),0===a.length&&(a.push(b.on("focus",this._onDocFocus,this)),a.push(b.on("mousedown",this._onDocMouseDown,this)),a.push(this.after("keysChange",this._attachKeyHandler)),a.push(this.after("descendantsChange",this._initDescendants)),a.push(this.after("activeDescendantChange",
this._afterActiveDescendantChange)),c=this.after("focusedChange",d.bind(function(a){a.newVal&&(this._attachKeyHandler(),c.detach())},this)),a.push(c)),this._eventHandlers=a)},_onDocMouseDown:function(a){var b=this.get("host"),c=a.target,d=b.contains(c),e,k=function(a){var c=!1;a.compareTo(b)||(c=this._isDescendant(a)?a:k.call(this,a.get("parentNode")));return c};d&&((e=k.call(this,c))?c=e:!e&&this.get("focused")&&(this._set("focused",!1),this._onDocFocus(a)));if(d&&this._isDescendant(c))this.focus(c);
else if(f.webkit&&this.get("focused")&&(!d||d&&!this._isDescendant(c)))this._set("focused",!1),this._onDocFocus(a)},_onDocFocus:function(a){a=this._focusTarget||a.target;var b=this.get("focused"),c=this.get("focusClass"),d=this._focusedNode,f;this._focusTarget&&(this._focusTarget=null);this.get("host").contains(a)?(f=this._isDescendant(a),!b&&f?b=!0:b&&!f&&(b=!1)):b=!1;c&&(d&&(!d.compareTo(a)||!b)&&this._removeFocusClass(),f&&b&&(c.fn?(a=c.fn(a),a.addClass(c.className)):a.addClass(c),this._focusedNode=
a));this._set("focused",b)},_focusNext:function(a,b){var c=b||this.get("activeDescendant"),d;this._isDescendant(a.target)&&c<=this._lastNodeIndex&&(c+=1,c===this._lastNodeIndex+1&&this.get("circular")&&(c=0),(d=this._descendants.item(c))&&(d.get("disabled")?this._focusNext(a,c):this.focus(c)));this._preventScroll(a)},_focusPrevious:function(a,b){var c=b||this.get("activeDescendant"),d;this._isDescendant(a.target)&&0<=c&&(c-=1,-1===c&&this.get("circular")&&(c=this._lastNodeIndex),(d=this._descendants.item(c))&&
(d.get("disabled")?this._focusPrevious(a,c):this.focus(c)));this._preventScroll(a)},_afterActiveDescendantChange:function(a){var b=this._descendants.item(a.prevVal);b&&b.set("tabIndex",-1);(b=this._descendants.item(a.newVal))&&b.set("tabIndex",0)},initializer:function(a){this.start()},destructor:function(){this.stop();this.get("host").focusManager=null},focus:function(b){a.isUndefined(b)&&(b=this.get("activeDescendant"));this.set("activeDescendant",b,{src:"UI"});if(b=this._descendants.item(this.get("activeDescendant")))b.focus(),
f.opera&&"button"===b.get("nodeName").toLowerCase()&&(this._focusTarget=b)},blur:function(){var a;if(this.get("focused")){if(a=this._descendants.item(this.get("activeDescendant")))a.blur(),this._removeFocusClass();this._set("focused",!1,{src:"UI"})}},start:function(){this._stopped&&(this._initDescendants(),this._attachEventHandlers(),this._stopped=!1)},stop:function(){this._stopped||(this._detachEventHandlers(),this._focusedNode=this._descendants=null,this._lastNodeIndex=0,this._stopped=!0)},refresh:function(){this._initDescendants();
this._eventHandlers||this._attachEventHandlers()}});k.NAME="nodeFocusManager";k.NS="focusManager";d.namespace("Plugin");d.Plugin.NodeFocusManager=k},"3.17.2",{requires:"attribute node plugin node-event-simulate event-key event-focus".split(" ")})},1277:function(l,n){YUI.add("widget-anim",function(d,e){function c(b){c.superclass.constructor.apply(this,arguments)}c.NS="anim";c.NAME="pluginWidgetAnim";c.ANIMATIONS={fadeIn:function(){var b=this.get("host"),a=b.get("boundingBox"),c=new d.Anim({node:a,
to:{opacity:1},duration:this.get("duration")});b.get("visible")||a.setStyle("opacity",0);c.on("destroy",function(){this.get("node").setStyle("opacity",d.UA.ie?1:"")});return c},fadeOut:function(){return new d.Anim({node:this.get("host").get("boundingBox"),to:{opacity:0},duration:this.get("duration")})}};c.ATTRS={duration:{value:0.2},animShow:{valueFn:c.ANIMATIONS.fadeIn},animHide:{valueFn:c.ANIMATIONS.fadeOut}};d.extend(c,d.Plugin.Base,{initializer:function(b){this._bindAnimShow();this._bindAnimHide();
this.after("animShowChange",this._bindAnimShow);this.after("animHideChange",this._bindAnimHide);this.beforeHostMethod("_uiSetVisible",this._uiAnimSetVisible)},destructor:function(){this.get("animShow").destroy();this.get("animHide").destroy()},_uiAnimSetVisible:function(b){if(this.get("host").get("rendered"))return b?(this.get("animHide").stop(),this.get("animShow").run()):(this.get("animShow").stop(),this.get("animHide").run()),new d.Do.Prevent},_uiSetVisible:function(b){var a=this.get("host"),c=
a.getClassName("hidden");a.get("boundingBox").toggleClass(c,!b)},_bindAnimShow:function(){this.get("animShow").on("start",d.bind(function(){this._uiSetVisible(!0)},this))},_bindAnimHide:function(){this.get("animHide").after("end",d.bind(function(){this._uiSetVisible(!1)},this))}});d.namespace("Plugin").WidgetAnim=c},"3.17.2",{requires:["anim-base","plugin","widget"]})},1278:function(l,n){YUI.add("widget-child",function(d,e){function c(){d.after(this._syncUIChild,this,"syncUI");d.after(this._bindUIChild,
this,"bindUI")}var b=d.Lang;c.ATTRS={selected:{value:0,validator:b.isNumber},index:{readOnly:!0,getter:function(){var a=this.get("parent"),b=-1;a&&(b=a.indexOf(this));return b}},parent:{readOnly:!0},depth:{readOnly:!0,getter:function(){for(var a=this.get("parent"),b=this.get("root"),c=-1;a;){c+=1;if(a==b)break;a=a.get("parent")}return c}},root:{readOnly:!0,getter:function(){var a=function(b){var c=b.get("parent"),e=b.ROOT_TYPE,h=c;e&&(h=c&&d.instanceOf(c,e));return h?a(c):b};return a(this)}}};c.prototype=
{ROOT_TYPE:null,_getUIEventNode:function(){var a=this.get("root"),b;a&&(b=a.get("boundingBox"));return b},next:function(a){var b=this.get("parent"),c;b&&(c=b.item(this.get("index")+1));!c&&a&&(c=b.item(0));return c},previous:function(a){var b=this.get("parent"),c=this.get("index"),d;b&&0<c&&(d=b.item([c-1]));!d&&a&&(d=b.item(b.size()-1));return d},remove:function(a){var c,e;b.isNumber(a)?e=d.WidgetParent.prototype.remove.apply(this,arguments):(c=this.get("parent"))&&(e=c.remove(this.get("index")));
return e},isRoot:function(){return this==this.get("root")},ancestor:function(a){var b=this.get("root"),c;if(this.get("depth")>a)for(c=this.get("parent");c!=b&&c.get("depth")>a;)c=c.get("parent");return c},_uiSetChildSelected:function(a){var b=this.get("boundingBox"),c=this.getClassName("selected");0===a?b.removeClass(c):b.addClass(c)},_afterChildSelectedChange:function(a){this._uiSetChildSelected(a.newVal)},_syncUIChild:function(){this._uiSetChildSelected(this.get("selected"))},_bindUIChild:function(){this.after("selectedChange",
this._afterChildSelectedChange)}};d.WidgetChild=c},"3.17.2",{requires:["base-build","widget"]})},1279:function(l,n){YUI.add("widget-parent",function(d,e){function c(a){this.publish("addChild",{defaultTargetOnly:!0,defaultFn:this._defAddChildFn});this.publish("removeChild",{defaultTargetOnly:!0,defaultFn:this._defRemoveChildFn});this._items=[];var b,c;a&&a.children&&(b=a.children,c=this.after("initializedChange",function(a){this._add(b);c.detach()}));d.after(this._renderChildren,this,"renderUI");d.after(this._bindUIParent,
this,"bindUI");this.after("selectionChange",this._afterSelectionChange);this.after("selectedChange",this._afterParentSelectedChange);this.after("activeDescendantChange",this._afterActiveDescendantChange);this._hDestroyChild=this.after("*:destroy",this._afterDestroyChild);this.after("*:focusedChange",this._updateActiveDescendant)}var b=d.Lang;c.ATTRS={defaultChildType:{setter:function(a){var c=d.Attribute.INVALID_VALUE;a=b.isString(a)?d[a]:a;b.isFunction(a)&&(c=a);return c}},activeDescendant:{readOnly:!0},
multiple:{value:!1,validator:b.isBoolean,writeOnce:!0,getter:function(a){var b=this.get("root");return b&&b!=this?b.get("multiple"):a}},selection:{readOnly:!0,setter:"_setSelection",getter:function(a){return b.isArray(a)?new d.ArrayList(a):a}},selected:{setter:function(a){var b=a;1===a&&!this.get("multiple")&&(b=d.Attribute.INVALID_VALUE);return b}}};c.prototype={destructor:function(){this._destroyChildren()},_afterDestroyChild:function(a){a=a.target;a.get("parent")==this&&a.remove()},_afterSelectionChange:function(a){if(a.target==
this&&a.src!=this){a=a.newVal;var b=0;a&&(b=2,d.instanceOf(a,d.ArrayList)&&a.size()===this.size()&&(b=1));this.set("selected",b,{src:this})}},_afterActiveDescendantChange:function(a){var b=this.get("parent");b&&b._set("activeDescendant",a.newVal)},_afterParentSelectedChange:function(a){var b=a.newVal;this==a.target&&(a.src!=this&&(0===b||1===b))&&this.each(function(a){a.set("selected",b,{src:this})},this)},_setSelection:function(a){var b=null,c;this.get("multiple")&&!this.isEmpty()?(c=[],this.each(function(a){0<
a.get("selected")&&c.push(a)}),0<c.length&&(b=c)):0<a.get("selected")&&(b=a);return b},_updateSelection:function(a){var b=a.target,c;b.get("parent")==this&&("_updateSelection"!=a.src&&(c=this.get("selection"),!this.get("multiple")&&(c&&0<a.newVal)&&c.set("selected",0,{src:"_updateSelection"}),this._set("selection",b)),a.src==this&&this._set("selection",b,{src:this}))},_updateActiveDescendant:function(a){this._set("activeDescendant",!0===a.newVal?a.target:null)},_createChild:function(a){var c=this.get("defaultChildType"),
e=a.childType||a.type,g,h,l;e&&(h=b.isString(e)?d[e]:e);b.isFunction(h)?l=h:c&&(l=c);l?g=new l(a):d.error("Could not create a child instance because its constructor is either undefined or invalid.");return g},_defAddChildFn:function(a){var c=a.child,e=a.index,g=this._items;c.get("parent")&&c.remove();b.isNumber(e)?g.splice(e,0,c):g.push(c);c._set("parent",this);c.addTarget(this);a.index=c.get("index");c.after("selectedChange",d.bind(this._updateSelection,this))},_defRemoveChildFn:function(a){var b=
a.child;a=a.index;var c=this._items;b.get("focused")&&b.blur();b.get("selected")&&b.set("selected",0);c.splice(a,1);b.removeTarget(this);b._oldParent=b.get("parent");b._set("parent",null)},_add:function(a,c){var e,g,h;b.isArray(a)?(e=[],d.each(a,function(a,b){(g=this._add(a,c+b))&&e.push(g)},this),0<e.length&&(h=e)):(g=d.instanceOf(a,d.Widget)?a:this._createChild(a))&&this.fire("addChild",{child:g,index:c})&&(h=g);return h},add:function(){var a=this._add.apply(this,arguments),a=a?b.isArray(a)?a:[a]:
[];return new d.ArrayList(a)},remove:function(a){var b=this._items[a],c;b&&this.fire("removeChild",{child:b,index:a})&&(c=b);return c},removeAll:function(){var a=[],b;d.each(this._items.concat(),function(){(b=this.remove(0))&&a.push(b)},this);return new d.ArrayList(a)},selectChild:function(a){this.item(a).set("selected",1)},selectAll:function(){this.set("selected",1)},deselectAll:function(){this.set("selected",0)},_uiAddChild:function(a,b){a.render(b);var c=a.get("boundingBox"),d;(d=a.next(!1))&&
d.get("rendered")?(d=d.get("boundingBox"),d.insert(c,"before")):(d=a.previous(!1))&&d.get("rendered")?(d=d.get("boundingBox"),d.insert(c,"after")):b.contains(c)||b.appendChild(c)},_uiRemoveChild:function(a){a.get("boundingBox").remove()},_afterAddChild:function(a){a=a.child;a.get("parent")==this&&this._uiAddChild(a,this._childrenContainer)},_afterRemoveChild:function(a){a=a.child;a._oldParent==this&&this._uiRemoveChild(a)},_bindUIParent:function(){this.after("addChild",this._afterAddChild);this.after("removeChild",
this._afterRemoveChild)},_renderChildren:function(){var a=this._childrenContainer||this.get("contentBox");this._childrenContainer=a;this.each(function(b){b.render(a)})},_destroyChildren:function(){this._hDestroyChild.detach();this.each(function(a){a.destroy()})}};d.augment(c,d.ArrayList);d.WidgetParent=c},"3.17.2",{requires:["arraylist","base-build","widget"]})}});

}