!function(){"use strict";var e,t,n={274:function(e,t,n){var r=i(n(180)),o=i(n(521));function i(e){return e&&e.__esModule?e:{default:e}}window.document.addEventListener("DOMContentLoaded",(()=>{(0,o.default)(),(0,r.default)()}))},521:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=s(n(648)),o=s(n(93)),i=s(n(436)),a=s(n(149));function s(e){return e&&e.__esModule?e:{default:e}}t.default=()=>{r.default.component.register("AnchorSelectorField",o.default),r.default.transform("pages-history",(e=>{e.component("HistoryViewer.pages-controller-cms-content",i.default,"PageHistoryViewer")})),r.default.transform("pages-history-revert",(e=>{e.component("HistoryViewerToolbar.VersionedAdmin.HistoryViewer.SiteTree.HistoryViewerVersionDetail",a.default,"PageRevertMutation")}))}},180:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a(n(648)),o=n(827),i=a(n(572));function a(e){return e&&e.__esModule?e:{default:e}}t.default=()=>{r.default.reducer.register("cms",(0,o.combineReducers)({anchorSelector:i.default}))}},93:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.ConnectedAnchorSelectorField=t.Component=void 0;var r=y(n(754)),o=y(n(363)),i=y(n(875)),a=n(624),s=n(827),u=n(762),l=y(n(277)),c=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=b(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}r.default=e,n&&n.set(e,r);return r}(n(447)),d=y(n(892)),f=y(n(42)),p=y(n(783)),h=y(n(78)),v=y(n(720)),m=y(n(820)),g=y(n(86));function b(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(b=function(e){return e?n:t})(e)}function y(e){return e&&e.__esModule?e:{default:e}}const w=()=>null;class O extends l.default{constructor(e){super(e),this.handleChange=this.handleChange.bind(this),this.handleLoadingError=this.handleLoadingError.bind(this)}componentDidMount(){this.ensurePagesLoaded()}componentDidUpdate(e){this.props.pageId!==e.pageId&&this.ensurePagesLoaded()}ensurePagesLoaded(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props;if(e.loadingState===d.default.UPDATING||e.loadingState===d.default.SUCCESS||!e.pageId)return Promise.resolve();let t=[];e.loadingState===d.default.FIELD_ONLY&&(t=this.props.anchors),e.actions.anchorSelector.beginUpdating(e.pageId);const n=e.data.endpoint.replace(/:id/,e.pageId);return(0,i.default)(n,{credentials:"same-origin"}).then((e=>e.json())).then((n=>{const r=[...new Set([...n,...t])];return e.actions.anchorSelector.updated(e.pageId,r),r})).catch((t=>{e.actions.anchorSelector.updateFailed(e.pageId),this.handleLoadingError(t,e)}))}getDropdownOptions(){const e=this.props.anchors.map((e=>({value:e})));return this.props.value&&!this.props.anchors.find((e=>e===this.props.value))&&e.unshift({value:this.props.value}),e}handleChange(e){"function"==typeof this.props.onChange&&this.props.onChange(e?e.value:"")}handleLoadingError(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.props;if(t.onLoadingError===w)throw e;return t.onLoadingError({errors:[{value:e.message,type:"error"}]})}render(){const e=(0,m.default)("anchorselectorfield",this.props.extraClass),t=this.getDropdownOptions(),n=this.props.value||"",i=r.default._t("CMS.ANCHOR_SELECT_OR_TYPE","Select or enter anchor");return o.default.createElement(h.default,null,o.default.createElement(p.default,{isSearchable:!0,isClearable:!0,options:t,className:e,name:this.props.name,onChange:this.handleChange,value:{value:n},noOptionsMessage:()=>r.default._t("CMS.ANCHOR_NO_OPTIONS","No options"),placeholder:i,getOptionLabel:e=>{let{value:t}=e;return t},classNamePrefix:"anchorselectorfield"}))}}t.Component=O,O.propTypes={extraClass:g.default.string,id:g.default.string,name:g.default.string.isRequired,onChange:g.default.func,value:g.default.string,attributes:g.default.oneOfType([g.default.object,g.default.array]),pageId:g.default.number,anchors:g.default.array,loadingState:g.default.oneOf(Object.keys(d.default).map((e=>d.default[e]))),onLoadingError:g.default.func,data:g.default.shape({endpoint:g.default.string,targetFieldName:g.default.string})},O.defaultProps={value:"",extraClass:"",onLoadingError:w,attributes:{}};const C=(0,a.connect)((function(e,t){const n=(0,u.formValueSelector)(t.formid,v.default),r=t&&t.data&&t.data.targetFieldName||"PageID",o=Number(n(e,r)||0);let i=[];const a=o?e.cms.anchorSelector.pages.find((e=>e.id===o)):null;!a||a.loadingState!==d.default.SUCCESS&&a.loadingState!==d.default.DIRTY&&a.loadingState!==d.default.FIELD_ONLY||(i=a.anchors);let s=null;return s=a?a.loadingState:o?d.default.DIRTY:d.default.SUCCESS,{pageId:o,anchors:i,loadingState:s}}),(function(e){return{actions:{anchorSelector:(0,s.bindActionCreators)(c,e)}}}))(O);t.ConnectedAnchorSelectorField=C;var S=(0,f.default)(C);t.default=S},554:function(e,t,n){var r;((r=n(311))&&r.__esModule?r:{default:r}).default.entwine("ss",(function(e){e(".TreeDropdownField").entwine({OldValue:null}),e("#Form_AddForm_ParentID_Holder .treedropdownfield").entwine({onmatch(){this._super(),e(".cms-add-form").updateTypeList()}}),e(".cms-add-form .parent-mode :input").entwine({onclick:function(e){var t=this.closest("form").find("#Form_AddForm_ParentID_Holder .TreeDropdownField");"top"==this.val()?(t.setOldValue(t.getValue()),t.setValue(0)):(t.setValue(t.getOldValue()||0),t.setOldValue(null)),t.refresh(),t.trigger("change")}}),e(".cms-add-form").entwine({ParentCache:{},onadd:function(){var t=this;this.find("#Form_AddForm_ParentID_Holder .TreeDropdownField").on("change",(function(){t.updateTypeList()})),this.find(".SelectionGroup.parent-mode").on("change",(function(){t.updateTypeList()})),"top"==e(".cms-add-form .parent-mode :input").val()&&this.updateTypeList()},loadCachedChildren:function(e){var t=this.getParentCache();return void 0!==t[e]?t[e]:null},saveCachedChildren:function(e,t){var n=this.getParentCache();n[e]=t,this.setParentCache(n)},updateTypeList:function(){var t=this.data("hints"),n=this.find("#Form_AddForm_ParentID"),r=this.find("input[name=ParentModeField]:checked").val(),o=n.data("metadata"),i="child"===r?n.getValue():null,a=o?o.ClassName:null,s=a&&"child"===r&&i?a:"Root",u=void 0!==t[s]?t[s]:null,l=this,c=u&&void 0!==u.defaultChild?u.defaultChild:null,d=[];if(i){if(this.hasClass("loading"))return;return this.addClass("loading"),null!==(d=this.loadCachedChildren(i))?(this.updateSelectionFilter(d,c),void this.removeClass("loading")):(e.ajax({url:l.data("childfilter"),data:{ParentID:i},success:function(e){l.saveCachedChildren(i,e),l.updateSelectionFilter(e,c)},complete:function(){l.removeClass("loading")}}),!1)}d=u&&void 0!==u.disallowedChildren?u.disallowedChildren:[],this.updateSelectionFilter(d,c)},updateSelectionFilter:function(t,n){var r=this.find("#Form_AddForm_PageType div.radio.selected")[0],o=!1,i=null;if(this.find("#Form_AddForm_PageType div.radio").each((function(n,a){var s=e(this).find("input").val(),u=-1===e.inArray(s,t);a===r&&u&&(o=!0),e(this).setEnabled(u),u||e(this).setSelected(!1),i=(null===i||i)&&u})),o)var a=e(r).parents("li:first");else if(n)a=this.find("#Form_AddForm_PageType div.radio input[value="+n+"]").parents("li:first");else a=this.find("#Form_AddForm_PageType div.radio:not(.disabled):first");a.setSelected(!0),a.siblings().setSelected(!1),this.find("#Form_AddForm_PageType div.radio:not(.disabled)").length?this.find("button[name=action_doAdd]").removeAttr("disabled"):this.find("button[name=action_doAdd]").attr("disabled","disabled"),this.find(".message-restricted")[i?"hide":"show"]()}}),e(".cms-add-form #Form_AddForm_PageType div.radio").entwine({onclick:function(e){this.setSelected(!0)},setSelected:function(e){var t=this.find("input");e&&!t.is(":disabled")?(this.siblings().setSelected(!1),this.toggleClass("selected",!0),t.prop("checked",!0)):(this.toggleClass("selected",!1),t.prop("checked",!1))},setEnabled:function(t){e(this).toggleClass("disabled",!t),t?e(this).find("input").removeAttr("disabled"):e(this).find("input").attr("disabled","disabled").removeAttr("checked")}}),e(".cms-content-addpage-button").entwine({onclick:function(t){var n,r=e(".cms-tree"),o=e(".cms-list"),i=0;if(r.is(":visible")){var a=r.jstree("get_selected");i=a?e(a[0]).data("id"):null}else{var s=o.find('input[name="Page[GridState]"]').val();s&&(i=parseInt(JSON.parse(s).ParentID,10))}var u,l={selector:this.data("targetPanel"),pjax:this.data("pjax")};i?(n=this.data("extraParams")?this.data("extraParams"):"",u=e.path.addSearchParams(i18n.sprintf(this.data("urlAddpage"),i),n)):u=this.attr("href"),e(".cms-container").loadPanel(u,null,l),t.preventDefault(),this.blur()}})}))},649:function(e,t,n){var r=a(n(311)),o=a(n(754)),i=a(n(141));function a(e){return e&&e.__esModule?e:{default:e}}r.default.entwine("ss",(function(e){e(".cms-edit-form :input#Form_EditForm_ClassName").entwine({onchange:function(){alert(o.default._t("CMS.ALERTCLASSNAME"))}}),e(".cms-edit-form input[name=Title]").entwine({onmatch:function(){var t=this;t.data("OrigVal",t.val());var n=t.closest("form"),r=e("input:text[name=URLSegment]",n),o=e("input[name=LiveLink]",n);r.length>0&&(t._addActions(),this.on("change",(function(n){var i=t.data("OrigVal"),a=t.val();t.data("OrigVal",a),0===r.val().indexOf(r.data("defaultUrl"))&&""==o.val()?t.updateURLSegment(a):e(".update",t.parent()).show().parent(".form__field-holder").addClass("input-group"),t.updateRelatedFields(a,i),t.updateBreadcrumbLabel(a)}))),this._super()},onunmatch:function(){this._super()},updateRelatedFields:function(t,n){this.parents("form").find("input[name=MetaTitle], input[name=MenuTitle]").each((function(){var r=e(this);r.val()==n&&(r.val(t),r.updatedRelatedFields&&r.updatedRelatedFields())}))},updateURLSegment:function(t){var n=e("input:text[name=URLSegment]",this.closest("form")).closest(".field.urlsegment"),r=e(".update",this.parent());n.update(t),r.is(":visible")&&r.hide().parent(".form__field-holder").removeClass("input-group")},updateBreadcrumbLabel:function(t){e(".cms-edit-form input[name=ID]").val();var n=e("span.cms-panel-link.crumb");t&&""!=t&&n.text(t)},_addActions:function(){var t,n=this;(t=e("