!function(){const t=["bookVersionId","currentGradeNum"];function e(t,e){if(null==t)return{};var i,n,r=function(t,e){if(null==t)return{};var i,n,r={},a=Object.keys(t);for(n=0;n=0||(r[i]=t[i]);return r}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(t,i)&&(r[i]=t[i])}return r}function i(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function n(t){for(var e=1;e{a=t.d,o=t.a,l=t.x,h=t.r,c=t.y,d=t.a7,p=t.V,u=t.A,g=t.F,f=t.C,t.ah,m=t.q,v=t.M,y=t.al,x=t.w,w=t.z,b=t.E,_=t.a5,A=t.e,P=t.h,S=t.a0,T=t.Q},t=>{k=t.a,C=t.b,M=t.c,D=t.d,E=t.e,N=t.f,I=t.g,L=t.h},t=>{F=t.q},t=>{j=t.g,O=t.s,B=t.a,R=t.b},t=>{W=t.d},t=>{H=t.N},t=>{z=t.T,q=t.a},t=>{G=t.T},null,null,null],execute:function(){const U={container:"_container_1xc3a_1",head:"_head_1xc3a_10",back:"_back_1xc3a_18",tabs:"_tabs_1xc3a_21",downBtn:"_downBtn_1xc3a_37",activeBtn:"_activeBtn_1xc3a_48",icon:"_icon_1xc3a_48",iconUp:"_iconUp_1xc3a_73",popover:"_popover_1xc3a_78",content:"_content_1xc3a_97",wrap:"_wrap_1xc3a_103",emtpyWrap:"_emtpyWrap_1xc3a_109",wrapItem:"_wrapItem_1xc3a_120",item:"_item_1xc3a_130",name:"_name_1xc3a_161",favoriteBtn:"_favoriteBtn_1xc3a_168",containerImg:"_containerImg_1xc3a_174",cover:"_cover_1xc3a_200",loaded:"_loaded_1xc3a_230",book:"_book_1xc3a_233",bookWrap:"_bookWrap_1xc3a_247",show:"_show_1xc3a_255",popupContainer:"_popupContainer_1xc3a_260",searchList:"_searchList_1xc3a_266",popoverTitle:"_popoverTitle_1xc3a_272",popupList:"_popupList_1xc3a_288",btnGroup:"_btnGroup_1xc3a_310",btnSure:"_btnSure_1xc3a_325"},V=""+new URL("icon_back-b80c2fc2.svg",r.meta.url).href,X=a({name:"the-favorite",props:{isFavorite:{type:Boolean,default:!1}},setup:t=>()=>o("div",{class:["favoriteWrap",t.isFavorite?"liked":""]},[o("img",{class:"favoritIcon",src:t.isFavorite?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAgCAYAAAB6kdqOAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAJKADAAQAAAABAAAAIAAAAADfjkU8AAAHv0lEQVRYCZVXW6hWRRReM/u/HM/xclRCUzHLEFIkyqfwIUylG5pKIFqBhSgUkj1kGYT2ENJDUQhhF4QgDBRJPGZHo9KkHoISzUsmPQl5yfvlePz33jN935qZ39+T132Yf9bMrMs331ozex8jN3h6X180Nqv1e8kb+4QxdoR3MsSXZSGFOyul32tco6s6+O41ZuVK1+rCr1+f5bt2LYTNLG+z8eL8MKwbyd1ZnxfH/JX8+0Zv8cnADWsPtdol2SQh9X75K0Pzava+qdTniStrxnmBUwGgqz2mxBvB2lFTuhWVj1Z/Rvti6dKFpmJXOicjDQ2g5wv+wL6kDzSMvTO5uXy5q7jc83L/zV8dp216rgHUeHvJQ1m1vskbP9rAK4EI+zLK6himAOOxaf4xqHi7UaMaedZgTedowzXaF0435NXeYIqgsFy4E9JzZU775i9+/h+gxhuLH8wGDNjpnRtkXIHdw6JaExkzTmT/HjgtuVExaJ5BxUYf6BkYT1hDDzbAbtgQOmWYDKktl7AhjB03Vvqesrd3+sBvvvxFffDHL13aWXaa3djwGAsw6mz0WDHzF4u09RNZ9abIqZO6KwYnC5pCgrIEBL7SHDZisJfALoGRjYgEQFQkVgiUnbcE9a87f2r8wB1dJysElHcU71mfjTG6K2gbK2beIpH2DpEtG0ROHIMlphkITiApgIAqZh3zzXWkSBWVqTAP5jFFOyiSNcji2JBOsXeZen/W4WzTs2zhqGq945A1rt2UOZRLhIPRYzNE9u0W+fswjDHW7cAEq+oMU/pghwqS47Bl9H1kXYMa5/Gw595DaYI1+ARTeS1vPFDJfH2BuKJdte4bJ2bkPSLbN4OZ9cFCdwmPdBYdq1ewGAKnKJjVnVMPirRL+uwxvppW6pA52LKedGirufOvVcDM44KyMQbeJk8TGTdBZOc2kfMNBORWoN4KhtZkCUwG2oPzZnAuN8HQFo3poR39YKxXiW40+NHTiiWsTK1A6V54wAio1n0qMrBT5MJFTMGaTmhIAAmYynFNgTIgA8WGLtjFnmu6jp8ElL4pg50AGDJFa4dXfOmGWnjjSTDnzomcPoMVesdDEKqJjrvkoyDQ666xTpUkt65TTmvJhr4AhjUUWIKAGFpbvDMy6QBDuDsJALN6AijH2zU4pGMGjrvBsj4E2wwYZa5xTtegr+ucg6AnKuiBhHBjs2eDb1wC3LuzvpEfxztKkZNGRdt0lJzHQATFRxmJfQKWwNCWTCQfaZ1YdA4/0NW7SeNhjPgat5Dz1pTmKG/NAAYsUaZzbZA1eGRHmeJanG8JdhVAWk89bYM90xSAMG2BHX2tgCWiRYZO4WLODyRmPI9gWIMCHKadJgCca7JDUBynFscYNnVa7NUvAfH80B/Z0XSFrBAgoh+y1rnP9Q3M25UKrCEijqwpG3RMJ5i+yk4CwrkIQoFTpm5s9KPA6BsyY7Dx3YjeUVbmwZDYDxFJpPeF5w8bKe/HW0Usql2LWymkc2pEQJTZFECU01jBQK9VJ26gyQg27QDENUopiwLYUMpopcFNVK2eGLxn6zBct3hyt5HXkL6B+akAWvVqUuSQGUx3SRmNTxNIlLnOR+fxowBjzUBmypSNnAVMIGGsajA11m6huQKqnxu6AiCO8UWvOWZ+1UOoKQVB6hnsmsa5OB/ZCKkKTNEFCxrfPSFFZAd+SrwznZ4sxMGflex8z/GjS5qAzLerr5iyXEXlAIoswRFBNHMMdTJHQAzEXllrSZOucYwwyTYFJhiwo0CwpqcMTljKlazywYh/fuuJHtmF5/LsufvgaYIlhagl1hTfMxjiwScJAyoQ9IlrBYEf7aGp6cEAoLV4Wbg5NkgwrBsAK7lx5MzZTGy1emTw/u7RjMAn1FCQxRbFXOhddDl2gObwNcKdKvXax8CQ9W5REFEmewoGPY829QGkCQaACEazQNahZozprbnqrBheu2sA1bs27pfSvkrwNCQQrSm+SjCpaUhB6bEFGEspAIIRPnbSsQ7MhFQ5njKmEH8OKcjq/ZZ3HOz6vRVQyEbrDORLT85Zi9p5kWg1fRCQMIxwU+jeMh0pc0DCL8XAIgMCGRrTw2LWY57SBDAlLlYPp5W22qbOfdtm9wkdy6PvLMaXps/eiAtrjkWkjPcE4Wgfq4pAmHEWsLJFNskMmIynimyUjcCKgxLLDsxIVm/7YfCB7qnXCXtjQFS+MG3mJsn9MxnQWDhTQFEmW9oYRQGRjZBWpovMlDqGjHVegh5gKvXajs6D3025HhjO0etNn54ps9ahGOfx9iYwfoaCdDSwg7pSenjXsFAJAHMKBDIKES0ww/9OAGbroAPbn75ZQJbJTZ/2HzfNN9YsQ/p6SxS3Hlse4bxAY4+ADRznPA9rkHUN6dJ/CLlna/JKve2dW4EhkFsylNBemDxzCnhfhzoZTrb4KaH3EutGixopURkAyQrm1Lu1Z+qVtnn9/+zGh/qtn9sGRFdHRj3Sb9DIIR9Lo3gO76Nq+gzVLwQFwTQRB1JopMhqta97zp1ekG7hW8O5A4ZanV2aNOPhoszXoHAn4drFQQQKANKjbywuYPuH9ZVFg/7a9mur3e3Id8RQX4cXJz41sTTuXXxKPIoaM3gn/YR/M98asq97b1/d2x3/B8k9N3E67sAEAAAAAElFTkSuQmCC":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAkCAYAAAD7PHgWAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAKKADAAQAAAABAAAAJAAAAAC/FoutAAADKklEQVRYCc2YW4hNYRiGx3FyaJxPMUYOOZWSUBgjE8odk3AhXChR5E5qTG5QUmhScoFxNXKIckiZUk4hlJBcGJPzIeVYzOB5prWy7TFr9p7Zs9d+69nrX+v7//97117/+tbaOy8vx9UhBX/j6VMG82AYDIFv8AKuwQmogV+QqMnsLAXHFUIBvAbHXYaTcBtarXGMvAC/U+AufUpAeRLVkMq4W/SbCWlrIyN+gkk+wkFYCCOhG/SDqVABtWA/v8Hd8DbY/8x2DxTDAMiHIiiFvfASHCeV0AlS0k56hQn30+7bwigTl0MDhAnP0R4KUfJEt4LLxXFnwGORWkPUzj9geWTPpkHXWz1UQeem4WaPTCfyDsx7qNleBCZAeDbLojpGxOYTS/lSJcwzkfYX0OTKhOP/NE8FHVxvcWgFSTX4Bppcas/ARf4V+kNcukpiTW5KNrArCOxLDmR530qhwYfJee8FgdnJgSzvu34ta5osDHNbRsLL2zU8GOP2OLk1uEoPHcHK7yPvCVhe4tb9wECRWw0ODA5Yi3JBPonUID802MMG8g7OBVkPVU8/NPjKBvItJRcU+mj0pcHngauWnp3ZMu89oRp9adDK/RN07ltK3JoUGKhLNHKaHW/tDYkHY2iPIKclz3XYuAbZNmoRnxq0YMepbSTXx5FkE1044KU2uDo5mKX9UeTxJVcP/32i+T5n0E6jIZvy/fE6mL8qKvHRoNMdtn2iOmY4VhnkrWXbK2ruAoKPwTNxPfpboj1lFTkA5vsOs6BFWW4egIMeQViXaGZUrvvwivkUK01ndl9avcya9OYpgUxqMJNdAef/BMWQtnoz4iI4iYV8M3hJ2qq5TBD+5KyjPaUtE2poO1g8NXoJWvtI9E7dAQ3gXDWQsTW+gMn828KJP8ASSEdj6XwTHF8P5ZCJq8E0f+V741kwibjAI0sCcbUOvAkc8xRmQLtqLbOHCZ/RntNMNqvBeQhP6DBty1hWNIYsN8Dkrk9/FeZDKJ/t78G42zLIulz0FeAdrhF/Ki6G6mDfY36DfpOxahrZLegaCvF1aT3kjLy8W0Bjx2A45KS6Z9rVH+dMzG9PPT/rAAAAAElFTkSuQmCC"},null)])}),K={book:"_book_1xtvx_1",back:"_back_1xtvx_11",bookHide:"_bookHide_1xtvx_16",wrap:"_wrap_1xtvx_36",wrapItem:"_wrapItem_1xtvx_53",item:"_item_1xtvx_60",des:"_des_1xtvx_69",icon:"_icon_1xtvx_74",last:"_last_1xtvx_79"},Y=a({name:"courseware-detail",emits:["close"],setup(t,{emit:e}){const i=l({box:{},show:!1,steps:[{ele:"",eleRect:{},img:j("courseware-detail1.png"),handStyle:{top:"-0.4rem",left:"0.98rem",transform:"rotate(-90deg)"},boxStyle:{borderRadius:"0.1rem"},imgStyle:{top:"-1.3rem",left:"2.2rem"},btnsStyle:{top:"1.5rem",left:"3.5rem"}}],step:0}),r=h(!1),a=h({}),m=function(){var t=s((function*(){try{const e=yield B({guideTag:"guideInfo"});var t;if(e.data)a.value=JSON.parse(null===(t=e.data)||void 0===t?void 0:t.guideValue)||null;else a.value={};a.value&&a.value.coursewareDetail?r.value=!1:r.value=!0}catch(e){console.log(e)}}));return function(){return t.apply(this,arguments)}}();m();const v=()=>{console.log(`coursewareDetail-${i.step}`);const t=document.getElementById(`coursewareDetail-${i.step}`);if(t){const e=t.getBoundingClientRect();i.box={left:e.x+"px",top:e.y+"px",width:e.width+"px",height:e.height+"px"}}else x()};c((()=>{v(),window.addEventListener("resize",y)}));const y=()=>{v()};d((()=>{window.removeEventListener("resize",y)}));const x=()=>{i.step>=2?w():(i.step=i.step+1,v())},w=function(){var t=s((function*(){a.value?a.value.coursewareDetail=!0:a.value={coursewareDetail:!0};try{yield R({guideTag:"guideInfo",guideValue:JSON.stringify(a.value)})}catch(t){console.log(t)}r.value=!1}));return function(){return t.apply(this,arguments)}}();return()=>o(p,{teleport:"body",overlay:!1,closeOnClickOverlay:!1,class:["popup-custom",O.guidePopup],show:r.value,"onUpdate:show":t=>r.value=t},{default:()=>{var t;return[o("div",{class:O.content,onClick:()=>x()},[i.step!=i.steps.length-1&&o("div",{class:O.backBtn,onClick:t=>{t.stopPropagation(),w()}},[u("跳过")]),o("div",{class:O.box,style:n(n({},i.box),null===(t=i.steps[i.step])||void 0===t?void 0:t.boxStyle),id:`modeType-${i.step}`},[i.steps.map(((t,e)=>{var n,r;return o("div",{onClick:t=>t.stopPropagation(),class:O.item,style:{display:e===i.step?"":"none",left:`${null===(n=t.eleRect)||void 0===n?void 0:n.left}px`,top:`${null===(r=t.eleRect)||void 0===r?void 0:r.top}px`}},[o("img",{class:O.img,style:t.imgStyle,src:t.img},null),o("img",{class:O.iconHead,style:t.handStyle,src:j("indexDot.png")},null),o("div",{class:O.btns,style:t.btnsStyle},[i.step+1==i.steps.length?o(g,null,[o(f,{class:[O.btn,O.endBtn],round:!0,type:"primary",onClick:()=>w()},{default:()=>[u("完成")]})]):o(f,{class:O.btn,round:!0,type:"primary",onClick:()=>x()},{default:()=>[u("下一步 ("),i.step+1,u("/"),i.steps.length,u(")")]})])])}))])])]}})}});var Q={};!function(t,e){!function(t){class e{constructor(t,e){this.state={angle:0,area:[],position:{x:0,y:0},hardAngle:0,hardDrawingAngle:0},this.createdDensity=e,this.nowDrawingDensity=this.createdDensity,this.render=t}setDensity(t){this.createdDensity=t,this.nowDrawingDensity=t}setDrawingDensity(t){this.nowDrawingDensity=t}setPosition(t){this.state.position=t}setAngle(t){this.state.angle=t}setArea(t){this.state.area=t}setHardDrawingAngle(t){this.state.hardDrawingAngle=t}setHardAngle(t){this.state.hardAngle=t,this.state.hardDrawingAngle=t}setOrientation(t){this.orientation=t}getDrawingDensity(){return this.nowDrawingDensity}getDensity(){return this.createdDensity}getHardAngle(){return this.state.hardAngle}}class i extends e{constructor(t,e,i){super(t,i),this.image=null,this.isLoad=!1,this.loadingAngle=0,this.image=new Image,this.image.src=e}draw(t){const e=this.render.getContext(),i=this.render.convertToGlobal(this.state.position),n=this.render.getRect().pageWidth,r=this.render.getRect().height;e.save(),e.translate(i.x,i.y),e.beginPath();for(let a of this.state.area)null!==a&&(a=this.render.convertToGlobal(a),e.lineTo(a.x-i.x,a.y-i.y));e.rotate(this.state.angle),e.clip(),this.isLoad?e.drawImage(this.image,0,0,n,r):this.drawLoader(e,{x:0,y:0},n,r),e.restore()}simpleDraw(t){const e=this.render.getRect(),i=this.render.getContext(),n=e.pageWidth,r=e.height,a=1===t?e.left+e.pageWidth:e.left,s=e.top;this.isLoad?i.drawImage(this.image,a,s,n,r):this.drawLoader(i,{x:a,y:s},n,r)}drawLoader(t,e,i,n){t.beginPath(),t.strokeStyle="rgb(200, 200, 200)",t.fillStyle="rgb(255, 255, 255)",t.lineWidth=1,t.rect(e.x+1,e.y+1,i-1,n-1),t.stroke(),t.fill();const r={x:e.x+i/2,y:e.y+n/2};t.beginPath(),t.lineWidth=10,t.arc(r.x,r.y,20,this.loadingAngle,3*Math.PI/2+this.loadingAngle),t.stroke(),t.closePath(),this.loadingAngle+=.07,this.loadingAngle>=2*Math.PI&&(this.loadingAngle=0)}load(){this.isLoad||(this.image.onload=()=>{this.isLoad=!0})}newTemporaryCopy(){return this}getTemporaryCopy(){return this}hideTemporaryCopy(){}}class n{constructor(t,e){this.pages=[],this.currentPageIndex=0,this.currentSpreadIndex=0,this.landscapeSpread=[],this.portraitSpread=[],this.render=e,this.app=t,this.currentPageIndex=0,this.isShowCover=this.app.getSettings().showCover}destroy(){this.pages=[]}createSpread(){this.landscapeSpread=[],this.portraitSpread=[];for(let e=0;e=0&&t0?this.pages[e-1]:null}getFlippingPage(t){const e=this.currentSpreadIndex;if("portrait"===this.render.getOrientation())return 0===t?this.pages[e].newTemporaryCopy():this.pages[e-1];{const i=0===t?this.getSpread()[e+1]:this.getSpread()[e-1];return 1===i.length||0===t?this.pages[i[0]]:this.pages[i[1]]}}getBottomPage(t){const e=this.currentSpreadIndex;if("portrait"===this.render.getOrientation())return 0===t?this.pages[e+1]:this.pages[e-1];{const i=0===t?this.getSpread()[e+1]:this.getSpread()[e-1];return 1===i.length?this.pages[i[0]]:0===t?this.pages[i[1]]:this.pages[i[0]]}}showNext(){this.currentSpreadIndex0&&(this.currentSpreadIndex--,this.showSpread())}getCurrentPageIndex(){return this.currentPageIndex}show(t=null){if(null===t&&(t=this.currentPageIndex),t<0||t>=this.pages.length)return;const e=this.getSpreadIndexByPage(t);null!==e&&(this.currentSpreadIndex=e,this.showSpread())}getCurrentSpreadIndex(){return this.currentSpreadIndex}setCurrentSpreadIndex(t){if(!(t>=0&&t=t.left&&e.x<=t.width+t.left&&e.y>=t.top&&e.y<=t.top+t.height?e:null}static GetRotatedPoint(t,e,i){return{x:t.x*Math.cos(i)+t.y*Math.sin(i)+e.x,y:t.y*Math.cos(i)-t.x*Math.sin(i)+e.y}}static LimitPointToCircle(t,e,i){if(a.GetDistanceBetweenTwoPoint(t,i)<=e)return i;const n=t.x,r=t.y,s=i.x,o=i.y;let l=Math.sqrt(Math.pow(e,2)*Math.pow(n-s,2)/(Math.pow(n-s,2)+Math.pow(r-o,2)))+n;i.x<0&&(l*=-1);let h=(l-n)*(r-o)/(n-s)+r;return n-s+r===0&&(h=e),{x:l,y:h}}static GetIntersectBetweenTwoSegment(t,e,i){return a.PointInRect(t,a.GetIntersectBeetwenTwoLine(e,i))}static GetIntersectBeetwenTwoLine(t,e){const i=t[0].y-t[1].y,n=e[0].y-e[1].y,r=t[1].x-t[0].x,a=e[1].x-e[0].x,s=t[0].x*t[1].y-t[1].x*t[0].y,o=e[0].x*e[1].y-e[1].x*e[0].y,l=i*o-n*s,h=r*o-a*s,c=-(s*a-o*r)/(i*a-n*r),d=-(i*o-n*s)/(i*a-n*r);if(isFinite(c)&&isFinite(d))return{x:c,y:d};if(Math.abs(l-h)<.1)throw new Error("Segment included");return null}static GetCordsFromTwoPoint(t,e){const i=Math.abs(t.x-e.x),n=Math.abs(t.y-e.y),r=Math.max(i,n),a=[t];function s(t,e,i,n,r){return e>t?t+r*(i/n):e=10&&t.push(this.sideIntersectPoint):"top"===this.corner&&t.push({x:this.pageWidth,y:this.pageHeight}),t.push(this.bottomIntersectPoint),t.push(this.topIntersectPoint),t}getAngle(){return 0===this.direction?-this.angle:this.angle}getRect(){return this.rect}getPosition(){return this.position}getActiveCorner(){return 0===this.direction?this.rect.topLeft:this.rect.topRight}getDirection(){return this.direction}getFlippingProgress(){return Math.abs((this.position.x-this.pageWidth)/(2*this.pageWidth)*100)}getCorner(){return this.corner}getBottomPagePosition(){return 1===this.direction?{x:this.pageWidth,y:0}:{x:0,y:0}}getShadowStartPoint(){return"top"===this.corner?this.topIntersectPoint:null!==this.sideIntersectPoint?this.sideIntersectPoint:this.topIntersectPoint}getShadowAngle(){const t=a.GetAngleBetweenTwoLine(this.getSegmentToShadowLine(),[{x:0,y:0},{x:this.pageWidth,y:0}]);return 0===this.direction?t:Math.PI-t}calcAngleAndPosition(t){let e=t;if(this.updateAngleAndGeometry(e),e="top"===this.corner?this.checkPositionAtCenterLine(e,{x:0,y:0},{x:0,y:this.pageHeight}):this.checkPositionAtCenterLine(e,{x:0,y:this.pageHeight},{x:0,y:0}),Math.abs(e.x-this.pageWidth)<1&&Math.abs(e.y)<1)throw new Error("Point is too small");return e}updateAngleAndGeometry(t){this.angle=this.calculateAngle(t),this.rect=this.getPageRect(t)}calculateAngle(t){const e=this.pageWidth-t.x+1,i="bottom"===this.corner?this.pageHeight-t.y:t.y;let n=2*Math.acos(e/Math.sqrt(i*i+e*e));i<0&&(n=-n);const r=Math.PI-n;if(!isFinite(n)||r>=0&&r<.003)throw new Error("The G point is too small");return"bottom"===this.corner&&(n=-n),n}getPageRect(t){return"top"===this.corner?this.getRectFromBasePoint([{x:0,y:0},{x:this.pageWidth,y:0},{x:0,y:this.pageHeight},{x:this.pageWidth,y:this.pageHeight}],t):this.getRectFromBasePoint([{x:0,y:-this.pageHeight},{x:this.pageWidth,y:-this.pageHeight},{x:0,y:0},{x:this.pageWidth,y:0}],t)}getRectFromBasePoint(t,e){return{topLeft:this.getRotatedPoint(t[0],e),topRight:this.getRotatedPoint(t[1],e),bottomLeft:this.getRotatedPoint(t[2],e),bottomRight:this.getRotatedPoint(t[3],e)}}getRotatedPoint(t,e){return{x:t.x*Math.cos(this.angle)+t.y*Math.sin(this.angle)+e.x,y:t.y*Math.cos(this.angle)-t.x*Math.sin(this.angle)+e.y}}calculateIntersectPoint(t){const e={left:-1,top:-1,width:this.pageWidth+2,height:this.pageHeight+2};"top"===this.corner?(this.topIntersectPoint=a.GetIntersectBetweenTwoSegment(e,[t,this.rect.topRight],[{x:0,y:0},{x:this.pageWidth,y:0}]),this.sideIntersectPoint=a.GetIntersectBetweenTwoSegment(e,[t,this.rect.bottomLeft],[{x:this.pageWidth,y:0},{x:this.pageWidth,y:this.pageHeight}]),this.bottomIntersectPoint=a.GetIntersectBetweenTwoSegment(e,[this.rect.bottomLeft,this.rect.bottomRight],[{x:0,y:this.pageHeight},{x:this.pageWidth,y:this.pageHeight}])):(this.topIntersectPoint=a.GetIntersectBetweenTwoSegment(e,[this.rect.topLeft,this.rect.topRight],[{x:0,y:0},{x:this.pageWidth,y:0}]),this.sideIntersectPoint=a.GetIntersectBetweenTwoSegment(e,[t,this.rect.topLeft],[{x:this.pageWidth,y:0},{x:this.pageWidth,y:this.pageHeight}]),this.bottomIntersectPoint=a.GetIntersectBetweenTwoSegment(e,[this.rect.bottomLeft,this.rect.bottomRight],[{x:0,y:this.pageHeight},{x:this.pageWidth,y:this.pageHeight}]))}checkPositionAtCenterLine(t,e,i){let n=t;const r=a.LimitPointToCircle(e,this.pageWidth,n);n!==r&&(n=r,this.updateAngleAndGeometry(n));const s=Math.sqrt(Math.pow(this.pageWidth,2)+Math.pow(this.pageHeight,2));let o=this.rect.bottomRight,l=this.rect.topLeft;if("bottom"===this.corner&&(o=this.rect.topRight,l=this.rect.bottomLeft),o.x<=0){const t=a.LimitPointToCircle(i,s,l);t!==n&&(n=t,this.updateAngleAndGeometry(n))}return n}getSegmentToShadowLine(){const t=this.getShadowStartPoint();return[t,t!==this.sideIntersectPoint&&null!==this.sideIntersectPoint?this.sideIntersectPoint:this.bottomIntersectPoint]}}class h{constructor(t,e){this.flippingPage=null,this.bottomPage=null,this.calc=null,this.state="read",this.render=t,this.app=e}fold(t){this.setState("user_fold"),null===this.calc&&this.start(t),this.do(this.render.convertToPage(t))}flip(t){if(this.app.getSettings().disableFlipByClick&&!this.isPointOnCorners(t))return;if(null!==this.calc&&this.render.finishAnimation(),!this.start(t))return;const e=this.getBoundsRect();this.setState("flipping");const i=e.height/10,n="bottom"===this.calc.getCorner()?e.height-i:i,r="bottom"===this.calc.getCorner()?e.height:0;this.calc.calc({x:e.pageWidth-i,y:n}),this.animateFlippingTo({x:e.pageWidth-i,y:n},{x:-e.pageWidth,y:r},!0)}start(t){this.reset();const e=this.render.convertToBook(t),i=this.getBoundsRect(),n=this.getDirectionByPoint(e),r=e.y>=i.height/2?"bottom":"top";if(!this.checkDirection(n))return!1;try{if(this.flippingPage=this.app.getPageCollection().getFlippingPage(n),this.bottomPage=this.app.getPageCollection().getBottomPage(n),"landscape"===this.render.getOrientation())if(1===n){const t=this.app.getPageCollection().nextBy(this.flippingPage);null!==t&&this.flippingPage.getDensity()!==t.getDensity()&&(this.flippingPage.setDrawingDensity("hard"),t.setDrawingDensity("hard"))}else{const t=this.app.getPageCollection().prevBy(this.flippingPage);null!==t&&this.flippingPage.getDensity()!==t.getDensity()&&(this.flippingPage.setDrawingDensity("hard"),t.setDrawingDensity("hard"))}return this.render.setDirection(n),this.calc=new l(n,r,i.pageWidth.toString(10),i.height.toString(10)),!0}catch(t){return!1}}do(t){if(null!==this.calc&&this.calc.calc(t)){const t=this.calc.getFlippingProgress();this.bottomPage.setArea(this.calc.getBottomClipArea()),this.bottomPage.setPosition(this.calc.getBottomPagePosition()),this.bottomPage.setAngle(0),this.bottomPage.setHardAngle(0),this.flippingPage.setArea(this.calc.getFlippingClipArea()),this.flippingPage.setPosition(this.calc.getActiveCorner()),this.flippingPage.setAngle(this.calc.getAngle()),0===this.calc.getDirection()?this.flippingPage.setHardAngle(90*(200-2*t)/100):this.flippingPage.setHardAngle(-90*(200-2*t)/100),this.render.setPageRect(this.calc.getRect()),this.render.setBottomPage(this.bottomPage),this.render.setFlippingPage(this.flippingPage),this.render.setShadowData(this.calc.getShadowStartPoint(),this.calc.getShadowAngle(),t,this.calc.getDirection())}}flipToPage(t,e){const i=this.app.getPageCollection().getCurrentSpreadIndex(),n=this.app.getPageCollection().getSpreadIndexByPage(t);try{n>i&&(this.app.getPageCollection().setCurrentSpreadIndex(n-1),this.flipNext(e)),nthis.do(a)));const o=this.getAnimationDuration(r.length);this.render.startAnimation(s,o,(()=>{this.calc&&(i&&(1===this.calc.getDirection()?this.app.turnToPrevPage():this.app.turnToNextPage()),n&&(this.render.setBottomPage(null),this.render.setFlippingPage(null),this.render.clearShadow(),this.setState("read"),this.reset()))}))}getCalculation(){return this.calc}getState(){return this.state}setState(t){this.state!==t&&(this.app.updateState(t),this.state=t)}getDirectionByPoint(t){const e=this.getBoundsRect();if("portrait"===this.render.getOrientation()){if(t.x-e.pageWidth<=e.width/5)return 1}else if(t.x=1e3?e:t/1e3*e}checkDirection(t){return 0===t?this.app.getCurrentPageIndex()=1}reset(){this.calc=null,this.flippingPage=null,this.bottomPage=null}getBoundsRect(){return this.render.getRect()}checkState(...t){for(const e of t)if(this.state===e)return!0;return!1}isPointOnCorners(t){const e=this.getBoundsRect(),i=e.pageWidth,n=Math.sqrt(Math.pow(i,2)+Math.pow(e.height,2))/5,r=this.render.convertToBook(t);return r.x>0&&r.y>0&&r.xe.width-n)&&(r.ye.height-n)}}class c{constructor(t,e){this.leftPage=null,this.rightPage=null,this.flippingPage=null,this.bottomPage=null,this.direction=null,this.orientation=null,this.shadow=null,this.animation=null,this.pageRect=null,this.boundsRect=null,this.timer=0,this.safari=!1,this.setting=e,this.app=t;const i=new RegExp("Version\\/[\\d\\.]+.*Safari/");this.safari=null!==i.exec(window.navigator.userAgent)}render(t){if(null!==this.animation){const e=Math.round((t-this.animation.startedAt)/this.animation.durationFrame);e{this.render(e),requestAnimationFrame(t)};requestAnimationFrame(t)}startAnimation(t,e,i){this.finishAnimation(),this.animation={frames:t,duration:e,durationFrame:e/t.length,onAnimateEnd:i,startedAt:this.timer}}finishAnimation(){null!==this.animation&&(this.animation.frames[this.animation.frames.length-1](),null!==this.animation.onAnimateEnd&&this.animation.onAnimateEnd()),this.animation=null}update(){this.boundsRect=null;const t=this.calculateBoundsRect();this.orientation!==t&&(this.orientation=t,this.app.updateOrientation(t))}calculateBoundsRect(){let t="landscape";const e=this.getBlockWidth(),i=e/2,n=this.getBlockHeight()/2,r=this.setting.width/this.setting.height;let a=this.setting.width,s=this.setting.height,o=i-a;return"stretch"===this.setting.size?(e<2*this.setting.minWidth&&this.app.getSettings().usePortrait&&(t="portrait"),a="portrait"===t?this.getBlockWidth():this.getBlockWidth()/2,a>this.setting.maxWidth&&(a=this.setting.maxWidth),s=a/r,s>this.getBlockHeight()&&(s=this.getBlockHeight(),a=s*r),o="portrait"===t?i-a/2-a:i-a):e<2*a&&this.app.getSettings().usePortrait&&(t="portrait",o=i-a/2-a),this.boundsRect={left:o,top:n-s/2,width:2*a,height:s,pageWidth:a},t}setShadowData(t,e,i,n){if(!this.app.getSettings().drawShadow)return;const r=100*this.getSettings().maxShadowOpacity;this.shadow={pos:t,angle:e,width:3*this.getRect().pageWidth/4*i/100,opacity:(100-i)*r/100/100,direction:n,progress:2*i}}clearShadow(){this.shadow=null}getBlockWidth(){return this.app.getUI().getDistElement().offsetWidth}getBlockHeight(){return this.app.getUI().getDistElement().offsetHeight}getDirection(){return this.direction}getRect(){return null===this.boundsRect&&this.calculateBoundsRect(),this.boundsRect}getSettings(){return this.app.getSettings()}getOrientation(){return this.orientation}setPageRect(t){this.pageRect=t}setDirection(t){this.direction=t}setRightPage(t){null!==t&&t.setOrientation(1),this.rightPage=t}setLeftPage(t){null!==t&&t.setOrientation(0),this.leftPage=t}setBottomPage(t){null!==t&&t.setOrientation(1===this.direction?0:1),this.bottomPage=t}setFlippingPage(t){null!==t&&t.setOrientation(0===this.direction&&"portrait"!==this.orientation?0:1),this.flippingPage=t}convertToBook(t){const e=this.getRect();return{x:t.x-e.left,y:t.y-e.top}}isSafari(){return this.safari}convertToPage(t,e){e||(e=this.direction);const i=this.getRect();return{x:0===e?t.x-i.left-i.width/2:i.width/2-t.x+i.left,y:t.y-i.top}}convertToGlobal(t,e){if(e||(e=this.direction),null==t)return null;const i=this.getRect();return{x:0===e?t.x+i.left+i.width/2:i.width/2-t.x+i.left,y:t.y+i.top}}convertRectToGlobal(t,e){return e||(e=this.direction),{topLeft:this.convertToGlobal(t.topLeft,e),topRight:this.convertToGlobal(t.topRight,e),bottomLeft:this.convertToGlobal(t.bottomLeft,e),bottomRight:this.convertToGlobal(t.bottomRight,e)}}}class d extends c{constructor(t,e,i){super(t,e),this.canvas=i,this.ctx=i.getContext("2d")}getContext(){return this.ctx}reload(){}drawFrame(){this.clear(),"portrait"!==this.orientation&&null!=this.leftPage&&this.leftPage.simpleDraw(0),null!=this.rightPage&&this.rightPage.simpleDraw(1),null!=this.bottomPage&&this.bottomPage.draw(),this.drawBookShadow(),null!=this.flippingPage&&this.flippingPage.draw(),null!=this.shadow&&(this.drawOuterShadow(),this.drawInnerShadow());const t=this.getRect();"portrait"===this.orientation&&(this.ctx.beginPath(),this.ctx.rect(t.left+t.pageWidth,t.top,t.width,t.height),this.ctx.clip())}drawBookShadow(){const t=this.getRect();this.ctx.save(),this.ctx.beginPath();const e=t.width/20;this.ctx.rect(t.left,t.top,t.width,t.height);const i={x:t.left+t.width/2-e/2,y:0};this.ctx.translate(i.x,i.y);const n=this.ctx.createLinearGradient(0,0,e,0);n.addColorStop(0,"rgba(0, 0, 0, 0)"),n.addColorStop(.4,"rgba(0, 0, 0, 0.2)"),n.addColorStop(.49,"rgba(0, 0, 0, 0.1)"),n.addColorStop(.5,"rgba(0, 0, 0, 0.5)"),n.addColorStop(.51,"rgba(0, 0, 0, 0.4)"),n.addColorStop(1,"rgba(0, 0, 0, 0)"),this.ctx.clip(),this.ctx.fillStyle=n,this.ctx.fillRect(0,0,e,2*t.height),this.ctx.restore()}drawOuterShadow(){const t=this.getRect();this.ctx.save(),this.ctx.beginPath(),this.ctx.rect(t.left,t.top,t.width,t.height);const e=this.convertToGlobal({x:this.shadow.pos.x,y:this.shadow.pos.y});this.ctx.translate(e.x,e.y),this.ctx.rotate(Math.PI+this.shadow.angle+Math.PI/2);const i=this.ctx.createLinearGradient(0,0,this.shadow.width,0);0===this.shadow.direction?(this.ctx.translate(0,-100),i.addColorStop(0,"rgba(0, 0, 0, "+this.shadow.opacity+")"),i.addColorStop(1,"rgba(0, 0, 0, 0)")):(this.ctx.translate(-this.shadow.width,-100),i.addColorStop(0,"rgba(0, 0, 0, 0)"),i.addColorStop(1,"rgba(0, 0, 0, "+this.shadow.opacity+")")),this.ctx.clip(),this.ctx.fillStyle=i,this.ctx.fillRect(0,0,this.shadow.width,2*t.height),this.ctx.restore()}drawInnerShadow(){const t=this.getRect();this.ctx.save(),this.ctx.beginPath();const e=this.convertToGlobal({x:this.shadow.pos.x,y:this.shadow.pos.y}),i=this.convertRectToGlobal(this.pageRect);this.ctx.moveTo(i.topLeft.x,i.topLeft.y),this.ctx.lineTo(i.topRight.x,i.topRight.y),this.ctx.lineTo(i.bottomRight.x,i.bottomRight.y),this.ctx.lineTo(i.bottomLeft.x,i.bottomLeft.y),this.ctx.translate(e.x,e.y),this.ctx.rotate(Math.PI+this.shadow.angle+Math.PI/2);const n=3*this.shadow.width/4,r=this.ctx.createLinearGradient(0,0,n,0);0===this.shadow.direction?(this.ctx.translate(-n,-100),r.addColorStop(1,"rgba(0, 0, 0, "+this.shadow.opacity+")"),r.addColorStop(.9,"rgba(0, 0, 0, 0.05)"),r.addColorStop(.7,"rgba(0, 0, 0, "+this.shadow.opacity+")"),r.addColorStop(0,"rgba(0, 0, 0, 0)")):(this.ctx.translate(0,-100),r.addColorStop(0,"rgba(0, 0, 0, "+this.shadow.opacity+")"),r.addColorStop(.1,"rgba(0, 0, 0, 0.05)"),r.addColorStop(.3,"rgba(0, 0, 0, "+this.shadow.opacity+")"),r.addColorStop(1,"rgba(0, 0, 0, 0)")),this.ctx.clip(),this.ctx.fillStyle=r,this.ctx.fillRect(0,0,n,2*t.height),this.ctx.restore()}clear(){this.ctx.fillStyle="white",this.ctx.fillRect(0,0,this.canvas.width,this.canvas.height)}}class p{constructor(t,e,i){this.touchPoint=null,this.swipeTimeout=250,this.onResize=()=>{this.update()},this.onMouseDown=t=>{if(this.checkTarget(t.target)){const e=this.getMousePos(t.clientX,t.clientY);this.app.startUserTouch(e),t.preventDefault()}},this.onTouchStart=t=>{if(this.checkTarget(t.target)&&t.changedTouches.length>0){const e=t.changedTouches[0],i=this.getMousePos(e.clientX,e.clientY);this.touchPoint={point:i,time:Date.now()},setTimeout((()=>{null!==this.touchPoint&&this.app.startUserTouch(i)}),this.swipeTimeout),this.app.getSettings().mobileScrollSupport||t.preventDefault()}},this.onMouseUp=t=>{const e=this.getMousePos(t.clientX,t.clientY);this.app.userStop(e)},this.onMouseMove=t=>{const e=this.getMousePos(t.clientX,t.clientY);this.app.userMove(e,!1)},this.onTouchMove=t=>{if(t.changedTouches.length>0){const e=t.changedTouches[0],i=this.getMousePos(e.clientX,e.clientY);this.app.getSettings().mobileScrollSupport?(null!==this.touchPoint&&(Math.abs(this.touchPoint.point.x-i.x)>10||"read"!==this.app.getState())&&t.cancelable&&this.app.userMove(i,!0),"read"!==this.app.getState()&&t.preventDefault()):this.app.userMove(i,!0)}},this.onTouchEnd=t=>{if(t.changedTouches.length>0){const e=t.changedTouches[0],i=this.getMousePos(e.clientX,e.clientY);let n=!1;if(null!==this.touchPoint){const t=i.x-this.touchPoint.point.x,e=Math.abs(i.y-this.touchPoint.point.y);Math.abs(t)>this.swipeDistance&&e<2*this.swipeDistance&&Date.now()-this.touchPoint.time0?this.app.flipPrev(this.touchPoint.point.y'),this.wrapper=t.querySelector(".stf__wrapper"),this.app=e;const n=this.app.getSettings().usePortrait?1:2;t.style.minWidth=i.minWidth*n+"px",t.style.minHeight=i.minHeight+"px","fixed"===i.size&&(t.style.minWidth=i.width*n+"px",t.style.minHeight=i.height+"px"),i.autoSize&&(t.style.width="100%",t.style.maxWidth=2*i.maxWidth+"px"),t.style.display="block",window.addEventListener("resize",this.onResize,!1),this.swipeDistance=i.swipeDistance}destroy(){this.app.getSettings().useMouseEvents&&this.removeHandlers(),this.distElement.remove(),this.wrapper.remove()}getDistElement(){return this.distElement}getWrapper(){return this.wrapper}setOrientationStyle(t){this.wrapper.classList.remove("--portrait","--landscape"),"portrait"===t?(this.app.getSettings().autoSize&&(this.wrapper.style.paddingBottom=this.app.getSettings().height/this.app.getSettings().width*100+"%"),this.wrapper.classList.add("--portrait")):(this.app.getSettings().autoSize&&(this.wrapper.style.paddingBottom=this.app.getSettings().height/(2*this.app.getSettings().width)*100+"%"),this.wrapper.classList.add("--landscape")),this.update()}removeHandlers(){window.removeEventListener("resize",this.onResize),this.distElement.removeEventListener("mousedown",this.onMouseDown),this.distElement.removeEventListener("touchstart",this.onTouchStart),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("touchend",this.onTouchEnd)}setHandlers(){window.addEventListener("resize",this.onResize,!1),this.app.getSettings().useMouseEvents&&(this.distElement.addEventListener("mousedown",this.onMouseDown),this.distElement.addEventListener("touchstart",this.onTouchStart),window.addEventListener("mousemove",this.onMouseMove),window.addEventListener("touchmove",this.onTouchMove,{passive:!this.app.getSettings().mobileScrollSupport}),window.addEventListener("mouseup",this.onMouseUp),window.addEventListener("touchend",this.onTouchEnd))}getMousePos(t,e){const i=this.distElement.getBoundingClientRect();return{x:t-i.left,y:e-i.top}}checkTarget(t){return!this.app.getSettings().clickEventForward||!["a","button"].includes(t.tagName.toLowerCase())}}class u extends p{constructor(t,e,i,n){super(t,e,i),this.wrapper.insertAdjacentHTML("afterbegin",'
'),this.distElement=t.querySelector(".stf__block"),this.items=n;for(const r of n)this.distElement.appendChild(r);this.setHandlers()}clear(){for(const t of this.items)this.parentElement.appendChild(t)}updateItems(t){this.removeHandlers(),this.distElement.innerHTML="";for(const e of t)this.distElement.appendChild(e);this.items=t,this.setHandlers()}update(){this.app.getRender().update()}}class g extends p{constructor(t,e,i){super(t,e,i),this.wrapper.innerHTML='',this.canvas=t.querySelectorAll("canvas")[0],this.distElement=this.canvas,this.resizeCanvas(),this.setHandlers()}resizeCanvas(){const t=getComputedStyle(this.canvas),e=parseInt(t.getPropertyValue("width"),10),i=parseInt(t.getPropertyValue("height"),10);this.canvas.width=e,this.canvas.height=i}getCanvas(){return this.canvas}update(){this.resizeCanvas(),this.app.getRender().update()}}class f extends c{constructor(t,e,i){super(t,e),this.outerShadow=null,this.innerShadow=null,this.hardShadow=null,this.hardInnerShadow=null,this.element=i,this.createShadows()}createShadows(){this.element.insertAdjacentHTML("beforeend",'
\n
\n
\n
'),this.outerShadow=this.element.querySelector(".stf__outerShadow"),this.innerShadow=this.element.querySelector(".stf__innerShadow"),this.hardShadow=this.element.querySelector(".stf__hardShadow"),this.hardInnerShadow=this.element.querySelector(".stf__hardInnerShadow")}clearShadow(){super.clearShadow(),this.outerShadow.style.cssText="display: none",this.innerShadow.style.cssText="display: none",this.hardShadow.style.cssText="display: none",this.hardInnerShadow.style.cssText="display: none"}reload(){this.element.querySelector(".stf__outerShadow")||this.createShadows()}drawHardInnerShadow(){const t=this.getRect(),e=this.shadow.progress>100?200-this.shadow.progress:this.shadow.progress;let i=(100-e)*(2.5*t.pageWidth)/100+20;i>t.pageWidth&&(i=t.pageWidth);let n=`\n display: block;\n z-index: ${(this.getSettings().startZIndex+5).toString(10)};\n width: ${i}px;\n height: ${t.height}px;\n background: linear-gradient(to right,\n rgba(0, 0, 0, ${this.shadow.opacity*e/100}) 5%,\n rgba(0, 0, 0, 0) 100%);\n left: ${t.left+t.width/2}px;\n transform-origin: 0 0;\n `;n+=0===this.getDirection()&&this.shadow.progress>100||1===this.getDirection()&&this.shadow.progress<=100?"transform: translate3d(0, 0, 0);":"transform: translate3d(0, 0, 0) rotateY(180deg);",this.hardInnerShadow.style.cssText=n}drawHardOuterShadow(){const t=this.getRect();let e=(100-(this.shadow.progress>100?200-this.shadow.progress:this.shadow.progress))*(2.5*t.pageWidth)/100+20;e>t.pageWidth&&(e=t.pageWidth);let i=`\n display: block;\n z-index: ${(this.getSettings().startZIndex+4).toString(10)};\n width: ${e}px;\n height: ${t.height}px;\n background: linear-gradient(to left, rgba(0, 0, 0, ${this.shadow.opacity}) 5%, rgba(0, 0, 0, 0) 100%);\n left: ${t.left+t.width/2}px;\n transform-origin: 0 0;\n `;i+=0===this.getDirection()&&this.shadow.progress>100||1===this.getDirection()&&this.shadow.progress<=100?"transform: translate3d(0, 0, 0) rotateY(180deg);":"transform: translate3d(0, 0, 0);",this.hardShadow.style.cssText=i}drawInnerShadow(){const t=this.getRect(),e=3*this.shadow.width/4,i=0===this.getDirection()?e:0,n=0===this.getDirection()?"to left":"to right",r=this.convertToGlobal(this.shadow.pos),s=this.shadow.angle+3*Math.PI/2,o=[this.pageRect.topLeft,this.pageRect.topRight,this.pageRect.bottomRight,this.pageRect.bottomLeft];let l="polygon( ";for(const c of o){let t=1===this.getDirection()?{x:-c.x+this.shadow.pos.x,y:c.y-this.shadow.pos.y}:{x:c.x-this.shadow.pos.x,y:c.y-this.shadow.pos.y};t=a.GetRotatedPoint(t,{x:i,y:100},s),l+=t.x+"px "+t.y+"px, "}l=l.slice(0,-2),l+=")";const h=`\n display: block;\n z-index: ${(this.getSettings().startZIndex+10).toString(10)};\n width: ${e}px;\n height: ${2*t.height}px;\n background: linear-gradient(${n},\n rgba(0, 0, 0, ${this.shadow.opacity}) 5%,\n rgba(0, 0, 0, 0.05) 15%,\n rgba(0, 0, 0, ${this.shadow.opacity}) 35%,\n rgba(0, 0, 0, 0) 100%);\n transform-origin: ${i}px 100px;\n transform: translate3d(${r.x-i}px, ${r.y-100}px, 0) rotate(${s}rad);\n clip-path: ${l};\n -webkit-clip-path: ${l};\n `;this.innerShadow.style.cssText=h}drawOuterShadow(){const t=this.getRect(),e=this.convertToGlobal({x:this.shadow.pos.x,y:this.shadow.pos.y}),i=this.shadow.angle+3*Math.PI/2,n=1===this.getDirection()?this.shadow.width:0,r=0===this.getDirection()?"to right":"to left",s=[{x:0,y:0},{x:t.pageWidth,y:0},{x:t.pageWidth,y:t.height},{x:0,y:t.height}];let o="polygon( ";for(const h of s)if(null!==h){let t=1===this.getDirection()?{x:-h.x+this.shadow.pos.x,y:h.y-this.shadow.pos.y}:{x:h.x-this.shadow.pos.x,y:h.y-this.shadow.pos.y};t=a.GetRotatedPoint(t,{x:n,y:100},i),o+=t.x+"px "+t.y+"px, "}o=o.slice(0,-2),o+=")";const l=`\n display: block;\n z-index: ${(this.getSettings().startZIndex+10).toString(10)};\n width: ${this.shadow.width}px;\n height: ${2*t.height}px;\n background: linear-gradient(${r}, rgba(0, 0, 0, ${this.shadow.opacity}), rgba(0, 0, 0, 0));\n transform-origin: ${n}px 100px;\n transform: translate3d(${e.x-n}px, ${e.y-100}px, 0) rotate(${i}rad);\n clip-path: ${o};\n -webkit-clip-path: ${o};\n `;this.outerShadow.style.cssText=l}drawLeftPage(){"portrait"!==this.orientation&&null!==this.leftPage&&(1===this.direction&&null!==this.flippingPage&&"hard"===this.flippingPage.getDrawingDensity()?(this.leftPage.getElement().style.zIndex=(this.getSettings().startZIndex+5).toString(10),this.leftPage.setHardDrawingAngle(180+this.flippingPage.getHardAngle()),this.leftPage.draw(this.flippingPage.getDrawingDensity())):this.leftPage.simpleDraw(0))}drawRightPage(){null!==this.rightPage&&(0===this.direction&&null!==this.flippingPage&&"hard"===this.flippingPage.getDrawingDensity()?(this.rightPage.getElement().style.zIndex=(this.getSettings().startZIndex+5).toString(10),this.rightPage.setHardDrawingAngle(180+this.flippingPage.getHardAngle()),this.rightPage.draw(this.flippingPage.getDrawingDensity())):this.rightPage.simpleDraw(1))}drawBottomPage(){if(null===this.bottomPage)return;const t=null!=this.flippingPage?this.flippingPage.getDrawingDensity():null;"portrait"===this.orientation&&1===this.direction||(this.bottomPage.getElement().style.zIndex=(this.getSettings().startZIndex+3).toString(10),this.bottomPage.draw(t))}drawFrame(){this.clear(),this.drawLeftPage(),this.drawRightPage(),this.drawBottomPage(),null!=this.flippingPage&&(this.flippingPage.getElement().style.zIndex=(this.getSettings().startZIndex+5).toString(10),this.flippingPage.draw()),null!=this.shadow&&null!==this.flippingPage&&("soft"===this.flippingPage.getDrawingDensity()?(this.drawOuterShadow(),this.drawInnerShadow()):(this.drawHardOuterShadow(),this.drawHardInnerShadow()))}clear(){for(const t of this.app.getPageCollection().getPages())t!==this.leftPage&&t!==this.rightPage&&t!==this.flippingPage&&t!==this.bottomPage&&(t.getElement().style.cssText="display: none"),t.getTemporaryCopy()!==this.flippingPage&&t.hideTemporaryCopy()}update(){super.update(),null!==this.rightPage&&this.rightPage.setOrientation(1),null!==this.leftPage&&this.leftPage.setOrientation(0)}}class m{constructor(){this._default={startPage:0,size:"fixed",width:0,height:0,minWidth:0,maxWidth:0,minHeight:0,maxHeight:0,drawShadow:!0,flippingTime:1e3,usePortrait:!0,startZIndex:0,autoSize:!0,maxShadowOpacity:1,showCover:!1,mobileScrollSupport:!0,swipeDistance:30,clickEventForward:!0,useMouseEvents:!0,showPageCorners:!0,disableFlipByClick:!1}}getSettings(t){const e=this._default;if(Object.assign(e,t),"stretch"!==e.size&&"fixed"!==e.size)throw new Error('Invalid size type. Available only "fixed" and "stretch" value');if(e.width<=0||e.height<=0)throw new Error("Invalid width or height");if(e.flippingTime<=0)throw new Error("Invalid flipping time");return"stretch"===e.size?(e.minWidth<=0&&(e.minWidth=100),e.maxWidth{this.ui.update(),this.trigger("init",this,{page:this.setting.startPage,mode:this.render.getOrientation()})}),1)}loadFromHTML(t){this.ui=new u(this.block,this,this.setting,t),this.render=new f(this,this.setting,this.ui.getDistElement()),this.flipController=new h(this.render,this),this.pages=new o(this,this.render,this.ui.getDistElement(),t),this.pages.load(),this.render.start(),this.pages.show(this.setting.startPage),setTimeout((()=>{this.ui.update(),this.trigger("init",this,{page:this.setting.startPage,mode:this.render.getOrientation()})}),1)}updateFromImages(t){const e=this.pages.getCurrentPageIndex();this.pages.destroy(),this.pages=new r(this,this.render,t),this.pages.load(),this.pages.show(e),this.trigger("update",this,{page:e,mode:this.render.getOrientation()})}updateFromHtml(t){const e=this.pages.getCurrentPageIndex();this.pages.destroy(),this.pages=new o(this,this.render,this.ui.getDistElement(),t),this.pages.load(),this.ui.updateItems(t),this.render.reload(),this.pages.show(e),this.trigger("update",this,{page:e,mode:this.render.getOrientation()})}clear(){this.pages.destroy(),this.ui.clear()}turnToPrevPage(){this.pages.showPrev()}turnToNextPage(){this.pages.showNext()}turnToPage(t){this.pages.show(t)}flipNext(t="top"){this.flipController.flipNext(t)}flipPrev(t="top"){this.flipController.flipPrev(t)}flip(t,e="top"){this.flipController.flipToPage(t,e)}updateState(t){this.trigger("changeState",this,t)}updatePageIndex(t){this.trigger("flip",this,t)}updateOrientation(t){this.ui.setOrientationStyle(t),this.update(),this.trigger("changeOrientation",this,t)}getPageCount(){return this.pages.getPageCount()}getCurrentPageIndex(){return this.pages.getCurrentPageIndex()}getPage(t){return this.pages.getPage(t)}getRender(){return this.render}getFlipController(){return this.flipController}getOrientation(){return this.render.getOrientation()}getBoundsRect(){return this.render.getRect()}getSettings(){return this.setting}getUI(){return this.ui}getState(){return this.flipController.getState()}getPageCollection(){return this.pages}startUserTouch(t){this.mousePosition=t,this.isUserTouch=!0,this.isUserMove=!1}userMove(t,e){this.isUserTouch||e||!this.setting.showPageCorners?this.isUserTouch&&a.GetDistanceBetweenTwoPoint(this.mousePosition,t)>5&&(this.isUserMove=!0,this.flipController.fold(t)):this.flipController.showCorner(t)}userStop(t,e=!1){this.isUserTouch&&(this.isUserTouch=!1,e||(this.isUserMove?this.flipController.stopMove():this.flipController.flip(t)))}},Object.defineProperty(t,"__esModule",{value:!0})}(e)}(0,Q);const Z=a({name:"the-book",props:{bookData:{type:Object,default:()=>({})},tab:{type:String,default:""},show:{type:Boolean,default:!1},rect:{type:Object,default:()=>({})}},emits:["close"],setup(t,{emit:e}){var i,n,r,a;m(),console.log(v.user.data.phone);const d="lastTime"+(null!==(i=null===(n=v)||void 0===n||null===(r=n.user)||void 0===r||null===(a=r.data)||void 0===a?void 0:a.phone)&&void 0!==i?i:""),p=l({show:!1,width:0,height:0,transform:"",list:[],lastTime:localStorage.getItem(d)}),f=h(!1),A=function(){var t=s((function*(){console.log("初始化完成")}));return function(){return t.apply(this,arguments)}}();const P=()=>{clearTimeout(null);const t=document.querySelector(".bookWrap");null.turn("page",1),t&&(t.style.transform=p.transform),e("close"),setTimeout((()=>{t.style.transition="",t.style.transform="",p.show=!1,p.list=[]}),1e3)};c(s((function*(){yield A(),y("webViewOnResume",(()=>{p.lastTime=localStorage.getItem(d)}))})));x((()=>t.show),(()=>{t.show&&((()=>{var e;if(null===(e=t.bookData)||void 0===e||!e.lessonList)return;const i=Math.floor((.8*document.body.clientHeight-40)/50);console.log("🚀 ~ step:",i);const n=[];let r=[];for(let a=0;a=i?(n.push([...r]),r=[{name:e.name}]):r.push({name:e.name});for(let t=0;t=i?(n.push([...r]),r=[e.knowledgeList[t]]):r.push(e.knowledgeList[t])}r.length&&n.push(r),p.list=n})(),w((()=>{(()=>{const t=.8*document.body.clientHeight;p.height=t,p.width=t*(210/297)*2,p.show=!0,w((()=>{const t=document.getElementById("flipbook");new Q.PageFlip(t,{width:p.width/2,height:p.height,showCover:!0}).loadFromHTML(document.querySelectorAll(".page"))}))})()})))}));return()=>o("div",{class:[K.book,p.show?"":K.bookHide]},[o("div",{class:K.back,onClick:P},[o("img",{src:V},null)]),o("div",{class:"bookWrap",style:{width:p.width+"px"}},[!!p.list.length&&o("div",{id:"flipbook"},[o("div",{class:"page","data-density":"hard"},[o("img",{style:"width: 100%; height: 100%; object-fit: cover;",src:t.bookData.coverImg},null)]),p.list.map((e=>o("div",{class:"page"},[o("div",{class:K.wrap},[o("div",{class:K.wrapItem},[e.map(((e,i)=>o(g,null,[o("div",{class:[K.item,e.id&&K.des],onTouchstart:t=>{t.stopPropagation()},onClick:i=>{i.stopPropagation(),(e=>{if(e.id){if(!e.containMaterial)return void b("暂无资源");localStorage.setItem(d,e.id);const i=F.stringify({id:e.id,lessonCoursewareId:e.lessonCoursewareId,lessonCoursewareDetailId:e.lessonCoursewareDetailId,name:e.name,tab:t.tab}),n=location.origin+location.pathname+"#/courseware-play?"+i;console.log("🚀 ~ url:",n),_({api:"openWebView",content:{url:n,orientation:0,isHideTitle:!1,c_orientation:0}})}})(e)}},[e.id?o("img",{id:1==i?"coursewareDetail-0":"",class:K.icon,src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAKKADAAQAAAABAAAAKAAAAAB65masAAAFDElEQVRYCcWZy24cRRSGT3XPxbHj+MIlwXLCJkJKkLJmzSICicfIhi0Pwg55k9dASF6AxAOwQAIhgRRkQpwQRMaZxjOeme7i/8+pmqtlVwMzLqlVl66u+uo/p0731DiZS/6s+754eYTmhyL+DsrX57r892obQzon0nkmUlUF5jnCoIcizcfujXd+mJ4AvSx571tyVnyO2qfifRbbl5K3NwCIKU5eiJSDyRTOVagcyM7+Z845vaGAAe4rgH046b3EUuuaSNYQOX0l0oeAC8l9Lbv7HxPSlKJyq4IjTFkaUgtKnpsg1KuntKa44HPfL92sMyAwnJoZefGXyODvmbtaobl940GmG2LZPrcwvZ/43saOSKO10MMEGz6iibFbryCNsAfKke3mzbdN0UWMh873X3eXEkoWJzu/pYkNk2PDMJVDmPtUhPAV/dQVzvdeQ+8rTjlMTDMzNs6lgD7XmlTFukZ9XEPx1UA8Vu0rlGG2CkpU2KllWUnlR8i9lJWXUVXJta1bcuOt27MzMBbyypsWfhgjA2w64M9firz8EdIT6gwvAEzqGlJlTSmlgXLTymgrxcoVy2zHpX2Rd4tiETDi0sS8plIiINT67Vu8kezJyuU6KQHsAgQgWfaA8Ch7vWftpfYnLPr4RTNO8SwUEwHDcxjbS6Yg40mpngAYbwYqWY3LOYC4kLgIgybkN0/gBhjpvd1cbm/Zu2KBLDSkA3oPVUy5aC6aNyrH3ANyUg/3CA0ohScs6s8LvnKxWF/+j4CAU6WQm/kAS7W0DhiFoGoRCPcIHKAM3u4HcZKyZAVpLvoXFYgKTnKCEsZAI5T2jSaP9/F8nXSxA0yNZGAThQyIZm2JW9sOgKauKQ3goGD0TbZzoXVS8nI4me5QNRkmUvM2ZOv+R9Lc2pM+Pj47v/8kvdPClEY/6xNVxe6Gz3KMGA1SQNMBaVoqgJybw8ydS7Z2Q+dZ296TW7hOOy/kz+MnMuz1gsnNT6m4PV9PwXQTB3PpBlFQbgKoIbNxbX37pty594G8uXcXiyDUrG+qginShT7JCkaTTmKbmXmObzx13myrv9mOByh8T1Vcjg+6MDjVMBNz09Cn5hXswwf/eP5UOt3uJCbyGaqpeT0TJyvICUwNvnttNzIOjgZ9yVvrctYr5OXxr9I5OVHTR19lHtWPz49lTijUADQwew/bjib08S/fSWN9Wwp8BNiHQVBZfS/ERy0HUCyqTkoHxMDxy8XMFXwKn1T9AuZE+Bj72XRflmlaQsIlqGidlNxbgy4m01eWmtvim4Yb1OMrzlwhqm1QsQ9dgs/XScm9LVzQfAYWYxpNHu9FECo53r1UEFf0Qy6gTkruHb9UxmCMi/wwBTBhDCCYE/W4EDUv6hGept5slfiSEXn3kk8tLiQZUFWCD2l4oYr0qRjbUGbIYZuBTvwxgkUX4InCJ3eT3w/4+kxMa7v7AAgbI4AZ1JRqhOSlChps3DhqZlUyWRMlq/2rzuPnYIWdWyIv8SMo/hjiacYQZsMt5E6GVYYfSZkMcA418DnacuQNubnh5N7O7O+OizSqDXjRYMu4l+Fdet7x0jLmqj8m2OCD7qj+k6t6wh1xkxyuarp/Mc/hFR2/JaDy+M3Jg8y1N3kmfJDwyKq7HJBNP4dXfgR82VIdjoDb1ydHwHpgjQYc2HyBy35VXzbIMu6rWcEQ4DjF7A8KNKzkb4jpxWmY00hyCJrHweXGPf4B6HyHtp8LqjYAAAAASUVORK5CYII="},null):null,o("div",{class:K.name,style:{lineHeight:"20Px"}},[e.name,p.lastTime===e.id&&o("span",{class:K.last},[u("上次观看")])])])])))])])]))),p.list.length%2==1&&o("div",{class:"page"},[o("div",{class:K.wrap},[o("div",{class:K.wrapItem},null)])]),o("div",{class:"page","data-density":"hard"},[o("div",{class:K.wrap},[o("div",{class:K.wrapItem,style:{background:"#FFD8A1"}},null)])])])]),f.value?o(Y,null,null):null])}}),$=a({name:"courseware-list",emits:["close"],setup(t,{emit:e}){const i=l({box:{},show:!1,steps:[{ele:"",eleRect:{},img:j("courseware-list1.png"),handStyle:{top:"1.5rem",left:"3.5rem",transform:"rotate(-90deg)"},imgStyle:{top:".7rem",left:"5rem"},btnsStyle:{top:"3.5rem",left:"6.2rem"},boxStyle:{},eleRectPadding:{left:-4,top:-4,width:-8,height:-8}},{ele:"",img:j("courseware-list2.png"),handStyle:{top:"-.25rem",left:"1.38rem",transform:"rotate(-90deg)"},imgStyle:{top:"-1.2rem",left:"2.4rem"},btnsStyle:{top:"1.6rem",left:"3.6rem"},eleRectPadding:{left:4,top:4,width:8,height:8}},{ele:"",img:j("courseware-list3.png"),handStyle:{bottom:"-2.1rem",left:"0.66rem"},imgStyle:{top:"1.1rem",left:"-2rem"},btnsStyle:{top:"4.2rem",left:"-0.5rem"},eleRectPadding:{left:4,top:4,width:8,height:8}},{ele:"",img:j("courseware-list4.png"),handStyle:{top:".8rem",left:"1rem"},imgStyle:{top:"1.1rem",left:"-4.6rem"},btnsStyle:{top:"4rem",left:"-4.5rem","justify-content":"center",padding:0}}],step:0}),r=h(!1),a=h({}),m=function(){var t=s((function*(){try{const e=yield B({guideTag:"guideInfo"});var t;if(e.data)a.value=JSON.parse(null===(t=e.data)||void 0===t?void 0:t.guideValue)||null;else a.value={};a.value&&a.value.courseware?r.value=!1:r.value=!0}catch(e){console.log(e)}}));return function(){return t.apply(this,arguments)}}();m();const v=()=>{const t=document.getElementById(`courseware-${i.step}`);if(t){var e,n,r,a;const s=t.getBoundingClientRect(),o=(null===(e=i.steps[i.step].eleRectPadding)||void 0===e?void 0:e.left)||0,l=(null===(n=i.steps[i.step].eleRectPadding)||void 0===n?void 0:n.top)||0,h=(null===(r=i.steps[i.step].eleRectPadding)||void 0===r?void 0:r.width)||0,c=(null===(a=i.steps[i.step].eleRectPadding)||void 0===a?void 0:a.height)||0;i.box={left:s.x-o+"px",top:s.y-l+"px",width:s.width+h+"px",height:s.height+c+"px"}}else x()};c((()=>{v(),window.addEventListener("resize",y)}));const y=()=>{v()};d((()=>{window.removeEventListener("resize",y)}));const x=()=>{i.step>=3?w():(i.step=i.step+1,v())},w=function(){var t=s((function*(){a.value?a.value.courseware=!0:a.value={courseware:!0};try{yield R({guideTag:"guideInfo",guideValue:JSON.stringify(a.value)})}catch(t){console.log(t)}r.value=!1}));return function(){return t.apply(this,arguments)}}();return()=>o(p,{teleport:"body",overlay:!1,closeOnClickOverlay:!1,class:["popup-custom",O.guidePopup],show:r.value,"onUpdate:show":t=>r.value=t},{default:()=>[o("div",{class:O.content,onClick:()=>x()},[i.step!=i.steps.length-1&&o("div",{class:O.backBtn,onClick:t=>{t.stopPropagation(),w()}},[u("跳过")]),o("div",{class:O.box,style:n(n({},i.box),i.steps[i.step].boxStyle),id:`modeType-${i.step}`},[i.steps.map(((t,e)=>{var n,r;return o("div",{onClick:t=>t.stopPropagation(),class:O.item,style:{display:e===i.step?"":"none",left:`${null===(n=t.eleRect)||void 0===n?void 0:n.left}px`,top:`${null===(r=t.eleRect)||void 0===r?void 0:r.top}px`}},[o("img",{class:O.img,style:t.imgStyle,src:t.img},null),o("img",{class:O.iconHead,style:t.handStyle,src:j("indexDot.png")},null),o("div",{class:O.btns,style:t.btnsStyle},[i.step+1==i.steps.length?o(g,null,[o(f,{class:[O.btn],round:!0,type:"primary",onClick:()=>w()},{default:()=>[u("完成")]}),o(f,{class:[O.btn,O.endBtn],round:!0,color:"transparent",style:{"border-color":"#fff"},type:"primary",onClick:()=>{i.step=0,v()}},{default:()=>[u("再看一遍")]})]):o(f,{class:O.btn,round:!0,type:"primary",onClick:()=>x()},{default:()=>[u("下一步 ("),i.step+1,u("/"),i.steps.length,u(")")]})])])}))])])]})}});/*! jQuery v1.7 jquery.com | jquery.org/license */!function(t,e){function i(t){return E.isWindow(t)?t:9===t.nodeType&&(t.defaultView||t.parentWindow)}function n(t){if(!de[t]){var e=C.body,i=E("<"+t+">").appendTo(e),n=i.css("display");i.remove(),"none"!==n&&""!==n||(oe||((oe=C.createElement("iframe")).frameBorder=oe.width=oe.height=0),e.appendChild(oe),le&&oe.createElement||((le=(oe.contentWindow||oe.contentDocument).document).write(("CSS1Compat"===C.compatMode?"":"")+""),le.close()),i=le.createElement(t),le.body.appendChild(i),n=E.css(i,"display"),e.removeChild(oe)),de[t]=n}return de[t]}function r(t,e){var i={};return E.each(ge.concat.apply([],ge.slice(0,e)),(function(){i[this]=t})),i}function a(){ce=e}function s(){return setTimeout(a,0),ce=E.now()}function o(){try{return new t.XMLHttpRequest}catch(e){}}function l(t,e,i,n){if(E.isArray(e))E.each(e,(function(e,r){i||Rt.test(t)?n(t,r):l(t+"["+("object"==typeof r||E.isArray(r)?e:"")+"]",r,i,n)}));else if(i||null==e||"object"!=typeof e)n(t,e);else for(var r in e)l(t+"["+r+"]",e[r],i,n)}function h(t,i){var n,r,a=E.ajaxSettings.flatOptions||{};for(n in i)i[n]!==e&&((a[n]?t:r||(r={}))[n]=i[n]);r&&E.extend(!0,t,r)}function c(t,i,n,r,a,s){(s=s||{})[a=a||i.dataTypes[0]]=!0;for(var o,l=t[a],h=0,d=l?l.length:0,p=t===Jt;h0?("border"!==i&&E.each(r,(function(){i||(n-=parseFloat(E.css(t,"padding"+this))||0),"margin"===i?n+=parseFloat(E.css(t,i+this))||0:n-=parseFloat(E.css(t,"border"+this+"Width"))||0})),n+"px"):(((n=Pt(t,e,e))<0||null==n)&&(n=t.style[e]||0),n=parseFloat(n)||0,i&&E.each(r,(function(){n+=parseFloat(E.css(t,"padding"+this))||0,"padding"!==i&&(n+=parseFloat(E.css(t,"border"+this+"Width"))||0),"margin"===i&&(n+=parseFloat(E.css(t,i+this))||0)})),n+"px")}function u(t,e){e.src?E.ajax({url:e.src,async:!1,dataType:"script"}):E.globalEval((e.text||e.textContent||e.innerHTML||"").replace(bt,"/*$0*/")),e.parentNode&&e.parentNode.removeChild(e)}function g(t){var e=(t.nodeName||"").toLowerCase();"input"===e?f(t):"script"!==e&&void 0!==t.getElementsByTagName&&E.grep(t.getElementsByTagName("input"),f)}function f(t){"checkbox"!==t.type&&"radio"!==t.type||(t.defaultChecked=t.checked)}function m(t){return void 0!==t.getElementsByTagName?t.getElementsByTagName("*"):void 0!==t.querySelectorAll?t.querySelectorAll("*"):[]}function v(t,e){var i;1===e.nodeType&&(e.clearAttributes&&e.clearAttributes(),e.mergeAttributes&&e.mergeAttributes(t),"object"===(i=e.nodeName.toLowerCase())?e.outerHTML=t.outerHTML:"input"!==i||"checkbox"!==t.type&&"radio"!==t.type?"option"===i?e.selected=t.defaultSelected:"input"!==i&&"textarea"!==i||(e.defaultValue=t.defaultValue):(t.checked&&(e.defaultChecked=e.checked=t.checked),e.value!==t.value&&(e.value=t.value)),e.removeAttribute(E.expando))}function y(t,e){if(1===e.nodeType&&E.hasData(t)){var i,n,r,a=E._data(t),s=E._data(e,a),o=a.events;if(o)for(i in delete s.handle,s.events={},o)for(n=0,r=o[i].length;n=0===i}))}function _(t){return!t||!t.parentNode||11===t.parentNode.nodeType}function A(){return!0}function P(){return!1}function S(t,e,i){var n=e+"defer",r=e+"queue",a=e+"mark",s=E._data(t,n);s&&("queue"===i||!E._data(t,r))&&("mark"===i||!E._data(t,a))&&setTimeout((function(){!E._data(t,r)&&!E._data(t,a)&&(E.removeData(t,n,!0),s.fire())}),0)}function T(t){for(var e in t)if(("data"!==e||!E.isEmptyObject(t[e]))&&"toJSON"!==e)return!1;return!0}function k(t,i,n){if(n===e&&1===t.nodeType){var r="data-"+i.replace(F,"-$1").toLowerCase();if("string"==typeof(n=t.getAttribute(r))){try{n="true"===n||"false"!==n&&("null"===n?null:E.isNumeric(n)?parseFloat(n):L.test(n)?E.parseJSON(n):n)}catch(N){}E.data(t,i,n)}else n=e}return n}var C=t.document,M=t.navigator,D=t.location,E=function(){function i(){if(!o.isReady){try{C.documentElement.doScroll("left")}catch(t){return void setTimeout(i,1)}o.ready()}}var n,r,a,s,o=function(t,e){return new o.fn.init(t,e,n)},l=t.jQuery,h=t.$,c=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,d=/\S/,p=/^\s+/,u=/\s+$/,g=/\d/,f=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,m=/^[\],:{}\s]*$/,v=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,y=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,x=/(?:^|:|,)(?:\s*\[)+/g,w=/(webkit)[ \/]([\w.]+)/,b=/(opera)(?:.*version)?[ \/]([\w.]+)/,_=/(msie) ([\w.]+)/,A=/(mozilla)(?:.*? rv:([\w.]+))?/,P=/-([a-z]|[0-9])/gi,S=/^-ms-/,T=function(t,e){return(e+"").toUpperCase()},k=M.userAgent,D=Object.prototype.toString,E=Object.prototype.hasOwnProperty,N=Array.prototype.push,I=Array.prototype.slice,L=String.prototype.trim,F=Array.prototype.indexOf,j={};return o.fn=o.prototype={constructor:o,init:function(t,i,n){var r,a,s,l;if(!t)return this;if(t.nodeType)return this.context=this[0]=t,this.length=1,this;if("body"===t&&!i&&C.body)return this.context=C,this[0]=C.body,this.selector=t,this.length=1,this;if("string"==typeof t){if((r="<"!==t.charAt(0)||">"!==t.charAt(t.length-1)||t.length<3?c.exec(t):[null,t,null])&&(r[1]||!i)){if(r[1])return l=(i=i instanceof o?i[0]:i)?i.ownerDocument||i:C,(s=f.exec(t))?o.isPlainObject(i)?(t=[C.createElement(s[1])],o.fn.attr.call(t,i,!0)):t=[l.createElement(s[1])]:t=((s=o.buildFragment([r[1]],[l])).cacheable?o.clone(s.fragment):s.fragment).childNodes,o.merge(this,t);if((a=C.getElementById(r[2]))&&a.parentNode){if(a.id!==r[2])return n.find(t);this.length=1,this[0]=a}return this.context=C,this.selector=t,this}return!i||i.jquery?(i||n).find(t):this.constructor(i).find(t)}return o.isFunction(t)?n.ready(t):(t.selector!==e&&(this.selector=t.selector,this.context=t.context),o.makeArray(t,this))},selector:"",jquery:"1.7",length:0,size:function(){return this.length},toArray:function(){return I.call(this,0)},get:function(t){return null==t?this.toArray():t<0?this[this.length+t]:this[t]},pushStack:function(t,e,i){var n=this.constructor();return o.isArray(t)?N.apply(n,t):o.merge(n,t),n.prevObject=this,n.context=this.context,"find"===e?n.selector=this.selector+(this.selector?" ":"")+i:e&&(n.selector=this.selector+"."+e+"("+i+")"),n},each:function(t,e){return o.each(this,t,e)},ready:function(t){return o.bindReady(),a.add(t),this},eq:function(t){return-1===t?this.slice(t):this.slice(t,+t+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(I.apply(this,arguments),"slice",I.call(arguments).join(","))},map:function(t){return this.pushStack(o.map(this,(function(e,i){return t.call(e,i,e)})))},end:function(){return this.prevObject||this.constructor(null)},push:N,sort:[].sort,splice:[].splice},o.fn.init.prototype=o.fn,o.extend=o.fn.extend=function(){var t,i,n,r,a,s,l=arguments[0]||{},h=1,c=arguments.length,d=!1;for("boolean"==typeof l&&(d=l,l=arguments[1]||{},h=2),"object"!=typeof l&&!o.isFunction(l)&&(l={}),c===h&&(l=this,--h);h0)return;a.fireWith(C,[o]),o.fn.trigger&&o(C).trigger("ready").unbind("ready")}},bindReady:function(){if(!a){if(a=o.Callbacks("once memory"),"complete"===C.readyState)return setTimeout(o.ready,1);if(C.addEventListener)C.addEventListener("DOMContentLoaded",s,!1),t.addEventListener("load",o.ready,!1);else if(C.attachEvent){C.attachEvent("onreadystatechange",s),t.attachEvent("onload",o.ready);var e=!1;try{e=null==t.frameElement}catch(M){}C.documentElement.doScroll&&e&&i()}}},isFunction:function(t){return"function"===o.type(t)},isArray:Array.isArray||function(t){return"array"===o.type(t)},isWindow:function(t){return t&&"object"==typeof t&&"setInterval"in t},isNumeric:function(t){return null!=t&&g.test(t)&&!isNaN(t)},type:function(t){return null==t?String(t):j[D.call(t)]||"object"},isPlainObject:function(t){if(!t||"object"!==o.type(t)||t.nodeType||o.isWindow(t))return!1;try{if(t.constructor&&!E.call(t,"constructor")&&!E.call(t.constructor.prototype,"isPrototypeOf"))return!1}catch(C){return!1}var i;for(i in t);return i===e||E.call(t,i)},isEmptyObject:function(t){for(var e in t)return!1;return!0},error:function(t){throw t},parseJSON:function(e){return"string"==typeof e&&e?(e=o.trim(e),t.JSON&&t.JSON.parse?t.JSON.parse(e):m.test(e.replace(v,"@").replace(y,"]").replace(x,""))?new Function("return "+e)():void o.error("Invalid JSON: "+e)):null},parseXML:function(i){var n;try{t.DOMParser?n=(new DOMParser).parseFromString(i,"text/xml"):((n=new ActiveXObject("Microsoft.XMLDOM")).async="false",n.loadXML(i))}catch(h){n=e}return(!n||!n.documentElement||n.getElementsByTagName("parsererror").length)&&o.error("Invalid XML: "+i),n},noop:function(){},globalEval:function(e){e&&d.test(e)&&(t.execScript||function(e){t.eval.call(t,e)})(e)},camelCase:function(t){return t.replace(S,"ms-").replace(P,T)},nodeName:function(t,e){return t.nodeName&&t.nodeName.toUpperCase()===e.toUpperCase()},each:function(t,i,n){var r,a=0,s=t.length,l=s===e||o.isFunction(t);if(n)if(l){for(r in t)if(!1===i.apply(t[r],n))break}else for(;a0&&t[0]&&t[h-1]||0===h||o.isArray(t)))for(;l1?I.call(arguments,0):e,l.notifyWith(h,s)}}function i(t){return function(e){n[t]=arguments.length>1?I.call(arguments,0):e,--o||l.resolveWith(l,n)}}var n=I.call(arguments,0),r=0,a=n.length,s=Array(a),o=a,l=a<=1&&t&&E.isFunction(t.promise)?t:E.Deferred(),h=l.promise();if(a>1){for(;r
a",t=m.getElementsByTagName("*"),e=m.getElementsByTagName("a")[0],!t||!t.length||!e)return{};n=(i=C.createElement("select")).appendChild(C.createElement("option")),r=m.getElementsByTagName("input")[0],s={leadingWhitespace:3===m.firstChild.nodeType,tbody:!m.getElementsByTagName("tbody").length,htmlSerialize:!!m.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:"/a"===e.getAttribute("href"),opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,unknownElems:!!m.getElementsByTagName("nav").length,checkOn:"on"===r.value,optSelected:n.selected,getSetAttribute:"t"!==m.className,enctype:!!C.createElement("form").enctype,submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},r.checked=!0,s.noCloneChecked=r.cloneNode(!0).checked,i.disabled=!0,s.optDisabled=!n.disabled;try{delete m.test}catch(V){s.deleteExpando=!1}for(g in!m.addEventListener&&m.attachEvent&&m.fireEvent&&(m.attachEvent("onclick",(function(){s.noCloneEvent=!1})),m.cloneNode(!0).fireEvent("onclick")),(r=C.createElement("input")).value="t",r.setAttribute("type","radio"),s.radioValue="t"===r.value,r.setAttribute("checked","checked"),m.appendChild(r),(o=C.createDocumentFragment()).appendChild(m.lastChild),s.checkClone=o.cloneNode(!0).cloneNode(!0).lastChild.checked,m.innerHTML="",m.style.width=m.style.paddingLeft="1px",l=C.getElementsByTagName("body")[0],c=C.createElement(l?"div":"body"),d={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},l&&E.extend(d,{position:"absolute",left:"-999px",top:"-999px"}),d)c.style[g]=d[g];if(c.appendChild(m),(h=l||v).insertBefore(c,h.firstChild),s.appendChecked=r.checked,s.boxModel=2===m.offsetWidth,"zoom"in m.style&&(m.style.display="inline",m.style.zoom=1,s.inlineBlockNeedsLayout=2===m.offsetWidth,m.style.display="",m.innerHTML="
",s.shrinkWrapBlocks=2!==m.offsetWidth),m.innerHTML="
t
",f=0===(p=m.getElementsByTagName("td"))[0].offsetHeight,p[0].style.display="",p[1].style.display="none",s.reliableHiddenOffsets=f&&0===p[0].offsetHeight,m.innerHTML="",C.defaultView&&C.defaultView.getComputedStyle&&((a=C.createElement("div")).style.width="0",a.style.marginRight="0",m.appendChild(a),s.reliableMarginRight=0===(parseInt((C.defaultView.getComputedStyle(a,null)||{marginRight:0}).marginRight,10)||0)),m.attachEvent)for(g in{submit:1,change:1,focusin:1})(f=(u="on"+g)in m)||(m.setAttribute(u,"return;"),f="function"==typeof m[u]),s[g+"Bubbles"]=f;return E((function(){var t,e,i,n,r,a="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",o="visibility:hidden;border:0;",h="style='"+a+"border:5px solid #000;padding:0;'",d="
";!(l=C.getElementsByTagName("body")[0])||((t=C.createElement("div")).style.cssText=o+"width:0;height:0;position:static;top:0;margin-top:1px",l.insertBefore(t,l.firstChild),(c=C.createElement("div")).style.cssText=a+o,c.innerHTML=d,t.appendChild(c),i=(e=c.firstChild).firstChild,n=e.nextSibling.firstChild.firstChild,r={doesNotAddBorder:5!==i.offsetTop,doesAddBorderForTableAndCells:5===n.offsetTop},i.style.position="fixed",i.style.top="20px",r.fixedPosition=20===i.offsetTop||15===i.offsetTop,i.style.position=i.style.top="",e.style.overflow="hidden",e.style.position="relative",r.subtractsBorderForOverflowNotVisible=-5===i.offsetTop,r.doesNotIncludeMarginInBodyOffset=1!==l.offsetTop,l.removeChild(t),c=t=null,E.extend(s,r))})),c.innerHTML="",h.removeChild(c),c=o=i=n=l=a=m=r=null,s}(),E.boxModel=E.support.boxModel;var L=/^(?:\{.*\}|\[.*\])$/,F=/([A-Z])/g;E.extend({cache:{},uuid:0,expando:"jQuery"+(E.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(t){return!!(t=t.nodeType?E.cache[t[E.expando]]:t[E.expando])&&!T(t)},data:function(t,i,n,r){if(E.acceptData(t)){var a,s,o;E.expando;var l="string"==typeof i,h=t.nodeType,c=h?E.cache:t,d=h?t[E.expando]:t[E.expando]&&E.expando,p="events"===i;if((!d||!c[d]||!p&&!r&&!c[d].data)&&l&&n===e)return;return d||(h?t[E.expando]=d=++E.uuid:d=E.expando),c[d]||(c[d]={},h||(c[d].toJSON=E.noop)),"object"!=typeof i&&"function"!=typeof i||(r?c[d]=E.extend(c[d],i):c[d].data=E.extend(c[d].data,i)),a=s=c[d],r||(s.data||(s.data={}),s=s.data),n!==e&&(s[E.camelCase(i)]=n),p&&!s[i]?a.events:(l?null==(o=s[i])&&(o=s[E.camelCase(i)]):o=s,o)}},removeData:function(t,e,i){if(E.acceptData(t)){var n,r,a;E.expando;var s=t.nodeType,o=s?E.cache:t,l=s?t[E.expando]:E.expando;if(!o[l])return;if(e&&(n=i?o[l]:o[l].data)){E.isArray(e)||(e in n?e=[e]:e=(e=E.camelCase(e))in n?[e]:e.split(" "));for(r=0,a=e.length;r-1)return!0;return!1},val:function(t){var i,n,r,a=this[0];return arguments.length?(r=E.isFunction(t),this.each((function(n){var a,s=E(this);1===this.nodeType&&(null==(a=r?t.call(this,n,s.val()):t)?a="":"number"==typeof a?a+="":E.isArray(a)&&(a=E.map(a,(function(t){return null==t?"":t+""}))),(i=E.valHooks[this.nodeName.toLowerCase()]||E.valHooks[this.type])&&"set"in i&&i.set(this,a,"value")!==e||(this.value=a))}))):a?(i=E.valHooks[a.nodeName.toLowerCase()]||E.valHooks[a.type])&&"get"in i&&(n=i.get(a,"value"))!==e?n:"string"==typeof(n=a.value)?n.replace(H,""):null==n?"":n:e}}),E.extend({valHooks:{option:{get:function(t){var e=t.attributes.value;return!e||e.specified?t.value:t.text}},select:{get:function(t){var e,i,n,r,a=t.selectedIndex,s=[],o=t.options,l="select-one"===t.type;if(a<0)return null;for(i=l?a:0,n=l?a+1:o.length;i=0})),i.length||(t.selectedIndex=-1),i}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(t,i,n,r){var a,s,o,l=t.nodeType;return t&&3!==l&&8!==l&&2!==l?r&&i in E.attrFn?E(t)[i](n):"getAttribute"in t?((o=1!==l||!E.isXMLDoc(t))&&(i=i.toLowerCase(),s=E.attrHooks[i]||(U.test(i)?O:j)),n!==e?null===n?(E.removeAttr(t,i),e):s&&"set"in s&&o&&(a=s.set(t,n,i))!==e?a:(t.setAttribute(i,""+n),n):s&&"get"in s&&o&&null!==(a=s.get(t,i))?a:null===(a=t.getAttribute(i))?e:a):E.prop(t,i,n):e},removeAttr:function(t,e){var i,n,r,a,s=0;if(1===t.nodeType)for(a=(n=(e||"").split(W)).length;s=0}})}));var X=/^(?:textarea|input|select)$/i,K=/^([^\.]*)?(?:\.(.+))?$/,Y=/\bhover(\.\S+)?/,Q=/^key/,Z=/^(?:mouse|contextmenu)|click/,$=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,J=function(t){var e=$.exec(t);return e&&(e[1]=(e[1]||"").toLowerCase(),e[3]=e[3]&&new RegExp("(?:^|\\s)"+e[3]+"(?:\\s|$)")),e},tt=function(t,e){return(!e[1]||t.nodeName.toLowerCase()===e[1])&&(!e[2]||t.id===e[2])&&(!e[3]||e[3].test(t.className))},et=function(t){return E.event.special.hover?t:t.replace(Y,"mouseenter$1 mouseleave$1")};E.event={add:function(t,i,n,r,a){var s,o,l,h,c,d,p,u,g,f,m;if(3!==t.nodeType&&8!==t.nodeType&&i&&n&&(s=E._data(t))){for(n.handler&&(n=(g=n).handler),n.guid||(n.guid=E.guid++),(l=s.events)||(s.events=l={}),(o=s.handle)||(s.handle=o=function(t){return void 0===E||t&&E.event.triggered===t.type?e:E.event.dispatch.apply(o.elem,arguments)},o.elem=t),i=et(i).split(" "),h=0;h=0&&(m=m.slice(0,-1),o=!0),m.indexOf(".")>=0&&(v=m.split("."),m=v.shift(),v.sort()),(!r||E.event.customEvent[m])&&!E.event.global[m])return;if((i="object"==typeof i?i[E.expando]?i:new E.Event(m,i):new E.Event(m)).type=m,i.isTrigger=!0,i.exclusive=o,i.namespace=v.join("."),i.namespace_re=i.namespace?new RegExp("(^|\\.)"+v.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,d=m.indexOf(":")<0?"on"+m:"",(a||!r)&&i.preventDefault(),!r){for(l in s=E.cache)s[l].events&&s[l].events[m]&&E.event.trigger(i,n,s[l].handle.elem,!0);return}if(i.result=e,i.target||(i.target=r),(n=null!=n?E.makeArray(n):[]).unshift(i),(p=E.event.special[m]||{}).trigger&&!1===p.trigger.apply(r,n))return;if(g=[[r,p.bindType||m]],!a&&!p.noBubble&&!E.isWindow(r)){for(f=p.delegateType||m,c=null,h=r.parentNode;h;h=h.parentNode)g.push([h,f]),c=h;c&&c===r.ownerDocument&&g.push([c.defaultView||c.parentWindow||t,f])}for(l=0;l=0:p===e&&(p=o[d]=c.quick?tt(a,c.quick):E(a).is(d)),p&&h.push(c);h.length&&y.push({elem:a,matches:h})}for(u.length>g&&y.push({elem:this,matches:u.slice(g)}),n=0;n0?this.bind(e,t,i):this.trigger(e)},E.attrFn&&(E.attrFn[e]=!0),Q.test(e)&&(E.event.fixHooks[e]=E.event.keyHooks),Z.test(e)&&(E.event.fixHooks[e]=E.event.mouseHooks)})),function(){function t(t,e,i,n,a,s){for(var o=0,l=n.length;o0){c=h;break}h=h[t]}n[o]=c}}}function i(t,e,i,n,a,s){for(var o=0,l=n.length;o+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,r="sizcache"+(Math.random()+"").replace(".",""),a=0,s=Object.prototype.toString,o=!1,l=!0,h=/\\/g,c=/\r\n/g,d=/\W/;[0,0].sort((function(){return l=!1,0}));var p=function(t,e,i,r){i=i||[];var a=e=e||C;if(1!==e.nodeType&&9!==e.nodeType)return[];if(!t||"string"!=typeof t)return i;var o,l,h,c,d,u,m,v,y=!0,x=p.isXML(e),_=[],A=t;do{if(n.exec(""),(o=n.exec(A))&&(A=o[3],_.push(o[1]),o[2])){c=o[3];break}}while(o);if(_.length>1&&f.exec(t))if(2===_.length&&g.relative[_[0]])l=b(_[0]+_[1],e,r);else for(l=g.relative[_[0]]?[e]:p(_.shift(),e);_.length;)t=_.shift(),g.relative[t]&&(t+=_.shift()),l=b(t,l,r);else if(!r&&_.length>1&&9===e.nodeType&&!x&&g.match.ID.test(_[0])&&!g.match.ID.test(_[_.length-1])&&(e=(d=p.find(_.shift(),e,x)).expr?p.filter(d.expr,d.set)[0]:d.set[0]),e)for(l=(d=r?{expr:_.pop(),set:w(r)}:p.find(_.pop(),1!==_.length||"~"!==_[0]&&"+"!==_[0]||!e.parentNode?e:e.parentNode,x)).expr?p.filter(d.expr,d.set):d.set,_.length>0?h=w(l):y=!1;_.length;)m=u=_.pop(),g.relative[u]?m=_.pop():u="",null==m&&(m=e),g.relative[u](h,m,x);else h=_=[];if(h||(h=l),h||p.error(u||t),"[object Array]"===s.call(h))if(y)if(e&&1===e.nodeType)for(v=0;null!=h[v];v++)h[v]&&(!0===h[v]||1===h[v].nodeType&&p.contains(e,h[v]))&&i.push(l[v]);else for(v=0;null!=h[v];v++)h[v]&&1===h[v].nodeType&&i.push(l[v]);else i.push.apply(i,h);else w(h,i);return c&&(p(c,a,i,r),p.uniqueSort(i)),i};p.uniqueSort=function(t){if(y&&(o=l,t.sort(y),o))for(var e=1;e0},p.find=function(t,e,i){var n,r,a,s,o,l;if(!t)return[];for(r=0,a=g.order.length;r":function(t,e){var i,n="string"==typeof e,r=0,a=t.length;if(n&&!d.test(e)){for(e=e.toLowerCase();r=0)?i||n.push(s):i&&(e[o]=!1));return!1},ID:function(t){return t[1].replace(h,"")},TAG:function(t,e){return t[1].replace(h,"").toLowerCase()},CHILD:function(t){if("nth"===t[1]){t[2]||p.error(t[0]),t[2]=t[2].replace(/^\+|\s*/g,"");var e=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(("even"===t[2]?"2n":"odd"===t[2]&&"2n+1")||!/\D/.test(t[2])&&"0n+"+t[2]||t[2]);t[2]=e[1]+(e[2]||1)-0,t[3]=e[3]-0}else t[2]&&p.error(t[0]);return t[0]=a++,t},ATTR:function(t,e,i,n,r,a){var s=t[1]=t[1].replace(h,"");return!a&&g.attrMap[s]&&(t[1]=g.attrMap[s]),t[4]=(t[4]||t[5]||"").replace(h,""),"~="===t[2]&&(t[4]=" "+t[4]+" "),t},PSEUDO:function(t,e,i,r,a){if("not"===t[1]){if(!((n.exec(t[3])||"").length>1||/^\w/.test(t[3]))){var s=p.filter(t[3],e,i,!0^a);return i||r.push.apply(r,s),!1}t[3]=p(t[3],null,null,e)}else if(g.match.POS.test(t[0])||g.match.CHILD.test(t[0]))return!0;return t},POS:function(t){return t.unshift(!0),t}},filters:{enabled:function(t){return!1===t.disabled&&"hidden"!==t.type},disabled:function(t){return!0===t.disabled},checked:function(t){return!0===t.checked},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},parent:function(t){return!!t.firstChild},empty:function(t){return!t.firstChild},has:function(t,e,i){return!!p(i[3],t).length},header:function(t){return/h\d/i.test(t.nodeName)},text:function(t){var e=t.getAttribute("type"),i=t.type;return"input"===t.nodeName.toLowerCase()&&"text"===i&&(e===i||null===e)},radio:function(t){return"input"===t.nodeName.toLowerCase()&&"radio"===t.type},checkbox:function(t){return"input"===t.nodeName.toLowerCase()&&"checkbox"===t.type},file:function(t){return"input"===t.nodeName.toLowerCase()&&"file"===t.type},password:function(t){return"input"===t.nodeName.toLowerCase()&&"password"===t.type},submit:function(t){var e=t.nodeName.toLowerCase();return("input"===e||"button"===e)&&"submit"===t.type},image:function(t){return"input"===t.nodeName.toLowerCase()&&"image"===t.type},reset:function(t){var e=t.nodeName.toLowerCase();return("input"===e||"button"===e)&&"reset"===t.type},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},input:function(t){return/input|select|textarea|button/i.test(t.nodeName)},focus:function(t){return t===t.ownerDocument.activeElement}},setFilters:{first:function(t,e){return 0===e},last:function(t,e,i,n){return e===n.length-1},even:function(t,e){return e%2==0},odd:function(t,e){return e%2==1},lt:function(t,e,i){return ei[3]-0},nth:function(t,e,i){return i[3]-0===e},eq:function(t,e,i){return i[3]-0===e}},filter:{PSEUDO:function(t,e,i,n){var r=e[1],a=g.filters[r];if(a)return a(t,i,e,n);if("contains"===r)return(t.textContent||t.innerText||u([t])||"").indexOf(e[3])>=0;if("not"===r){for(var s=e[3],o=0,l=s.length;o=0}},ID:function(t,e){return 1===t.nodeType&&t.getAttribute("id")===e},TAG:function(t,e){return"*"===e&&1===t.nodeType||!!t.nodeName&&t.nodeName.toLowerCase()===e},CLASS:function(t,e){return(" "+(t.className||t.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(t,e){var i=e[1],n=p.attr?p.attr(t,i):g.attrHandle[i]?g.attrHandle[i](t):null!=t[i]?t[i]:t.getAttribute(i),r=n+"",a=e[2],s=e[4];return null==n?"!="===a:!a&&p.attr?null!=n:"="===a?r===s:"*="===a?r.indexOf(s)>=0:"~="===a?(" "+r+" ").indexOf(s)>=0:s?"!="===a?r!==s:"^="===a?0===r.indexOf(s):"$="===a?r.substr(r.length-s.length)===s:"|="===a&&(r===s||r.substr(0,s.length+1)===s+"-"):r&&!1!==n},POS:function(t,e,i,n){var r=e[2],a=g.setFilters[r];if(a)return a(t,i,e,n)}}},f=g.match.POS,m=function(t,e){return"\\"+(e-0+1)};for(var v in g.match)g.match[v]=new RegExp(g.match[v].source+/(?![^\[]*\])(?![^\(]*\))/.source),g.leftMatch[v]=new RegExp(/(^(?:.|\r|\n)*?)/.source+g.match[v].source.replace(/\\(\d+)/g,m));var y,x,w=function(t,e){return t=Array.prototype.slice.call(t,0),e?(e.push.apply(e,t),e):t};try{Array.prototype.slice.call(C.documentElement.childNodes,0)[0].nodeType}catch(G){w=function(t,e){var i=0,n=e||[];if("[object Array]"===s.call(t))Array.prototype.push.apply(n,t);else if("number"==typeof t.length)for(var r=t.length;i",n.insertBefore(t,n.firstChild),C.getElementById(i)&&(g.find.ID=function(t,i,n){if(void 0!==i.getElementById&&!n){var r=i.getElementById(t[1]);return r?r.id===t[1]||void 0!==r.getAttributeNode&&r.getAttributeNode("id").nodeValue===t[1]?[r]:e:[]}},g.filter.ID=function(t,e){var i=void 0!==t.getAttributeNode&&t.getAttributeNode("id");return 1===t.nodeType&&i&&i.nodeValue===e}),n.removeChild(t),n=t=null}(),function(){var t=C.createElement("div");t.appendChild(C.createComment("")),t.getElementsByTagName("*").length>0&&(g.find.TAG=function(t,e){var i=e.getElementsByTagName(t[1]);if("*"===t[1]){for(var n=[],r=0;i[r];r++)1===i[r].nodeType&&n.push(i[r]);i=n}return i}),t.innerHTML="",t.firstChild&&void 0!==t.firstChild.getAttribute&&"#"!==t.firstChild.getAttribute("href")&&(g.attrHandle.href=function(t){return t.getAttribute("href",2)}),t=null}(),C.querySelectorAll&&function(){var t=p,e=C.createElement("div");if(e.innerHTML="

",!e.querySelectorAll||0!==e.querySelectorAll(".TEST").length){for(var i in p=function(e,i,n,r){if(i=i||C,!r&&!p.isXML(i)){var a=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(e);if(a&&(1===i.nodeType||9===i.nodeType)){if(a[1])return w(i.getElementsByTagName(e),n);if(a[2]&&g.find.CLASS&&i.getElementsByClassName)return w(i.getElementsByClassName(a[2]),n)}if(9===i.nodeType){if("body"===e&&i.body)return w([i.body],n);if(a&&a[3]){var s=i.getElementById(a[3]);if(!s||!s.parentNode)return w([],n);if(s.id===a[3])return w([s],n)}try{return w(i.querySelectorAll(e),n)}catch(h){}}else if(1===i.nodeType&&"object"!==i.nodeName.toLowerCase()){var o=i,l=i.getAttribute("id"),c=l||"__sizzle__",d=i.parentNode,u=/^\s*[+~]/.test(e);l?c=c.replace(/'/g,"\\$&"):i.setAttribute("id",c),u&&d&&(i=i.parentNode);try{if(!u||d)return w(i.querySelectorAll("[id='"+c+"'] "+e),n)}catch(v){}finally{l||o.removeAttribute("id")}}}return t(e,i,n,r)},t)p[i]=t[i];e=null}}(),function(){var t=C.documentElement,e=t.matchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||t.msMatchesSelector;if(e){var i=!e.call(C.createElement("div"),"div"),n=!1;try{e.call(C.documentElement,"[test!='']:sizzle")}catch(E){n=!0}p.matchesSelector=function(t,r){if(r=r.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']"),!p.isXML(t))try{if(n||!g.match.PSEUDO.test(r)&&!/!=/.test(r)){var a=e.call(t,r);if(a||!i||t.document&&11!==t.document.nodeType)return a}}catch(s){}return p(r,null,null,[t]).length>0}}}(),function(){var t=C.createElement("div");if(t.innerHTML="
",t.getElementsByClassName&&0!==t.getElementsByClassName("e").length){if(t.lastChild.className="e",1===t.getElementsByClassName("e").length)return;g.order.splice(1,0,"CLASS"),g.find.CLASS=function(t,e,i){if(void 0!==e.getElementsByClassName&&!i)return e.getElementsByClassName(t[1])},t=null}}(),C.documentElement.contains?p.contains=function(t,e){return t!==e&&(!t.contains||t.contains(e))}:C.documentElement.compareDocumentPosition?p.contains=function(t,e){return!!(16&t.compareDocumentPosition(e))}:p.contains=function(){return!1},p.isXML=function(t){var e=(t?t.ownerDocument||t:0).documentElement;return!!e&&"HTML"!==e.nodeName};var b=function(t,e,i){for(var n,r=[],a="",s=e.nodeType?[e]:e;n=g.match.PSEUDO.exec(t);)a+=n[0],t=t.replace(g.match.PSEUDO,"");t=g.relative[t]?t+"*":t;for(var o=0,l=s.length;o0)for(a=r;a=0:E.filter(t,this).length>0:this.filter(t).length>0)},closest:function(t,e){var i,n,r=[],a=this[0];if(E.isArray(t)){for(var s=1;a&&a.ownerDocument&&a!==e;){for(i=0;i-1:E.find.matchesSelector(a,t)){r.push(a);break}if(!(a=a.parentNode)||!a.ownerDocument||a===e||11===a.nodeType)break}return r=r.length>1?E.unique(r):r,this.pushStack(r,"closest",t)},index:function(t){return t?"string"==typeof t?E.inArray(this[0],E(t)):E.inArray(t.jquery?t[0]:t,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(t,e){var i="string"==typeof t?E(t,e):E.makeArray(t&&t.nodeType?[t]:t),n=E.merge(this.get(),i);return this.pushStack(_(i[0])||_(n[0])?n:E.unique(n))},andSelf:function(){return this.add(this.prevObject)}}),E.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return E.dir(t,"parentNode")},parentsUntil:function(t,e,i){return E.dir(t,"parentNode",i)},next:function(t){return E.nth(t,2,"nextSibling")},prev:function(t){return E.nth(t,2,"previousSibling")},nextAll:function(t){return E.dir(t,"nextSibling")},prevAll:function(t){return E.dir(t,"previousSibling")},nextUntil:function(t,e,i){return E.dir(t,"nextSibling",i)},prevUntil:function(t,e,i){return E.dir(t,"previousSibling",i)},siblings:function(t){return E.sibling(t.parentNode.firstChild,t)},children:function(t){return E.sibling(t.firstChild)},contents:function(t){return E.nodeName(t,"iframe")?t.contentDocument||t.contentWindow.document:E.makeArray(t.childNodes)}},(function(t,e){E.fn[t]=function(i,n){var r=E.map(this,e,i),a=st.call(arguments);return it.test(t)||(n=i),n&&"string"==typeof n&&(r=E.filter(n,r)),r=this.length>1&&!lt[t]?E.unique(r):r,(this.length>1||rt.test(n))&&nt.test(t)&&(r=r.reverse()),this.pushStack(r,t,a.join(","))}})),E.extend({filter:function(t,e,i){return i&&(t=":not("+t+")"),1===e.length?E.find.matchesSelector(e[0],t)?[e[0]]:[]:E.find.matches(t,e)},dir:function(t,i,n){for(var r=[],a=t[i];a&&9!==a.nodeType&&(n===e||1!==a.nodeType||!E(a).is(n));)1===a.nodeType&&r.push(a),a=a[i];return r},nth:function(t,e,i,n){e=e||1;for(var r=0;t&&(1!==t.nodeType||++r!==e);t=t[i]);return t},sibling:function(t,e){for(var i=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&i.push(t);return i}});var ht="abbr article aside audio canvas datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",ct=/ jQuery\d+="(?:\d+|null)"/g,dt=/^\s+/,pt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,ut=/<([\w:]+)/,gt=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},At=w(C);_t.optgroup=_t.option,_t.tbody=_t.tfoot=_t.colgroup=_t.caption=_t.thead,_t.th=_t.td,E.support.htmlSerialize||(_t._default=[1,"div
","
"]),E.fn.extend({text:function(t){return E.isFunction(t)?this.each((function(e){var i=E(this);i.text(t.call(this,e,i.text()))})):"object"!=typeof t&&t!==e?this.empty().append((this[0]&&this[0].ownerDocument||C).createTextNode(t)):E.text(this)},wrapAll:function(t){if(E.isFunction(t))return this.each((function(e){E(this).wrapAll(t.call(this,e))}));if(this[0]){var e=E(t,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&e.insertBefore(this[0]),e.map((function(){for(var t=this;t.firstChild&&1===t.firstChild.nodeType;)t=t.firstChild;return t})).append(this)}return this},wrapInner:function(t){return E.isFunction(t)?this.each((function(e){E(this).wrapInner(t.call(this,e))})):this.each((function(){var e=E(this),i=e.contents();i.length?i.wrapAll(t):e.append(t)}))},wrap:function(t){return this.each((function(){E(this).wrapAll(t)}))},unwrap:function(){return this.parent().each((function(){E.nodeName(this,"body")||E(this).replaceWith(this.childNodes)})).end()},append:function(){return this.domManip(arguments,!0,(function(t){1===this.nodeType&&this.appendChild(t)}))},prepend:function(){return this.domManip(arguments,!0,(function(t){1===this.nodeType&&this.insertBefore(t,this.firstChild)}))},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,(function(t){this.parentNode.insertBefore(t,this)}));if(arguments.length){var t=E(arguments[0]);return t.push.apply(t,this.toArray()),this.pushStack(t,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,(function(t){this.parentNode.insertBefore(t,this.nextSibling)}));if(arguments.length){var t=this.pushStack(this,"after",arguments);return t.push.apply(t,E(arguments[0]).toArray()),t}},remove:function(t,e){for(var i,n=0;null!=(i=this[n]);n++)t&&!E.filter(t,[i]).length||(!e&&1===i.nodeType&&(E.cleanData(i.getElementsByTagName("*")),E.cleanData([i])),i.parentNode&&i.parentNode.removeChild(i));return this},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)for(1===t.nodeType&&E.cleanData(t.getElementsByTagName("*"));t.firstChild;)t.removeChild(t.firstChild);return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map((function(){return E.clone(this,t,e)}))},html:function(t){if(t===e)return this[0]&&1===this[0].nodeType?this[0].innerHTML.replace(ct,""):null;if("string"!=typeof t||mt.test(t)||!E.support.leadingWhitespace&&dt.test(t)||_t[(ut.exec(t)||["",""])[1].toLowerCase()])E.isFunction(t)?this.each((function(e){var i=E(this);i.html(t.call(this,e,i.html()))})):this.empty().append(t);else{t=t.replace(pt,"<$1>");try{for(var i=0,n=this.length;i1&&c0?this.clone(!0):this).get();E(r[s])[e](l),n=n.concat(l)}return this.pushStack(n,t,r.selector)}})),E.extend({clone:function(t,e,i){var n,r,a,s=t.cloneNode(!0);if(!(E.support.noCloneEvent&&E.support.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||E.isXMLDoc(t)))for(v(t,s),n=m(t),r=m(s),a=0;n[a];++a)r[a]&&v(n[a],r[a]);if(e&&(y(t,s),i))for(n=m(t),r=m(s),a=0;n[a];++a)y(n[a],r[a]);return n=r=null,s},clean:function(t,e,i,n){var r;void 0===(e=e||C).createElement&&(e=e.ownerDocument||e[0]&&e[0].ownerDocument||C);for(var a,s,o=[],l=0;null!=(s=t[l]);l++)if("number"==typeof s&&(s+=""),s){if("string"==typeof s)if(ft.test(s)){s=s.replace(pt,"<$1>");var h=(ut.exec(s)||["",""])[1].toLowerCase(),c=_t[h]||_t._default,d=c[0],p=e.createElement("div");for(e===C?At.appendChild(p):w(e).appendChild(p),p.innerHTML=c[1]+s+c[2];d--;)p=p.lastChild;if(!E.support.tbody){var u=gt.test(s),f="table"!==h||u?""!==c[1]||u?[]:p.childNodes:p.firstChild&&p.firstChild.childNodes;for(a=f.length-1;a>=0;--a)E.nodeName(f[a],"tbody")&&!f[a].childNodes.length&&f[a].parentNode.removeChild(f[a])}!E.support.leadingWhitespace&&dt.test(s)&&p.insertBefore(e.createTextNode(dt.exec(s)[0]),p.firstChild),s=p.childNodes}else s=e.createTextNode(s);var m;if(!E.support.appendChecked)if(s[0]&&"number"==typeof(m=s.length))for(a=0;a=0?e+"px":void 0:e}}})),E.support.opacity||(E.cssHooks.opacity={get:function(t,e){return Ct.test((e&&t.currentStyle?t.currentStyle.filter:t.style.filter)||"")?parseFloat(RegExp.$1)/100+"":e?"1":""},set:function(t,e){var i=t.style,n=t.currentStyle,r=E.isNumeric(e)?"alpha(opacity="+100*e+")":"",a=n&&n.filter||i.filter||"";i.zoom=1,e>=1&&""===E.trim(a.replace(kt,""))&&(i.removeAttribute("filter"),n&&!n.filter)||(i.filter=kt.test(a)?a.replace(kt,r):a+" "+r)}}),E((function(){E.support.reliableMarginRight||(E.cssHooks.marginRight={get:function(t,e){var i;return E.swap(t,{display:"inline-block"},(function(){i=e?Pt(t,"margin-right","marginRight"):t.style.marginRight})),i}})})),C.defaultView&&C.defaultView.getComputedStyle&&(St=function(t,i){var n,r,a;return i=i.replace(Mt,"-$1").toLowerCase(),(r=t.ownerDocument.defaultView)?((a=r.getComputedStyle(t,null))&&(""===(n=a.getPropertyValue(i))&&!E.contains(t.ownerDocument.documentElement,t)&&(n=E.style(t,i))),n):e}),C.documentElement.currentStyle&&(Tt=function(t,e){var i,n,r,a=t.currentStyle&&t.currentStyle[e],s=t.style;return null===a&&s&&(r=s[e])&&(a=r),!Dt.test(a)&&Et.test(a)&&(i=s.left,(n=t.runtimeStyle&&t.runtimeStyle.left)&&(t.runtimeStyle.left=t.currentStyle.left),s.left="fontSize"===e?"1em":a||0,a=s.pixelLeft+"px",s.left=i,n&&(t.runtimeStyle.left=n)),""===a?"auto":a}),Pt=St||Tt,E.expr&&E.expr.filters&&(E.expr.filters.hidden=function(t){var e=t.offsetWidth,i=t.offsetHeight;return 0===e&&0===i||!E.support.reliableHiddenOffsets&&"none"===(t.style&&t.style.display||E.css(t,"display"))},E.expr.filters.visible=function(t){return!E.expr.filters.hidden(t)});var jt,Ot,Bt=/%20/g,Rt=/\[\]$/,Wt=/\r?\n/g,Ht=/#.*$/,zt=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,qt=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,Gt=/^(?:GET|HEAD)$/,Ut=/^\/\//,Vt=/\?/,Xt=/)<[^<]*)*<\/script>/gi,Kt=/^(?:select|textarea)/i,Yt=/\s+/,Qt=/([?&])_=[^&]*/,Zt=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,$t=E.fn.load,Jt={},te={},ee=["*/"]+["*"];try{jt=D.href}catch(ve){(jt=C.createElement("a")).href="",jt=jt.href}Ot=Zt.exec(jt.toLowerCase())||[],E.fn.extend({load:function(t,i,n){if("string"!=typeof t&&$t)return $t.apply(this,arguments);if(!this.length)return this;var r=t.indexOf(" ");if(r>=0){var a=t.slice(r,t.length);t=t.slice(0,r)}var s="GET";i&&(E.isFunction(i)?(n=i,i=e):"object"==typeof i&&(i=E.param(i,E.ajaxSettings.traditional),s="POST"));var o=this;return E.ajax({url:t,type:s,dataType:"html",data:i,complete:function(t,e,i){i=t.responseText,t.isResolved()&&(t.done((function(t){i=t})),o.html(a?E("
").append(i.replace(Xt,"")).find(a):i)),n&&o.each(n,[i,e,t])}}),this},serialize:function(){return E.param(this.serializeArray())},serializeArray:function(){return this.map((function(){return this.elements?E.makeArray(this.elements):this})).filter((function(){return this.name&&!this.disabled&&(this.checked||Kt.test(this.nodeName)||qt.test(this.type))})).map((function(t,e){var i=E(this).val();return null==i?null:E.isArray(i)?E.map(i,(function(t,i){return{name:e.name,value:t.replace(Wt,"\r\n")}})):{name:e.name,value:i.replace(Wt,"\r\n")}})).get()}}),E.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),(function(t,e){E.fn[e]=function(t){return this.bind(e,t)}})),E.each(["get","post"],(function(t,i){E[i]=function(t,n,r,a){return E.isFunction(n)&&(a=a||r,r=n,n=e),E.ajax({type:i,url:t,data:n,success:r,dataType:a})}})),E.extend({getScript:function(t,i){return E.get(t,e,i,"script")},getJSON:function(t,e,i){return E.get(t,e,i,"json")},ajaxSetup:function(t,e){return e?h(t,E.ajaxSettings):(e=t,t=E.ajaxSettings),h(t,e),t},ajaxSettings:{url:jt,isLocal:/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/.test(Ot[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":ee},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":t.String,"text html":!0,"text json":E.parseJSON,"text xml":E.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:d(Jt),ajaxTransport:d(te),ajax:function(t,i){function n(t,i,n,s){if(2!==b){b=2,l&&clearTimeout(l),o=e,a=s||"",_.readyState=t>0?4:0;var h,c,p,x,w,A=i,P=n?function(t,i,n){var r,a,s,o,l=t.contents,h=t.dataTypes,c=t.responseFields;for(a in c)a in n&&(i[c[a]]=n[a]);for(;"*"===h[0];)h.shift(),r===e&&(r=t.mimeType||i.getResponseHeader("content-type"));if(r)for(a in l)if(l[a]&&l[a].test(r)){h.unshift(a);break}if(h[0]in n)s=h[0];else{for(a in n){if(!h[0]||t.converters[a+" "+h[0]]){s=a;break}o||(o=a)}s=s||o}if(s)return s!==h[0]&&h.unshift(s),n[s]}(u,_,n):e;if(t>=200&&t<300||304===t)if(u.ifModified&&((x=_.getResponseHeader("Last-Modified"))&&(E.lastModified[r]=x),(w=_.getResponseHeader("Etag"))&&(E.etag[r]=w)),304===t)A="notmodified",h=!0;else try{c=function(t,i){t.dataFilter&&(i=t.dataFilter(i,t.dataType));var n,r,a,s,o,l,h,c,d=t.dataTypes,p={},u=d.length,g=d[0];for(n=1;n0&&(l=setTimeout((function(){_.abort("timeout")}),u.timeout));try{b=1,o.send(x,n)}catch(S){b<2?n(-1,S):E.error(S)}}else n(-1,"No Transport");return _},param:function(t,i){var n=[],r=function(t,e){e=E.isFunction(e)?e():e,n[n.length]=encodeURIComponent(t)+"="+encodeURIComponent(e)};if(i===e&&(i=E.ajaxSettings.traditional),E.isArray(t)||t.jquery&&!E.isPlainObject(t))E.each(t,(function(){r(this.name,this.value)}));else for(var a in t)l(a,t[a],i,r);return n.join("&").replace(Bt,"+")}}),E.extend({active:0,lastModified:{},etag:{}});var ie=E.now(),ne=/(\=)\?(&|$)|\?\?/i;E.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return E.expando+"_"+ie++}}),E.ajaxPrefilter("json jsonp",(function(e,i,n){var r="application/x-www-form-urlencoded"===e.contentType&&"string"==typeof e.data;if("jsonp"===e.dataTypes[0]||!1!==e.jsonp&&(ne.test(e.url)||r&&ne.test(e.data))){var a,s=e.jsonpCallback=E.isFunction(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,o=t[s],l=e.url,h=e.data,c="$1"+s+"$2";return!1!==e.jsonp&&(l=l.replace(ne,c),e.url===l&&(r&&(h=h.replace(ne,c)),e.data===h&&(l+=(/\?/.test(l)?"&":"?")+e.jsonp+"="+s))),e.url=l,e.data=h,t[s]=function(t){a=[t]},n.always((function(){t[s]=o,a&&E.isFunction(o)&&t[s](a[0])})),e.converters["script json"]=function(){return a||E.error(s+" was not called"),a[0]},e.dataTypes[0]="json","script"}})),E.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(t){return E.globalEval(t),t}}}),E.ajaxPrefilter("script",(function(t){t.cache===e&&(t.cache=!1),t.crossDomain&&(t.type="GET",t.global=!1)})),E.ajaxTransport("script",(function(t){if(t.crossDomain){var i,n=C.head||C.getElementsByTagName("head")[0]||C.documentElement;return{send:function(r,a){(i=C.createElement("script")).async="async",t.scriptCharset&&(i.charset=t.scriptCharset),i.src=t.url,i.onload=i.onreadystatechange=function(t,r){(r||!i.readyState||/loaded|complete/.test(i.readyState))&&(i.onload=i.onreadystatechange=null,n&&i.parentNode&&n.removeChild(i),i=e,r||a(200,"success"))},n.insertBefore(i,n.firstChild)},abort:function(){i&&i.onload(0,1)}}}}));var re,ae=!!t.ActiveXObject&&function(){for(var t in re)re[t](0,1)},se=0;E.ajaxSettings.xhr=t.ActiveXObject?function(){return!this.isLocal&&o()||function(){try{return new t.ActiveXObject("Microsoft.XMLHTTP")}catch(e){}}()}:o,function(t){E.extend(E.support,{ajax:!!t,cors:!!t&&"withCredentials"in t})}(E.ajaxSettings.xhr()),E.support.ajax&&E.ajaxTransport((function(i){var n;if(!i.crossDomain||E.support.cors)return{send:function(r,a){var s,o,l=i.xhr();if(i.username?l.open(i.type,i.url,i.async,i.username,i.password):l.open(i.type,i.url,i.async),i.xhrFields)for(o in i.xhrFields)l[o]=i.xhrFields[o];i.mimeType&&l.overrideMimeType&&l.overrideMimeType(i.mimeType),!i.crossDomain&&!r["X-Requested-With"]&&(r["X-Requested-With"]="XMLHttpRequest");try{for(o in r)l.setRequestHeader(o,r[o])}catch(F){}l.send(i.hasContent&&i.data||null),n=function(t,r){var o,h,c,d,p;try{if(n&&(r||4===l.readyState))if(n=e,s&&(l.onreadystatechange=E.noop,ae&&delete re[s]),r)4!==l.readyState&&l.abort();else{o=l.status,c=l.getAllResponseHeaders(),d={},(p=l.responseXML)&&p.documentElement&&(d.xml=p),d.text=l.responseText;try{h=l.statusText}catch(R){h=""}o||!i.isLocal||i.crossDomain?1223===o&&(o=204):o=d.text?200:404}}catch(W){r||a(-1,W)}d&&a(o,h,d,c)},i.async&&4!==l.readyState?(s=++se,ae&&(re||(re={},E(t).unload(ae)),re[s]=n),l.onreadystatechange=n):n()},abort:function(){n&&n(0,1)}}}));var oe,le,he,ce,de={},pe=/^(?:toggle|show|hide)$/,ue=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,ge=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];E.fn.extend({show:function(t,e,i){var a,s;if(t||0===t)return this.animate(r("show",3),t,e,i);for(var o=0,l=this.length;o=l.duration+this.startTime){for(e in this.now=this.end,this.pos=this.state=1,this.update(),l.animatedProperties[this.prop]=!0,l.animatedProperties)!0!==l.animatedProperties[e]&&(a=!1);if(a){if(null!=l.overflow&&!E.support.shrinkWrapBlocks&&E.each(["","X","Y"],(function(t,e){o.style["overflow"+e]=l.overflow[t]})),l.hide&&E(o).hide(),l.hide||l.show)for(e in l.animatedProperties)E.style(o,e,l.orig[e]),E.removeData(o,"fxshow"+e,!0),E.removeData(o,"toggle"+e,!0);(n=l.complete)&&(l.complete=!1,n.call(o))}return!1}return l.duration==1/0?this.now=r:(i=r-this.startTime,this.state=i/l.duration,this.pos=E.easing[l.animatedProperties[this.prop]](this.state,i,0,1,l.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update(),!0}},E.extend(E.fx,{tick:function(){for(var t,e=E.timers,i=0;i-1?(r=(d=s.position()).top,a=d.left):(r=parseFloat(l)||0,a=parseFloat(h)||0),E.isFunction(e)&&(e=e.call(t,i,o)),null!=e.top&&(c.top=e.top-o.top+r),null!=e.left&&(c.left=e.left-o.left+a),"using"in e?e.using.call(t,c):s.css(c)}},E.fn.extend({position:function(){if(!this[0])return null;var t=this[0],e=this.offsetParent(),i=this.offset(),n=me.test(e[0].nodeName)?{top:0,left:0}:e.offset();return i.top-=parseFloat(E.css(t,"marginTop"))||0,i.left-=parseFloat(E.css(t,"marginLeft"))||0,n.top+=parseFloat(E.css(e[0],"borderTopWidth"))||0,n.left+=parseFloat(E.css(e[0],"borderLeftWidth"))||0,{top:i.top-n.top,left:i.left-n.left}},offsetParent:function(){return this.map((function(){for(var t=this.offsetParent||C.body;t&&!me.test(t.nodeName)&&"static"===E.css(t,"position");)t=t.offsetParent;return t}))}}),E.each(["Left","Top"],(function(t,n){var r="scroll"+n;E.fn[r]=function(n){var a,s;return n===e?(a=this[0])?(s=i(a))?"pageXOffset"in s?s[t?"pageYOffset":"pageXOffset"]:E.support.boxModel&&s.document.documentElement[r]||s.document.body[r]:a[r]:null:this.each((function(){(s=i(this))?s.scrollTo(t?E(s).scrollLeft():n,t?n:E(s).scrollTop()):this[r]=n}))}})),E.each(["Height","Width"],(function(t,i){var n=i.toLowerCase();E.fn["inner"+i]=function(){var t=this[0];return t?t.style?parseFloat(E.css(t,n,"padding")):this[n]():null},E.fn["outer"+i]=function(t){var e=this[0];return e?e.style?parseFloat(E.css(e,n,t?"margin":"border")):this[n]():null},E.fn[n]=function(t){var r=this[0];if(!r)return null==t?null:this;if(E.isFunction(t))return this.each((function(e){var i=E(this);i[n](t.call(this,e,i[n]()))}));if(E.isWindow(r)){var a=r.document.documentElement["client"+i],s=r.document.body;return"CSS1Compat"===r.document.compatMode&&a||s&&s["client"+i]||a}if(9===r.nodeType)return Math.max(r.documentElement["client"+i],r.body["scroll"+i],r.documentElement["scroll"+i],r.body["offset"+i],r.documentElement["offset"+i]);if(t===e){var o=E.css(r,n),l=parseFloat(o);return E.isNumeric(l)?l:o}return this.css(n,"string"==typeof t?t:t+"px")}})),t.jQuery=t.$=E}(window),function(t){var e,i,n="",r=Math.PI,a=r/2,s="ontouchstart"in window,o=s?{down:"touchstart",move:"touchmove",up:"touchend",over:"touchstart",out:"touchend"}:{down:"mousedown",move:"mousemove",up:"mouseup",over:"mouseover",out:"mouseout"},l={backward:["bl","tl"],forward:["br","tr"],all:["tl","bl","tr","br","l","r"]},h=["single","double"],c=["ltr","rtl"],d={acceleration:!0,display:"double",duration:600,page:1,gradients:!0,turnCorners:"bl,br",when:null},p={cornerSize:100},u={init:function(r){var a;e="WebKitCSSMatrix"in window||"MozPerspective"in document.body.style,i=!(a=/AppleWebkit\/([0-9\.]+)/i.exec(navigator.userAgent))||parseFloat(a[1])>534.3,n=_();var l,h=0,c=this.data(),p=this.children();if(r=t.extend({width:this.width(),height:this.height(),direction:this.attr("dir")||this.css("direction")||"ltr"},d,r),c.opts=r,c.pageObjs={},c.pages={},c.pageWrap={},c.pageZoom={},c.pagePlace={},c.pageMv=[],c.zoom=1,c.totalPages=r.pages||0,c.eventHandlers={touchStart:t.proxy(u._touchStart,this),touchMove:t.proxy(u._touchMove,this),touchEnd:t.proxy(u._touchEnd,this),start:t.proxy(u._eventStart,this)},r.when)for(l in r.when)b(l,r.when)&&this.bind(l,r.when[l]);for(this.css({position:"relative",width:r.width,height:r.height}),this.turn("display",r.display),""!==r.direction&&this.turn("direction",r.direction),e&&!s&&r.acceleration&&this.transform(x(0,0,!0)),l=0;lo)throw S('Page "'+i+'" cannot be inserted')}else i=o,a=!0;return i>=1&&i<=o&&(r="double"==s.display?i%2?" odd":" even":"",s.done&&this.turn("stop"),i in s.pageObjs&&u._movePages.call(this,i,1),a&&(s.totalPages=o),s.pageObjs[i]=t(e).css({float:"left"}).addClass("page p"+i+r),-1!=navigator.userAgent.indexOf("MSIE 9.0")&&s.pageObjs[i].hasClass("hard")&&s.pageObjs[i].removeClass("hard"),u._addPage.call(this,i),u._removeFromDOM.call(this)),this},_addPage:function(e){var i=this.data(),n=i.pageObjs[e];if(n)if(u._necessPage.call(this,e)){if(!i.pageWrap[e]){i.pageWrap[e]=t("
",{class:"page-wrapper",page:e,css:{position:"absolute",overflow:"hidden"}}),this.append(i.pageWrap[e]),i.pagePlace[e]||(i.pagePlace[e]=e,i.pageObjs[e].appendTo(i.pageWrap[e]));var r=u._pageSize.call(this,e,!0);n.css({width:r.width,height:r.height}),i.pageWrap[e].css(r)}i.pagePlace[e]==e&&u._makeFlip.call(this,e)}else i.pagePlace[e]=0,i.pageObjs[e]&&i.pageObjs[e].remove()},hasPage:function(t){return b(t,this.data().pageObjs)},center:function(e){var i=this.data(),n=t(this).turn("size"),r=0;if(!i.noCenter){if("double"==i.display){var a=this.turn("view",e||i.tpage||i.page);"ltr"==i.direction?a[0]?a[1]||(r+=n.width/4):r-=n.width/4:a[0]?a[1]||(r-=n.width/4):r+=n.width/4}t(this).css({marginLeft:r})}return this},destroy:function(){var e=this,i=this.data();if("prevented"!=P("destroying",this)){for(i.destroying=!0,t.each(["end","first","flip","last","pressed","released","start","turning","turned","zooming","missing"],(function(t,i){e.unbind(i)})),this.parent().unbind("start",i.eventHandlers.start),t(document).unbind(o.move,i.eventHandlers.touchMove).unbind(o.up,i.eventHandlers.touchEnd);0!==i.totalPages;)this.turn("removePage",i.totalPages);return i.fparent&&i.fparent.remove(),i.shadow&&i.shadow.remove(),this.removeData(),i=null,this}},is:function(){return"object"==typeof this.data().pages},zoom:function(e){var i=this.data();if("number"==typeof e){if(e<.001||e>100)throw S(e+" is not a value for zoom");if("prevented"==P("zooming",this,[e,i.zoom]))return this;var n=this.turn("size"),r=this.turn("view"),a=1/i.zoom,s=Math.round(n.width*a*e),o=Math.round(n.height*a*e);i.zoom=e,t(this).turn("stop").turn("size",s,o),i.opts.autoCenter&&this.turn("center"),u._updateShadow.call(this);for(var l=0;la.totalPages)throw S('"'+t+'" is not a valid page');return r[1]=r[1]||r[0],r[0]>=1&&r[1]<=a.totalPages?(e=Math.floor(2),a.totalPages-r[1]>r[0]?n=2*e-(i=Math.min(r[0]-1,e)):i=2*e-(n=Math.min(a.totalPages-r[1],e))):(i=5,n=5),[Math.max(1,r[0]-i),Math.min(a.totalPages,r[1]+n)]},_necessPage:function(t){if(0===t)return!0;var e=this.turn("range");return this.data().pageObjs[t].hasClass("fixed")||t>=e[0]&&t<=e[1]},_removeFromDOM:function(){var t,e=this.data();for(t in e.pageWrap)b(t,e.pageWrap)&&!u._necessPage.call(this,t)&&u._removePageFromDOM.call(this,t)},_removePageFromDOM:function(t){var e=this.data();if(e.pages[t]){var i=e.pages[t].data();g._moveFoldingPage.call(e.pages[t],!1),i.f&&i.f.fwrapper&&i.f.fwrapper.remove(),e.pages[t].removeData(),e.pages[t].remove(),delete e.pages[t]}e.pageObjs[t]&&e.pageObjs[t].remove(),e.pageWrap[t]&&(e.pageWrap[t].remove(),delete e.pageWrap[t]),u._removeMv.call(this,t),delete e.pagePlace[t],delete e.pageZoom[t]},removePage:function(t){var e=this.data();if("*"==t)for(;0!==e.totalPages;)this.turn("removePage",e.totalPages);else{if(t<1||t>e.totalPages)throw S("The page "+t+" doesn't exist");e.pageObjs[t]&&(this.turn("stop"),u._removePageFromDOM.call(this,t),delete e.pageObjs[t]),u._movePages.call(this,t,-1),e.totalPages=e.totalPages-1,e.page>e.totalPages?(e.page=null,u._fitPage.call(this,e.totalPages)):(u._makeRange.call(this),this.turn("update"))}return this},_movePages:function(t,e){var i,n=this,r=this.data(),a="single"==r.display,s=function(t){var i=t+e,s=i%2,o=s?" odd ":" even ";r.pageObjs[t]&&(r.pageObjs[i]=r.pageObjs[t].removeClass("p"+t+" odd even").addClass("p"+i+o)),r.pagePlace[t]&&r.pageWrap[t]&&(r.pagePlace[i]=i,r.pageObjs[i].hasClass("fixed")?r.pageWrap[i]=r.pageWrap[t].attr("page",i):r.pageWrap[i]=r.pageWrap[t].css(u._pageSize.call(n,i,!0)).attr("page",i),r.pages[t]&&(r.pages[i]=r.pages[t].flip("options",{page:i,next:a||s?i+1:i-1})),e&&(delete r.pages[t],delete r.pagePlace[t],delete r.pageZoom[t],delete r.pageObjs[t],delete r.pageWrap[t]))};if(e>0)for(i=r.totalPages;i>=t;i--)s(i);else for(i=t;i<=r.totalPages;i++)s(i)},display:function(e){var i=this.data(),n=i.display;if(void 0===e)return n;if(-1==t.inArray(e,h))throw S('"'+e+'" is not a value for display');switch(e){case"single":i.pageObjs[0]||(this.turn("stop").css({overflow:"hidden"}),i.pageObjs[0]=t("
",{class:"page p-temporal"}).css({width:this.width(),height:this.height()}).appendTo(this)),this.addClass("shadow");break;case"double":i.pageObjs[0]&&(this.turn("stop").css({overflow:""}),i.pageObjs[0].remove(),delete i.pageObjs[0]),this.removeClass("shadow")}if(i.display=e,n){var r=this.turn("size");u._movePages.call(this,1,0),this.turn("size",r.width,r.height).turn("update")}return this},direction:function(e){var i=this.data();if(void 0===e)return i.direction;if(e=e.toLowerCase(),-1==t.inArray(e,c))throw S('"'+e+'" is not a value for direction');return"rtl"==e&&t(this).attr("dir","ltr").css({direction:"ltr"}),i.direction=e,i.done&&this.turn("size",t(this).width(),t(this).height()),this},animating:function(){return this.data().pageMv.length>0},corner:function(){var t,e,i=this.data();for(e in i.pages)if(b(e,i.pages)&&(t=i.pages[e].flip("corner")))return t;return!1},data:function(){return this.data()},disable:function(e){var i,n=this.data(),r=this.turn("view");for(i in n.disabled=void 0===e||!0===e,n.pages)b(i,n.pages)&&n.pages[i].flip("disable",!!n.disabled||-1==t.inArray(parseInt(i,10),r));return this},disabled:function(t){return void 0===t?!0===this.data().disabled:this.turn("disable",t)},size:function(t,e){if(void 0===t||void 0===e)return{width:this.width(),height:this.height()};this.turn("stop");var i,n,r=this.data(),a="double"==r.display?t/2:t;for(i in this.css({width:t,height:e}),r.pageObjs[0]&&r.pageObjs[0].css({width:a,height:e}),r.pageWrap)b(i,r.pageWrap)&&(n=u._pageSize.call(this,i,!0),r.pageObjs[i].css({width:n.width,height:n.height}),r.pageWrap[i].css(n),r.pages[i]&&r.pages[i].css({width:n.width,height:n.height}));return this.turn("resize"),this},resize:function(){var t,e=this.data();for(e.pages[0]&&(e.pageWrap[0].css({left:-this.width()}),e.pages[0].flip("resize",!0)),t=1;t<=e.totalPages;t++)e.pages[t]&&e.pages[t].flip("resize",!0);u._updateShadow.call(this),e.opts.autoCenter&&this.turn("center")},_removeMv:function(t){var e,i=this.data();for(e=0;e0?i[0]:0,i[1]<=e.totalPages?i[1]:0]:[i[0]>0&&i[0]<=e.totalPages?i[0]:0]},stop:function(t,e){if(this.turn("animating")){var i,n,r,a=this.data();for(a.tpage&&(a.page=a.tpage,delete a.tpage),i=0;it;i--)this.turn("removePage",i);return e.totalPages=t,u._fitPage.call(this,e.page),this}return e.totalPages},_missing:function(t){var e=this.data();if(!(e.totalPages<1)){var i,n=this.turn("range",t),r=[];for(i=n[0];i<=n[1];i++)e.pageObjs[i]||r.push(i);r.length>0&&this.trigger("missing",[r])}},_fitPage:function(t){var e=this.data(),i=this.turn("view",t);if(u._missing.call(this,t),e.pageObjs[t]){e.page=t,this.turn("stop");for(var n=0;ns[1]?(i=s[1],n=o[0]):s[0]&&ei?"r":"l"):r.pages[i].flip("turnPage",e>i?"l":"r"):"ltr"==r.direction?r.pages[i].flip("turnPage",h[e>i?1:0]):r.pages[i].flip("turnPage",h[e>i?0:1]))},page:function(e){var i=this.data();if(void 0===e)return i.page;if(!i.disabled&&!i.destroying){if((e=parseInt(e,10))>0&&e<=i.totalPages)return e!=i.page&&(i.done&&-1==t.inArray(e,this.turn("view"))?u._turnPage.call(this,e):u._fitPage.call(this,e)),this;throw S("The page "+e+" does not exist")}},next:function(){return this.turn("page",Math.min(this.data().totalPages,u._view.call(this,this.data().page).pop()+1))},previous:function(){return this.turn("page",Math.max(1,u._view.call(this,this.data().page).shift()-1))},peel:function(t,e){var i,n=this.data(),r=this.turn("view");(e=void 0===e||!0===e,!1===t)?this.turn("stop",null,e):"single"==n.display?n.pages[n.page].flip("peel",t,e):(i="ltr"==n.direction?-1!=t.indexOf("l")?r[0]:r[1]:-1!=t.indexOf("l")?r[1]:r[0],n.pages[i]&&n.pages[i].flip("peel",t,e));return this},_addMotionPage:function(){var e=t(this).data().f.opts,i=e.turn;i.data(),u._addMv.call(i,e.page)},_eventStart:function(t,e,i){var n=e.turn.data(),r=n.pageZoom[e.page];t.isDefaultPrevented()||(r&&r!=n.zoom&&(e.turn.trigger("zoomed",[e.page,e.turn.turn("view",e.page),r,n.zoom]),n.pageZoom[e.page]=n.zoom),"single"==n.display&&i&&("l"==i.charAt(1)&&"ltr"==n.direction||"r"==i.charAt(1)&&"rtl"==n.direction?(e.next=e.nexte.page?e.next:e.page+1),u._addMotionPage.call(t.target)),u._updateShadow.call(e.turn)},_eventEnd:function(e,i,n){t(e.target).data().f;var r=i.turn,a=r.data();if(n){var s=a.tpage||a.page;s!=i.next&&s!=i.page||(delete a.tpage,u._fitPage.call(r,s||i.next,!0))}else u._removeMv.call(r,i.page),u._updateShadow.call(r),r.turn("update")},_eventPressed:function(e){var i=t(e.target).data().f,n=i.opts.turn,r=n.data();return r.pages,r.mouseAction=!0,n.turn("update"),i.time=(new Date).getTime()},_eventReleased:function(e,i){var n,r=t(e.target),a=r.data().f,s=a.opts.turn,o=s.data();n="single"==o.display?"br"==i.corner||"tr"==i.corner?i.xr.width()/2:i.x<0||i.x>r.width(),((new Date).getTime()-a.time<200||n)&&(e.preventDefault(),u._turnPage.call(s,a.opts.next)),o.mouseAction=!1},_flip:function(e){e.stopPropagation();var i=t(e.target).data().f.opts;i.turn.trigger("turn",[i.next]),i.turn.data().opts.autoCenter&&i.turn.turn("center",i.next)},_touchStart:function(){var t=this.data();for(var e in t.pages)if(b(e,t.pages)&&!1===g._eventStart.apply(t.pages[e],arguments))return!1},_touchMove:function(){var t=this.data();for(var e in t.pages)b(e,t.pages)&&g._eventMove.apply(t.pages[e],arguments)},_touchEnd:function(){var t=this.data();for(var e in t.pages)b(e,t.pages)&&g._eventEnd.apply(t.pages[e],arguments)},calculateZ:function(t){var e,i,n,r,a,s=this,o=this.data(),l=this.turn("view"),h=l[0]||l[1],c=t.length-1,d={pageZ:{},partZ:{},pageV:{}},p=function(t){var e=s.turn("view",t);e[0]&&(d.pageV[e[0]]=!0),e[1]&&(d.pageV[e[1]]=!0)};for(e=0;e<=c;e++)i=t[e],n=o.pages[i].data().f.opts.next,r=o.pagePlace[i],p(i),p(n),a=o.pagePlace[n]==n?n:i,d.pageZ[a]=o.totalPages-Math.abs(h-a),d.partZ[r]=2*o.totalPages-c+e;return d},update:function(){var e,i=this.data();if(this.turn("animating")&&0!==i.pageMv[0]){var n,r,a=this.turn("calculateZ",i.pageMv),s=this.turn("corner"),o=this.turn("view"),l=this.turn("view",i.tpage);for(e in i.pageWrap)b(e,i.pageWrap)&&(r=i.pageObjs[e].hasClass("fixed"),i.pageWrap[e].css({display:a.pageV[e]||r?"":"none",zIndex:(i.pageObjs[e].hasClass("hard")?a.partZ[e]:a.pageZ[e])||(r?-1:0)}),(n=i.pages[e])&&(n.flip("z",a.partZ[e]||null),a.pageV[e]&&n.flip("resize"),i.tpage?n.flip("hover",!1).flip("disable",-1==t.inArray(parseInt(e,10),i.pageMv)&&e!=l[0]&&e!=l[1]):n.flip("hover",!1===s).flip("disable",e!=o[0]&&e!=o[1])))}else for(e in i.pageWrap)if(b(e,i.pageWrap)){var h=u._setPageLoc.call(this,e);i.pages[e]&&i.pages[e].flip("disable",i.disabled||1!=h).flip("hover",!0).flip("z",null)}return this},_updateShadow:function(){var e,i,n=this.data(),r=this.width(),a=this.height(),s="single"==n.display?r:r/2;e=this.turn("view"),n.shadow||(n.shadow=t("
",{class:"shadow",css:m(0,0,0).css}).appendTo(this));for(var o=0;o=n||a.y>=r)return!1;var o=g._cAllowed.call(this);switch(i.effect){case"hard":if(a.x>n-s)a.corner="r";else{if(!(a.x=r-s))return!1;a.corner+="b"}if(a.x<=s)a.corner+="l";else{if(!(a.x>=n-s))return!1;a.corner+="r"}}return!(!a.corner||-1==t.inArray(a.corner,o))&&a},_isIArea:function(t){var e=this.data().f.parent.offset();return t=s&&t.originalEvent?t.originalEvent.touches[0]:t,g._cornerActivated.call(this,{x:t.pageX-e.left,y:t.pageY-e.top})},_c:function(t,e){switch(e=e||0,t){case"tl":return y(e,e);case"tr":return y(this.width()-e,e);case"bl":return y(e,this.height()-e);case"br":return y(this.width()-e,this.height()-e);case"l":return y(e,0);case"r":return y(this.width()-e,0)}},_c2:function(t){switch(t){case"tl":case"l":return y(2*this.width(),0);case"tr":case"r":return y(-this.width(),0);case"bl":return y(2*this.width(),this.height());case"br":return y(-this.width(),this.height())}},_foldingPage:function(){var t=this.data().f;if(t){var e=t.opts;return e.turn?"single"==(t=e.turn.data()).display?e.next>1||e.page>1?t.pageObjs[0]:null:t.pageObjs[e.next]:void 0}},_backGradient:function(){var e=this.data().f,i=e.opts.turn.data(),n=i.opts.gradients&&("single"==i.display||2!=e.opts.page&&e.opts.page!=i.totalPages-1);return n&&!e.bshadow&&(e.bshadow=t("
",m(0,0,1)).css({position:"",width:this.width(),height:this.height()}).appendTo(e.parent)),n},type:function(){return this.data().f.effect},resize:function(t){var e=this.data().f,i=e.opts.turn.data(),n=this.width(),r=this.height();switch(e.effect){case"hard":t&&(e.wrapper.css({width:n,height:r}),e.fpage.css({width:n,height:r}),i.opts.gradients&&(e.ashadow.css({width:n,height:r}),e.bshadow.css({width:n,height:r})));break;case"sheet":if(t){var a=Math.round(Math.sqrt(Math.pow(n,2)+Math.pow(r,2)));e.wrapper.css({width:a,height:a}),e.fwrapper.css({width:a,height:a}).children(":first-child").css({width:n,height:r}),e.fpage.css({width:n,height:r}),i.opts.gradients&&e.ashadow.css({width:n,height:r}),g._backGradient.call(this)&&e.bshadow.css({width:n,height:r})}if(e.parent.is(":visible")){var s=T(e.parent[0]);e.fwrapper.css({top:s.top,left:s.left}),s=T(e.opts.turn[0]),e.fparent.css({top:-s.top,left:-s.left})}this.flip("z",e.opts["z-index"])}},_addPageWrapper:function(){var e=this.data().f,i=e.opts.turn.data(),r=this.parent();if(e.parent=r,!e.wrapper)switch(e.effect){case"hard":var a={};a[n+"transform-style"]="preserve-3d",a[n+"backface-visibility"]="hidden",e.wrapper=t("
",m(0,0,2)).css(a).appendTo(r).prepend(this),e.fpage=t("
",m(0,0,1)).css(a).appendTo(r),i.opts.gradients&&(e.ashadow=t("
",m(0,0,0)).hide().appendTo(r),e.bshadow=t("
",m(0,0,0)));break;case"sheet":if(this.width(),this.height(),e.fparent=e.opts.turn.data().fparent,!e.fparent){var s=t("
",{css:{"pointer-events":"none"}}).hide();s.data().flips=0,s.css(m(0,0,"auto","visible").css).appendTo(e.opts.turn),e.opts.turn.data().fparent=s,e.fparent=s}this.css({position:"absolute",top:0,left:0,bottom:"auto",right:"auto"}),e.wrapper=t("
",m(0,0,this.css("z-index"))).appendTo(r).prepend(this),e.fwrapper=t("
",m(r.offset().top,r.offset().left)).hide().appendTo(e.fparent),e.fpage=t("
",m(0,0,0,"visible")).css({cursor:"default"}).appendTo(e.fwrapper),i.opts.gradients&&(e.ashadow=t("
",m(0,0,1)).appendTo(e.fpage)),g.setData.call(this,e)}g.resize.call(this,!0)},_fold:function(t){var e=this.data().f,s=e.opts.turn.data(),o=g._c.call(this,t.corner),l=this.width(),h=this.height();switch(e.effect){case"hard":"l"==t.corner?t.x=Math.min(Math.max(t.x,0),2*l):t.x=Math.max(Math.min(t.x,l),-l);var c,d,p,u,f,m=s.totalPages,v=e.opts["z-index"]||m,b={overflow:"visible"},_=o.x?(o.x-t.x)/l:t.x/l,P=90*_,S=P<90;switch(t.corner){case"l":u="0% 50%",f="100% 50%",S?(c=0,d=e.opts.next-1>0,p=1):(c="100%",d=e.opts.page+1a&&(O.x=O.x+Math.abs(O.y*e.y/e.x),O.y=0,Math.round(O.x*Math.tan(r-c))a){var u=r-c,f=W-h/Math.sin(u);F=y(Math.round(f*Math.cos(u)),Math.round(f*Math.sin(u))),z&&(F.x=-F.x),H&&(F.y=-F.y)}T=Math.round(O.y/Math.tan(c)+O.x);var m=l-T,v=m*Math.cos(2*c),x=m*Math.sin(2*c);if(j=y(Math.round(z?m-v:T+v),Math.round(H?x:h-x)),s.opts.gradients){D=m*Math.sin(c);var w=g._c2.call(I,t.corner),b=Math.sqrt(Math.pow(w.x-t.x,2)+Math.pow(w.y-t.y,2))/l;N=Math.sin(a*(b>1?2-b:b)),E=Math.min(b,1),M=D>100?(D-100)/D:0,k=y(D*Math.sin(c)/l*100,D*Math.cos(c)/h*100),g._backGradient.call(I)&&(C=y(1.2*D*Math.sin(c)/l*100,1.2*D*Math.cos(c)/h*100),z||(C.x=100-C.x),H||(C.y=100-C.y))}return O.x=Math.round(O.x),O.y=Math.round(O.y),!0},G=function(t,i,n,r){var a=["0","auto"],o=(l-W)*n[0]/100,c=(h-W)*n[1]/100,d={left:a[i[0]],top:a[i[1]],right:a[i[2]],bottom:a[i[3]]},p={},u=90!=r&&-90!=r?z?-1:1:0,f=n[0]+"% "+n[1]+"%";I.css(d).transform(w(r)+x(t.x+u,t.y,R),f),e.fpage.css(d).transform(w(r)+x(t.x+j.x-F.x-l*n[0]/100,t.y+j.y-F.y-h*n[1]/100,R)+w((180/r-2)*r),f),e.wrapper.transform(x(-t.x+o-u,-t.y+c,R)+w(-r),f),e.fwrapper.transform(x(-t.x+F.x+o,-t.y+F.y+c,R)+w(-r),f),s.opts.gradients&&(n[0]&&(k.x=100-k.x),n[1]&&(k.y=100-k.y),p["box-shadow"]="0 0 20px rgba(0,0,0,"+.5*N+")",B.css(p),A(e.ashadow,y(z?100:0,H?0:100),y(k.x,k.y),[[M,"rgba(0,0,0,0)"],[.8*(1-M)+M,"rgba(0,0,0,"+.2*E+")"],[1,"rgba(255,255,255,"+.2*E+")"]],3),g._backGradient.call(I)&&A(e.bshadow,y(z?0:100,H?0:100),y(C.x,C.y),[[.6,"rgba(0,0,0,0)"],[.8,"rgba(0,0,0,"+.3*E+")"],[1,"rgba(0,0,0,0)"]],3))};switch(t.corner){case"l":case"r":break;case"tl":t.x=Math.max(t.x,1),q(),G(O,[1,0,0,1],[100,0],L);break;case"tr":t.x=Math.min(t.x,l-1),q(),G(y(-O.x,O.y),[0,0,0,1],[0,0],-L);break;case"bl":t.x=Math.max(t.x,1),q(),G(y(O.x,-O.y),[1,1,0,0],[100,100],-L);break;case"br":t.x=Math.min(t.x,l-1),q(),G(y(-O.x,-O.y),[0,1,1,0],[0,100],L)}}e.point=t},_moveFoldingPage:function(t){var e=this.data().f;if(e){var i=e.opts.turn,n=i.data(),r=n.pagePlace;if(t){var a=e.opts.next;if(r[a]!=e.opts.page)e.folding&&g._moveFoldingPage.call(this,!1),g._foldingPage.call(this).appendTo(e.fpage),r[a]=e.opts.page,e.folding=a;i.turn("update")}else if(e.folding){if(n.pages[e.folding]){var s=n.pages[e.folding].data().f;n.pageObjs[e.folding].appendTo(s.wrapper)}else n.pageWrap[e.folding]&&n.pageObjs[e.folding].appendTo(n.pageWrap[e.folding]);e.folding in r&&(r[e.folding]=e.folding),delete e.folding}}},_showFoldedPage:function(t,e){var i=g._foldingPage.call(this),n=this.data(),r=n.f,a=r.visible;if(i){if(!a||!r.point||r.point.corner!=t.corner){var s="hover"==r.status||"peel"==r.status||r.opts.turn.data().mouseAction?t.corner:null;if(a=!1,"prevented"==P("start",this,[r.opts,s]))return!1}if(e){var o=this,l=r.point&&r.point.corner==t.corner?r.point:g._c.call(this,t.corner,1);this.animatef({from:[l.x,l.y],to:[t.x,t.y],duration:500,frame:function(e){t.x=Math.round(e[0]),t.y=Math.round(e[1]),g._fold.call(o,t)}})}else g._fold.call(this,t),n.effect&&!n.effect.turning&&this.animatef(!1);if(!a)switch(r.effect){case"hard":r.visible=!0,g._moveFoldingPage.call(this,!0),r.fpage.show(),r.opts.shadows&&r.bshadow.show();break;case"sheet":r.visible=!0,r.fparent.show().data().flips++,g._moveFoldingPage.call(this,!0),r.fwrapper.show(),r.bshadow&&r.bshadow.show()}return!0}return!1},hide:function(){var t=this.data().f,e=t.opts.turn.data(),i=g._foldingPage.call(this);switch(t.effect){case"hard":e.opts.gradients&&(t.bshadowLoc=0,t.bshadow.remove(),t.ashadow.hide()),t.wrapper.transform(""),t.fpage.hide();break;case"sheet":0==--t.fparent.data().flips&&t.fparent.hide(),this.css({left:0,top:0,right:"auto",bottom:"auto"}).transform(""),t.wrapper.transform(""),t.fwrapper.hide(),t.bshadow&&t.bshadow.hide(),i.transform("")}return t.visible=!1,this},hideFoldedPage:function(t){var e=this.data().f;if(e.point){var i=this,n=e.point,r=function(){e.point=null,e.status="",i.flip("hide"),i.trigger("end",[e.opts,!1])};if(t){var a=g._c.call(this,n.corner),s="t"==n.corner.substr(0,1)?Math.min(0,n.y-a.y)/2:Math.max(0,n.y-a.y)/2,o=y(n.x,n.y+s),l=y(a.x,a.y-s);this.animatef({from:0,to:1,frame:function(t){var e=v(n,o,l,a,t);n.x=e.x,n.y=e.y,g._fold.call(i,n)},complete:r,duration:800,hiding:!0})}else this.animatef(!1),r()}},turnPage:function(t){var e=this,i=this.data().f,n=i.opts.turn.data();t={corner:i.corner?i.corner.corner:t||g._cAllowed.call(this)[0]};var r=i.point||g._c.call(this,t.corner,i.opts.turn?n.opts.elevation:0),a=g._c2.call(this,t.corner);this.trigger("flip").animatef({from:0,to:1,frame:function(i){var n=v(r,r,a,a,i);t.x=n.x,t.y=n.y,g._showFoldedPage.call(e,t)},complete:function(){e.trigger("end",[i.opts,!0])},duration:n.opts.duration,turning:!0}),i.corner=null},moving:function(){return"effect"in this.data()},isTurning:function(){return this.flip("moving")&&this.data().effect.turning},corner:function(){return this.data().f.corner},_eventStart:function(t){var e=this.data().f,i=e.opts.turn;if(!e.corner&&!e.disabled&&!this.flip("isTurning")&&e.opts.page==i.data().pagePlace[e.opts.page]){if(e.corner=g._isIArea.call(this,t),e.corner&&g._foldingPage.call(this))return this.trigger("pressed",[e.point]),g._showFoldedPage.call(this,e.corner),!1;e.corner=null}},_eventMove:function(t){var e=this.data().f;if(!e.disabled)if(t=s?t.originalEvent.touches:[t],e.corner){var i=e.parent.offset();e.corner.x=t[0].pageX-i.left,e.corner.y=t[0].pageY-i.top,g._showFoldedPage.call(this,e.corner)}else if(e.hover&&!this.data().effect&&this.is(":visible")){var n=g._isIArea.call(this,t[0]);if(n){if("sheet"==e.effect&&2==n.corner.length||"hard"==e.effect){e.status="hover";var r=g._c.call(this,n.corner,e.opts.cornerSize/2);n.x=r.x,n.y=r.y,g._showFoldedPage.call(this,n,!0)}}else"hover"==e.status&&(e.status="",g.hideFoldedPage.call(this,!0))}},_eventEnd:function(){var t=this.data().f,e=t.corner;!t.disabled&&e&&"prevented"!=P("released",this,[t.point||e])&&g.hideFoldedPage.call(this,!0),t.corner=null},disable:function(t){return g.setData.call(this,{disabled:t}),this},hover:function(t){return g.setData.call(this,{hover:t}),this},peel:function(e,i){var n=this.data().f;if(e){if(-1==t.inArray(e,l.all))throw S("Corner "+e+" is not permitted");if(-1!=t.inArray(e,g._cAllowed.call(this))){var r=g._c.call(this,e,n.opts.cornerSize/2);n.status="peel",g._showFoldedPage.call(this,{corner:e,x:r.x,y:r.y},i)}}else n.status="",g.hideFoldedPage.call(this,i);return this}};function f(t,e,i){if(i[0]&&"object"!=typeof i[0]){if(e[i[0]])return e[i[0]].apply(t,Array.prototype.slice.call(i,1));throw S(i[0]+" is not a method or property")}return e.init.apply(t,i)}function m(t,e,i,n){return{css:{position:"absolute",top:t,left:e,overflow:n||"hidden",zIndex:i||"auto"}}}function v(t,e,i,n,r){var a=1-r,s=a*a*a,o=r*r*r;return y(Math.round(s*t.x+3*r*a*a*e.x+3*r*r*a*i.x+o*n.x),Math.round(s*t.y+3*r*a*a*e.y+3*r*r*a*i.y+o*n.y))}function y(t,e){return{x:t,y:e}}function x(t,i,n){return e&&n?" translate3d("+t+"px,"+i+"px, 0px) ":" translate("+t+"px, "+i+"px) "}function w(t){return" rotate("+t+"deg) "}function b(t,e){return Object.prototype.hasOwnProperty.call(e,t)}function _(){for(var t=["Moz","Webkit","Khtml","O","ms"],e=t.length,i="";e--;)t[e]+"Transform"in document.body.style&&(i="-"+t[e].toLowerCase()+"-");return i}function A(t,e,i,r,a){var s,o=[];if("-webkit-"==n){for(s=0;s{_({api:"goBack"})},g=l({currentGradeNum:null,bookVersionId:null,page:1,rows:999,type:"COURSEWARE"});A((()=>J.grades.map(((t,e)=>n(n({},t),{},{color:g.currentGradeNum===e?"var(--van-primary-color)":"",className:g.currentGradeNum===e?"fontBlod":""})))));const y=h(!1),x=l({list:[],loading:!1,favoriteList:[],tab:"all",details:[],bookData:{},showBook:!1,book:{}}),w=function(){var t=s((function*(){try{const t=v.user.data.schoolInfos,e=t.length>0?t[0].tenantId:null;if(e){const{data:t}=yield k({id:e});r.value=t.bookVersionList||[],a.value=W(r.value)}}catch(t){}}));return function(){return t.apply(this,arguments)}}(),b=function(){var i=s((function*(){var i;x.loading=!0;const{bookVersionId:r,currentGradeNum:a}=g,s=e(g,t),o=yield C(n(n({},s),{},{bookVersionId:-1==r?null:r,currentGradeNum:a||""}));200===(null==o?void 0:o.code)&&Array.isArray(null==o||null===(i=o.data)||void 0===i?void 0:i.rows)&&(x.list=o.data.rows.map((t=>(t.load=!1,t.key=Date.now()+t.id,t)))),x.loading=!1,setTimeout((()=>{y.value=!0}),100)}));return function(){return i.apply(this,arguments)}}(),F=function(){var t=s((function*(){var t,e,i;x.loading=!0;const n=yield M({clientType:"STUDENT",userId:null===(t=v.user)||void 0===t||null===(e=t.data)||void 0===e?void 0:e.id,page:g.page,rows:g.rows,bookVersionId:-1!=g.bookVersionId?g.bookVersionId:"",currentGradeNum:g.currentGradeNum?g.currentGradeNum:""});200===(null==n?void 0:n.code)&&Array.isArray(null==n||null===(i=n.data)||void 0===i?void 0:i.rows)&&(x.list=n.data.rows.map((t=>(t.name=`${t.name}`,t.load=!1,t.favoriteFlag=!0,t.key=Date.now()+t.id,t)))),x.loading=!1}));return function(){return t.apply(this,arguments)}}(),j=function(){var t=s((function*(){var t;x.loading=!0;const e=yield D({bookVersionId:g.bookVersionId?g.bookVersionId:"",page:g.page,rows:g.rows,currentGradeNum:g.currentGradeNum?g.currentGradeNum:""});200===(null==e?void 0:e.code)&&Array.isArray(null==e||null===(t=e.data)||void 0===t?void 0:t.rows)&&(x.list=e.data.rows.map((t=>(t.load=!1,t.key=Date.now()+t.id,t)))),x.loading=!1}));return function(){return t.apply(this,arguments)}}(),O=()=>{"all"===x.tab&&b(),"favorite"===x.tab&&F(),"course"===x.tab&&j()};c((()=>{w(),O()}));const B=function(){var t=s((function*(t){t.favoriteFlag?yield E({lessonCoursewareId:t.id}):(yield N({lessonCoursewareId:t.id}),"favorite"===x.tab&&O())}));return function(e){return t.apply(this,arguments)}}();let R=null;const K=function(){var t=s((function*(t){if("course"===x.tab){var e;const i=yield I(t.id);if(200!=(null==i?void 0:i.code)||!Array.isArray(null==i||null===(e=i.data)||void 0===e?void 0:e.lessonList))return void T({title:"提示",message:"课程教材已更新,是否重新加载?"}).then((()=>{O()})).catch((()=>{}));x.details=i.data.lessonList||[],x.bookData=i.data,console.log("🚀 ~ data.details course:",x.details)}else{var i;const e=yield L(t.id);200==(null==e?void 0:e.code)&&Array.isArray(null==e||null===(i=e.data)||void 0===i?void 0:i.lessonList)&&(x.details=e.data.lessonList||[],x.bookData=e.data,console.log("🚀 ~ data.details:",x.details))}Y(t.id),Q((()=>{x.showBook=!0}))}));return function(e){return t.apply(this,arguments)}}(),Y=t=>{const e=document.querySelector(`[data-id="${t}"]`);if(!e)return;const i=e.getBoundingClientRect();x.book=i},Q=t=>{requestAnimationFrame((()=>{requestAnimationFrame((()=>{t()}))}))},tt=function(){var t=s((function*(t){yield K(t)}));return function(e){return t.apply(this,arguments)}}();return()=>o("div",{class:U.container},[o("div",{class:U.head,style:{opacity:x.showBook?0:""}},[o("div",{class:U.back,onClick:d},[o("img",{src:V},null)]),o(z,{class:U.tabs,active:x.tab,"onUpdate:active":t=>x.tab=t,onChange:()=>("course"===x.tab?a.value=[...W(r.value),{bookVersionId:-1,bookVersionName:"自定义"}]:a.value=W(r.value),void O())},{default:()=>[o(q,{title:"全部教材",name:"all"},null),o(q,{title:"课程教材",name:"course"},null),o(q,{name:"favorite"},{title:()=>o("div",{id:"courseware-2"},[u("我的收藏")])})]}),o(f,P({class:[U.downBtn,"course"!=x.tab&&g.bookVersionId>0||"course"==x.tab&&g.bookVersionId||g.currentGradeNum?U.activeBtn:""],round:!0,size:"small",onClick:()=>i.value=!0},{id:"courseware-3"}),{default:()=>[u("筛选"),o("svg",{class:[U.icon,i.value?U.iconUp:""],width:"9px",height:"5px",viewBox:"0 0 9 5",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},[o("title",null,[u("三角形")]),o("g",{id:"演示用",stroke:"none","stroke-width":"1",fill:"currentColor","fill-rule":"evenodd"},[o("g",{id:"全部教材-筛选",transform:"translate(-769.000000, -35.000000)",fill:"currentColor"},[o("g",{id:"编组-3",transform:"translate(696.000000, 20.000000)"},[o("g",{id:"筛选目录备份-2",transform:"translate(13.000000, 7.000000)"},[o("path",{d:"M64.8716471,8.41294119 L68.2489659,12.1655176 C68.4336954,12.3707726 68.4170562,12.6869176 68.2118012,12.8716471 C68.1199888,12.9542782 68.0008397,13 67.8773188,13 L61.1226812,13 C60.8465388,13 60.6226812,12.7761424 60.6226812,12.5 C60.6226812,12.3764791 60.668403,12.25733 60.7510341,12.1655176 L64.1283529,8.41294119 C64.3130824,8.20768618 64.6292274,8.19104698 64.8344824,8.37577649 C64.8475136,8.38750459 64.859919,8.39990996 64.8716471,8.41294119 Z",id:"三角形",transform:"translate(64.500000, 10.500000) rotate(-180.000000) translate(-64.500000, -10.500000) "},null)])])])])])]})]),o("div",{class:U.content},[o("div",{class:[U.wrap,x.list.length<=0&&!x.loading?U.emtpyWrap:""]},[x.list.map(((t,e)=>o("div",{class:[U.wrapItem,x.bookData.id===t.id&&x.showBook?U.wrapItemHide:""],key:t.key,onClick:()=>tt(t)},[o("div",{class:U.item},[o(H,P({"data-id":t.id},{id:0==e?"courseware-0":""},{class:[U.cover,t.load?U.loaded:""],objectFit:"cover",src:t.coverImg,onLoad:()=>{t.load=!0},onError:()=>{t.load=!0}}),null)]),o("div",{class:U.name},[t.name]),!x.loading&&"course"!==x.tab&&o("div",{id:0===e?"courseware-1":"",class:U.favoriteBtn,onClick:e=>{e.stopPropagation(),t.favoriteFlag=!t.favoriteFlag,((t,e=300)=>{R&&clearTimeout(R),R=setTimeout(t,e)})((()=>B(t)))}},[o(X,{isFavorite:t.favoriteFlag},null)])]))),x.list.length<=0&&!x.loading&&o(S,{image:"list",description:"暂无数据"},null)])]),o(Z,{show:x.showBook,bookData:x.bookData,tab:x.tab,rect:x.book,onClose:()=>{x.showBook=!1}},null),y.value?o($,null,null):null,o(p,{show:i.value,"onUpdate:show":t=>i.value=t,class:U.popupContainer},{default:()=>[o("div",{class:U.popoverContainer},[o("div",{class:U.searchList},[o("div",{class:U.popoverTitle},[u("教材版本")]),o("div",{class:[U.popupList,U.versionList]},[a.value.map((t=>o(G,{plain:g.bookVersionId==t.bookVersionId,round:!0,onClick:()=>g.bookVersionId=t.bookVersionId},{default:()=>[t.bookVersionName]})))]),o("div",{class:U.popoverTitle},[u("选择年级")]),o("div",{class:[U.popupList,U.versionList]},[J.grades.map((t=>o(G,{plain:g.currentGradeNum===t.value,round:!0,onClick:()=>g.currentGradeNum=t.value},{default:()=>[t.text]})))])]),o("div",{class:U.btnGroup},[o(f,{round:!0,onClick:()=>{g.bookVersionId=null,g.currentGradeNum=null}},{default:()=>[u("重置")]}),o(f,{round:!0,class:U.btnSure,onClick:()=>{O(),i.value=!1}},{default:()=>[u("确认")]})])])]})])}}))}}}))}();