AdfRichUIPeer.createPeerClass(AdfRichUIPeer,"AdfDhtmlPivotTablePeer",!1);AdfPage.PAGE.getLookAndFeel().registerPeerConstructor("oracle.dss.adf.pivotTable.PivotTable","AdfDhtmlPivotTablePeer");
AdfDhtmlPivotTablePeer.InitSubclass=function(){AdfRichUIPeer.addDomEventHandlers(this,"change");AdfRichUIPeer.addComponentEventHandlers(this,AdfUIInputEvent.CLICK_EVENT_TYPE,AdfUIInputEvent.MOUSE_DOWN_EVENT_TYPE,AdfUIInputEvent.KEY_DOWN_EVENT_TYPE,AdfUIInputEvent.KEY_UP_EVENT_TYPE,AdfComponentEvent.FOCUS_EVENT_TYPE,AdfComponentEvent.BLUR_EVENT_TYPE,AdfUIInputEvent.DOUBLE_CLICK_EVENT_TYPE,AdfUIInputEvent.MOUSE_OUT_EVENT_TYPE,AdfUIInputEvent.MOUSE_IN_EVENT_TYPE,AdfComponentEvent.CONTEXT_MENU_EVENT_TYPE,
AdfActionEvent.ACTION_EVENT_TYPE,AdfDialogEvent.EVENT_TYPE,AdfPopupOpeningEvent.POPUP_OPENING_EVENT_TYPE,AdfPopupClosedEvent.POPUP_CLOSED_EVENT_TYPE);AdfObject.ensureClassInitialization(AdfDhtmlPivotTablePeer);AdfRichUIPeer.addSuppressedPPRAttributes(this,"splitRow");AdfRichUIPeer.addSuppressedPPRAttributes(this,"splitColumn");AdfRichUIPeer.addSuppressedPPRAttributes(this,"startRow");AdfRichUIPeer.addSuppressedPPRAttributes(this,"startColumn");AdfRichUIPeer.addSuppressedPPRAttributes(this,"secondStartRow");
AdfRichUIPeer.addSuppressedPPRAttributes(this,"secondStartColumn");AdfRichUIPeer.addSuppressedPPRAttributes(this,"startRowPixel");AdfRichUIPeer.addSuppressedPPRAttributes(this,"startColumnPixel");AdfRichUIPeer.addSuppressedPPRAttributes(this,"secondStartRowPixel");AdfRichUIPeer.addSuppressedPPRAttributes(this,"secondStartColumnPixel");AdfRichUIPeer.addSuppressedPPRAttributes(this,"rowHeaderStartLayer");AdfRichUIPeer.addSuppressedPPRAttributes(this,"columnHeaderStartLayer");AdfRichUIPeer.addSuppressedPPRAttributes(this,
"rowHeaderStartPixel");AdfRichUIPeer.addSuppressedPPRAttributes(this,"columnHeaderStartPixel");AdfRichUIPeer.addSuppressedPPRAttributes(this,"_sizeOverrides");AdfRichUIPeer.addSuppressedPPRAttributes(this,"selection");AdfRichUIPeer.addSuppressedPPRAttributes(this,"activeCellKey");this.ROW_HEADER_COMPONENT="0";this.COLUMN_HEADER_COMPONENT="1";this.DATABODY_COMPONENT="2";this.PARTIAL="partial";this.STATE_NORMAL=0;this.STATE_CONTEXT_MENU=1;this.STATE_DIALOG=2;this.STATE_STAMP_POPUP=3;this.PIVOT_BEFOREAFTER_MARGIN=
5;this.COLUMN_RESIZE_MARGIN=3;this.ROW_RESIZE_MARGIN=1;AdfPivotTableUtils.isMobileTouchDevice()?this.MIN_COL_HEADER_HEIGHT=this.MIN_ROW_HEADER_WIDTH=this.MIN_ROW_HEIGHT=this.MIN_COLUMN_WIDTH=22:this.MIN_COL_HEADER_HEIGHT=this.MIN_ROW_HEADER_WIDTH=this.MIN_ROW_HEIGHT=this.MIN_COLUMN_WIDTH=10;this._INPUT_REGEXP=/^INPUT|SELECT|OPTION|BUTTON|^A\b|TEXTAREA/;this._DIGIT_REGEXP=/\d+/g;this._WHITESPACE_REGEXP=/\s+/g;this.ORIGINAL_COLOR="_oc";this.BACKGROUND_COLOR_NEEDS_RESTORING="_bc";this._NAMED_COLOR_MAP=
{ALICEBLUE:"#F0F8FF",ANTIQUEWHITE:"#FAEBD7",AQUA:"#00FFFF",AQUAMARINE:"#7FFFD4",AZURE:"#F0FFFF",BEIGE:"#F5F5DC",BISQUE:"#FFE4C4",BLACK:"#000000",BLANCHEDALMOND:"#FFEBCD",BLUE:"#0000FF",BLUEVIOLET:"#8A2BE2",BROWN:"#A52A2A",BURLYWOOD:"#DEB887",CADETBLUE:"#5F9EA0",CHARTREUSE:"#7FFF00",CHOCOLATE:"#D2691E",CORAL:"#FF7F50",CORNFLOWERBLUE:"#6495ED",CORNSILK:"#FFF8DC",CRIMSON:"#DC143C",CYAN:"#00FFFF",DARKBLUE:"#00008B",DARKCYAN:"#008B8B",DARKGOLDENROD:"#B8860B",DARKGRAY:"#A9A9A9",DARKGREEN:"#006400",DARKKHAKI:"#BDB76B",
DARKMAGENTA:"#8B008B",DARKOLIVEGREEN:"#556B2F",DARKORANGE:"#FF8C00",DARKORCHID:"#9932CC",DARKRED:"#8B0000",DARKSALMON:"#E9967A",DARKSEAGREEN:"#8FBC8F",DARKSLATEBLUE:"#483D8B",DARKSLATEGRAY:"#2F4F4F",DARKTURQUOISE:"#00CED1",DARKVIOLET:"#9400D3",DEEPPINK:"#FF1493",DEEPSKYBLUE:"#00BFFF",DIMGRAY:"#696969",DODGERBLUE:"#1E90FF",FIREBRICK:"#B22222",FLORALWHITE:"#FFFAF0",FORESTGREEN:"#228B22",FUCHSIA:"#FF00FF",GAINSBORO:"#DCDCDC",GHOSTWHITE:"#F8F8FF",GOLD:"#FFD700",GOLDENROD:"#DAA520",GRAY:"#808080",GREEN:"#008000",
GREENYELLOW:"#ADFF2F",HONEYDEW:"#F0FFF0",HOTPINK:"#FF69B4",INDIANRED:"#CD5C5C",INDIGO:"#4B0082",IVORY:"#FFFFF0",KHAKI:"#F0E68C",LAVENDER:"#E6E6FA",LAVENDERBLUSH:"#FFF0F5",LAWNGREEN:"#7CFC00",LEMONCHIFFON:"#FFFACD",LIGHTBLUE:"#ADD8E6",LIGHTCORAL:"#F08080",LIGHTCYAN:"#E0FFFF",LIGHTGOLDENRODYELLOW:"#FAFAD2",LIGHTGREY:"#D3D3D3",LIGHTGREEN:"#90EE90",LIGHTPINK:"#FFB6C1",LIGHTSALMON:"#FFA07A",LIGHTSEAGREEN:"#20B2AA",LIGHTSKYBLUE:"#87CEFA",LIGHTSLATEGRAY:"#778899",LIGHTSTEELBLUE:"#B0C4DE",LIGHTYELLOW:"#FFFFE0",
LIME:"#00FF00",LIMEGREEN:"#32CD32",LINEN:"#FAF0E6",MAGENTA:"#FF00FF",MAROON:"#800000",MEDIUMAQUAMARINE:"#66CDAA",MEDIUMBLUE:"#0000CD",MEDIUMORCHID:"#BA55D3",MEDIUMPURPLE:"#9370D8",MEDIUMSEAGREEN:"#3CB371",MEDIUMSLATEBLUE:"#7B68EE",MEDIUMSPRINGGREEN:"#00FA9A",MEDIUMTURQUOISE:"#48D1CC",MEDIUMVIOLETRED:"#C71585",MIDNIGHTBLUE:"#191970",MINTCREAM:"#F5FFFA",MISTYROSE:"#FFE4E1",MOCCASIN:"#FFE4B5",NAVAJOWHITE:"#FFDEAD",NAVY:"#000080",OLDLACE:"#FDF5E6",OLIVE:"#808000",OLIVEDRAB:"#6B8E23",ORANGE:"#FFA500",
ORANGERED:"#FF4500",ORCHID:"#DA70D6",PALEGOLDENROD:"#EEE8AA",PALEGREEN:"#98FB98",PALETURQUOISE:"#AFEEEE",PALEVIOLETRED:"#D87093",PAPAYAWHIP:"#FFEFD5",PEACHPUFF:"#FFDAB9",PERU:"#CD853F",PINK:"#FFC0CB",PLUM:"#DDA0DD",POWDERBLUE:"#B0E0E6",PURPLE:"#800080",RED:"#FF0000",ROSYBROWN:"#BC8F8F",ROYALBLUE:"#4169E1",SADDLEBROWN:"#8B4513",SALMON:"#FA8072",SANDYBROWN:"#F4A460",SEAGREEN:"#2E8B57",SEASHELL:"#FFF5EE",SIENNA:"#A0522D",SILVER:"#C0C0C0",SKYBLUE:"#87CEEB",SLATEBLUE:"#6A5ACD",SLATEGRAY:"#708090",SNOW:"#FFFAFA",
SPRINGGREEN:"#00FF7F",STEELBLUE:"#4682B4",TAN:"#D2B48C",TEAL:"#008080",THISTLE:"#D8BFD8",TOMATO:"#FF6347",TURQUOISE:"#40E0D0",VIOLET:"#EE82EE",WHEAT:"#F5DEB3",WHITE:"#FFFFFF",WHITESMOKE:"#F5F5F5",YELLOW:"#FFFF00",YELLOWGREEN:"#9ACD32"};this._SELECT_RANGE=[["colNav0","colNav1"],["rowNav0","rowNav1"]];this._CHOICE_ID_SUFFIX="c";this._PREV_LINK_ID_SUFFIX="p";this._NEXT_LINK_ID_SUFFIX="n";this._ADA_CLEAR_SELECTION_LINK_ID="ClearSelectionLink";this._ADA_TOGGLE_SELECTION_CHECKBOXES_LINK_ID="ToggleCheckboxesLink";
this._ADA_SELECTION_CHECKBOX_ID="SelectionCheckbox";this.EMPTY_TEXT_ID="et";this.NAV_LAYER_DECREASE=0;this.NAV_LAYER_INCREASE=1;this.NAV_SLICE_DECREASE=2;this.NAV_SLICE_INCREASE=3;this._SELECTION_DIV_ID="SelectionDiv";this.HIGHLIGHTING_NORMAL=0;this.HIGHLIGHTING_SELECTED=1;this.HIGHLIGHTING_FOCUSED=2;this.HIGHLIGHTING_FOCUSED_AND_SELECTED=3;this.CONTEXT_MENU_POPUP_ID="MainContextMenuPopup";this.BODY_CONTEXT_MENU_POPUP_ID="BodyContextMenuPopup";this.EMPTY_MENU_ID="EmptyMenu";this.HEADER_SORT_ASCENDING_MENU_ITEM_ID=
"HeaderSortAscendingMenuItem";this.HEADER_SORT_DESCENDING_MENU_ITEM_ID="HeaderSortDescendingMenuItem";this.DATA_SORT_ASCENDING_MENU_ITEM_ID="DataSortAscendingMenuItem";this.DATA_SORT_DESCENDING_MENU_ITEM_ID="DataSortDescendingMenuItem";this.RESIZE_HEIGHT_MENU_ITEM_ID="ResizeHeightMenuItem";this.RESIZE_WIDTH_MENU_ITEM_ID="ResizeWidthMenuItem";this.SPLIT_PANES_MENU_ITEM_ID="SplitPanesMenuItem";this.RESIZE_DIALOG_POPUP_ID="ResizeDialogPopup";this.RESIZE_DIALOG_ID="ResizeDialog";this.RESIZE_DIALOG_PLM_ID=
"ResizeDialogPlm";this.RESIZE_DIALOG_SPINNER_ID="ResizeDialogSpin";this._SORT_INDICATOR="si";this._SORT_ASCENDING="_asc";this._SORT_DESCENDING="_desc";this._SORTED_TYPE="_sorted";this._SORTED_ASCENDING="1";this._SORTED_DESCENDING="2";this._NAMING_SEP=":";this._isNavigationMode=!1;this._NAVBAR_PREV=[[],[]];this._NAVBAR_PREV[0][0]="nb_pv_00";this._NAVBAR_PREV[0][1]="nb_pv_01";this._NAVBAR_PREV[1][0]="nb_pv_10";this._NAVBAR_PREV[1][1]="nb_pv_11";this._NAVBAR_FIRST=[[],[]];this._NAVBAR_FIRST[0][0]="nb_fr_00";
this._NAVBAR_FIRST[0][1]="nb_fr_01";this._NAVBAR_FIRST[1][0]="nb_fr_10";this._NAVBAR_FIRST[1][1]="nb_fr_11";this._NAVBAR_NEXT=[[],[]];this._NAVBAR_NEXT[0][0]="nb_nx_00";this._NAVBAR_NEXT[0][1]="nb_nx_01";this._NAVBAR_NEXT[1][0]="nb_nx_10";this._NAVBAR_NEXT[1][1]="nb_nx_11";this._NAVBAR_LAST=[[],[]];this._NAVBAR_LAST[0][0]="nb_ls_00";this._NAVBAR_LAST[0][1]="nb_ls_01";this._NAVBAR_LAST[1][0]="nb_ls_10";this._NAVBAR_LAST[1][1]="nb_ls_11"};
AdfDhtmlPivotTablePeer.prototype.preserveEditingBehavior=function(){return"true"==this.getDomElement().getAttribute("_old_edit")?!0:!1};AdfDhtmlPivotTablePeer.prototype._isReadOnly=function(){return"true"==this.getDomElement().getAttribute("_readonly")?!0:!1};
AdfDhtmlPivotTablePeer.prototype._updateInitialACK=function(a){var b=this.getComponent(),c=a.getAttribute("_initACK");c?(b.setProperty(AdfRichPivotTable.__ACTIVE_CELL_KEY,c,!1,AdfUIComponent.PROPAGATE_NEVER),b.setProperty("activeCellKey",c,!1,AdfUIComponent.PROPAGATE_NEVER),this._activeCellKeySetFromServer=!0):a.getAttribute("_afrACKChange")&&(this._activeCellKeySetFromServer=!0)};
AdfDhtmlPivotTablePeer.prototype._isClickToEditAll=function(){return"true"==this.getDomElement().getAttribute("_cteAll")?!0:!1};
AdfDhtmlPivotTablePeer.prototype.HandleComponentFocus=function(a){if(!this._isAda&&!(0==this._ptUtils._rowExtent||0==this._ptUtils._colExtent))if(this._serverBusy&&AdfAgent.AGENT.getPlatform()==AdfAgent.IE_PLATFORM)AdfPage.PAGE.getGlassPane().focus();else{if(this._activeCellKeySetFromServer){var b=this._getActiveCellKey();null!=b&&null==this._focusCellIndex&&(b=this._getDataCellIndexFromKey(b),this.selectAndFocusDataCell(b),this._focusCellNeedsInit=!1)}else this._focusCellNeedsInit?this.initializeFocusCell():
this.highlightFocusCell();this.preserveEditingBehavior()||(a=a.getNativeEvent(),a=AdfAgent.AGENT.getEventTarget(a),b=this._getDataCellKeyAndCell(a),null!=b&&null!=b[0]&&null!=b[1]&&b[1].id&&void 0==a._afrOldValue&&AdfDhtmlPivotTablePeer._saveFocusCellValue(a))}};AdfDhtmlPivotTablePeer.prototype.HandleComponentBlur=function(a){!this._isAda&&0==this._codeExecutionCounter&&(AdfPivotTableUtils.isMobileTouchDevice()&&this.hidePivotHandle(),this.highlightFocusCell(!0),this.endKeyboardPivoting(!0))};
AdfDhtmlPivotTablePeer.prototype._displayContextMenuAfterEdit=function(){this._displayContextMenu(this.domEventForContextMenuAfterEdit,this.domEventForContextMenuAfterEdit.flag);this.domEventForContextMenuAfterEdit=null};AdfDhtmlPivotTablePeer.prototype._dismissEditAndDisplayContextMenu=function(a,b){var c=a.getNativeEvent();null!=this._activeCell?(this._processDismissCTE(a),AdfAgent.AGENT.preventDefault(c),c.flag=b,this.domEventForContextMenuAfterEdit=c):this._displayContextMenu(c,b)};
AdfDhtmlPivotTablePeer.prototype.HandleComponentContextMenu=function(a){if(!this.isAttachmentMode()&&this.isSelectionUiEnabled()&&!(this._ptState==AdfDhtmlPivotTablePeer.STATE_DIALOG||this._ptState==AdfDhtmlPivotTablePeer.STATE_STAMP_POPUP)&&!this._isAda){var b=AdfAgent.AGENT,c=a.getNativeEvent(),d=b.getEventTarget(c);if(!this._isInputElement(d))if(this.isClientValidationError(d))b.preventDefault(c);else if(this.getDomElement().focus(),d=this._getMouseContext(c),d.headerContext&&d.headerContext.cell&&
!d.headerContext.isEmptyEdge)b=this.newHeaderCellIndexWithEdgeFromCell(d.headerContext.cell),this.isSelected(b)||this.selectAndFocusHeaderCell(b),this._dismissEditAndDisplayContextMenu(a,!1);else if(d.databodyContext){var d=d.databodyContext.cell,e=this.newDataCellIndexFromCell(d),f=this._getStyleClass(AdfPivotTableUtils.DATABODY_CELL_SELECTED_STYLE);this.preserveEditingBehavior()?(!this.isSelected(e)&&!AdfDhtmlCommonUtils.containsCSSClassName(d,f)&&this.selectAndFocusDataCell(e),this._dismissEditAndDisplayContextMenu(a,
!1)):this.isInHeaderSelection(e,null,!0)||this.isMultipleDatabodyCellsSelected()&&this.isSelected(e)?this._dismissEditAndDisplayContextMenu(a,!1):this._activeCell==d?this._dismissEditAndDisplayContextMenu(a,!1):(!this.isSelected(e)&&!AdfDhtmlCommonUtils.containsCSSClassName(d,f)&&this.selectAndFocusDataCell(e),b.preventDefault(c),this._isReadOnly()?this._dismissEditAndDisplayContextMenu(a,!1):this._isClickToEditAll()?(this._dismissPreviousActiveCell(d,null,null),this._cancelDismiss=!1,this._dismissClickToEdit(!0),
this._displayContextMenu(c,!1)):(this.domEventForContextMenuAfterEdit=b.copyEvent(c),this.doHandleClickToEdit(a)))}else this._dismissEditAndDisplayContextMenu(a,!0)}};AdfDhtmlPivotTablePeer.prototype._getBodyContextMenuPopupId=function(){var a=this.getDomElement().getAttribute("_cbcm");return null==a?AdfDhtmlPivotTablePeer.BODY_CONTEXT_MENU_POPUP_ID:a};
AdfDhtmlPivotTablePeer.prototype._getContextMenuPopupId=function(){var a=this.getDomElement().getAttribute("_ccm");return null==a?AdfDhtmlPivotTablePeer.CONTEXT_MENU_POPUP_ID:a};
AdfDhtmlPivotTablePeer.prototype._displayContextMenu=function(a,b,c){this._ptState=AdfDhtmlPivotTablePeer.STATE_CONTEXT_MENU;this.selectionChangedSinceLastCmRequest=!1;this._displayLegacyContextMenu(a,b,c)||(b=b?this._getBodyContextMenuPopupId():this._getContextMenuPopupId(),this.showContextMenu(a,b,this.getComponent(),c),c=AdfAgent.AGENT,c.stopPropagation(a),c.preventDefault(a))};
AdfDhtmlPivotTablePeer.prototype._displayLegacyContextMenu=function(a,b,c){var d=this.getComponent(),e=!1,f=null;if(f=b?d.getBodyContextMenuId?d.getBodyContextMenuId():null:d.getContextMenuId?d.getContextMenuId():null)e=!0,b=d.findComponent(f),null==b&&(b=AdfPage.PAGE.findComponent(f),d=null),null!=b&&(b.removeEventListener("popupClosed",this.handleLegacyContextMenuClosing,null),b.addEventListener("popupClosed",this.handleLegacyContextMenuClosing,null)),this.showContextMenu(a,f,d,c),c=AdfAgent.AGENT,
c.stopPropagation(a),c.preventDefault(a);return e};AdfDhtmlPivotTablePeer.prototype.handleLegacyContextMenuClosing=function(){this.HandleComponentPopupClosed(null)};
AdfDhtmlPivotTablePeer.prototype.HandleComponentAction=function(a){var b=a.getSource();b.getDisabled()||(b=b.getClientId(),-1!=b.indexOf(AdfDhtmlPivotTablePeer.DATA_SORT_ASCENDING_MENU_ITEM_ID)?(this.handleSortContextMenuAction(!0,!1),a.cancel()):-1!=b.indexOf(AdfDhtmlPivotTablePeer.DATA_SORT_DESCENDING_MENU_ITEM_ID)?(this.handleSortContextMenuAction(!1,!1),a.cancel()):-1!=b.indexOf(AdfDhtmlPivotTablePeer.HEADER_SORT_ASCENDING_MENU_ITEM_ID)?(this.handleSortContextMenuAction(!0,!0),a.cancel()):-1!=
b.indexOf(AdfDhtmlPivotTablePeer.HEADER_SORT_DESCENDING_MENU_ITEM_ID)?(this.handleSortContextMenuAction(!1,!0),a.cancel()):-1!=b.indexOf(AdfDhtmlPivotTablePeer.RESIZE_HEIGHT_MENU_ITEM_ID)?(this.showResizeDialog(!0),a.cancel()):-1!=b.indexOf(AdfDhtmlPivotTablePeer.RESIZE_WIDTH_MENU_ITEM_ID)?(this.showResizeDialog(!1),a.cancel()):-1!=b.indexOf(AdfDhtmlPivotTablePeer.SPLIT_PANES_MENU_ITEM_ID)&&(this.queueSplitRequest(),a.cancel()))};
AdfDhtmlPivotTablePeer.prototype.handleSortContextMenuAction=function(a,b){var c=this.getSelectedEdge(),d=this.getSelectionForEdge(c)[0].startIndex;b?d=d.layer:(c=1-c,d=d.slice);this.queueSortRequest(c,d,a,b)};
AdfDhtmlPivotTablePeer.prototype.HandleComponentDialog=function(a){a.getSource().getClientId()==this.getComponent().getClientId()+AdfDhtmlPivotTablePeer._NAMING_SEP+AdfDhtmlPivotTablePeer.RESIZE_DIALOG_ID&&a.getOutcome()==AdfDialogEvent.OUTCOME_OK&&(this.handleResizeDialog(a),a.cancel(),a=this.getComponent().getClientId(),AdfPage.PAGE.findComponent(a+AdfDhtmlPivotTablePeer._NAMING_SEP+AdfDhtmlPivotTablePeer.RESIZE_DIALOG_POPUP_ID).hide())};
AdfDhtmlPivotTablePeer.prototype.HandleComponentPopupOpening=function(a){if(this._currentRequest==AdfDhtmlPivotTablePeer.PARTIAL)a.cancel();else{var b=a.getSource().getClientId(),c=b.indexOf(":",this.getComponent().getClientId().length+1),b=b.substring(this.getComponent().getClientId().length+1,c);if(isNaN(b))switch(this._ptState){case AdfDhtmlPivotTablePeer.STATE_NORMAL:case AdfDhtmlPivotTablePeer.STATE_CONTEXT_MENU:b=this.selectionChangedSinceLastCmRequest;b||(b=a.getSource().getDescendantComponents(),
b=null==b||1>=b.length);b?(a.cancel(),this._ptState=AdfDhtmlPivotTablePeer.STATE_NORMAL):this._ptState=AdfDhtmlPivotTablePeer.STATE_CONTEXT_MENU;break;case AdfDhtmlPivotTablePeer.STATE_DIALOG:this.resizeDialogOpening()}else this._ptState=AdfDhtmlPivotTablePeer.STATE_STAMP_POPUP}};AdfDhtmlPivotTablePeer.prototype.HandleComponentPopupClosed=function(a){this._ptState=AdfDhtmlPivotTablePeer.STATE_NORMAL};
AdfDhtmlPivotTablePeer.prototype.isClientValidationError=function(a){var b=AdfAgent.AGENT,c=this.getComponent();if(a==this._activeCell&&(c=AdfPage.PAGE.getClientIdsWithMessages(c.getClientId()),null!=c&&0<c.length))for(var d=0;d<c.length;d++)if(0==c[d].indexOf(a.id))return a=b.getElementById(c[d]),a=this._getInputElementsInNode(a),null!=a&&0<a.length&&a[0].focus(),!0;return!1};
AdfDhtmlPivotTablePeer.prototype.HandleComponentClick=function(a){if(!(this._currentRequest==AdfDhtmlPivotTablePeer.PARTIAL||this._ptState==AdfDhtmlPivotTablePeer.STATE_DIALOG||this._ptState==AdfDhtmlPivotTablePeer.STATE_STAMP_POPUP)){var b=this.getComponent(),c=AdfAgent.AGENT,d=a.getNativeEvent(),c=c.getEventTarget(d);if(!this.isClientValidationError(c)&&(!this._isPaging||!this._handleClickOnPagingControl(d,c)))a.isLeftButtonPressed()&&(this.handleImageAction(b,c),this._isSortEnabled&&this.handleSortAction(b,
d,c)),this._isClickToEditAll()?(a=!0,null!=this._activeCell&&(b=this._findInputComponentInCell(this._activeCell).component,null!=b&&b instanceof AdfUIEditableValue&&(a=b.getValid())),a?this._handleClickToEditAll(d,c):(d=this.newDataCellIndexFromCell(this._activeCell),this.selectAndFocusDataCell(d),this._processClickToEditRequest())):(a=AdfAgent.AGENT.getMousePosition(d),(void 0==this._resizeDropMousePos||this._resizeDropMousePos.x!=a.x||this._resizeDropMousePos.x!=a.x)&&!d.shiftKey&&!this.ctrlEquivalent(d)&&
this._dismissClickToEditIfNeeded(c),this._resizeDropMousePos=void 0,this.preserveEditingBehavior()||this.doHandleClickToEdit(d,c))}};
AdfDhtmlPivotTablePeer.prototype._handleClickToEditAll=function(a,b){var c=this._getDataCellKeyAndCell(b);if(null!=c){var d=c[0],c=c[1];if(!(null==d||null==c))if(this._updateInputReadOnlyState(b,c,!1)){null!=this._submittedCellKey&&(this._cancelDismiss=!1,this._dismissClickToEdit(!1));var e=c.parentNode.offsetHeight;this._activeCell!=this._prevActiveCell&&this._dismissPreviousActiveCell(c,c,e);this._cellRowHeight=c.parentNode.offsetHeight;var f=c.parentNode.offsetHeight-e;0!=f&&this._clickToEditResize(c,
f);this._lastUpdatedRow=this.getCoordinates(c).row;this._oldRowHeight=e;this._prevActiveCell=this._activeCell=c;this._setActiveCellKey(d,!0)}else this.preserveEditingBehavior()||this.doHandleClickToEdit(a,b)}};
AdfDhtmlPivotTablePeer.prototype.doHandleClickToEdit=function(a,b){if(this._isClickToEdit()&&!this._isReadOnly()){if(!a.shiftKey&&!this.ctrlEquivalent(a)){var c=this._getDataCellKeyAndCell(b);if(null!=c){var d=c[0],c=c[1];null!=d&&c.id&&(d!=this._getActiveCellKey()?(this._activeCell=c,this._cellRowHeight=c.parentNode.offsetHeight,this._cancelDismiss=!0,this._setActiveCellKey(d)):this._activeCellKeySetFromServer&&(d=AdfAgent.AGENT.getEventTarget(a),"INPUT"==d.tagName&&"text"==d.type&&d.select()))}}else null!=
this._getActiveCellKey()&&this._processClickToEditRequest();this._activeCellKeySetFromServer=!1}};
AdfDhtmlPivotTablePeer.prototype.setCursorToEndOfText=function(a){var b=AdfAgent.AGENT;a=a.getNativeEvent();a=b.getEventTarget(a);"INPUT"==a.tagName&&"text"==a.type&&(b.getPlatform()==AdfAgent.IE_PLATFORM?(b=a.createTextRange(),b.moveStart("character",a.value.length),b.moveEnd("character",a.value.length),b.select()):(a.setSelectionRange(a.value.length,a.value.length),a.blur(),a.focus(),b=document.createEvent("KeyboardEvent"),b.initKeyEvent("keypress",!0,!0,null,!1,!1,!1,!1,27,0),a.dispatchEvent(b)))};
AdfDhtmlPivotTablePeer.prototype.HandleComponentDblClick=function(a){this.preserveEditingBehavior()?this.doHandleClickToEdit(a):this.setCursorToEndOfText(a);this._clickCellKey=this._clickTimeStamp=null};
AdfDhtmlPivotTablePeer.prototype.HandleComponentKeyDown=function(a){if(!(this._ptState==AdfDhtmlPivotTablePeer.STATE_DIALOG||this._ptState==AdfDhtmlPivotTablePeer.STATE_CONTEXT_MENU||this._ptState==AdfDhtmlPivotTablePeer.STATE_STAMP_POPUP)){var b=a.getNativeEvent(),c=AdfAgent.AGENT,d=c.getEventTarget(b),e=b.keyCode;if(this._isPaging)for(var f=d,g=this.getDomElement();f!=g;){if(f==this._ptUtils._pagingControl[0][0]||f==this._ptUtils._pagingControl[0][1]||f==this._ptUtils._pagingControl[1][1]||f==this._ptUtils._pagingControl[1][0]){e==
AdfKeyStroke.ENTER_KEY&&(this._updatedPagingInputValue=!0);return}f=f.parentNode}var g=b.altKey,h=b.ctrlKey,l=b.shiftKey,f=this.getComponent();if("A"==d.tagName&&e==AdfKeyStroke.ENTER_KEY){var m=this._getDataCellKeyAndCell(d);if(null!=m){var n=m[1];if(null!=m[0]&&n.id&&n==this._activeCell)return}}if(!this._isAda&&this._currentRequest!=AdfDhtmlPivotTablePeer.PARTIAL){m=this._focusCellIndex;n=this.isMultipleDatabodyCellsSelected();if(null!=m&&this.getEdge(m)==AdfPivotTableUtils.DATABODY&&null!=this._activeCell&&
(n||this._getDataCellFromCellIndex(m)==this._activeCell)){switch(e){case AdfKeyStroke.ESC_KEY:a.cancel();!this.preserveEditingBehavior()&&void 0!=d._afrOldValue?AdfDhtmlPivotTablePeer._hasFocusCellValueChanged(d)?(AdfPage.PAGE.scheduleTimer(null,AdfDhtmlPivotTablePeer._restoreFocusCellValue,d,0),this._isClickToEditAll()&&(c=this._findInputComponent(d,this._activeCell),null!=c&&(c.resetValue(),c=AdfRichUIPeer.getDomElementForComponent(c),null!=c&&c.removeAttribute("_afrCellDirty")))):(this._isClickToEditAll()||
this._clearMessageAndRevalidate(a),this._processDismissCTE(a),this._isNavigationMode=!0):this.preserveEditingBehavior()&&(this._clearMessageAndRevalidate(a),this._processDismissCTE(a));break;case AdfKeyStroke.TAB_KEY:case AdfKeyStroke.ENTER_KEY:c=!0;void 0!=d._afrOldValue&&d._afrOldValue!=d.value&&(c=this._clearMessageAndRevalidate(a));a.cancel();c&&(e==AdfKeyStroke.TAB_KEY?this.handleTabLeftRightKey_EditMode(a,e):this.handleEnterUpDownKey_EditMode(a,e));break;case AdfKeyStroke.ARROWLEFT_KEY:case AdfKeyStroke.ARROWRIGHT_KEY:case AdfKeyStroke.ARROWUP_KEY:case AdfKeyStroke.ARROWDOWN_KEY:!this.preserveEditingBehavior()&&
(h&&!l)&&(c=!0,void 0!=d._afrOldValue&&d._afrOldValue!=d.value&&(c=this._clearMessageAndRevalidate(a)),a.cancel(),c&&(e==AdfKeyStroke.ARROWLEFT_KEY||e==AdfKeyStroke.ARROWRIGHT_KEY?this.handleTabLeftRightKey_EditMode(a,e):this.handleEnterUpDownKey_EditMode(a,e)))}return}m=this._focusCellIndex;if(null!=m&&this.getEdge(m)!=AdfPivotTableUtils.DATABODY&&e==AdfKeyStroke.ENTER_KEY){range=this.newHeaderCellRange(m);nodes=this.getNodesInHeaderCellRange(range,m.edge);if(0==nodes.length)return;m=nodes[0];n=
this._getInputElementsInNode(m);d=this._getCurrentInputElementIndex(n,d);if(null!=n&&-1==d){a=m.firstChild;if(null==a)return;a=a.firstChild;if(null==a||"SPAN"!=a.nodeName)return;c.getAttribute(a,"_dr")&&this.handleDrillAction(f,m);return}}}switch(e){case 16:case 18:if(this._isAda)break;g&&l&&this.showPivotHandlesForKeyboardPivoting();break;case AdfKeyStroke.ARROWRIGHT_KEY:case AdfKeyStroke.ARROWDOWN_KEY:case AdfKeyStroke.ARROWUP_KEY:case AdfKeyStroke.ARROWLEFT_KEY:if(this._isAda)break;g?h||this.isAttachmentMode()||
this.handleKeyboardPivoting(e,l):!h||l?(this.handleKeyboardNavigation(l,e,!1),this._focusElement(this.getDomElement())):this.handleCtrlArrowNavigation(e);a.cancel();break;case AdfKeyStroke.ESC_KEY:if(this._isAda)break;g&&l&&this.endKeyboardPivoting(!0);break;case AdfKeyStroke.SPACE_KEY:if(this._isAda)break;m=this._focusCellIndex;null!=m&&this.getEdge(m)!=AdfPivotTableUtils.DATABODY&&this.handleHeaderSelection(m,b);a.cancel();break;case AdfKeyStroke.F2_KEY:if(this._isAda)break;this.editCellWithFocus();
break;case AdfKeyStroke.TAB_KEY:if(this._isAda)break;null!=this._focusCellIndex&&this.getEdge(this._focusCellIndex)==AdfPivotTableUtils.DATABODY?null!=this._activeCell?a.cancel():this._isReadOnly()&&!this.preserveEditingBehavior()?this.handleTabKey(a,l):this.handleTABKey_NonEditMode(a):this.handleTABKey_NonEditMode(a);break;case AdfKeyStroke.M_KEY:h&&g&&this.handleKeyboardContextMenu(b);break;case AdfKeyStroke.ENTER_KEY:if(this._isAda)break;this.preserveEditingBehavior()||(this._isReadOnly()?this.handleEnterKey(b):
(this.domEventForReadOnlyContentCheck=AdfAgent.AGENT.copyEvent(b),this.editCellWithFocus()))}}};AdfDhtmlPivotTablePeer.prototype.HandleComponentKeyUp=function(a){this._isAda||(a=a.getNativeEvent(),(!a.altKey||!a.shiftKey&&this._keyboardPivotingShiftKey)&&this.endKeyboardPivoting(!1))};
AdfDhtmlPivotTablePeer._hasFocusCellValueChanged=function(a){if("INPUT"==a.tagName){if("text"==a.type)return a._afrOldValue!=a.value;if("checkbox"==a.type||"radio"==a.type)return a._afrOldValue!=a.checked}else if("SELECT"==a.tagName)for(var b=0;b<a.options.length;b++){if(a.options[b].selected)return a._afrOldValue!=a.options[b].value}else if("TEXTAREA"==a.tagName)return a._afrOldValue!=a.value;return!1};
AdfDhtmlPivotTablePeer._saveFocusCellValue=function(a){if("INPUT"==a.tagName)if("text"==a.type)a._afrOldValue=a.value;else{if("checkbox"==a.type||"radio"==a.type)a._afrOldValue=a.checked}else if("SELECT"==a.tagName)for(var b=0;b<a.options.length;b++)a.options[b].selected&&(a._afrOldValue=a.options[b].value);else"TEXTAREA"==a.tagName&&(a._afrOldValue=a.value)};
AdfDhtmlPivotTablePeer._restoreFocusCellValue=function(a){if("INPUT"==a.tagName)if("text"==a.type)a.value=a._afrOldValue,a.select();else{if("checkbox"==a.type||"radio"==a.type)a.checked=a._afrOldValue}else if("SELECT"==a.tagName)for(var b=0;b<a.options.length;b++)a.options[b].selected=!1,a._afrOldValue==a.options[b].value&&(a.options[b].selected=!0);else"TEXTAREA"==a.tagName&&(a.value=a._afrOldValue,a.select())};
AdfDhtmlPivotTablePeer.prototype.isDataCellInBuffer=function(a){for(var b=0;2>b;++b){var c=a[this._ptUtils.sliceAttr[b]],d=c<this._ptUtils._splitSlice[b]?0:1,e=this.getBufferStartSlice(b,d);if(c<e)return!1;d=this.getBufferEndSlice(b,d);if(c>=d)return!1}return!0};
AdfDhtmlPivotTablePeer.prototype.handleEnterKey=function(a){if(null!=this._focusCellIndex){var b;a.shiftKey?this._focusCellIndex.row==this._ptUtils._splitSlice[1]?b=this.closestVisibleDataCellIndex(1,0,!1,this._focusCellIndex.column):0<this._focusCellIndex.row&&(b=this.newDataCellIndex(this._focusCellIndex.row-1,this._focusCellIndex.column)):this._focusCellIndex.row+1==this._ptUtils._splitSlice[1]?b=this.closestVisibleDataCellIndex(1,1,!0,this._focusCellIndex.column):this._focusCellIndex.row+1<this._ptUtils._rowExtent&&
(b=this.newDataCellIndex(this._focusCellIndex.row+1,this._focusCellIndex.column));if(null==b)!this._isReadOnly()&&!this._isClickToEditAll()&&(a=this.getComponent().getProperty(AdfRichPivotTable.__ACTIVE_CELL_KEY),this._queueClickToEditEvent(a,null,this._cellRowHeight,null)&&(this._oldActiveCellKey=a));else if(this.isDataCellInBuffer(b))this.selectAndFocusDataCell(b),this.scrollToDataCell(b),this._isReadOnly()||this.editCellWithFocus();else{var c=this._focusCellIndex.column!=b.column;this.selectAndFocusDataCell(b);
this._isEditingCellWithFocus=!0;c?this.longJumpToCell(b.row,b.column):(b=this._ptUtils._databodyScrollers[b.row<this._ptUtils._splitSlice[1]?0:1][1],c=this._activeCell.parentNode.offsetHeight,b.scrollTop=a.shiftKey?b.scrollTop-c:b.scrollTop+c,this.HandleDomScroll(this.getComponent(),null))}}};
AdfDhtmlPivotTablePeer.prototype.handleEnterUpDownKey_EditMode=function(a,b){var c=a.getNativeEvent();if(b==AdfKeyStroke.ENTER_KEY)this.handleEnterKey(c);else if(b==AdfKeyStroke.ARROWUP_KEY&&0==this._focusCellIndex.row)this._navigateToHeaderKeyCode=AdfKeyStroke.ARROWUP_KEY,this._processDismissCTE(a);else if(b==AdfKeyStroke.ARROWDOWN_KEY||b==AdfKeyStroke.ARROWUP_KEY)if(this._setFocusOnLastElement=b==AdfKeyStroke.ARROWUP_KEY?!0:!1,this.handleKeyboardNavigation(!1,b,!0),c=this._isShortScrollActive())this._isEditingCellWithFocus=
!0;else{var d=this.getCoordinates(this._activeCell);b==AdfKeyStroke.ARROWDOWN_KEY&&null!=this._focusCellIndex&&!c&&d.col==this._focusCellIndex.column&&d.row==this._focusCellIndex.row||this.editCellWithFocus()}};AdfDhtmlPivotTablePeer.prototype.scrollToCellIndexCTE=function(a){this.selectAndFocusDataCell(a);this.isDataCellInBuffer(a)?(this.scrollToDataCell(a),this._isReadOnly()||this.editCellWithFocus()):(this._isEditingCellWithFocus=!0,this.longJumpToCell(a.row,a.column))};
AdfDhtmlPivotTablePeer.prototype.handleTabKey=function(a,b){if(this._currentRequest!=AdfDhtmlPivotTablePeer.PARTIAL){var c=-1;if(b)if(0==this._focusCellIndex.column)if(0<this._focusCellIndex.row){var d=this.newDataCellIndex(this._focusCellIndex.row-1,this._ptUtils._colExtent-1);this.scrollToCellIndexCTE(d)}else return;else c=this._ptUtils._rightToLeft?AdfKeyStroke.ARROWRIGHT_KEY:AdfKeyStroke.ARROWLEFT_KEY;else if(this._focusCellIndex.column==this._ptUtils._colExtent-1)if(this._focusCellIndex.row<
this._ptUtils._rowExtent-1)d=this.newDataCellIndex(this._focusCellIndex.row+1,0),this.scrollToCellIndexCTE(d);else return;else c=this._ptUtils._rightToLeft?AdfKeyStroke.ARROWLEFT_KEY:AdfKeyStroke.ARROWRIGHT_KEY;-1!=c&&this.handleKeyboardNavigation(!1,c,!1);a.cancel()}};
AdfDhtmlPivotTablePeer.prototype.handleEditLeftCell=function(a,b){var c=this.getCoordinates(this._activeCell);0!=c.col&&!this._ptUtils._rightToLeft||c.col<this._ptUtils._colExtent-1&&this._ptUtils._rightToLeft?(this._setFocusOnLastElement=!0,this.handleKeyboardNavigation(!1,AdfKeyStroke.ARROWLEFT_KEY,!0),this._isShortScrollActive()&&(this._isEditingCellWithFocus=!0,this._isClickToEditAll()&&this._dismissPreviousActiveCell(this._activeCell,this._activeCell,this._oldRowHeight)),this.editCellWithFocus()):
b?!this._ptUtils._rightToLeft&&0==c.col?this.preserveEditingBehavior()||0==this._focusCellIndex.row?this._processDismissCTE(a):(c=this.newDataCellIndex(this._focusCellIndex.row-1,this._ptUtils._colExtent-1),this.scrollToCellIndexCTE(c)):this._ptUtils._rightToLeft&&c.col==this._ptUtils._colExtent-1&&(this.preserveEditingBehavior()||c.row==this._ptUtils._rowExtent-1?this._processDismissCTE(a):(c=this.newDataCellIndex(this._focusCellIndex.row+1,0),this.scrollToCellIndexCTE(c))):!this._ptUtils._rightToLeft&&
0==c.col&&(this._navigateToHeaderKeyCode=AdfKeyStroke.ARROWLEFT_KEY,this._processDismissCTE(a))};
AdfDhtmlPivotTablePeer.prototype.handleEditRightCell=function(a,b){var c=this.getCoordinates(this._activeCell);c.col<this._ptUtils._colExtent-1&&!this._ptUtils._rightToLeft||0!=c.col&&this._ptUtils._rightToLeft?(this.handleKeyboardNavigation(!1,AdfKeyStroke.ARROWRIGHT_KEY,!0),this._isShortScrollActive()&&(this._isEditingCellWithFocus=!0,this._isClickToEditAll()&&this._dismissPreviousActiveCell(this._activeCell,this._activeCell,this._oldRowHeight)),this.editCellWithFocus()):!this._ptUtils._rightToLeft&&
c.col==this._ptUtils._colExtent-1?b&&(this.preserveEditingBehavior()||c.row==this._ptUtils._rowExtent-1?this._processDismissCTE(a):(c=this.newDataCellIndex(this._focusCellIndex.row+1,0),this.scrollToCellIndexCTE(c))):this._ptUtils._rightToLeft&&0==c.col&&(b?0==this._focusCellIndex.row?this._processDismissCTE(a):(c=this.newDataCellIndex(this._focusCellIndex.row-1,this._ptUtils._colExtent-1),this.scrollToCellIndexCTE(c)):(this._navigateToHeaderKeyCode=AdfKeyStroke.ARROWRIGHT_KEY,this._processDismissCTE(a)))};
AdfDhtmlPivotTablePeer.prototype.handleTabLeftRightKey_EditMode=function(a,b){var c=a.getNativeEvent(),d=AdfAgent.AGENT.getEventTarget(c),e=this._getDataCell(d),f=this._ptUtils._rightToLeft;if(e)if(b==AdfKeyStroke.TAB_KEY){var e=this._getInputElementsInNode(e),g=this._getCurrentInputElementIndex(e,d);c.shiftKey&&!f||!c.shiftKey&&f?this._isAncestorOrSelf(e[0],d)?this.handleEditLeftCell(a,!0):this._focusElement(-1==g?e[0]:e[g-1]):this._isAncestorOrSelf(e[e.length-1],d)?this.handleEditRightCell(a,!0):
this._focusElement(-1==g?e[0]:e[g+1])}else b==AdfKeyStroke.ARROWLEFT_KEY?this.handleEditLeftCell(a,!1):this.handleEditRightCell(a,!1);else b==AdfKeyStroke.TAB_KEY?c.shiftKey&&!f||!c.shiftKey&&f?this.handleEditLeftCell(a,!0):this.handleEditRightCell(a,!0):b==AdfKeyStroke.ARROWLEFT_KEY?this.handleEditLeftCell(a,!1):this.handleEditRightCell(a,!1)};
AdfDhtmlPivotTablePeer.prototype.handleTABKey_NonEditMode=function(a){var b=a.getNativeEvent();this._isAda||(null==this._getActiveCellKey()?this._focusElementInHeaderCell(a)||(b.shiftKey?this._focusElement(this.getDomElement()):(a=this.getDomElement(),a=AdfDhtmlPivotTablePeer._getChildById(a.childNodes[0],a.id+"::ScrollbarTesterParent"),null!=a&&this._focusElement(a))):(this._clearMessageAndRevalidate(a),a.cancel(),this._processDismissCTE(a)))};
AdfDhtmlPivotTablePeer.prototype._focusElementInHeaderCell=function(a){var b=a.getNativeEvent(),c=AdfAgent.AGENT.getEventTarget(b),d=this._focusCellIndex;if(null!=d&&this.isHeaderCellIndex(d)){var e=this.newHeaderCellRange(d),d=this.getNodesInHeaderCellRange(e,d.edge);if(0<d.length&&(d=this._getInputElementsInNode(d[0]),c=this._getCurrentInputElementIndex(d,c),0<d.length)){if(!b.shiftKey&&c!=d.length-1)return a.cancel(),this._focusElement(-1==c?d[0]:d[c+1]),!0;if(b.shiftKey&&0!=c)return a.cancel(),
this._focusElement(-1==c?d[d.length-1]:d[c-1]),!0}}return!1};
AdfDhtmlPivotTablePeer.prototype.handleKeyboardContextMenu=function(a){if(!this.isAttachmentMode()&&this.isSelectionUiEnabled())if(this.getDomElement().focus(),this._isAda){var b=null==this.getSelectedEdge();this._displayContextMenu(a,b)}else if(b=this._focusCellIndex,null==b)this._displayContextMenu(a,!0);else if(this.isHeaderCellIndex(b)){var c=this.newHeaderCellRange(b),c=this.getNodesInHeaderCellRange(c,b.edge);0<c.length&&(this.isSelected(b)||this.selectAndFocusHeaderCell(b),this._displayContextMenu(a,
!1,c[0]))}else c=this.newDataCellRange(b),c=this.getNodesInDataCellRange(c),0<c.length&&this._displayContextMenu(a,!1,c[0])};AdfDhtmlPivotTablePeer.prototype.HandleComponentMouseOver=function(a){!this._isAda&&(!AdfPivotTableUtils.isMobileTouchDevice()&&!this.isAttachmentMode())&&(!this._resizeDragState&&(!this._headerSelectionDragState&&!this._databodySelectionDragState)&&this._isSortEnabled)&&(a=a.getNativeEventTarget(),(a=this._getParentElement(a,"TH"))&&this._setSortIndicatorEnabled(a,!0))};
AdfDhtmlPivotTablePeer.prototype.HandleComponentMouseOut=function(a){!this._isAda&&!AdfPivotTableUtils.isMobileTouchDevice()&&(this.hidePivotHandle(),this._isSortEnabled&&(a=a.getNativeEventTarget(),(a=this._getParentElement(a,"TH"))&&this._setSortIndicatorEnabled(a,!1)))};
AdfDhtmlPivotTablePeer.prototype.HandleDomMouseMove=function(a,b){if(!this._isAda&&!AdfPivotTableUtils.isMobileTouchDevice()&&this._currentRequest!=AdfDhtmlPivotTablePeer.PARTIAL&&!this._resizeDragState&&!this._headerSelectionDragState&&!this._databodySelectionDragState){var c=AdfAgent.AGENT,d=AdfAgent.AGENT.getPlatform()==AdfAgent.IE_PLATFORM&&8<=c.getVersion();this._oldMousePos=c.getMousePosition(b);var e=this._getMouseContext(b),f=this._getHeaderResizeMouseAction(c,e),g;f&&(g=f.cell);var h=!1;
f&&(g&&"resize"==f.type&&!this._resizedCell)&&(h=!0,"startRow"==f.data||"endRow"==f.data?AdfDhtmlPivotTablePeer._setCursor(g,c.getCursor("row-resize")):AdfDhtmlPivotTablePeer._setCursor(g,c.getCursor("col-resize")));if(e.headerContext&&e.headerContext.cell||e.pivotHandleContext){var l,m=!1;e.headerContext?(f=e.headerContext.edge,l=e.headerContext.layer,e=e.headerContext.isEmptyEdge,!e&&!h&&(AdfDhtmlPivotTablePeer._setCursor(g,this._headerSelectionCursors[f]),h=!0)):(m=!0,f=e.pivotHandleContext.edge,
l=e.pivotHandleContext.layer,e=e.pivotHandleContext.isEmptyEdge);if(!this.isAttachmentMode())if(e)this.hidePivotHandle();else if(e=this.getPivotHandle(f,l),m&&(this.isPivotEnabled()&&this.isPivotable(f,l,e))&&(h=!0,AdfDhtmlPivotTablePeer._setCursor(e,c.getCursor("move"))),null==this._currentPivotHandle||null!=e&&e.id!=this._currentPivotHandle.id)this.hidePivotHandle(),null!=e&&this.showPivotHandle(f,l,e)}else this.hidePivotHandle();this.handleCellImageMouseMove(a,b,c);!h&&!d&&AdfDhtmlPivotTablePeer._setCursor(g,
"")}};AdfDhtmlPivotTablePeer.prototype.handleCellImageMouseMove=function(a,b,c){b=c.getEventTarget(b);c.getAttribute(b.parentNode.parentNode,"_cellImgName")?this._imagePopupDisplayed?b!=this._lastCellImage&&(this.hideImagePopup(a),this.showImagePopup(a,b)):this.showImagePopup(a,b):this._imagePopupDisplayed&&this.hideImagePopup(a)};
AdfDhtmlPivotTablePeer.prototype.HandleComponentMouseDown=function(a){if(!this._isAda&&!(this._ptState==AdfDhtmlPivotTablePeer.STATE_DIALOG||this._ptState==AdfDhtmlPivotTablePeer.STATE_STAMP_POPUP)){var b=a.getNativeEvent(),c=AdfAgent.AGENT;if(c.isLeftButton(b)){var d=c.getEventTarget(b);if(this._isInputElement(d)&&!this._isClickToEditAll())this.enableUserSelect();else{this.disableUserSelect();var e=this._getMouseContext(b,!0),c=this._getHeaderResizeMouseAction(c,e);"resize"==c.type&&!AdfPivotTableUtils.isMobileTouchDevice()?
(this.hidePivotHandle(),(d="startRow"==c.data||"endRow"==c.data)?this.showRowResizeIndicator(c):this.showColumnResizeIndicator(c),this._resizeDeltaRaw=this._resizeDelta=0,this._resizeDragState=!0,d?AdfPage.PAGE.startDrag(b,this._rowResizeDragCallback,this._rowResizeDropCallback):AdfPage.PAGE.startDrag(b,this._colResizeDragCallback,this._colResizeDropCallback)):e.headerContext&&e.headerContext.cell&&!e.headerContext.isEmptyEdge?(this.getDomElement().focus(),this.handleMouseHeaderSelection(e,b)):e.databodyContext?
AdfPivotTableUtils.isMobileTouchDevice()?(this.handleMouseDatabodySelection(e,b),this.getDomElement().focus(),this.hidePivotHandle()):(this.getDomElement().focus(),c=!1,null!=d&&(null!=this._activeCell&&this._getDataCell(d)==this._activeCell)&&(c=!0),c||this.handleMouseDatabodySelection(e,b)):AdfPivotTableUtils.isMobileTouchDevice()&&this.hidePivotHandle();b=this._getDataCellKeyAndCell(a.getNativeEventTarget());null!=b&&null!=b[0]&&(b=b[0],d=(new Date).getTime(),e=d-this._clickTimeStamp,null==this._clickTimeStamp||
3E3<e||this._clickCellKey!=b?(this._clickTimeStamp=d,this._clickCellKey=b):null!=this._clickTimeStamp&&(0<e&&3E3>e&&this._clickCellKey==b)&&(b=this._getDataCellIndexFromKey(b),null!=this._clickCellKey&&(null!=this._focusCellIndex&&null!=b&&b.row==this._focusCellIndex.row&&b.column==this._focusCellIndex.column)&&this.HandleComponentDblClick(a)))}}}};
AdfDhtmlPivotTablePeer.prototype._getMouseContext=function(a,b){var c={},d=AdfAgent.AGENT,e=d.getMousePosition(a);if(this._ptUtils._rightToLeft){var f=d.getWindowWidth();normalizedMouseX=f-e.x}else normalizedMouseX=e.x;c.component=this._getVisitedComponent(d,e);c.target=d.getEventTarget(a);if(c.component==AdfPivotTableUtils.COLUMN_EDGE||c.component==AdfPivotTableUtils.ROW_EDGE){var g={};c.headerContext=g;c.headerContext.isEmptyEdge=c.component==AdfPivotTableUtils.COLUMN_EDGE&&0==this._ptUtils._colLayerCount||
c.component==AdfPivotTableUtils.ROW_EDGE&&0==this._ptUtils._rowLayerCount;var h=this._getParentElement(c.target,"TH");if(h){g.cell=h;var l=d.getElementPosition(h);g.cellWidth=h.offsetWidth;g.cellHeight=h.offsetHeight;this._ptUtils._rightToLeft&&(l.x=f-l.x-g.cellWidth);g.cellMouseX=normalizedMouseX-l.x;g.cellMouseY=e.y-l.y;g.edge=c.component;g.layer=c.component==AdfPivotTableUtils.ROW_EDGE?this.getAbsoluteColumnIndex(d,h)-1:this._getParentElement(h,"TR").rowIndex-1}c.pivotHandleContext=c.component==
AdfPivotTableUtils.ROW_EDGE?this._getRowHeaderPivotContext(d,e.x,f):this._getColHeaderPivotContext(d,e.y)}else if(c.component==AdfPivotTableUtils.ROW_PIVOT_HANDLES)c.pivotHandleContext=this._getRowHeaderPivotContext(d,e.x,f);else if(c.component==AdfPivotTableUtils.COL_PIVOT_HANDLES)c.pivotHandleContext=this._getColHeaderPivotContext(d,e.y);else if(h=this._getDataCell(c.target))c.databodyContext={},c.databodyContext.cell=h;return c};
AdfDhtmlPivotTablePeer.prototype._getVisitedComponent=function(a,b){var c=this._ptUtils._rightToLeft;if(void 0!=this._ptUtils._splitSlice){var d=this._ptUtils._colHeaders[0<this._ptUtils._splitSlice[0]?0:1],e=a.getElementPosition(d),f=c?b.x-e.x<=d._width:0<b.x-e.x;if(f&&b.y-e.y<=d._height)return this._lastVisitedComponent=AdfPivotTableUtils.COLUMN_EDGE;var g=this._ptUtils._rowHeaders[0<this._ptUtils._splitSlice[1]?0:1],h=a.getElementPosition(g);if((f=c?0<b.x-h.x:b.x-h.x<=g._width)&&0<b.y-h.y)return this._lastVisitedComponent=
AdfPivotTableUtils.ROW_EDGE;var l;switch(this._lastVisitedComponent){case AdfPivotTableUtils.ROW_EDGE:case AdfPivotTableUtils.ROW_PIVOT_HANDLES:l=AdfPivotTableUtils.ROW_PIVOT_HANDLES;break;case AdfPivotTableUtils.COLUMN_EDGE:case AdfPivotTableUtils.COL_PIVOT_HANDLES:l=AdfPivotTableUtils.COL_PIVOT_HANDLES;break;default:l=null}var m=this._phSize?this._phSize:0,f=l==AdfPivotTableUtils.COL_PIVOT_HANDLES&&40<m?m:40;l=l==AdfPivotTableUtils.ROW_PIVOT_HANDLES&&40<m?m:40;var n=m=!1;(f=c?b.x-e.x<=d._width+
f:b.x-e.x>-f)&&b.y-e.y<=d._height&&(n=!0);(f=c?0<b.x-h.x:b.x-h.x<=g._width)&&b.y-h.y>-l&&(m=!0);return n&&m?this._lastVisitedComponent==AdfPivotTableUtils.ROW_EDGE||this._lastVisitedComponent==AdfPivotTableUtils.ROW_PIVOT_HANDLES?this._lastVisitedComponent=AdfPivotTableUtils.ROW_PIVOT_HANDLES:this._lastVisitedComponent=AdfPivotTableUtils.COL_PIVOT_HANDLES:n?this._lastVisitedComponent=AdfPivotTableUtils.COL_PIVOT_HANDLES:m?this._lastVisitedComponent=AdfPivotTableUtils.ROW_PIVOT_HANDLES:null}};
AdfDhtmlPivotTablePeer.prototype.hideImagePopup=function(a){this._imagePopupDisplayed=!1;this.hidePopup(a)};
AdfDhtmlPivotTablePeer.prototype.showImagePopup=function(a,b){this._imagePopupDisplayed=!0;this._lastCellImage=b;var c=b.parentNode.parentNode.firstChild.firstChild.cloneNode(!0),d={};d[AdfDhtmlCommonUtils.TYPE]=AdfDhtmlCommonUtils.TYPE_NOTEWINDOW;d[AdfDhtmlCommonUtils.ALIGN_ELEMENT]=b;d[AdfRichPopup.HINT_ALIGN]=AdfRichPopup.ALIGN_BEFORE_START;d[AdfDhtmlCommonUtils.AUTODISMISS]=AdfDhtmlCommonUtils.AUTODISMISS_NEVER;this.showPopup(a,c,d)};
AdfDhtmlPivotTablePeer.prototype.handleImageAction=function(a,b){var c=AdfAgent.AGENT,d=!1;if(b){var e;e="A"==b.tagName?b:b.parentNode;var f=c.getAttribute(e.parentNode,"_cellImgName");if(f){if(this._currentRequest==AdfDhtmlPivotTablePeer.PARTIAL)return;this._isAda?(d=c.getIntAttribute(e.parentNode,"_row"),e=c.getIntAttribute(e.parentNode,"_col")):(e=this.getCoordinates(e.parentNode.parentNode),d=e.row,e=e.col);e=new AdfPivotTableCellImageClickEvent(a,d,e,f);e.setPartial(!0);a.queueEvent(e);d=!0}else if(c.getAttribute(e.parentNode,
"_dr"))e=this._getParentElement(e.parentNode,"TH"),this.handleDrillAction(a,e),d=!0;else if(c.getAttribute(e.parentNode,"_adaPivot")){var f=c.getIntAttribute(e.parentNode,"_fromEdge"),d=c.getIntAttribute(e.parentNode,"_fromLayer"),g=c.getIntAttribute(e.parentNode,"_toEdge"),h=c.getIntAttribute(e.parentNode,"_toLayer");e=c.getAttribute(e.parentNode,"_flags");this._pivot(f,d,g,h,e);d=!0}else c.getAttribute(e.parentNode,"_adaExtPivot")&&(c=this.getKeyboardPivotPeer(),null!=c&&(f={},f.fromLayerName=AdfAgent.AGENT.getAttribute(e.parentNode,
"_fromLayerName"),c.getPeer().PerformADADrop(a,f),d=!0))}return d};
AdfDhtmlPivotTablePeer.prototype.handleDrillAction=function(a,b){if(this._currentRequest!=AdfDhtmlPivotTablePeer.PARTIAL){var c=this.getHeaderCellCoordinates(b),c=new AdfPivotTableDrillEvent(a,c.edge,c.startLayer,c.startSlice,"0");c.setPartial(!0);this._focusElement(this.getDomElement());a.queueEvent(c);c.isCanceled()?this._clientValidationErrorRecovery(this._getActiveCellKey()):(this.setCurrentRequest(AdfDhtmlPivotTablePeer.PARTIAL),this.setServerRequest(null),this._isAda||this._displayStatus(this._fetchText,
!0))}};
AdfDhtmlPivotTablePeer.prototype.handleSortAction=function(a,b,c){if(this._currentRequest!=AdfDhtmlPivotTablePeer.PARTIAL){(a=c.parentNode.getAttribute(AdfDhtmlPivotTablePeer._SORT_ASCENDING))||(a=c.parentNode.parentNode.getAttribute(AdfDhtmlPivotTablePeer._SORT_ASCENDING));var d=c.parentNode.getAttribute(AdfDhtmlPivotTablePeer._SORT_DESCENDING);d||(d=c.parentNode.parentNode.getAttribute(AdfDhtmlPivotTablePeer._SORT_DESCENDING));if(a||d){var e=this._getParentElement(c,"TH");c=this.getHeaderCellCoordinates(e);var f=
AdfRichUIPeer.CreateSubId(this.getComponent().getClientId(),c.startSlice+"::"+AdfDhtmlPivotTablePeer._SORT_INDICATOR),g=null,g=void 0==e.getAttribute("_vt")?AdfPivotTableUtils.isMobileTouchDevice()?AdfDhtmlPivotTablePeer._getChildById(e.childNodes[0],f):AdfDhtmlPivotTablePeer._getChildById(e,f):AdfDhtmlPivotTablePeer._getChildById(e.childNodes[0].rows[0].cells[0],f),e=g.getAttribute(AdfDhtmlPivotTablePeer._SORTED_TYPE),f=void 0;a&&e!=AdfDhtmlPivotTablePeer._SORTED_ASCENDING?f=!0:d&&e!=AdfDhtmlPivotTablePeer._SORTED_DESCENDING&&
(f=!1);void 0!=f&&(this.queueSortRequest(AdfPivotTableUtils.ROW_EDGE,c.startSlice,f,!1),AdfAgent.AGENT.eatEvent(b))}}};
AdfDhtmlPivotTablePeer.prototype.queueSortRequest=function(a,b,c,d){b=""+b;var e=this.getComponent();a=new AdfPivotTableSortEvent(e,a,b,c,d);a.setPartial(!0);this._focusElement(this.getDomElement());e.queueEvent(a);a.isCanceled()?this._clientValidationErrorRecovery(this._getActiveCellKey()):(this.setCurrentRequest(AdfDhtmlPivotTablePeer.PARTIAL),this.setServerRequest(null),this._isAda||this._displayStatus(this._fetchText,!0))};
AdfDhtmlPivotTablePeer.prototype._isSortIndicator=function(a){var b=a.parentNode.getAttribute(AdfDhtmlPivotTablePeer._SORT_ASCENDING);b||(b=a.parentNode.parentNode.getAttribute(AdfDhtmlPivotTablePeer._SORT_ASCENDING));var c=a.parentNode.getAttribute(AdfDhtmlPivotTablePeer._SORT_DESCENDING);c||(c=a.parentNode.parentNode.getAttribute(AdfDhtmlPivotTablePeer._SORT_DESCENDING));return void 0!=c||void 0!=b};
AdfDhtmlPivotTablePeer.prototype._setSortIndicatorEnabled=function(a,b){var c=this.getHeaderCellCoordinates(a);if(c){var c=AdfRichUIPeer.CreateSubId(this.getComponent().getClientId(),c.startSlice+"::"+AdfDhtmlPivotTablePeer._SORT_INDICATOR),d=null,d=void 0==a.getAttribute("_vt")?AdfPivotTableUtils.isMobileTouchDevice()?AdfDhtmlPivotTablePeer._getChildById(a.childNodes[0],c):AdfDhtmlPivotTablePeer._getChildById(a,c):AdfDhtmlPivotTablePeer._getChildById(a.childNodes[0].rows[0].cells[0],c);null!=d&&
null==d.getAttribute(AdfDhtmlPivotTablePeer._SORTED_TYPE)&&(d.childNodes[0].style.display=b?"":"none")}};AdfDhtmlPivotTablePeer.prototype.getComponent=function(){return this._tempComponent?this._tempComponent:AdfDhtmlPivotTablePeer.superclass.getComponent.call(this)};
AdfDhtmlPivotTablePeer.prototype.InitDomElement=function(a,b){try{this._tempComponent=a;this._codeExecutionCounter=0;AdfDhtmlPivotTablePeer.superclass.InitDomElement.call(this,a,b);this.__logEnabled=!1;var c=AdfAgent.AGENT,d=c.getAttribute(b,"_ada"),e=c.getAttribute(b,"_immediate");this._adsEnabled=void 0!=c.getAttribute(b,"_adsEnabled");this._fetchText=c.getAttribute(b,"_fetchText");this._cellSelected=c.getAttribute(b,"_cellSelected");this._rowSelected=c.getAttribute(b,"_rowSelected");this._colSelected=
c.getAttribute(b,"_colSelected");this._multiple=c.getAttribute(b,"_multiple");this._rowInfo=c.getAttribute(b,"_rowInfo");this._colInfo=c.getAttribute(b,"_colInfo");this._heightText=c.getAttribute(b,"_heightText");this._widthText=c.getAttribute(b,"_widthText");this._moveBefore=c.getAttribute(b,"_moveBefore");this._swapWith=c.getAttribute(b,"_swapWith");this._moveAfter=c.getAttribute(b,"_moveAfter");this._moveToRows=c.getAttribute(b,"_moveToRows");this._moveToCols=c.getAttribute(b,"_moveToCols");this._ptState=
AdfDhtmlPivotTablePeer.STATE_NORMAL;this._isAda=void 0!=d;this._isSortEnabled=!1;this._isImmediate=void 0!=e;this._streamingDisabled=!1;AdfPage.PAGE.isStreamingDisabled&&(this._streamingDisabled=AdfPage.PAGE.isStreamingDisabled());this._currentRequest=AdfPivotTableDataFetchEvent.FETCH_TYPE_INITIAL;this._resizeDragState=this._pivotDragEnabled=!1;this._selectedLayer=this._selectedEdge=this._currentPivotHandle=null;this.clearSizeOverrides(a);this._serverBusy=this._cellDirty=this.alreadyRequestedDismissEdit=
!1;this._bufferADSCounter=this._blockADSCounter=-1;var f=a.getProperty("modelName");null!=f&&AdfPage.PAGE.setPageProperty("ROW_AND_COLUMN_EDGE:"+f,a.getClientId());this._attachmentMode="true"==b.getAttribute("_attachment");this._isPaging=AdfDhtmlPivotTablePeer.isPaging(b);if(this._isAda){for(var g=b.childNodes[0].childNodes,h=0;h<g.length;++h){var l=g[h];if(l.id&&(-1!=l.id.indexOf("Inner")||l.id.lastIndexOf("::et")==l.id.length-4)){var m=g[h];break}}this._ptUtils={};var n=c.getIntAttribute(m,"_colExtent"),
p=c.getIntAttribute(m,"_rowExtent");this._adaEdgeExtent=[n,p];var q=c.getIntAttribute(m,"_colBlockSize"),r=c.getIntAttribute(m,"_rowBlockSize");this._adaBlockSize=[q,r];var v=c.getIntAttribute(m,"_startRow"),u=c.getIntAttribute(m,"_startCol");a.setProperty(AdfRichPivotTable.__START_ROW_KEY,v);a.setProperty(AdfRichPivotTable.__START_COLUMN_KEY,u);this._adaStartSlice=[];this._adaStartPane=[];this._adaCanvasStartSlice=[];this._adaCanvasEndSlice=[];var w=c.getIntAttribute(m,"_splitCol"),y=c.getIntAttribute(m,
"_splitRow");this._ptUtils._splitSlice=[w,y];a.setProperty(AdfRichPivotTable.__SPLIT_COLUMN_KEY,w);a.setProperty(AdfRichPivotTable.__SPLIT_ROW_KEY,y);if(-1!=w){var t=c.getIntAttribute(m,"_secondStartCol");a.setProperty(AdfRichPivotTable.__SECOND_START_COLUMN_KEY,t);this._adaStartPane[0]=0;this._adaStartSlice[0]=[u,t];this._adaCanvasStartSlice[0]=[0,t];this._adaCanvasEndSlice[0]=[t,n]}else this._adaStartPane[0]=1,this._adaStartSlice[0]=[void 0,u],this._adaCanvasStartSlice[0]=[void 0,0],this._adaCanvasEndSlice[0]=
[void 0,n];if(-1!=y){var A=c.getIntAttribute(m,"_secondStartRow");a.setProperty(AdfRichPivotTable.__SECOND_START_ROW_KEY,A);this._adaStartPane[1]=0;this._adaStartSlice[1]=[v,A];this._adaCanvasStartSlice[1]=[0,A];this._adaCanvasEndSlice[1]=[A,p]}else this._adaStartPane[1]=1,this._adaStartSlice[1]=[void 0,v],this._adaCanvasStartSlice[1]=[void 0,0],this._adaCanvasEndSlice[1]=[void 0,p];var D=a.getProperty(AdfRichPivotTable.__CLIENT_BLOCKS_KEY);void 0==D||"foo"==D?a.setProperty(AdfRichPivotTable.__CLIENT_BLOCKS_KEY,
"bar",!1,AdfUIComponent.PROPAGATE_ALWAYS):a.setProperty(AdfRichPivotTable.__CLIENT_BLOCKS_KEY,"foo",!1,AdfUIComponent.PROPAGATE_ALWAYS);for(h=0;2>h;++h)for(var C=this._adaStartPane[h];2>C;++C){var z=this._getChoiceElement(a,h,C);z&&AdfRichUIPeer.addEventHandlerToDomInstance(AdfDhtmlPivotTablePeer,z,"change");for(d=0;2>d;++d){var x=this._getPrevNextLinkElement(a,h,C,d);if(x){var E=this.createCallback2(this._handlePrevNextSliceClick,[h,C,d]);c.addBubbleEventListener(x,"click",E)}}}AdfPivotTableUtils.DATABODY=
-1;AdfPivotTableUtils.COLUMN_EDGE=0;AdfPivotTableUtils.ROW_EDGE=1;this._graphScreenReaderMode=c.getBooleanAttribute(m,"_graphSR");this.initializeSelectionAda(a,m,g)}else{this._ptUtils=new AdfPivotTableUtils(a,this,b);for(var h=0;2>h;++h)for(g=0;2>g;++g)0<h+g&&AdfRichUIPeer.addEventHandlerToDomInstance(AdfDhtmlPivotTablePeer,this._ptUtils._databodyScrollers[h][g],"scroll"),this._ptUtils._headers[h][g].onscroll=this.createCallback2(this.handleHeaderScroll,[h,g]),this._ptUtils._databodies[h][g].onscroll=
this.createCallback2(this.handleDatabodyScroll,[h,g]);AdfRichUIPeer.addEventHandlerToDomInstance(AdfDhtmlPivotTablePeer,b,"mousemove");AdfPivotTableUtils.isMobileTouchDevice()||this.setupMouseWheel();this._colResizeDragCallback=this.createCallback(this._handleColResizeDrag);this._colResizeDropCallback=this.createCallback(this._handleColResizeDrop);this._rowResizeDragCallback=this.createCallback(this._handleRowResizeDrag);this._rowResizeDropCallback=this.createCallback(this._handleRowResizeDrop);this._selectionDragCallback=
this.createCallback(this.handleSelectionDrag);this._selectionDropCallback=this.createCallback(this.handleSelectionDrop);"true"==c.getAttribute(b,"_cteAll")&&AdfPage.PAGE.addBusyStateListener(this,this._handleBusyState);this.isAttachmentMode()||(a.setDragSource(new AdfPivotTableDragSource),null==a.getDropTarget()&&a.setDropTarget(new AdfPivotTableDropTarget));this._headerSelectionCursors=[this.getHeaderSelectionCursor(b,0),this.getHeaderSelectionCursor(b,1)]}}finally{this._tempComponent=null}};
AdfDhtmlPivotTablePeer.prototype.needsResizeNotify=function(a){return this._isAda?!1:!0};
AdfDhtmlPivotTablePeer.prototype.ResizeNotify=function(a,b,c,d){if(this._fetchInitialBlock)this._ptUtils.isShrinkToFit()||(this._maxHeight=d,this._maxWidth=c),this.HandleDomScroll(this.getComponent(),null),this._ptUtils.sizePivotTable(c,d),this._ptUtils.scrollHTMLBlocks(),this._ptUtils.fetchNearbyBlocks(!0),this._isPaging&&this.updatePagingControls();else if(this._ptUtils._innerContainer.style.width=this.getDomElement().offsetWidth-1+"px",this._ptUtils._innerContainer.style.height=this.getDomElement().offsetHeight-
1+"px",this._maxHeight=d,this._maxWidth=c,this._fetchInitialBlock=!0,this._isImmediate)c=AdfDhtmlPivotTablePeer._getChildBySubId(this.getDomElement(),"PPRTarget"),this.DomReplaceNotify(c);else{if(this._streamingDisabled||!AdfPage.PAGE.isStreamingRequestPending(this.getComponent().getClientId()))a=[],a[0]=AdfPivotTableDataFetchEvent.createSizeParameter(c,d),this.fetchBlocks(AdfPivotTableDataFetchEvent.FETCH_TYPE_INITIAL,AdfPivotTableUtils.DELAY_INITIAL,[],a,void 0,void 0,void 0);this._displayStatus(this._fetchText,
!0)}};
AdfDhtmlPivotTablePeer.prototype.DomReplaceNotify=function(a){try{this._ptUtils.startTimer(1,2);this._ptUtils.checkpointTimer(1,"wrote to logger");this._codeExecutionCounter++;if(this._isAda)return;this._cellDirty=!1;var b=this.getComponent(),c=b.getProperty(AdfRichPivotTable.__CLIENT_BLOCKS_KEY);void 0==c||"foo"==c?b.setProperty(AdfRichPivotTable.__CLIENT_BLOCKS_KEY,"bar",!1,AdfUIComponent.PROPAGATE_ALWAYS):b.setProperty(AdfRichPivotTable.__CLIENT_BLOCKS_KEY,"foo",!1,AdfUIComponent.PROPAGATE_ALWAYS);var d=
AdfAgent.AGENT.getAttribute(a,"_cte");this._ptUtils.checkpointTimer(1,"before CTE block");if(d){var e,b=void 0,f=AdfAgent.AGENT.getIntAttribute(a,"_orh");if("true"==d){e=a.parentNode.offsetHeight;b=e-f;if(null!=this._oldActiveCellKey){var g=this._getDataCellIndexFromKey(this._oldActiveCellKey),h=this.getCoordinates(a);g.column==h.col&&g.row==h.row&&(b=0)}this._oldCellRowHeight=f;this._lastUpdatedRow=this.getCoordinates(a).row;this._activeCell=a;this._lastEditCellRowHeight=e}else"false"==d&&(e=a.parentNode.offsetHeight,
f&&(b=f-e),this.getCoordinates(a).row==this._lastUpdatedRow&&(b=0,this._oldCellRowHeight=f));b?this._clickToEditResize(a,b):AdfAgent.AGENT.getPlatform()==AdfAgent.IE_PLATFORM&&this._ptUtils.updateTextAreaCellHeights(a.parentNode,e);return}this._ptUtils.checkpointTimer(1,"CTE block");if(a.id==this.getDomElement().id+"::RequestDone"){this.highlightFocusCell();var l=AdfAgent.AGENT.getBooleanAttribute(a,"_vError",!1);if(l){var m=AdfAgent.AGENT.getBooleanAttribute(a,"_CTEAction",!1),n=this._recoverACK(m);
this._recover(n);this._cleanupStateVariable();this.domEventForContextMenuAfterEdit=null}this._syncAckWithAC();this._currentRequest==AdfDhtmlPivotTablePeer.PARTIAL&&this.setCurrentRequest(null);this.alreadyRequestedDismissEdit=!1;this._hideStatus();this._focusClickToEditCell();this._needFetchNearbyBlock&&this._startDelayedDismissCTE&&this._ptUtils.fetchNearbyBlocks(!0);this._startDelayedDismissCTE=this._needFetchNearbyBlock=null;null!=this._navigateToHeaderKeyCode&&(l||(this.getDomElement().focus(),
this.handleCtrlArrowNavigation(this._navigateToHeaderKeyCode)),this._navigateToHeaderKeyCode=null);null!=this.domEventForContextMenuAfterEdit&&(this._displayContextMenuCB=this.createCallback(this._displayContextMenuAfterEdit),AdfAgent.AGENT.getDomWindow().setTimeout(this._displayContextMenuCB,300));null!=this.domEventForReadOnlyContentCheck&&(null!=this._activeCell&&0==this._getInputElementsInNode(this._activeCell).length&&this.handleEnterKey(this.domEventForReadOnlyContentCheck),this.domEventForReadOnlyContentCheck=
null)}this._ptUtils.checkpointTimer(1,"RequestDone block");var p=AdfDhtmlPivotTablePeer._getChildBySubId(this.getDomElement(),"PPRTarget");if(a==p){var q=AdfAgent.AGENT.getAttribute(p,"_renType"),r=this._ptUtils.getArrivingBlocks(p,this._ptUtils._id,AdfPivotTableUtils.DATABODY);if(this.__logEnabled){var v={};this.putInTestLog(v);v.type="DRN";v.time=(new Date).getTime()-this.__baseTime;v.scrollLeft=this._ptUtils.getScroller(1,1).scrollLeft;v.scrollTop=this._ptUtils.getScroller(1,1).scrollTop;v.renderType=
q;v.databodyBlocks=r;v.rowHeaderBlocks=this._ptUtils.getArrivingBlocks(p,this._ptUtils._id,AdfPivotTableUtils.ROW_EDGE);v.colHeaderBlocks=this._ptUtils.getArrivingBlocks(p,this._ptUtils._id,AdfPivotTableUtils.COLUMN_EDGE)}this.requestMatchesResponse(this._serverRequest,r,q)&&this.setServerRequest(null);if(this._currentRequest==AdfDhtmlPivotTablePeer.PARTIAL&&q!=AdfDhtmlPivotTablePeer.PARTIAL){this.__logEnabled&&(v.bailingDueToAp=!0);q==AdfPivotTableDataFetchEvent.FETCH_TYPE_INITIAL_FILL_VIEWPORT&&
this._startDelayedDismissCTE&&(this._needFetchNearbyBlock=!0);return}if(q==AdfPivotTableDataFetchEvent.FETCH_TYPE_LONG_SCROLL||q==AdfPivotTableDataFetchEvent.FETCH_TYPE_SHORT_SCROLL||q==AdfPivotTableDataFetchEvent.FETCH_TYPE_INITIAL_FILL_VIEWPORT)this.__logEnabled&&(v.callingHdsJustInCase=!0),this.HandleDomScroll(this._component,null,!0);if(this._currentRequest!=AdfDhtmlPivotTablePeer.PARTIAL&&!this.requestMatchesResponse(this._currentRequest,r,q)){this.__logEnabled&&(v.bailingBcDoesntMatchAtTime=
(new Date).getTime()-this.__baseTime);return}if(this._adsEnabled){var u=AdfAgent.AGENT.getIntAttribute(r[0],"_adsCounter");if(!this.validateBlockForADS(u,q)){AdfPage.PAGE.addPartialTargets(this.getComponent());return}}this._hideStatus();AdfPivotTableUtils.isMobileTouchDevice()&&!this._isPaging&&(this._ptUtils._scrollWaitForFetch=!1);this.clearSizeOverrides(b);var w=this.getArrivingSelectionString(p);this._ptUtils.checkpointTimer(1,"in block-fetch block, just before switch");switch(q){case AdfPivotTableDataFetchEvent.FETCH_TYPE_INITIAL:this._initSummary(p);
case AdfDhtmlPivotTablePeer.PARTIAL:this._ptUtils.initInfo(p,b);this._ptUtils.checkpointTimer(1,"Init case: just called initInfo");this._isSortEnabled=AdfAgent.AGENT.getBooleanAttribute(p,"_sortEnabled");this._currentPivotHandle=null;var y=this._ptUtils.getArrivingElements(p,this._ptUtils._id+"::"+AdfDhtmlPivotTablePeer.EMPTY_TEXT_ID)[0];this._ptUtils._emptyTextDiv=y;this._colInfo=TrFastMessageFormatUtils.format(this._colInfo,"{0}",this._ptUtils._colExtent);this._rowInfo=TrFastMessageFormatUtils.format(this._rowInfo,
"{0}",this._ptUtils._rowExtent);this._ptUtils.checkpointTimer(1,"Init case: just did some misc init");this._ptUtils.setVisibilityOfPanes();this._ptUtils.checkpointTimer(1,"Init case: setVisibilityOfPanes");this._ptUtils.removeAllBlocks();this._ptUtils.checkpointTimer(1,"Init case: removeAllBlocks");this._ptUtils.removePivotHandlesAndLayerLabelBlock();this._ptUtils.addPivotHandlesAndLayerLabelBlock(p);this._ptUtils.checkpointTimer(1,"Init case: pivothandles");y&&this._ptUtils._databodies[1][1].appendChild(y);
this._ptUtils.addBlocksToBuffer();this._ptUtils.checkpointTimer(1,"Init case: addBlocksToBuffer");var t=this._ptUtils.sizeInitialHTMLBlocks(!0);this._ptUtils.checkpointTimer(1,"Init case: sizeInitialHTMLBlocks");this._isRowHeaderTextWrap()&&this._ptUtils._isRowHeaderWidthOverrideSmaller&&this._ptUtils.coordinateRowBlockSizes();this._ptUtils.sizePivotTable(this._maxWidth,this._maxHeight);this._ptUtils.checkpointTimer(1,"Init case: sizePivotTable");this._ptUtils.positionInitialBlocks(t);this._ptUtils.checkpointTimer(1,
"Init case: positionInitialBlocks");this.setCurrentRequest(null,u);this._ptUtils.markBlocksNotNew();this._ptUtils.fetchNearbyBlocks(!0);this._ptUtils.checkpointTimer(1,"Init case: fetchNearbyBlocks");this.initializeSelection(w);this._ptUtils.checkpointTimer(1,"Init case: initializeSelection");var A=AdfAgent.AGENT.getAttribute(p,"_ack");"null"!=A?(b.setProperty(AdfRichPivotTable.__ACTIVE_CELL_KEY,A,!1,AdfUIComponent.PROPAGATE_ALWAYS),b.setProperty("activeCellKey",A,!1,AdfUIComponent.PROPAGATE_ALWAYS)):
(b.setProperty(AdfRichPivotTable.__ACTIVE_CELL_KEY,null,!1,AdfUIComponent.PROPAGATE_ALWAYS),b.setProperty("activeCellKey",null,!1,AdfUIComponent.PROPAGATE_ALWAYS));this._ptUtils.checkpointTimer(1,"Init case: ACK");this._updateInitialACK(p);break;case AdfPivotTableDataFetchEvent.FETCH_TYPE_LONG_SCROLL:if("true"==this.getDomElement().getAttribute("_rngChgLstnr"))var D=this._ptUtils.cloneArray(this._ptUtils._databodyBuffers);this._ptUtils.removeAllBlocks();this._ptUtils.addBlocksToBuffer();if(null!=
D){var C=this._getRangeChangeEvent(D,this._ptUtils._databodyBuffers);C.setBlockRemoved(!1)}t=this._ptUtils.sizeInitialHTMLBlocks(!1);this._isRowHeaderTextWrap()&&this._ptUtils._isRowHeaderWidthOverrideSmaller&&this._ptUtils.coordinateRowBlockSizes();this._ptUtils.sizePivotTable(this._maxWidth,this._maxHeight);this._ptUtils.positionInitialBlocks(t);this.setUnchangedSelection(w);this.setCurrentRequest(null,u);this._ptUtils.markBlocksNotNew();null!=C&&b.queueEvent(C);this._handleEditingAndFocusAfterFetch();
break;case AdfPivotTableDataFetchEvent.FETCH_TYPE_SHORT_SCROLL:case AdfPivotTableDataFetchEvent.FETCH_TYPE_INITIAL_FILL_VIEWPORT:d=[[],[]];for(e=1;0<=e;--e)for(var z=this._ptUtils._startPane[e];2>z;++z)d[e][z]=this._ptUtils.getScrollPos(e,z)-this._ptUtils.getOldScrollPos(e,z);"true"==this.getDomElement().getAttribute("_rngChgLstnr")&&(D=this._ptUtils.cloneArray(this._ptUtils._databodyBuffers));this._ptUtils.trimBuffer(d);null!=D&&(C=this._getRangeChangeEvent(D,this._ptUtils._databodyBuffers));this._ptUtils.addBlocksToBuffer();
this._adsEnabled&&this.applyOldBufferedADSEvents(u);this._ptUtils.sizeNewHTMLBlocks();this._isRowHeaderTextWrap()&&this._ptUtils.coordinateRowBlockSizes();this._ptUtils.sizePivotTable(this._maxWidth,this._maxHeight);this._ptUtils.positionNewHTMLBlocks(d);this._ptUtils.scrollHTMLBlocks(!0);this._ptUtils.setViewportStartSliceFromPosition();this.mergeSelection(w);this.highlightSelection(!1,!0);this.setCurrentRequest(null,u);this._ptUtils.markBlocksNotNew();null!=C&&b.queueEvent(C);this._handleEditingAndFocusAfterFetch();
break;default:AdfAssert.assert(AdfPivotTableUtils.assertsOff,"unexpected renderType in DomReplaceNotify")}this._ptUtils.checkpointTimer(1,"after switch");this._unfinishedHeaderKeyboardNavigation&&this.restartHandlingHeaderKeyboardNavigation();this._syncAckWithAC();this.highlightFocusCell();this._isPaging&&this.updatePagingControls()}else if("TD"==a.nodeName&&AdfAgent.AGENT.getPlatform()==AdfAgent.IE_PLATFORM){var x=a.parentNode;null!=x&&this._ptUtils.updateTextAreaCellHeights(x)}null!=this._activeCell&&
(null!=a&&a.id==this._activeCell.id)&&(this._activeCell=a)}catch(E){AdfLogger.LOGGER.severe(E.message)}finally{this._codeExecutionCounter--}this._ptUtils.stopTimer(1,"end","DomReplaceNotify");return a};AdfDhtmlPivotTablePeer.prototype._initSummary=function(a){a=AdfAgent.AGENT.getAttribute(a,"_summary");var b=this._ptUtils._summaryDiv,c=AdfAgent.AGENT.getAttribute(b,"id");AdfAgent.AGENT.setTextContent(b,a);AdfAgent.AGENT.setAttribute(this._ptUtils._container,"aria-describedby",c)};
AdfDhtmlPivotTablePeer.prototype._handleEditingAndFocusAfterFetch=function(){if(!this._ptUtils.fetchNearbyBlocks(!0))if(this._isEditingCellWithFocus)null!=this._focusCellIndex&&(this.scrollToDataCell(this._focusCellIndex),this._isReadOnly()?this.selectAndFocusDataCell(this._focusCellIndex):this.editCellWithFocus()),this._isEditingCellWithFocus=!1;else if(this._ptUtils._horizScrollOutOfBlock||this._ptUtils._vertScrollOutOfBlock){var a=this._selectionFrontier;if(null!=a)if(this.isDataCellInBuffer(a))this.scrollToDataCell(a);
else if(this._ptUtils._horizScrollOutOfBlock){var b=a.row<this._ptUtils._splitSlice[1]?0:1,b=this.getBufferStartSlice(AdfPivotTableUtils.ROW_EDGE,b);this.longJumpToCell(b,a.column)}else this._ptUtils._vertScrollOutOfBlock&&(b=a.column<this._ptUtils._splitSlice[0]?0:1,b=this.getBufferStartSlice(AdfPivotTableUtils.COLUMN_EDGE,b),this.longJumpToCell(a.row,b));this._ptUtils._horizScrollOutOfBlock=!1;this._ptUtils._vertScrollOutOfBlock=!1}};
AdfDhtmlPivotTablePeer.prototype._syncAckWithAC=function(){var a=this._getActiveCellKey();this._activeCell=null==a?null:this._getDataCellFromKey(a)};AdfDhtmlPivotTablePeer.prototype._clientValidationErrorRecovery=function(a){this._recover(a);this._realignValidationErrorRowHeight();this._hideStatus()};
AdfDhtmlPivotTablePeer.prototype._recoverACK=function(a){a=a?this._oldActiveCellKey:this._getActiveCellKey();this.getComponent().setProperty(AdfRichPivotTable.__ACTIVE_CELL_KEY,a,!1,AdfUIComponent.PROPAGATE_ALWAYS);return a};AdfDhtmlPivotTablePeer.prototype._recover=function(a){null!=a&&(a=this._getDataCellIndexFromKey(a),null!=a&&(this.selectAndFocusDataCell(a),this._readjustScrollPos(),this.scrollToDataCell(a),this.domEventForContextMenuAfterEdit=null))};
AdfDhtmlPivotTablePeer.prototype._cleanupStateVariable=function(){this.setCurrentRequest(null);this.setServerRequest(null);this._unfinishedHeaderKeyboardNavigation=this._isEditingCellWithFocus=!1};AdfDhtmlPivotTablePeer.prototype._isClickToEdit=function(){return!this._isAda&&!this.isAttachmentMode()};
AdfDhtmlPivotTablePeer.prototype.getClientBlocks=function(){var a=[],b,c,d,e;if(this._isAda)for(var f=this._adaStartPane[1];2>f;++f){b=this._adaStartSlice[1][f];c=Math.min(this._adaBlockSize[1],this._adaCanvasEndSlice[1][f]-b);for(var g=this._adaStartPane[0];2>g;++g)d=this._adaStartSlice[0][g],e=Math.min(this._adaBlockSize[0],this._adaCanvasEndSlice[0][g]-d),d=[b,c,d,e],a.push(d)}else for(var h=this._ptUtils._startPane,l=this._ptUtils._databodyBuffers,m=this._ptUtils._rowHeaderBuffers,n=this._ptUtils._colHeaderBuffers,
f=h[1];2>f;++f)for(var p=l[f],q=m[f],r=q.length,g=h[0];2>g;++g)for(var v=p[g],u=n[g],w=u.length,y=0;y<r;++y)for(var t=v[y],A=0;A<w;++A)t[A]&&(b=this._ptUtils.getIntAttribute(q[y],"_startSlice"),c=this._ptUtils.getIntAttribute(q[y],"_numSlices"),d=this._ptUtils.getIntAttribute(u[A],"_startSlice"),e=this._ptUtils.getIntAttribute(u[A],"_numSlices"),d=[b,c,d,e],a.push(d));return a};
AdfDhtmlPivotTablePeer.prototype._getDataCellIndexFromKey=function(a){a=a.split(":");return 2==a.length?this.newDataCellIndex(1*a[0],1*a[1]):null};AdfDhtmlPivotTablePeer.prototype._getDataCellFromKey=function(a){a=this._getDataCellIndexFromKey(a);return null!=a&&(a=this.newDataCellRange(a),a=this.getNodesInDataCellRange(a),0<a.length&&null!=a[0])?a[0]:null};
AdfDhtmlPivotTablePeer.prototype._getDataCellFromCellIndex=function(a,b){if(null!=a){var c=this.newDataCellRange(a),c=this.getNodesInDataCellRange(c,void 0,b);if(0<c.length)return c[0]}return null};AdfDhtmlPivotTablePeer.prototype.isAttachmentMode=function(){return this._attachmentMode};AdfDhtmlPivotTablePeer.isPaging=function(a){return"true"==AdfAgent.AGENT.getAttribute(a,"_paging")};
AdfDhtmlPivotTablePeer.prototype._handleClickOnPagingControl=function(a,b){for(var c=0;2>c;c++)for(var d=this._ptUtils._startPane[c];2>d;d++){if(this._isNavBarLink(b,AdfDhtmlPivotTablePeer._NAVBAR_PREV[c][d]))return AdfDhtmlCommonUtils.addCSSClassName(b,"p_AFActivated"),this._handlePagePrevClick(a,c,d),!0;if(this._isNavBarLink(b,AdfDhtmlPivotTablePeer._NAVBAR_NEXT[c][d]))return AdfDhtmlCommonUtils.addCSSClassName(b,"p_AFActivated"),this._handlePageNextClick(a,c,d),!0;if(this._isNavBarLink(b,AdfDhtmlPivotTablePeer._NAVBAR_FIRST[c][d]))return AdfDhtmlCommonUtils.addCSSClassName(b,
"p_AFActivated"),this._handlePageFirstClick(a,c,d),!0;if(this._isNavBarLink(b,AdfDhtmlPivotTablePeer._NAVBAR_LAST[c][d]))return AdfDhtmlCommonUtils.addCSSClassName(b,"p_AFActivated"),this._handlePageLastClick(a,c,d),!0}return!1};AdfDhtmlPivotTablePeer.prototype._getParentMatchingId=function(a,b){for(var c=a,d=null,e=this.getDomElement();!d&&c&&c!=e.parent&&1==c.nodeType;)if(c.id&&0<=c.id.indexOf(b)){d=c;break}else c=c.parentNode;return d};
AdfDhtmlPivotTablePeer.prototype._isNavBarLink=function(a,b){var c=AdfRichUIPeer.CreateSubId(this.getComponent().getClientId(),b);return null!=this._getParentMatchingId(a,c)?!AdfDhtmlCommonUtils.containsCSSClassName(a,"p_AFDisabled"):!1};
AdfDhtmlPivotTablePeer.prototype._handlePagePrevClick=function(a,b,c){this._pagingControlInput=AdfPivotTableUtils.PAGE_PREV[b][c];this._adjustScroll=0;var d=this._ptUtils._databodiesByEdgeAndPane[b][c],e=this._ptUtils.firstSliceInShiftedViewport(b,c,0),f=this._ptUtils.lastSliceInShiftedViewport(b,c,0),g=1;0<e.pixel&&e.slice!=f.slice?g=e.pixelsInsideViewport:this._adjustScroll=1;e=this._ptUtils.getScrollPos(b,c);d=(b==AdfPivotTableUtils.ROW_EDGE?d.clientHeight:d.clientWidth)-g;d>e&&(this._adjustScroll=
this._adjustScroll+d-e);this._ptUtils.setScrollPos(b,c,e-d,!0);this.HandleDomScroll(this.getComponent(),null);AdfAgent.AGENT.eatEvent(a)};AdfDhtmlPivotTablePeer.prototype._handlePageFirstClick=function(a,b,c){this._pagingControlInput=AdfPivotTableUtils.PAGE_FIRST[b][c];this._ptUtils.setScrollPos(b,c,0,!0);this.HandleDomScroll(this.getComponent(),null);AdfAgent.AGENT.eatEvent(a)};
AdfDhtmlPivotTablePeer.prototype._handlePageLastClick=function(a,b,c){this._pagingControlInput=AdfPivotTableUtils.PAGE_LAST[b][c];this._ptUtils.setScrollPos(b,c,this._ptUtils._maxScrollPos[b][c],!0);this.HandleDomScroll(this.getComponent(),null);AdfAgent.AGENT.eatEvent(a)};
AdfDhtmlPivotTablePeer.prototype._handlePageNextClick=function(a,b,c){this._pagingControlInput=AdfPivotTableUtils.PAGE_NEXT[b][c];var d=this._ptUtils._databodiesByEdgeAndPane[b][c],e=this._ptUtils.lastSliceInShiftedViewport(b,c,0),f=e.pixelsInsideViewport;0>=e.pixelsOutsideViewport?f=e.pixelsOutsideViewport:e.slice==this._ptUtils.firstSliceInShiftedViewport(b,c,0).slice&&(f=0);e=this._ptUtils.getScrollPos(b,c);this._ptUtils.setScrollPos(b,c,e+(b==AdfPivotTableUtils.ROW_EDGE?d.clientHeight:d.clientWidth)-
f,!0);this.HandleDomScroll(this.getComponent(),null);AdfAgent.AGENT.eatEvent(a)};AdfDhtmlPivotTablePeer.prototype.getPageStartSlice=function(a){a=this._ptUtils.firstSliceInShiftedViewport(a,1,0);return 0<a.pixel?a.slice+1:a.slice};
AdfDhtmlPivotTablePeer.prototype.setPageStartSlice=function(a,b){var c=this._ptUtils.scrollDistanceToSlice(a,1,b);if(null!=c){var d=this._ptUtils.getScrollPos(a,1);this._ptUtils.setScrollPos(a,1,d+c,!0);this.HandleDomScroll(this.getComponent(),null)}else AdfPivotTableUtils.ROW_EDGE==a?this.longJumpToCell(b,this.getPageStartSlice(AdfPivotTableUtils.COLUMN_EDGE)):this.longJumpToCell(this.getPageStartSlice(AdfPivotTableUtils.ROW_EDGE),b)};
AdfDhtmlPivotTablePeer.prototype.updatePagingControls=function(){for(var a=0;2>a;a++)for(var b=this._ptUtils._startPane[a];2>b;b++)if(this._pagingControlInput==AdfPivotTableUtils.PAGE_PREV[a][b]&&this.adjustPagingScrollPos(a,b,1))return;var c=[[],[]],d=[[],[]],e=[[],[]],f=[[],[]],g=[[],[]];g[0][0]=this._ptUtils._splitSlice[0];g[1][0]=this._ptUtils._splitSlice[1];g[0][1]=this._ptUtils._edgeExtent[0];g[1][1]=this._ptUtils._edgeExtent[1];for(a=0;2>a;a++)for(b=this._ptUtils._startPane[a];2>b;b++)if(c[a][b]=
this._ptUtils.firstSliceInShiftedViewport(a,b,0),d[a][b]=c[a][b].slice,e[a][b]=this._ptUtils.lastSliceInShiftedViewport(a,b,0),f[a][b]=e[a][b].slice,-1!=d[a][b]&&-1!=f[a][b]){if(this.alignPagingScrollPos(c[a][b],e[a][b],f[a][b],a,b,g[a][b],this._ptUtils._databodiesByEdgeAndPane[a][b]))return}else return;this._updatedPagingInputValue=!1;this._keepPagingValueChange=[[!1,!1],[!1,!1]];for(var h=!0,a=0;2>a;a++)for(var l=this._ptUtils._splitSlice[a],b=this._ptUtils._startPane[a];2>b;b++)this.updatePagingInput(a,
b,-1!=l&&1==b?l+1:1,g[a][b],c[a][b],d[a][b],e[a][b],f[a][b])||(h=!1);h&&(this._pagingControlInput=null)};AdfDhtmlPivotTablePeer.prototype.adjustPagingScrollPos=function(a,b,c){if(null!=this._adjustScroll&&this._adjustScroll>c){var d=this._ptUtils.getScrollPos(a,b);if(d>c)return this._ptUtils.setScrollPos(a,b,d-this._adjustScroll,!0),this._adjustScroll=0,this.HandleDomScroll(this.getComponent(),null),!0;this._adjustScroll=0}return!1};
AdfDhtmlPivotTablePeer.prototype.updatePagingInput=function(a,b,c,d,e,f,g,h){var l=this._ptUtils._pagingControl[a][b],m=this._ptUtils._pagingControlInputId[a][b];if(-1!=f&&-1!=h){f!=h&&(0<e.pixel&&f++,0<g.pixelsOutsideViewport&&h--);f++;h++;g=l.childNodes[0].offsetWidth;e=this.getPagingControlInnerContentNode(l);if(l.offsetWidth<g)null==l._pw&&(e.childNodes[3].style.display="none",e.childNodes[4].style.display="none",e.childNodes[5].style.display="none",l._pw=g);else if(null==l._pw||parseInt(l._pw)<=
l.offsetWidth)g=e.childNodes[5],null==this._pagingRangeText&&(this._pagingRangeText=g.innerHTML),g.innerHTML=this._pagingRangeText.replace("-",d).replace("_","- ".concat(h)),e.childNodes[3].style.display="",e.childNodes[4].style.display="",e.childNodes[5].style.display="",l._pw=null;m=AdfPage.PAGE.findComponent(this.getComponent().getClientId().concat(m));f!=m.getValue()&&(this._keepPagingValueChange[a][b]=!0,m.setValue("".concat(f)));firstArrow=e.childNodes[1].childNodes[0];prevArrow=e.childNodes[2].childNodes[0];
lastArrow=e.childNodes[7].childNodes[0];nextArrow=e.childNodes[6].childNodes[0];this.setPagingInputStyles(firstArrow,prevArrow,lastArrow,nextArrow,f,h,c,d);l.parentNode.style.visibility="visible";return!0}};
AdfDhtmlPivotTablePeer.prototype.alignPagingScrollPos=function(a,b,c,d,e,f,g){if(this._pagingControlInput==AdfPivotTableUtils.PAGE_FIRST[d][e]&&0<a.pixel)return this._ptUtils.setScrollPos(d,e,0,!0),this.HandleDomScroll(this.getComponent(),null),!0;if(this._pagingControlInput==AdfPivotTableUtils.PAGE_LAST[d][e]&&0<b.pixelsOutsideViewport)return this._ptUtils.setScrollPos(d,e,this._ptUtils._maxScrollPos[d][e],!0),this.HandleDomScroll(this.getComponent(),null),!0;if(0<a.pixel&&!(0==b.pixelsOutsideViewport&&
c+1==f&&a.slice!=b.slice)){var h=a.pixelsInsideViewport,l=this._ptUtils.getScrollPos(d,e);if(a.pixel==this._adjustScroll)this._ptUtils.setScrollPos(d,e,l-this._adjustScroll,!0);else{if((this._pagingControlInput==AdfPivotTableUtils.PAGE_PREV[d][e]||a.slice==b.slice&&c+1==f)&&a.pixelsInsideViewport>=(d==AdfPivotTableUtils.ROW_EDGE?g.clientHeight:g.clientWidth)-this._adjustScroll)h=-1*a.pixel;this._ptUtils.setScrollPos(d,e,l+h,!0)}this._adjustScroll=0;this.HandleDomScroll(this.getComponent(),null);return!0}return!1};
AdfDhtmlPivotTablePeer.prototype.getPagingControlInnerContentNode=function(a){return a.childNodes[0].childNodes[0].childNodes[0]};
AdfDhtmlPivotTablePeer.prototype.setPagingInputStyles=function(a,b,c,d,e,f,g,h){AdfDhtmlCommonUtils.containsCSSClassName(a,"p_AFActivated")?AdfDhtmlCommonUtils.removeCSSClassName(a,"p_AFActivated"):AdfDhtmlCommonUtils.containsCSSClassName(b,"p_AFActivated")?AdfDhtmlCommonUtils.removeCSSClassName(b,"p_AFActivated"):AdfDhtmlCommonUtils.containsCSSClassName(c,"p_AFActivated")?AdfDhtmlCommonUtils.removeCSSClassName(c,"p_AFActivated"):AdfDhtmlCommonUtils.containsCSSClassName(d,"p_AFActivated")&&AdfDhtmlCommonUtils.removeCSSClassName(d,
"p_AFActivated");var l=AdfAgent.AGENT;e==g?AdfDhtmlCommonUtils.containsCSSClassName(a,"p_AFDisabled")||(AdfDhtmlCommonUtils.addCSSClassName(a,"p_AFDisabled"),a.removeAttribute("href"),AdfDhtmlCommonUtils.addCSSClassName(b,"p_AFDisabled"),b.removeAttribute("href")):AdfDhtmlCommonUtils.containsCSSClassName(a,"p_AFDisabled")&&(AdfDhtmlCommonUtils.removeCSSClassName(a,"p_AFDisabled"),l.setAttribute(a,"href","#"),AdfDhtmlCommonUtils.removeCSSClassName(b,"p_AFDisabled"),l.setAttribute(b,"href","#"));f==
h?AdfDhtmlCommonUtils.containsCSSClassName(c,"p_AFDisabled")||(AdfDhtmlCommonUtils.addCSSClassName(c,"p_AFDisabled"),c.removeAttribute("href"),AdfDhtmlCommonUtils.addCSSClassName(d,"p_AFDisabled"),d.removeAttribute("href")):AdfDhtmlCommonUtils.containsCSSClassName(c,"p_AFDisabled")&&(AdfDhtmlCommonUtils.removeCSSClassName(c,"p_AFDisabled"),l.setAttribute(c,"href","#"),AdfDhtmlCommonUtils.removeCSSClassName(d,"p_AFDisabled"),l.setAttribute(d,"href","#"))};
AdfDhtmlPivotTablePeer.prototype._clearMessageAndRevalidate=function(a){a=a.getSource();return a instanceof AdfUIEditableValue?(AdfPage.PAGE.clearMessages(a.getClientId()),a.validate(),a.getValid()):!0};AdfDhtmlPivotTablePeer.prototype.setCurrentRequest=function(a,b){this._currentRequest=a;this._adsEnabled&&null==a&&this.applyNewBufferedADSEvents(b)};AdfDhtmlPivotTablePeer.prototype.setServerRequest=function(a){this._serverRequest=a};
AdfDhtmlPivotTablePeer.prototype.enableUserSelect=function(){AdfAgent.AGENT.enableUserSelect(this.getDomElement());this._enableUserSelect=!0};AdfDhtmlPivotTablePeer.prototype.disableUserSelect=function(){(void 0==this._enableUserSelect||this._enableUserSelect)&&AdfAgent.AGENT.disableUserSelect(this.getDomElement());this._enableUserSelect=!1};AdfDhtmlPivotTablePeer.prototype.initTestLog=function(){this.__log=[];this.__logIndex=0;this.__logLength=200;this.__baseTime=(new Date).getTime()};
AdfDhtmlPivotTablePeer.prototype.putInTestLog=function(a){this.__log[this.__logIndex]=a;++this.__logIndex==this.__logLength&&(this.__logIndex=0)};
AdfDhtmlPivotTablePeer.prototype._getBlockInfo=function(a){for(var b={},c=0;c<a.length;c++)for(var d=0;d<a[c].length;d++){var e=a[c][d];if(e.getAttribute){var f=parseInt(e.getAttribute("_startrow"),10),g=parseInt(e.getAttribute("_startcol"),10);if(null==b.startRow||b.startRow>f)b.startRow=f;if(null==b.startCol||b.startCol>g)b.startCol=g;if(e.firstChild&&"TABLE"==e.firstChild.tagName){f=f+(e.firstChild.rows.length-1)-1;e=g+(e.firstChild.rows[0].cells.length-1)-1;if(null==b.endRow||b.endRow<f)b.endRow=
f;if(null==b.endCol||b.endCol<e)b.endCol=e}}}return b};AdfDhtmlPivotTablePeer.prototype._getRangeChangeEvent=function(a,b){var c=a[1][1],d=b[1][1],e=this._getBlockInfo(c),f=this._getBlockInfo(d);if(e.startRow==f.startRow&&e.endRow==f.endRow&&e.startCol==f.startCol&&e.endCol==f.endCol)return null;var g=this.getComponent(),e=new AdfPivotTableRangeChangeEvent(g,e.startRow,e.startCol,e.endRow,e.endCol,f.startRow,f.startCol,f.endRow,f.endCol);c.length!=d.length&&e.setBlockRemoved(!0);return e};