/**
 * Copyright (c) 2014, 2015, Oracle and/or its affiliates.
 * All rights reserved.
 */
"use strict";
/*
 Copyright 2013 jQuery Foundation and other contributors
 Released under the MIT license.
 http://jquery.org/license
*/
define(["ojs/ojcore","jquery","ojs/ojcomponentcore","hammerjs","ojs/ojdatacollection-common","ojs/ojinputtext","ojs/ojjquery-hammer"],function(a,f,d,b){(function(){a.Da("oj.ojPagingControl",f.oj.baseComponent,{version:"1.0.0",defaultElement:"\x3cdiv\x3e",widgetEventPrefix:"oj",options:{data:null,overflow:"fit",pageSize:25,pageOptions:{layout:["auto"],type:"numbers",maxPageLinks:6,orientation:"horizontal"},loadMoreOptions:{maxCount:500},mode:"page",ready:null,translations:{}},ob:{d2:"labelAccPaging",
Y1:"labelAccNavFirstPage",Z1:"labelAccNavLastPage",a2:"labelAccNavNextPage",c2:"labelAccNavPreviousPage",b2:"labelAccNavPage",e2:"labelLoadMore",g2:"labelLoadMoreMaxRows",h2:"labelNavInputPage",i2:"labelNavInputPageMax",cia:"labelNavInputPageSummary",mD:"msgItemRangeCurrent",pN:"msgItemRangeItems",t2:"msgItemRangeOf",y3:"tipNavInputPage",B3:"tipNavPageLink",A3:"tipNavNextPage",C3:"tipNavPreviousPage",x3:"tipNavFirstPage",z3:"tipNavLastPage",E1:"pageInvalid.summary",D1:"pageInvalid.detail",RM:"dataInvalidType.summary",
QM:"dataInvalidType.detail",C1:"maxPageLinksInvalid.summary",B1:"maxPageLinksInvalid.detail"},Ca:{LD:"oj-component",Ve:"oj-active",Un:"oj-clickable-icon-nocontext",sb:"oj-disabled",We:"oj-enabled",rj:"oj-focus",uk:"oj-hover",Xc:"oj-selected"},Z:{C2:"oj-pagingcontrol",zN:"oj-pagingcontrol-acc-label",AN:"oj-pagingcontrol-content",BN:"oj-pagingcontrol-loadmore",pD:"oj-pagingcontrol-loadmore-link",CN:"oj-pagingcontrol-loadmore-max-rows",qD:"oj-pagingcontrol-loadmore-range",DN:"oj-pagingcontrol-loadmore-range-current",
EN:"oj-pagingcontrol-loadmore-range-max",GN:"oj-pagingcontrol-nav",Gx:"oj-pagingcontrol-nav-arrow",FN:"oj-pagingcontrol-nav-arrow-section",MN:"oj-pagingcontrol-nav-page",R2:"oj-pagingcontrol-nav-page-ellipsis",E2:"oj-pagingcontrol-nav-dot",D2:"oj-pagingcontrol-nav-dot-bullet",Q2:"oj-pagingcontrol-nav-page-acc-label",I2:"oj-pagingcontrol-nav-label",IN:"oj-pagingcontrol-nav-input-section",rt:"oj-pagingcontrol-nav-input",HN:"oj-pagingcontrol-nav-input-max",rD:"oj-pagingcontrol-nav-input-summary",JN:"oj-pagingcontrol-nav-input-summary-current",
KN:"oj-pagingcontrol-nav-input-summary-max",P2:"oj-pagingcontrol-nav-pages-section",LN:"oj-pagingcontrol-nav-pages-links",qt:"oj-pagingcontrol-nav-first",F2:"oj-pagingcontrol-nav-first-acc-label",ut:"oj-pagingcontrol-nav-previous",S2:"oj-pagingcontrol-nav-previous-acc-label",tt:"oj-pagingcontrol-nav-next",M2:"oj-pagingcontrol-nav-next-acc-label",st:"oj-pagingcontrol-nav-last",J2:"oj-pagingcontrol-nav-last-acc-label",G2:"oj-pagingcontrol-nav-first-icon",T2:"oj-pagingcontrol-nav-previous-icon",N2:"oj-pagingcontrol-nav-next-icon",
K2:"oj-pagingcontrol-nav-last-icon",H2:"oj-pagingcontrol-nav-first-vertical-icon",U2:"oj-pagingcontrol-nav-previous-vertical-icon",O2:"oj-pagingcontrol-nav-next-vertical-icon",L2:"oj-pagingcontrol-nav-last-vertical-icon",bo:"oj-component-icon",Kh:"oj-helper-hidden-accessible"},q1:"data-oj-pagenum",Gf:"enabled",bm:"disabled",pg:"tabindex",Xl:{jq:"loadMore",yN:"page"},Ze:{Tg:"auto",dt:"all",wx:"input",V2:"rangeText",A2:"pages",qN:"nav"},B2:6,Sx:{dia:"numbers",u1:"dots"},firstPage:function(){return null!=
this.lb()?this.Oh(0,!1):this.br()},previousPage:function(){if(null!=this.lb()){var a=this.Mf();if(0<a)return this.Oh(a-1,!1)}return this.br()},nextPage:function(){if(null!=this.lb()){var a=this.Mf();if(a+1<=this.Je()-1||0>this.Je())return this.Oh(a+1,!1)}return this.br()},lastPage:function(){return null!=this.lb()&&0<this.Je()?this.Oh(this.Je()-1,!1):this.br()},page:function(a){return null!=this.lb()&&(a<=this.Je()||0>this.Je())?this.Oh(a,!1):this.br()},loadNext:function(){return null!=this.lb()?
this.$$():this.br()},refresh:function(){this._super();this.Bd()},getNodeBySubId:function(a){if(null==a)return this.element?this.element[0]:null;var b=a.subId,d=null;"oj-pagingcontrol-nav-input"===b?d=this.Ad().find("."+this.Z.rt)[0]:"oj-pagingcontrol-nav-input-max"===b?d=this.Ad().find("."+this.Z.HN)[0]:"oj-pagingcontrol-nav-input-summary"===b?d=this.Ad().find("."+this.Z.rD)[0]:"oj-pagingcontrol-nav-input-summary-current"===b?d=this.Ad().find("."+this.Z.JN)[0]:"oj-pagingcontrol-nav-input-summary-max"===
b?d=this.Ad().find("."+this.Z.KN)[0]:"oj-pagingcontrol-nav-first"===b?d=this.Ad().find("."+this.Z.qt)[0]:"oj-pagingcontrol-nav-next"===b?d=this.Ad().find("."+this.Z.tt)[0]:"oj-pagingcontrol-nav-previous"===b?d=this.Ad().find("."+this.Z.ut)[0]:"oj-pagingcontrol-nav-last"===b?d=this.Ad().find("."+this.Z.st)[0]:"oj-pagingcontrol-nav-page"===b?(a=a.index,d=this.Ad().find("["+this.q1+"\x3d"+a+"]")[0]):"oj-pagingcontrol-load-more-link"===b?d=this.Ad().find("."+this.Z.pD)[0]:"oj-pagingcontrol-load-more-range"===
b?d=this.Ad().find("."+this.Z.qD)[0]:"oj-pagingcontrol-load-more-range-current"===b?d=this.Ad().find("."+this.Z.DN)[0]:"oj-pagingcontrol-load-more-range-max"===b?d=this.Ad().find("."+this.Z.EN)[0]:"oj-pagingcontrol-load-more-max-rows"===b&&(d=this.Ad().find("."+this.Z.CN)[0]);void 0===d&&(d=null);return d},_ComponentCreate:function(){this._super();this.Yo();this.cu();this.Qm(this.Ad());this._on(this.Ik)},Ug:function(){this._super();this.oA();this.Oh(0,!0)},_destroy:function(){this.Pj();this.SA()},
cu:function(){var a=this.options;this.element.addClass(this.Z.C2);this.element.addClass(this.Ca.LD);this.O5();this.U5();this.cU=a.mode;a.mode==this.Xl.jq?(this.GP(),this.HP(),this.IP()):this.JP()},Ik:{"click .oj-pagingcontrol-loadmore-link":function(a){this.loadNext();a.preventDefault()},"click .oj-pagingcontrol-nav-dot":function(a){var b=f(a.currentTarget).attr("data-oj-pagenum");this.page(b);a.preventDefault()},"click .oj-pagingcontrol-nav-page":function(a){var b=f(a.currentTarget).attr("data-oj-pagenum");
this.page(b);a.preventDefault()},"click .oj-pagingcontrol-nav-first":function(a){f(a.currentTarget).hasClass(this.Ca.sb)||this.firstPage();a.preventDefault()},"click .oj-pagingcontrol-nav-previous":function(a){f(a.currentTarget).hasClass(this.Ca.sb)||this.previousPage();a.preventDefault()},"click .oj-pagingcontrol-nav-next":function(a){f(a.currentTarget).hasClass(this.Ca.sb)||this.nextPage();a.preventDefault()},"click .oj-pagingcontrol-nav-last":function(a){f(a.currentTarget).hasClass(this.Ca.sb)||
this.lastPage();a.preventDefault()},"keypress .oj-pagingcontrol-nav-input":function(a){13==a.which&&a.preventDefault()},"mousedown .oj-pagingcontrol-nav-first":function(a){f(a.currentTarget).hasClass(this.Ca.sb)||f(a.target).addClass(this.Ca.Ve);a.preventDefault()},"mousedown .oj-pagingcontrol-nav-previous":function(a){f(a.currentTarget).hasClass(this.Ca.sb)||f(a.target).addClass(this.Ca.Ve);a.preventDefault()},"mousedown .oj-pagingcontrol-nav-next":function(a){f(a.currentTarget).hasClass(this.Ca.sb)||
f(a.target).addClass(this.Ca.Ve);a.preventDefault()},"mousedown .oj-pagingcontrol-nav-last":function(a){f(a.currentTarget).hasClass(this.Ca.sb)||f(a.target).addClass(this.Ca.Ve);a.preventDefault()},"mouseup .oj-pagingcontrol-nav-first":function(a){f(a.target).removeClass(this.Ca.Ve);a.preventDefault()},"mouseup .oj-pagingcontrol-nav-previous":function(a){f(a.target).removeClass(this.Ca.Ve);a.preventDefault()},"mouseup .oj-pagingcontrol-nav-next":function(a){f(a.target).removeClass(this.Ca.Ve);a.preventDefault()},
"mouseup .oj-pagingcontrol-nav-last":function(a){f(a.target).removeClass(this.Ca.Ve);a.preventDefault()},"mouseleave .oj-pagingcontrol-nav-first":function(a){f(a.target).removeClass(this.Ca.Ve);a.preventDefault()},"mouseleave .oj-pagingcontrol-nav-previous":function(a){f(a.target).removeClass(this.Ca.Ve);a.preventDefault()},"mouseleave .oj-pagingcontrol-nav-next":function(a){f(a.target).removeClass(this.Ca.Ve);a.preventDefault()},"mouseleave .oj-pagingcontrol-nav-last":function(a){f(a.target).removeClass(this.Ca.Ve);
a.preventDefault()}},Bd:function(){this.f!=this.options.data&&(this.BE(),this.Oh(0,!0));var a=0,b=0;null!=this.f&&(b=this.f.getStartItemIndex());null!=this.f&&0!=this.f.totalSize()&&(a=this.f.getEndItemIndex()-b+1);if(this.cU!=this.options.mode)this.cU=this.options.mode,this.options.mode==this.Xl.jq?this.PU(a,b):this.QU(a,b);else if(this.options.mode==this.Xl.jq){var d=this.lb(),f=this.Zq();null!=d&&b+a==d.totalSize()?f.css("display","none"):this.PU(a,b)}else this.QU(a,b)},_setOption:function(a,b){this._superApply(arguments);
this.Oh(0,!0);this.Bd()},BE:function(){null!=this.f&&this.Pj();this.f=null},b5:function(){this.hE=this.gE=this.fE=null},c5:function(){this.kE=this.jE=this.iE=null},Mf:function(){var a=this.lb(),b=0;null!=a&&(b=a.getPage());return b},lb:function(){this.f||null==this.options.data||(this.f=this.options.data,this.Yo());return this.f},CR:function(a,b){var d=b,h=f(document.createElement("span")),k=f(document.createElement("span"));this.options.mode==this.Xl.jq?k.addClass(this.Z.DN):k.addClass(this.Z.JN);
var l=this.D(this.ob.mD,{pageFrom:d,pageTo:0});h.append(k);if(null!=a){var l=parseInt(b,10)+parseInt(a,10),d=0<l?d+1:0,m=this.lb();if(null!=m&&-1!=m.totalSize()){var l=l>m.totalSize()?m.totalSize():l,l=this.D(this.ob.mD,{pageFrom:d,pageTo:l}),d=this.D(this.ob.t2),n=f(document.createElement("span"));n.text(" "+d+" ");h.append(n);d=f(document.createElement("span"));this.options.mode==this.Xl.jq?d.addClass(this.Z.EN):d.addClass(this.Z.KN);d.text(m.totalSize());h.append(d)}else l=this.D(this.ob.mD,{pageFrom:d,
pageTo:l});m=this.D(this.ob.pN);d=f(document.createElement("span"));d.text(" "+m);h.append(d)}k.text(l);return h},q8:function(){var a=this.options.pageOptions.maxPageLinks;this.options.pageOptions.type==this.Sx.u1?a=Number.MAX_VALUE:a||(a=this.B2);return a},br:function(){return Promise.reject()},Je:function(){var a=this.lb(),b=0;null!=a&&(b=a.getPageCount());return b},zG:function(){var a=f(document.activeElement);if(a.hasClass(this.Z.MN)){var b=a.attr("data-oj-pagenum"),d=this;setTimeout(function(){0<=
b&&d.Nh().find("div[data-oj-pagenum\x3d"+b+"]").focus()},100)}else a.hasClass(this.Z.qt)?(d=this,setTimeout(function(){d.Nh().find("."+d.Z.qt).focus()},100)):a.hasClass(this.Z.ut)?(d=this,setTimeout(function(){d.Nh().find("."+d.Z.ut).focus()},100)):a.hasClass(this.Z.tt)?(d=this,setTimeout(function(){d.Nh().find("."+d.Z.tt).focus()},100)):a.hasClass(this.Z.st)?(d=this,setTimeout(function(){d.Nh().find("."+d.Z.st).focus()},100)):a.hasClass(this.Z.rt)&&(d=this,setTimeout(function(){d.Nh().find("."+d.Z.rt).focus()},
100));this.Dr()},j9:function(a){a.page!=a.previousPage&&this.Dr()},ym:function(){this.Oh(0,!1)},xz:function(){this.Dr()},CG:function(a){this.options.mode==this.Xl.jq&&this.ym(a)},AG:function(a){this.options.mode==this.Xl.yN&&this.vT(a)?this.Oh(this.Mf(),!0):this.Dr()},BG:function(a){0<this.Je()&&this.Mf()>this.Je()-1?this.Oh(this.Je()-1,!0):this.vT(a)?this.Oh(this.Mf(),!0):this.Dr()},X9:function(b,d){try{var g=d.value;g!=this.Mf()+1&&!isNaN(g)&&0<g&&(g=Math.round(g),this.page(g-1))}catch(f){var g=
this.D(this.ob.E1),k=this.D(this.ob.D1);a.u.error(g+"\n"+k)}},Oh:function(a,b){try{a=parseInt(a,10)}catch(d){return Promise.reject(d)}this.Yg=0;if(b)return this.$ba(a),Promise.resolve();var f=this.lb(),k=this;return new Promise(function(b,d){null!=f?f.setPage(a,{pageSize:k.options.pageSize}).then(function(){b(null)},function(a){d(a)}):b(null)})},$$:function(){var a=this.lb(),b=this.options.pageSize;this.Yg=this.Yg?this.Yg+b:b;if(-1==a.totalSize()||a.totalSize()>this.Yg){var d=this;return new Promise(function(f,
k){a.fetch({startIndex:d.Yg,pageSize:b}).then(function(a){f(a)},function(){k(null)})})}return Promise.resolve()},vT:function(a){var b=this.lb(),d=this.options.pageSize,f;for(f=0;f<a.indexes.length;f++){var k=a.indexes[f],l=b.getStartItemIndex();if(k>=l&&k<l+d)return!0}return!1},$ba:function(b){var d=this;this.gv||(this.ev=0,this.gv=Promise.resolve());this.ev++;this.uba=b;this.gv=this.gv.then(function(){d.ev--;if(0==d.ev){d.gv=void 0;var a=d.lb();null!=a&&a.setPage(d.uba,{pageSize:d.options.pageSize})}},
function(b){d.ev--;0==d.ev&&(d.gv=void 0,a.u.error(b))})},Dr:function(){var b=this;this.hv||(this.rv=0,this.hv=Promise.resolve());this.rv++;this.hv=this.hv.then(function(){b.rv--;0==b.rv&&(b.hv=void 0,b.Bd(),b._trigger("ready"))},function(d){b.rv--;0==b.rv&&(b.hv=void 0,a.u.error(d))})},PU:function(a,b){var d=this.Nh();null!=d&&d.empty();this.b5();this.GP();d=-1;null!=a&&(d=b+a);0>d||d<this.options.loadMoreOptions.maxCount?(this.HP(),this.IP(a,b)):this.V5()},QU:function(a,b){var d=this.options.overflow,
f=this.Nh();null!=f&&(this.vea(f),this.SA(),f.empty());this.c5();this.JP(a,b);this.oA();this.dca(a,b);if("fit"==d){var d=this.element.width(),f=this.cG(),k=this.y8(),l=this.A8(),m=this.z8(),n=null!=f?f[0].offsetWidth:0,q=null!=k?k[0].offsetWidth:0,k=null!=l?l.width():0,p=null!=m?m.width():0,n=n+q+p;n>d?n-k<=d?l.css("display","none"):n-k-p<=d?(null!=l&&l.css("display","none"),null!=m&&m.css("display","none")):(null!=l&&l.css("display","none"),null!=m&&m.css("display","none"),null!=f&&f.css("display",
"none")):0<n&&(null!=l&&l.css("display",""),null!=m&&m.css("display",""),null!=f&&f.css("display",""))}},dca:function(a){var b=this.cG(),d=b.children("."+this.Z.qt);d&&0<d.length&&(d=f(d[0]),0==this.Mf()?(d.addClass(this.Ca.sb),d.removeClass(this.Ca.We),d.attr("tabindex","-1")):(d.addClass(this.Ca.We),d.removeClass(this.Ca.sb),d.attr(this.pg,"0")));(d=b.children("."+this.Z.ut))&&0<d.length&&(d=f(d[0]),0==this.Mf()?(d.addClass(this.Ca.sb),d.removeClass(this.Ca.We),d.attr(this.pg,"-1")):(d.addClass(this.Ca.We),
d.removeClass(this.Ca.sb),d.attr(this.pg,"0")));(d=b.children("."+this.Z.st))&&0<d.length&&(d=f(d[0]),this.Mf()==this.Je()-1||0>=this.Je()?(d.addClass(this.Ca.sb),d.removeClass(this.Ca.We),d.attr(this.pg,"-1")):(d.addClass(this.Ca.We),d.removeClass(this.Ca.sb),d.attr(this.pg,"0")));(b=b.children("."+this.Z.tt))&&0<b.length&&(b=f(b[0]),this.Mf()==this.Je()-1||0===this.Je()||0>this.Je()&&0===a?(b.addClass(this.Ca.sb),b.removeClass(this.Ca.We),b.attr(this.pg,"-1")):(b.addClass(this.Ca.We),b.removeClass(this.Ca.sb),
b.attr(this.pg,"0")))},Yo:function(){var b=this.lb();if(null!=b){this.Pj();this.Va=[];this.Va.push({eventType:a.gc.F.PAGE,eventHandler:this.j9.bind(this)});this.Va.push({eventType:a.gc.F.PAGECOUNT,eventHandler:this.xz.bind(this)});this.Va.push({eventType:a.qa.F.ADD,eventHandler:this.AG.bind(this)});this.Va.push({eventType:a.qa.F.REMOVE,eventHandler:this.BG.bind(this)});this.Va.push({eventType:a.qa.F.RESET,eventHandler:this.ym.bind(this)});this.Va.push({eventType:a.qa.F.REFRESH,eventHandler:this.xz.bind(this)});
this.Va.push({eventType:a.qa.F.SYNC,eventHandler:this.zG.bind(this)});this.Va.push({eventType:a.qa.F.SORT,eventHandler:this.CG.bind(this)});var d,g;for(d=0;d<this.Va.length;d++)(g=b.on(this.Va[d].eventType,this.Va[d].eventHandler))&&(this.Va[d].eventHandler=g)}},Qm:function(b){if(!this.fH){var d=this;a.C.jh(b[0],function(){d.Dr()},50);this.fH=!0}},oA:function(){if(a.C.sf()&&this.options.mode==this.Xl.yN){var c=this.cG();if(null!=c){var d=this;if("vertical"==this.options.pageOptions.orientation){var g=
{recognizers:[[b.Swipe,{direction:b.DIRECTION_VERTICAL}]]};this.yG=c.wn(g).on("swipeup",function(a){a.preventDefault();d.nextPage()});this.vG=c.wn(g).on("swipedown",function(a){a.preventDefault();d.previousPage()})}else g={recognizers:[[b.Swipe,{direction:b.DIRECTION_HORIZONTAL}]]},this.wG=c.wn(g).on("swipeleft",function(a){a.preventDefault();d.nextPage()}),this.xG=c.wn(g).on("swiperight",function(a){a.preventDefault();d.previousPage()})}}},Pj:function(){var a=this.lb();if(null!=this.Va&&null!=a){var b;
for(b=0;b<this.Va.length;b++)a.off(this.Va[b].eventType,this.Va[b].eventHandler)}},vea:function(a){var b=this;a.find("*").each(function(){b.uq(this)})},SA:function(){a.C.sf()&&("vertical"==this.options.pageOptions.orientation?(null!=this.yG&&(this.yG.off("swipeup"),this.yG=null),null!=this.vG&&(this.vG.off("swipedown"),this.vG=null)):(null!=this.wG&&(this.wG.off("swipeleft"),this.wG=null),null!=this.xG&&(this.xG.off("swiperight"),this.xG=null)))},Hq:function(a,b){var d=f(document.createElement("span"));
d.addClass(b);d.addClass(this.Z.Kh);d.text(a);return d},O5:function(){var a=this.Ad(),b=this.D(this.ob.d2),b=this.Hq(b,this.Z.zN),d=this.element.attr("id")+"_oj_pgCtrl_acc_label";b.attr("id",d);a.append(b);return b},S5:function(){var a=this.D(this.ob.b2);return this.Hq(a,this.Z.Q2)},P5:function(){var a=this.D(this.ob.Y1);return this.Hq(a,this.Z.F2)},Q5:function(){var a=this.D(this.ob.Z1);return this.Hq(a,this.Z.J2)},R5:function(){var a=this.D(this.ob.a2);return this.Hq(a,this.Z.M2)},T5:function(){var a=
this.D(this.ob.c2);return this.Hq(a,this.Z.S2)},U5:function(){var a=this.Ad(),b=f(document.createElement("div"));b.addClass(this.Z.AN);var d=this.x8().attr("id");b.attr("role","navigation");b.attr("aria-labelledby",d);a.append(b);return b},GP:function(){var a=this.Nh(),b=f(document.createElement("div"));b.addClass(this.Z.BN);a.append(b);return b},HP:function(){var a=this.Zq(),b=f(document.createElement("a"));b.addClass(this.Z.pD);var d=this.D(this.ob.e2);b.text(d);b.attr(this.pg,"0");b.attr("href",
"#");a.append(b);return b},V5:function(){var a=this.Zq(),b=f(document.createElement("span"));b.addClass(this.Z.CN);var d=this.D(this.ob.g2,{maxRows:this.options.loadMoreOptions.maxCount});b.text(d);a.append(b);return b},IP:function(a,b){var d=this.Zq(),h=f(document.createElement("span"));h.addClass(this.Z.qD);var k=this.CR(a,b);h.append(k);d.append(h);return h},JP:function(a,b){var d="vertical"==this.options.pageOptions.orientation?!0:!1,h="dots"==this.options.pageOptions.type?!0:!1,k=this.options.pageOptions.layout;
null==k&&(k=[this.Ze.Tg]);var l=this.Nh(),m=f(document.createElement("div"));m.addClass(this.Z.GN);l.append(m);if(-1!=f.inArray(this.Ze.Tg,k)&&!h||-1!=f.inArray(this.Ze.dt,k)||-1!=f.inArray(this.Ze.wx,k)){l=f(document.createElement("div"));l.addClass(this.Z.IN);m.append(l);var n=f(document.createElement("label"));n.addClass(this.Z.I2);var q=this.D(this.ob.h2);n.text(q);l.append(n);q=f(document.createElement("input"));q.addClass(this.Z.rt);var p=this.D(this.ob.y3);this._focusable(this.element);q.attr("title",
p);q.attr(this.pg,"0");q.val(this.Mf()+1);n.append(q);n=0;if(0<this.Je()){n=this.Je();p=f(document.createElement("span"));p.addClass(this.Z.HN);var r=this.D(this.ob.i2,{pageMax:n});p.text(r);l.append(p)}else n=0<a?this.Mf()+2:this.Mf()+1;q.ojInputText({rootAttributes:{style:"width: auto; min-width: 0;"},optionChange:this.X9.bind(this),validators:[{type:"numberRange",options:{min:1,max:n}}]})}if(-1!=f.inArray(this.Ze.Tg,k)&&!h||-1!=f.inArray(this.Ze.dt,k)||-1!=f.inArray(this.Ze.V2,k))l=f(document.createElement("span")),
l.addClass(this.Z.rD),q=this.CR(a,b),l.append("("),l.append(q),l.append(")"),m.append(l);l=f(document.createElement("div"));l.addClass(this.Z.FN);m.append(l);if(-1!=f.inArray(this.Ze.Tg,k)&&!h||-1!=f.inArray(this.Ze.dt,k)||-1!=f.inArray(this.Ze.qN,k))q=f(document.createElement("a")),q.addClass(this.Z.Gx),q.addClass(this.Z.qt),d?q.addClass(this.Z.H2):q.addClass(this.Z.G2),q.addClass(this.Z.bo),q.addClass(this.Ca.Un),q.addClass(this.Ca.sb),n=this.D(this.ob.x3),this._hoverable(q),this._focusable(q),
q.attr("title",n),q.attr(this.pg,"0"),q.attr("href","#"),q.attr("oncontextmenu","return false;"),n=this.P5(),q.append(n),d&&q.css("display","block"),l.append(q),q=f(document.createElement("a")),q.addClass(this.Z.Gx),q.addClass(this.Z.ut),d?q.addClass(this.Z.U2):q.addClass(this.Z.T2),q.addClass(this.Z.bo),q.addClass(this.Ca.Un),q.addClass(this.Ca.sb),n=this.D(this.ob.C3),this._hoverable(q),this._focusable(q),q.attr("title",n),q.attr(this.pg,"0"),q.attr("href","#"),q.attr("oncontextmenu","return false;"),
n=this.T5(),q.append(n),d&&q.css("display","block"),l.append(q);if(-1!=f.inArray(this.Ze.Tg,k)||-1!=f.inArray(this.Ze.dt,k)||-1!=f.inArray(this.Ze.A2,k))q=f(document.createElement("div")),q.addClass(this.Z.P2),l.append(q),this.W5(q,this.q8(),a,b);if(-1!=f.inArray(this.Ze.Tg,k)&&!h||-1!=f.inArray(this.Ze.dt,k)||-1!=f.inArray(this.Ze.qN,k))h=f(document.createElement("a")),h.addClass(this.Z.Gx),h.addClass(this.Z.tt),d?h.addClass(this.Z.O2):h.addClass(this.Z.N2),h.addClass(this.Z.bo),h.addClass(this.Ca.Un),
h.addClass(this.Ca.sb),k=this.D(this.ob.A3),this._hoverable(h),this._focusable(h),h.attr("title",k),h.attr(this.pg,"0"),h.attr("href","#"),h.attr("oncontextmenu","return false;"),k=this.R5(),h.append(k),d&&h.css("display","block"),l.append(h),h=f(document.createElement("a")),h.addClass(this.Z.Gx),h.addClass(this.Z.st),d?h.addClass(this.Z.L2):h.addClass(this.Z.K2),h.addClass(this.Z.bo),h.addClass(this.Ca.Un),h.addClass(this.Ca.sb),k=this.D(this.ob.z3),this._hoverable(h),this._focusable(h),h.attr("title",
k),h.attr(this.pg,"0"),h.attr("href","#"),h.attr("oncontextmenu","return false;"),k=this.Q5(),h.append(k),d&&h.css("display","block"),l.append(h);return m},W5:function(a,b,d){if(5>b){var h=this.D(this.ob.C1);a=this.D(this.ob.B1);throw Error(h+"\n"+a);}h=f(document.createElement("div"));h.addClass(this.Z.LN);a.append(h);a=this.Je();var k=this.Mf(),l=b;b=[];if(0<=k){if(-1!=a&&a<=l)for(b[0]=0,d=1;d<a;d++)b[d]=d;else{b.push(0);0!=k&&b.push(k);k!=a-1&&-1!=a&&b.push(a-1);var l=l-b.length,m=k-1,n=1;if(k==
a-1||k==a-2)n=0;for(;l>n&&1<m;)b.push(m),m--,l--;k+=1;for(-1==a&&(l=0<d?1:0);0<l&&(k<=a||-1==a);)b.push(k),k++,l--}b.sort(function(a,b){return a-b});for(d=0;d<b.length;d++)k=b[d],this.PE(h,k),d!=b.length-1&&k!=b[d+1]-1&&this.PE(h,-1);-1==a&&this.PE(h,-1)}return h},PE:function(a,b){var d=this.Mf(),h=null,k="rtl"===this.hc(),l="vertical"==this.options.pageOptions.orientation?!0:!1,m="dots"==this.options.pageOptions.type?!0:!1;if(-1==b)h=f(document.createElement("span")),h.addClass(this.Z.R2),h.text("...");
else{d==b?(h=f(document.createElement("div")),h.addClass(this.Ca.Xc),h.addClass(this.Ca.Ve),h.addClass(this.Ca.sb),h.removeClass(this.Ca.We)):(h=f(document.createElement("a")),h.removeClass(this.Ca.Xc),h.removeClass(this.Ca.Ve),h.removeClass(this.Ca.sb),h.addClass(this.Ca.We));h.attr("data-oj-pagenum",b);m?h.addClass(this.Z.E2):h.addClass(this.Z.MN);var n=this.D(this.ob.B3,{pageNum:(b+1).toString()});this._hoverable(h);this._focusable(h);h.attr("title",n);h.attr(this.pg,"0");h.attr("href","#");h.attr("oncontextmenu",
"return false;");n=this.S5();h.append(n);n=f(document.createElement("span"));n.append((b+1).toString());m&&(n.addClass(this.Z.D2),this._hoverable(n),d==b&&(n.addClass(this.Ca.Xc),n.addClass(this.Ca.Ve)));n.attr("dir",k?"rtl":"ltr");h.append(n);this._hoverable(h);l&&h.css("display","block")}a.append(h);return h},x8:function(){var a=this.Ad(),b=null;a&&(b=a.find("."+this.Z.zN))&&0<b.length&&(b=f(b.get(0)));return b},Ad:function(){return f(this.element)},Nh:function(){if(!this.PO){var a=this.Ad(),b=
null;a&&(b=a.find("."+this.Z.AN))&&0<b.length&&(this.PO=f(b.get(0)))}return this.PO},Zq:function(){if(!this.fE){var a=this.Nh(),b=null;a&&(b=a.children("."+this.Z.BN))&&0<b.length&&(this.fE=f(b.get(0)))}return this.fE},nia:function(){if(!this.gE){var a=this.Zq(),b=null;a&&(b=a.children("."+this.Z.pD))&&0<b.length&&(this.gE=f(b.get(0)))}return this.gE},oia:function(){if(!this.hE){var a=this.Zq(),b=null;a&&(b=a.children("."+this.Z.qD))&&0<b.length&&(this.hE=f(b.get(0)))}return this.hE},uu:function(){if(!this.iE){var a=
this.Nh(),b=null;a&&(b=a.children("."+this.Z.GN))&&0<b.length&&(this.iE=f(b.get(0)))}return this.iE},pia:function(){if(!this.jE){var a=this.uu(),b=null;a&&(b=a.find("."+this.Z.rt))&&0<b.length&&(this.jE=f(b.get(0)))}return this.jE},z8:function(){if(!this.kE){var a=this.uu(),b=null;a&&(b=a.find("."+this.Z.rD))&&0<b.length&&(this.kE=f(b.get(0)))}return this.kE},A8:function(){var a=this.uu(),b=null;a&&(b=a.find("."+this.Z.LN))&&0<b.length&&(b=f(b.get(0)));return b},cG:function(){var a=this.uu(),b=null;
if(a)if((b=a.find("."+this.Z.FN))&&0<b.length)b=f(b.get(0));else return null;return b},y8:function(){var a=this.uu(),b=null;if(a)if((b=a.find("."+this.Z.IN))&&0<b.length)b=f(b.get(0));else return null;return b}})})()});