import{d as Me,a as W,x as ke,r as ae,y as Fe,a7 as li,V as Ge,A as Bt,F as Ue,C as ce,ah as Oi,q as hi,M as Ie,al as Wi,w as Hi,z as si,E as ji,a5 as ui,e as zi,h as ri,a0 as qi,Q as Gi}from"./index-6c34d204.js";import{a as Ui,b as Vi,c as Xi,d as Ki,e as Yi,f as Qi,g as Zi,h as Ji}from"./api-6edd3f4f.js";import{q as $i}from"./base-aba1ba3e.js";import{g as me,s as kt,a as ci,b as di}from"./api-2df42971.js";import{d as ze}from"./deep-clone-c0d00fc2.js";import{N as tn}from"./Image-2dd63dbd.js";import{T as en,a as qe}from"./index-2416e875.js";import{T as oi}from"./index-cad75acf.js";import"./fade-in-scale-up.cssr-2b5f3b8e.js";import"./use-tab-status-e808ebd1.js";import"./index-c7a1d472.js";const nn="_container_1xc3a_1",sn="_head_1xc3a_10",rn="_back_1xc3a_18",on="_tabs_1xc3a_21",an="_downBtn_1xc3a_37",ln="_activeBtn_1xc3a_48",hn="_icon_1xc3a_48",un="_iconUp_1xc3a_73",cn="_popover_1xc3a_78",dn="_content_1xc3a_97",pn="_wrap_1xc3a_103",fn="_emtpyWrap_1xc3a_109",gn="_wrapItem_1xc3a_120",mn="_item_1xc3a_130",yn="_name_1xc3a_161",vn="_favoriteBtn_1xc3a_168",wn="_containerImg_1xc3a_174",xn="_cover_1xc3a_200",bn="_loaded_1xc3a_230",An="_book_1xc3a_233",Pn="_bookWrap_1xc3a_247",Sn="_show_1xc3a_255",Tn="_popupContainer_1xc3a_260",Cn="_searchList_1xc3a_266",kn="_popoverTitle_1xc3a_272",Mn="_popupList_1xc3a_288",Dn="_btnGroup_1xc3a_310",_n="_btnSure_1xc3a_325",gt={container:nn,head:sn,back:rn,tabs:on,downBtn:an,activeBtn:ln,icon:hn,iconUp:un,popover:cn,content:dn,wrap:pn,emtpyWrap:fn,wrapItem:gn,item:mn,name:yn,favoriteBtn:vn,containerImg:wn,cover:xn,loaded:bn,book:An,bookWrap:Pn,show:Sn,popupContainer:Tn,searchList:Cn,popoverTitle:kn,popupList:Mn,btnGroup:Dn,btnSure:_n},pi=""+new URL("icon_back-b80c2fc2.svg",import.meta.url).href;const En="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",Nn="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",In=Me({name:"the-favorite",props:{isFavorite:{type:Boolean,default:!1}},setup(E){return()=>W("div",{class:["favoriteWrap",E.isFavorite?"liked":""]},[W("img",{class:"favoritIcon",src:E.isFavorite?Nn:En},null)])}}),Ln="_book_1xtvx_1",Fn="_back_1xtvx_11",Bn="_bookHide_1xtvx_16",Rn="_wrap_1xtvx_36",On="_wrapItem_1xtvx_53",Wn="_item_1xtvx_60",Hn="_des_1xtvx_69",jn="_icon_1xtvx_74",zn="_last_1xtvx_79",qt={book:Ln,back:Fn,bookHide:Bn,wrap:Rn,wrapItem:On,item:Wn,des:Hn,icon:jn,last:zn},qn="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=",Gn=Me({name:"courseware-detail",emits:["close"],setup(E,{emit:B}){const Q=ke({box:{},show:!1,steps:[{ele:"",eleRect:{},img:me("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}),st=ae(!1),$=ae({});(async()=>{var at;try{const ot=await ci({guideTag:"guideInfo"});ot.data?$.value=JSON.parse((at=ot.data)==null?void 0:at.guideValue)||null:$.value={},$.value&&$.value.coursewareDetail?st.value=!1:st.value=!0}catch(ot){console.log(ot)}})();const Z=()=>{console.log(`coursewareDetail-${Q.step}`);const at=document.getElementById(`coursewareDetail-${Q.step}`);if(at){const ot=at.getBoundingClientRect();Q.box={left:ot.x+"px",top:ot.y+"px",width:ot.width+"px",height:ot.height+"px"}}else bt()};Fe(()=>{Z(),window.addEventListener("resize",ut)});const ut=()=>{Z()};li(()=>{window.removeEventListener("resize",ut)});const bt=()=>{if(Q.step>=2){At();return}Q.step=Q.step+1,Z()},At=async()=>{$.value?$.value.coursewareDetail=!0:$.value={coursewareDetail:!0};try{const at=await di({guideTag:"guideInfo",guideValue:JSON.stringify($.value)})}catch(at){console.log(at)}st.value=!1};return()=>W(Ge,{teleport:"body",overlay:!1,closeOnClickOverlay:!1,class:["popup-custom",kt.guidePopup],show:st.value,"onUpdate:show":at=>st.value=at},{default:()=>{var at;return[W("div",{class:kt.content,onClick:()=>bt()},[Q.step!=Q.steps.length-1&&W("div",{class:kt.backBtn,onClick:ot=>{ot.stopPropagation(),At()}},[Bt("跳过")]),W("div",{class:kt.box,style:{...Q.box,...(at=Q.steps[Q.step])==null?void 0:at.boxStyle},id:`modeType-${Q.step}`},[Q.steps.map((ot,Et)=>{var Mt,St;return W("div",{onClick:X=>X.stopPropagation(),class:kt.item,style:{display:Et===Q.step?"":"none",left:`${(Mt=ot.eleRect)==null?void 0:Mt.left}px`,top:`${(St=ot.eleRect)==null?void 0:St.top}px`}},[W("img",{class:kt.img,style:ot.imgStyle,src:ot.img},null),W("img",{class:kt.iconHead,style:ot.handStyle,src:me("indexDot.png")},null),W("div",{class:kt.btns,style:ot.btnsStyle},[Q.step+1==Q.steps.length?W(Ue,null,[W(ce,{class:[kt.btn,kt.endBtn],round:!0,type:"primary",onClick:()=>At()},{default:()=>[Bt("完成")]})]):W(ce,{class:kt.btn,round:!0,type:"primary",onClick:()=>bt()},{default:()=>[Bt("下一步 ("),Q.step+1,Bt("/"),Q.steps.length,Bt(")")]})])])})])])]}})}});var Le={},Un={get exports(){return Le},set exports(E){Le=E}};(function(E,B){(function(Q,st){st(B)})(Oi,function(Q){class st{constructor(a,h){this.state={angle:0,area:[],position:{x:0,y:0},hardAngle:0,hardDrawingAngle:0},this.createdDensity=h,this.nowDrawingDensity=this.createdDensity,this.render=a}setDensity(a){this.createdDensity=a,this.nowDrawingDensity=a}setDrawingDensity(a){this.nowDrawingDensity=a}setPosition(a){this.state.position=a}setAngle(a){this.state.angle=a}setArea(a){this.state.area=a}setHardDrawingAngle(a){this.state.hardDrawingAngle=a}setHardAngle(a){this.state.hardAngle=a,this.state.hardDrawingAngle=a}setOrientation(a){this.orientation=a}getDrawingDensity(){return this.nowDrawingDensity}getDensity(){return this.createdDensity}getHardAngle(){return this.state.hardAngle}}class $ extends st{constructor(a,h,v){super(a,v),this.image=null,this.isLoad=!1,this.loadingAngle=0,this.image=new Image,this.image.src=h}draw(a){const h=this.render.getContext(),v=this.render.convertToGlobal(this.state.position),b=this.render.getRect().pageWidth,k=this.render.getRect().height;h.save(),h.translate(v.x,v.y),h.beginPath();for(let F of this.state.area)F!==null&&(F=this.render.convertToGlobal(F),h.lineTo(F.x-v.x,F.y-v.y));h.rotate(this.state.angle),h.clip(),this.isLoad?h.drawImage(this.image,0,0,b,k):this.drawLoader(h,{x:0,y:0},b,k),h.restore()}simpleDraw(a){const h=this.render.getRect(),v=this.render.getContext(),b=h.pageWidth,k=h.height,F=a===1?h.left+h.pageWidth:h.left,tt=h.top;this.isLoad?v.drawImage(this.image,F,tt,b,k):this.drawLoader(v,{x:F,y:tt},b,k)}drawLoader(a,h,v,b){a.beginPath(),a.strokeStyle="rgb(200, 200, 200)",a.fillStyle="rgb(255, 255, 255)",a.lineWidth=1,a.rect(h.x+1,h.y+1,v-1,b-1),a.stroke(),a.fill();const k={x:h.x+v/2,y:h.y+b/2};a.beginPath(),a.lineWidth=10,a.arc(k.x,k.y,20,this.loadingAngle,3*Math.PI/2+this.loadingAngle),a.stroke(),a.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 Wt{constructor(a,h){this.pages=[],this.currentPageIndex=0,this.currentSpreadIndex=0,this.landscapeSpread=[],this.portraitSpread=[],this.render=h,this.app=a,this.currentPageIndex=0,this.isShowCover=this.app.getSettings().showCover}destroy(){this.pages=[]}createSpread(){this.landscapeSpread=[],this.portraitSpread=[];for(let h=0;h=0&&a0?this.pages[h-1]:null}getFlippingPage(a){const h=this.currentSpreadIndex;if(this.render.getOrientation()==="portrait")return a===0?this.pages[h].newTemporaryCopy():this.pages[h-1];{const v=a===0?this.getSpread()[h+1]:this.getSpread()[h-1];return v.length===1||a===0?this.pages[v[0]]:this.pages[v[1]]}}getBottomPage(a){const h=this.currentSpreadIndex;if(this.render.getOrientation()==="portrait")return a===0?this.pages[h+1]:this.pages[h-1];{const v=a===0?this.getSpread()[h+1]:this.getSpread()[h-1];return v.length===1?this.pages[v[0]]:a===0?this.pages[v[1]]:this.pages[v[0]]}}showNext(){this.currentSpreadIndex0&&(this.currentSpreadIndex--,this.showSpread())}getCurrentPageIndex(){return this.currentPageIndex}show(a=null){if(a===null&&(a=this.currentPageIndex),a<0||a>=this.pages.length)return;const h=this.getSpreadIndexByPage(a);h!==null&&(this.currentSpreadIndex=h,this.showSpread())}getCurrentSpreadIndex(){return this.currentSpreadIndex}setCurrentSpreadIndex(a){if(!(a>=0&&a=a.left&&h.x<=a.width+a.left&&h.y>=a.top&&h.y<=a.top+a.height?h:null}static GetRotatedPoint(a,h,v){return{x:a.x*Math.cos(v)+a.y*Math.sin(v)+h.x,y:a.y*Math.cos(v)-a.x*Math.sin(v)+h.y}}static LimitPointToCircle(a,h,v){if(ut.GetDistanceBetweenTwoPoint(a,v)<=h)return v;const b=a.x,k=a.y,F=v.x,tt=v.y;let it=Math.sqrt(Math.pow(h,2)*Math.pow(b-F,2)/(Math.pow(b-F,2)+Math.pow(k-tt,2)))+b;v.x<0&&(it*=-1);let mt=(it-b)*(k-tt)/(b-F)+k;return b-F+k===0&&(mt=h),{x:it,y:mt}}static GetIntersectBetweenTwoSegment(a,h,v){return ut.PointInRect(a,ut.GetIntersectBeetwenTwoLine(h,v))}static GetIntersectBeetwenTwoLine(a,h){const v=a[0].y-a[1].y,b=h[0].y-h[1].y,k=a[1].x-a[0].x,F=h[1].x-h[0].x,tt=a[0].x*a[1].y-a[1].x*a[0].y,it=h[0].x*h[1].y-h[1].x*h[0].y,mt=v*it-b*tt,xt=k*it-F*tt,Ct=-(tt*F-it*k)/(v*F-b*k),Xt=-(v*it-b*tt)/(v*F-b*k);if(isFinite(Ct)&&isFinite(Xt))return{x:Ct,y:Xt};if(Math.abs(mt-xt)<.1)throw new Error("Segment included");return null}static GetCordsFromTwoPoint(a,h){const v=Math.abs(a.x-h.x),b=Math.abs(a.y-h.y),k=Math.max(v,b),F=[a];function tt(it,mt,xt,Ct,Xt){return mt>it?it+Xt*(xt/Ct):mt=10&&a.push(this.sideIntersectPoint):this.corner==="top"&&a.push({x:this.pageWidth,y:this.pageHeight}),a.push(this.bottomIntersectPoint),a.push(this.topIntersectPoint),a}getAngle(){return this.direction===0?-this.angle:this.angle}getRect(){return this.rect}getPosition(){return this.position}getActiveCorner(){return this.direction===0?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 this.direction===1?{x:this.pageWidth,y:0}:{x:0,y:0}}getShadowStartPoint(){return this.corner==="top"?this.topIntersectPoint:this.sideIntersectPoint!==null?this.sideIntersectPoint:this.topIntersectPoint}getShadowAngle(){const a=ut.GetAngleBetweenTwoLine(this.getSegmentToShadowLine(),[{x:0,y:0},{x:this.pageWidth,y:0}]);return this.direction===0?a:Math.PI-a}calcAngleAndPosition(a){let h=a;if(this.updateAngleAndGeometry(h),h=this.corner==="top"?this.checkPositionAtCenterLine(h,{x:0,y:0},{x:0,y:this.pageHeight}):this.checkPositionAtCenterLine(h,{x:0,y:this.pageHeight},{x:0,y:0}),Math.abs(h.x-this.pageWidth)<1&&Math.abs(h.y)<1)throw new Error("Point is too small");return h}updateAngleAndGeometry(a){this.angle=this.calculateAngle(a),this.rect=this.getPageRect(a)}calculateAngle(a){const h=this.pageWidth-a.x+1,v=this.corner==="bottom"?this.pageHeight-a.y:a.y;let b=2*Math.acos(h/Math.sqrt(v*v+h*h));v<0&&(b=-b);const k=Math.PI-b;if(!isFinite(b)||k>=0&&k<.003)throw new Error("The G point is too small");return this.corner==="bottom"&&(b=-b),b}getPageRect(a){return this.corner==="top"?this.getRectFromBasePoint([{x:0,y:0},{x:this.pageWidth,y:0},{x:0,y:this.pageHeight},{x:this.pageWidth,y:this.pageHeight}],a):this.getRectFromBasePoint([{x:0,y:-this.pageHeight},{x:this.pageWidth,y:-this.pageHeight},{x:0,y:0},{x:this.pageWidth,y:0}],a)}getRectFromBasePoint(a,h){return{topLeft:this.getRotatedPoint(a[0],h),topRight:this.getRotatedPoint(a[1],h),bottomLeft:this.getRotatedPoint(a[2],h),bottomRight:this.getRotatedPoint(a[3],h)}}getRotatedPoint(a,h){return{x:a.x*Math.cos(this.angle)+a.y*Math.sin(this.angle)+h.x,y:a.y*Math.cos(this.angle)-a.x*Math.sin(this.angle)+h.y}}calculateIntersectPoint(a){const h={left:-1,top:-1,width:this.pageWidth+2,height:this.pageHeight+2};this.corner==="top"?(this.topIntersectPoint=ut.GetIntersectBetweenTwoSegment(h,[a,this.rect.topRight],[{x:0,y:0},{x:this.pageWidth,y:0}]),this.sideIntersectPoint=ut.GetIntersectBetweenTwoSegment(h,[a,this.rect.bottomLeft],[{x:this.pageWidth,y:0},{x:this.pageWidth,y:this.pageHeight}]),this.bottomIntersectPoint=ut.GetIntersectBetweenTwoSegment(h,[this.rect.bottomLeft,this.rect.bottomRight],[{x:0,y:this.pageHeight},{x:this.pageWidth,y:this.pageHeight}])):(this.topIntersectPoint=ut.GetIntersectBetweenTwoSegment(h,[this.rect.topLeft,this.rect.topRight],[{x:0,y:0},{x:this.pageWidth,y:0}]),this.sideIntersectPoint=ut.GetIntersectBetweenTwoSegment(h,[a,this.rect.topLeft],[{x:this.pageWidth,y:0},{x:this.pageWidth,y:this.pageHeight}]),this.bottomIntersectPoint=ut.GetIntersectBetweenTwoSegment(h,[this.rect.bottomLeft,this.rect.bottomRight],[{x:0,y:this.pageHeight},{x:this.pageWidth,y:this.pageHeight}]))}checkPositionAtCenterLine(a,h,v){let b=a;const k=ut.LimitPointToCircle(h,this.pageWidth,b);b!==k&&(b=k,this.updateAngleAndGeometry(b));const F=Math.sqrt(Math.pow(this.pageWidth,2)+Math.pow(this.pageHeight,2));let tt=this.rect.bottomRight,it=this.rect.topLeft;if(this.corner==="bottom"&&(tt=this.rect.topRight,it=this.rect.bottomLeft),tt.x<=0){const mt=ut.LimitPointToCircle(v,F,it);mt!==b&&(b=mt,this.updateAngleAndGeometry(b))}return b}getSegmentToShadowLine(){const a=this.getShadowStartPoint();return[a,a!==this.sideIntersectPoint&&this.sideIntersectPoint!==null?this.sideIntersectPoint:this.bottomIntersectPoint]}}class ot{constructor(a,h){this.flippingPage=null,this.bottomPage=null,this.calc=null,this.state="read",this.render=a,this.app=h}fold(a){this.setState("user_fold"),this.calc===null&&this.start(a),this.do(this.render.convertToPage(a))}flip(a){if(this.app.getSettings().disableFlipByClick&&!this.isPointOnCorners(a)||(this.calc!==null&&this.render.finishAnimation(),!this.start(a)))return;const h=this.getBoundsRect();this.setState("flipping");const v=h.height/10,b=this.calc.getCorner()==="bottom"?h.height-v:v,k=this.calc.getCorner()==="bottom"?h.height:0;this.calc.calc({x:h.pageWidth-v,y:b}),this.animateFlippingTo({x:h.pageWidth-v,y:b},{x:-h.pageWidth,y:k},!0)}start(a){this.reset();const h=this.render.convertToBook(a),v=this.getBoundsRect(),b=this.getDirectionByPoint(h),k=h.y>=v.height/2?"bottom":"top";if(!this.checkDirection(b))return!1;try{if(this.flippingPage=this.app.getPageCollection().getFlippingPage(b),this.bottomPage=this.app.getPageCollection().getBottomPage(b),this.render.getOrientation()==="landscape")if(b===1){const F=this.app.getPageCollection().nextBy(this.flippingPage);F!==null&&this.flippingPage.getDensity()!==F.getDensity()&&(this.flippingPage.setDrawingDensity("hard"),F.setDrawingDensity("hard"))}else{const F=this.app.getPageCollection().prevBy(this.flippingPage);F!==null&&this.flippingPage.getDensity()!==F.getDensity()&&(this.flippingPage.setDrawingDensity("hard"),F.setDrawingDensity("hard"))}return this.render.setDirection(b),this.calc=new at(b,k,v.pageWidth.toString(10),v.height.toString(10)),!0}catch(F){return!1}}do(a){if(this.calc!==null&&this.calc.calc(a)){const h=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()),this.calc.getDirection()===0?this.flippingPage.setHardAngle(90*(200-2*h)/100):this.flippingPage.setHardAngle(-90*(200-2*h)/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(),h,this.calc.getDirection())}}flipToPage(a,h){const v=this.app.getPageCollection().getCurrentSpreadIndex(),b=this.app.getPageCollection().getSpreadIndexByPage(a);try{b>v&&(this.app.getPageCollection().setCurrentSpreadIndex(b-1),this.flipNext(h)),bthis.do(it));const tt=this.getAnimationDuration(k.length);this.render.startAnimation(F,tt,()=>{this.calc&&(v&&(this.calc.getDirection()===1?this.app.turnToPrevPage():this.app.turnToNextPage()),b&&(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(a){this.state!==a&&(this.app.updateState(a),this.state=a)}getDirectionByPoint(a){const h=this.getBoundsRect();if(this.render.getOrientation()==="portrait"){if(a.x-h.pageWidth<=h.width/5)return 1}else if(a.x=1e3?h:a/1e3*h}checkDirection(a){return a===0?this.app.getCurrentPageIndex()=1}reset(){this.calc=null,this.flippingPage=null,this.bottomPage=null}getBoundsRect(){return this.render.getRect()}checkState(...a){for(const h of a)if(this.state===h)return!0;return!1}isPointOnCorners(a){const h=this.getBoundsRect(),v=h.pageWidth,b=Math.sqrt(Math.pow(v,2)+Math.pow(h.height,2))/5,k=this.render.convertToBook(a);return k.x>0&&k.y>0&&k.xh.width-b)&&(k.yh.height-b)}}class Et{constructor(a,h){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=h,this.app=a;const v=new RegExp("Version\\/[\\d\\.]+.*Safari/");this.safari=v.exec(window.navigator.userAgent)!==null}render(a){if(this.animation!==null){const h=Math.round((a-this.animation.startedAt)/this.animation.durationFrame);h{this.render(h),requestAnimationFrame(a)};requestAnimationFrame(a)}startAnimation(a,h,v){this.finishAnimation(),this.animation={frames:a,duration:h,durationFrame:h/a.length,onAnimateEnd:v,startedAt:this.timer}}finishAnimation(){this.animation!==null&&(this.animation.frames[this.animation.frames.length-1](),this.animation.onAnimateEnd!==null&&this.animation.onAnimateEnd()),this.animation=null}update(){this.boundsRect=null;const a=this.calculateBoundsRect();this.orientation!==a&&(this.orientation=a,this.app.updateOrientation(a))}calculateBoundsRect(){let a="landscape";const h=this.getBlockWidth(),v=h/2,b=this.getBlockHeight()/2,k=this.setting.width/this.setting.height;let F=this.setting.width,tt=this.setting.height,it=v-F;return this.setting.size==="stretch"?(h<2*this.setting.minWidth&&this.app.getSettings().usePortrait&&(a="portrait"),F=a==="portrait"?this.getBlockWidth():this.getBlockWidth()/2,F>this.setting.maxWidth&&(F=this.setting.maxWidth),tt=F/k,tt>this.getBlockHeight()&&(tt=this.getBlockHeight(),F=tt*k),it=a==="portrait"?v-F/2-F:v-F):h<2*F&&this.app.getSettings().usePortrait&&(a="portrait",it=v-F/2-F),this.boundsRect={left:it,top:b-tt/2,width:2*F,height:tt,pageWidth:F},a}setShadowData(a,h,v,b){if(!this.app.getSettings().drawShadow)return;const k=100*this.getSettings().maxShadowOpacity;this.shadow={pos:a,angle:h,width:3*this.getRect().pageWidth/4*v/100,opacity:(100-v)*k/100/100,direction:b,progress:2*v}}clearShadow(){this.shadow=null}getBlockWidth(){return this.app.getUI().getDistElement().offsetWidth}getBlockHeight(){return this.app.getUI().getDistElement().offsetHeight}getDirection(){return this.direction}getRect(){return this.boundsRect===null&&this.calculateBoundsRect(),this.boundsRect}getSettings(){return this.app.getSettings()}getOrientation(){return this.orientation}setPageRect(a){this.pageRect=a}setDirection(a){this.direction=a}setRightPage(a){a!==null&&a.setOrientation(1),this.rightPage=a}setLeftPage(a){a!==null&&a.setOrientation(0),this.leftPage=a}setBottomPage(a){a!==null&&a.setOrientation(this.direction===1?0:1),this.bottomPage=a}setFlippingPage(a){a!==null&&a.setOrientation(this.direction===0&&this.orientation!=="portrait"?0:1),this.flippingPage=a}convertToBook(a){const h=this.getRect();return{x:a.x-h.left,y:a.y-h.top}}isSafari(){return this.safari}convertToPage(a,h){h||(h=this.direction);const v=this.getRect();return{x:h===0?a.x-v.left-v.width/2:v.width/2-a.x+v.left,y:a.y-v.top}}convertToGlobal(a,h){if(h||(h=this.direction),a==null)return null;const v=this.getRect();return{x:h===0?a.x+v.left+v.width/2:v.width/2-a.x+v.left,y:a.y+v.top}}convertRectToGlobal(a,h){return h||(h=this.direction),{topLeft:this.convertToGlobal(a.topLeft,h),topRight:this.convertToGlobal(a.topRight,h),bottomLeft:this.convertToGlobal(a.bottomLeft,h),bottomRight:this.convertToGlobal(a.bottomRight,h)}}}class Mt extends Et{constructor(a,h,v){super(a,h),this.canvas=v,this.ctx=v.getContext("2d")}getContext(){return this.ctx}reload(){}drawFrame(){this.clear(),this.orientation!=="portrait"&&this.leftPage!=null&&this.leftPage.simpleDraw(0),this.rightPage!=null&&this.rightPage.simpleDraw(1),this.bottomPage!=null&&this.bottomPage.draw(),this.drawBookShadow(),this.flippingPage!=null&&this.flippingPage.draw(),this.shadow!=null&&(this.drawOuterShadow(),this.drawInnerShadow());const a=this.getRect();this.orientation==="portrait"&&(this.ctx.beginPath(),this.ctx.rect(a.left+a.pageWidth,a.top,a.width,a.height),this.ctx.clip())}drawBookShadow(){const a=this.getRect();this.ctx.save(),this.ctx.beginPath();const h=a.width/20;this.ctx.rect(a.left,a.top,a.width,a.height);const v={x:a.left+a.width/2-h/2,y:0};this.ctx.translate(v.x,v.y);const b=this.ctx.createLinearGradient(0,0,h,0);b.addColorStop(0,"rgba(0, 0, 0, 0)"),b.addColorStop(.4,"rgba(0, 0, 0, 0.2)"),b.addColorStop(.49,"rgba(0, 0, 0, 0.1)"),b.addColorStop(.5,"rgba(0, 0, 0, 0.5)"),b.addColorStop(.51,"rgba(0, 0, 0, 0.4)"),b.addColorStop(1,"rgba(0, 0, 0, 0)"),this.ctx.clip(),this.ctx.fillStyle=b,this.ctx.fillRect(0,0,h,2*a.height),this.ctx.restore()}drawOuterShadow(){const a=this.getRect();this.ctx.save(),this.ctx.beginPath(),this.ctx.rect(a.left,a.top,a.width,a.height);const h=this.convertToGlobal({x:this.shadow.pos.x,y:this.shadow.pos.y});this.ctx.translate(h.x,h.y),this.ctx.rotate(Math.PI+this.shadow.angle+Math.PI/2);const v=this.ctx.createLinearGradient(0,0,this.shadow.width,0);this.shadow.direction===0?(this.ctx.translate(0,-100),v.addColorStop(0,"rgba(0, 0, 0, "+this.shadow.opacity+")"),v.addColorStop(1,"rgba(0, 0, 0, 0)")):(this.ctx.translate(-this.shadow.width,-100),v.addColorStop(0,"rgba(0, 0, 0, 0)"),v.addColorStop(1,"rgba(0, 0, 0, "+this.shadow.opacity+")")),this.ctx.clip(),this.ctx.fillStyle=v,this.ctx.fillRect(0,0,this.shadow.width,2*a.height),this.ctx.restore()}drawInnerShadow(){const a=this.getRect();this.ctx.save(),this.ctx.beginPath();const h=this.convertToGlobal({x:this.shadow.pos.x,y:this.shadow.pos.y}),v=this.convertRectToGlobal(this.pageRect);this.ctx.moveTo(v.topLeft.x,v.topLeft.y),this.ctx.lineTo(v.topRight.x,v.topRight.y),this.ctx.lineTo(v.bottomRight.x,v.bottomRight.y),this.ctx.lineTo(v.bottomLeft.x,v.bottomLeft.y),this.ctx.translate(h.x,h.y),this.ctx.rotate(Math.PI+this.shadow.angle+Math.PI/2);const b=3*this.shadow.width/4,k=this.ctx.createLinearGradient(0,0,b,0);this.shadow.direction===0?(this.ctx.translate(-b,-100),k.addColorStop(1,"rgba(0, 0, 0, "+this.shadow.opacity+")"),k.addColorStop(.9,"rgba(0, 0, 0, 0.05)"),k.addColorStop(.7,"rgba(0, 0, 0, "+this.shadow.opacity+")"),k.addColorStop(0,"rgba(0, 0, 0, 0)")):(this.ctx.translate(0,-100),k.addColorStop(0,"rgba(0, 0, 0, "+this.shadow.opacity+")"),k.addColorStop(.1,"rgba(0, 0, 0, 0.05)"),k.addColorStop(.3,"rgba(0, 0, 0, "+this.shadow.opacity+")"),k.addColorStop(1,"rgba(0, 0, 0, 0)")),this.ctx.clip(),this.ctx.fillStyle=k,this.ctx.fillRect(0,0,b,2*a.height),this.ctx.restore()}clear(){this.ctx.fillStyle="white",this.ctx.fillRect(0,0,this.canvas.width,this.canvas.height)}}class St{constructor(a,h,v){this.touchPoint=null,this.swipeTimeout=250,this.onResize=()=>{this.update()},this.onMouseDown=k=>{if(this.checkTarget(k.target)){const F=this.getMousePos(k.clientX,k.clientY);this.app.startUserTouch(F),k.preventDefault()}},this.onTouchStart=k=>{if(this.checkTarget(k.target)&&k.changedTouches.length>0){const F=k.changedTouches[0],tt=this.getMousePos(F.clientX,F.clientY);this.touchPoint={point:tt,time:Date.now()},setTimeout(()=>{this.touchPoint!==null&&this.app.startUserTouch(tt)},this.swipeTimeout),this.app.getSettings().mobileScrollSupport||k.preventDefault()}},this.onMouseUp=k=>{const F=this.getMousePos(k.clientX,k.clientY);this.app.userStop(F)},this.onMouseMove=k=>{const F=this.getMousePos(k.clientX,k.clientY);this.app.userMove(F,!1)},this.onTouchMove=k=>{if(k.changedTouches.length>0){const F=k.changedTouches[0],tt=this.getMousePos(F.clientX,F.clientY);this.app.getSettings().mobileScrollSupport?(this.touchPoint!==null&&(Math.abs(this.touchPoint.point.x-tt.x)>10||this.app.getState()!=="read")&&k.cancelable&&this.app.userMove(tt,!0),this.app.getState()!=="read"&&k.preventDefault()):this.app.userMove(tt,!0)}},this.onTouchEnd=k=>{if(k.changedTouches.length>0){const F=k.changedTouches[0],tt=this.getMousePos(F.clientX,F.clientY);let it=!1;if(this.touchPoint!==null){const mt=tt.x-this.touchPoint.point.x,xt=Math.abs(tt.y-this.touchPoint.point.y);Math.abs(mt)>this.swipeDistance&&xt<2*this.swipeDistance&&Date.now()-this.touchPoint.time0?this.app.flipPrev(this.touchPoint.point.y'),this.wrapper=a.querySelector(".stf__wrapper"),this.app=h;const b=this.app.getSettings().usePortrait?1:2;a.style.minWidth=v.minWidth*b+"px",a.style.minHeight=v.minHeight+"px",v.size==="fixed"&&(a.style.minWidth=v.width*b+"px",a.style.minHeight=v.height+"px"),v.autoSize&&(a.style.width="100%",a.style.maxWidth=2*v.maxWidth+"px"),a.style.display="block",window.addEventListener("resize",this.onResize,!1),this.swipeDistance=v.swipeDistance}destroy(){this.app.getSettings().useMouseEvents&&this.removeHandlers(),this.distElement.remove(),this.wrapper.remove()}getDistElement(){return this.distElement}getWrapper(){return this.wrapper}setOrientationStyle(a){this.wrapper.classList.remove("--portrait","--landscape"),a==="portrait"?(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(a,h){const v=this.distElement.getBoundingClientRect();return{x:a-v.left,y:h-v.top}}checkTarget(a){return!this.app.getSettings().clickEventForward||!["a","button"].includes(a.tagName.toLowerCase())}}class X extends St{constructor(a,h,v,b){super(a,h,v),this.wrapper.insertAdjacentHTML("afterbegin",'
'),this.distElement=a.querySelector(".stf__block"),this.items=b;for(const k of b)this.distElement.appendChild(k);this.setHandlers()}clear(){for(const a of this.items)this.parentElement.appendChild(a)}updateItems(a){this.removeHandlers(),this.distElement.innerHTML="";for(const h of a)this.distElement.appendChild(h);this.items=a,this.setHandlers()}update(){this.app.getRender().update()}}class z extends St{constructor(a,h,v){super(a,h,v),this.wrapper.innerHTML='',this.canvas=a.querySelectorAll("canvas")[0],this.distElement=this.canvas,this.resizeCanvas(),this.setHandlers()}resizeCanvas(){const a=getComputedStyle(this.canvas),h=parseInt(a.getPropertyValue("width"),10),v=parseInt(a.getPropertyValue("height"),10);this.canvas.width=h,this.canvas.height=v}getCanvas(){return this.canvas}update(){this.resizeCanvas(),this.app.getRender().update()}}class wt extends Et{constructor(a,h,v){super(a,h),this.outerShadow=null,this.innerShadow=null,this.hardShadow=null,this.hardInnerShadow=null,this.element=v,this.createShadows()}createShadows(){this.element.insertAdjacentHTML("beforeend",`
`),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 a=this.getRect(),h=this.shadow.progress>100?200-this.shadow.progress:this.shadow.progress;let v=(100-h)*(2.5*a.pageWidth)/100+20;v>a.pageWidth&&(v=a.pageWidth);let b=` display: block; z-index: ${(this.getSettings().startZIndex+5).toString(10)}; width: ${v}px; height: ${a.height}px; background: linear-gradient(to right, rgba(0, 0, 0, ${this.shadow.opacity*h/100}) 5%, rgba(0, 0, 0, 0) 100%); left: ${a.left+a.width/2}px; transform-origin: 0 0; `;b+=this.getDirection()===0&&this.shadow.progress>100||this.getDirection()===1&&this.shadow.progress<=100?"transform: translate3d(0, 0, 0);":"transform: translate3d(0, 0, 0) rotateY(180deg);",this.hardInnerShadow.style.cssText=b}drawHardOuterShadow(){const a=this.getRect();let h=(100-(this.shadow.progress>100?200-this.shadow.progress:this.shadow.progress))*(2.5*a.pageWidth)/100+20;h>a.pageWidth&&(h=a.pageWidth);let v=` display: block; z-index: ${(this.getSettings().startZIndex+4).toString(10)}; width: ${h}px; height: ${a.height}px; background: linear-gradient(to left, rgba(0, 0, 0, ${this.shadow.opacity}) 5%, rgba(0, 0, 0, 0) 100%); left: ${a.left+a.width/2}px; transform-origin: 0 0; `;v+=this.getDirection()===0&&this.shadow.progress>100||this.getDirection()===1&&this.shadow.progress<=100?"transform: translate3d(0, 0, 0) rotateY(180deg);":"transform: translate3d(0, 0, 0);",this.hardShadow.style.cssText=v}drawInnerShadow(){const a=this.getRect(),h=3*this.shadow.width/4,v=this.getDirection()===0?h:0,b=this.getDirection()===0?"to left":"to right",k=this.convertToGlobal(this.shadow.pos),F=this.shadow.angle+3*Math.PI/2,tt=[this.pageRect.topLeft,this.pageRect.topRight,this.pageRect.bottomRight,this.pageRect.bottomLeft];let it="polygon( ";for(const xt of tt){let Ct=this.getDirection()===1?{x:-xt.x+this.shadow.pos.x,y:xt.y-this.shadow.pos.y}:{x:xt.x-this.shadow.pos.x,y:xt.y-this.shadow.pos.y};Ct=ut.GetRotatedPoint(Ct,{x:v,y:100},F),it+=Ct.x+"px "+Ct.y+"px, "}it=it.slice(0,-2),it+=")";const mt=` display: block; z-index: ${(this.getSettings().startZIndex+10).toString(10)}; width: ${h}px; height: ${2*a.height}px; background: linear-gradient(${b}, rgba(0, 0, 0, ${this.shadow.opacity}) 5%, rgba(0, 0, 0, 0.05) 15%, rgba(0, 0, 0, ${this.shadow.opacity}) 35%, rgba(0, 0, 0, 0) 100%); transform-origin: ${v}px 100px; transform: translate3d(${k.x-v}px, ${k.y-100}px, 0) rotate(${F}rad); clip-path: ${it}; -webkit-clip-path: ${it}; `;this.innerShadow.style.cssText=mt}drawOuterShadow(){const a=this.getRect(),h=this.convertToGlobal({x:this.shadow.pos.x,y:this.shadow.pos.y}),v=this.shadow.angle+3*Math.PI/2,b=this.getDirection()===1?this.shadow.width:0,k=this.getDirection()===0?"to right":"to left",F=[{x:0,y:0},{x:a.pageWidth,y:0},{x:a.pageWidth,y:a.height},{x:0,y:a.height}];let tt="polygon( ";for(const mt of F)if(mt!==null){let xt=this.getDirection()===1?{x:-mt.x+this.shadow.pos.x,y:mt.y-this.shadow.pos.y}:{x:mt.x-this.shadow.pos.x,y:mt.y-this.shadow.pos.y};xt=ut.GetRotatedPoint(xt,{x:b,y:100},v),tt+=xt.x+"px "+xt.y+"px, "}tt=tt.slice(0,-2),tt+=")";const it=` display: block; z-index: ${(this.getSettings().startZIndex+10).toString(10)}; width: ${this.shadow.width}px; height: ${2*a.height}px; background: linear-gradient(${k}, rgba(0, 0, 0, ${this.shadow.opacity}), rgba(0, 0, 0, 0)); transform-origin: ${b}px 100px; transform: translate3d(${h.x-b}px, ${h.y-100}px, 0) rotate(${v}rad); clip-path: ${tt}; -webkit-clip-path: ${tt}; `;this.outerShadow.style.cssText=it}drawLeftPage(){this.orientation!=="portrait"&&this.leftPage!==null&&(this.direction===1&&this.flippingPage!==null&&this.flippingPage.getDrawingDensity()==="hard"?(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(){this.rightPage!==null&&(this.direction===0&&this.flippingPage!==null&&this.flippingPage.getDrawingDensity()==="hard"?(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(this.bottomPage===null)return;const a=this.flippingPage!=null?this.flippingPage.getDrawingDensity():null;this.orientation==="portrait"&&this.direction===1||(this.bottomPage.getElement().style.zIndex=(this.getSettings().startZIndex+3).toString(10),this.bottomPage.draw(a))}drawFrame(){this.clear(),this.drawLeftPage(),this.drawRightPage(),this.drawBottomPage(),this.flippingPage!=null&&(this.flippingPage.getElement().style.zIndex=(this.getSettings().startZIndex+5).toString(10),this.flippingPage.draw()),this.shadow!=null&&this.flippingPage!==null&&(this.flippingPage.getDrawingDensity()==="soft"?(this.drawOuterShadow(),this.drawInnerShadow()):(this.drawHardOuterShadow(),this.drawHardInnerShadow()))}clear(){for(const a of this.app.getPageCollection().getPages())a!==this.leftPage&&a!==this.rightPage&&a!==this.flippingPage&&a!==this.bottomPage&&(a.getElement().style.cssText="display: none"),a.getTemporaryCopy()!==this.flippingPage&&a.hideTemporaryCopy()}update(){super.update(),this.rightPage!==null&&this.rightPage.setOrientation(1),this.leftPage!==null&&this.leftPage.setOrientation(0)}}class ct{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(a){const h=this._default;if(Object.assign(h,a),h.size!=="stretch"&&h.size!=="fixed")throw new Error('Invalid size type. Available only "fixed" and "stretch" value');if(h.width<=0||h.height<=0)throw new Error("Invalid width or height");if(h.flippingTime<=0)throw new Error("Invalid flipping time");return h.size==="stretch"?(h.minWidth<=0&&(h.minWidth=100),h.maxWidth{this.ui.update(),this.trigger("init",this,{page:this.setting.startPage,mode:this.render.getOrientation()})},1)}loadFromHTML(j){this.ui=new X(this.block,this,this.setting,j),this.render=new wt(this,this.setting,this.ui.getDistElement()),this.flipController=new ot(this.render,this),this.pages=new At(this,this.render,this.ui.getDistElement(),j),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(j){const a=this.pages.getCurrentPageIndex();this.pages.destroy(),this.pages=new Z(this,this.render,j),this.pages.load(),this.pages.show(a),this.trigger("update",this,{page:a,mode:this.render.getOrientation()})}updateFromHtml(j){const a=this.pages.getCurrentPageIndex();this.pages.destroy(),this.pages=new At(this,this.render,this.ui.getDistElement(),j),this.pages.load(),this.ui.updateItems(j),this.render.reload(),this.pages.show(a),this.trigger("update",this,{page:a,mode:this.render.getOrientation()})}clear(){this.pages.destroy(),this.ui.clear()}turnToPrevPage(){this.pages.showPrev()}turnToNextPage(){this.pages.showNext()}turnToPage(j){this.pages.show(j)}flipNext(j="top"){this.flipController.flipNext(j)}flipPrev(j="top"){this.flipController.flipPrev(j)}flip(j,a="top"){this.flipController.flipToPage(j,a)}updateState(j){this.trigger("changeState",this,j)}updatePageIndex(j){this.trigger("flip",this,j)}updateOrientation(j){this.ui.setOrientationStyle(j),this.update(),this.trigger("changeOrientation",this,j)}getPageCount(){return this.pages.getPageCount()}getCurrentPageIndex(){return this.pages.getCurrentPageIndex()}getPage(j){return this.pages.getPage(j)}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(j){this.mousePosition=j,this.isUserTouch=!0,this.isUserMove=!1}userMove(j,a){this.isUserTouch||a||!this.setting.showPageCorners?this.isUserTouch&&ut.GetDistanceBetweenTwoPoint(this.mousePosition,j)>5&&(this.isUserMove=!0,this.flipController.fold(j)):this.flipController.showCorner(j)}userStop(j,a=!1){this.isUserTouch&&(this.isUserTouch=!1,a||(this.isUserMove?this.flipController.stopMove():this.flipController.flip(j)))}},Object.defineProperty(Q,"__esModule",{value:!0})})})(Un,Le);const Vn=Me({name:"the-book",props:{bookData:{type:Object,default:()=>({})},tab:{type:String,default:""},show:{type:Boolean,default:!1},rect:{type:Object,default:()=>({})}},emits:["close"],setup(E,{emit:B}){var Et,Mt,St,X;hi(),console.log(Ie.user.data.phone);const Q="lastTime"+((X=(St=(Mt=(Et=Ie)==null?void 0:Et.user)==null?void 0:Mt.data)==null?void 0:St.phone)!=null?X:""),st=ke({show:!1,width:0,height:0,transform:"",list:[],lastTime:localStorage.getItem(Q)}),$=ae(!1),Wt=async()=>{console.log("初始化完成")};let Z=null,ut=null;const bt=()=>{const z=document.body.clientHeight*.8;st.height=z,st.width=z*(210/297)*2,st.show=!0,si(()=>{const wt=document.getElementById("flipbook");new Le.PageFlip(wt,{width:st.width/2,height:st.height,showCover:!0}).loadFromHTML(document.querySelectorAll(".page"))})},At=()=>{clearTimeout(ut);const z=document.querySelector(".bookWrap");Z.turn("page",1),z&&(z.style.transform=st.transform),B("close"),setTimeout(()=>{z.style.transition="",z.style.transform="",st.show=!1,st.list=[]},1e3)};Fe(async()=>{await Wt(),Wi("webViewOnResume",()=>{st.lastTime=localStorage.getItem(Q)})});const at=()=>{var j;if(!((j=E.bookData)!=null&&j.lessonList))return;const z=Math.floor((document.body.clientHeight*.8-40)/50);console.log("🚀 ~ step:",z);const wt=[];let ct=[];for(let a=0;a=z?(wt.push([...ct]),ct=[{name:h.name}]):ct.push({name:h.name});for(let v=0;v=z?(wt.push([...ct]),ct=[h.knowledgeList[v]]):ct.push(h.knowledgeList[v])}ct.length&&wt.push(ct),st.list=wt};Hi(()=>E.show,()=>{E.show&&(at(),si(()=>{bt()}))});const ot=z=>{if(z.id){if(!z.containMaterial){ji("暂无资源");return}localStorage.setItem(Q,z.id);const wt=$i.stringify({id:z.id,lessonCoursewareId:z.lessonCoursewareId,lessonCoursewareDetailId:z.lessonCoursewareDetailId,name:z.name,tab:E.tab}),ct=location.origin+location.pathname+"#/courseware-play?"+wt;console.log("🚀 ~ url:",ct),ui({api:"openWebView",content:{url:ct,orientation:0,isHideTitle:!1,c_orientation:0}})}};return()=>W("div",{class:[qt.book,st.show?"":qt.bookHide]},[W("div",{class:qt.back,onClick:At},[W("img",{src:pi},null)]),W("div",{class:"bookWrap",style:{width:st.width+"px"}},[!!st.list.length&&W("div",{id:"flipbook"},[W("div",{class:"page","data-density":"hard"},[W("img",{style:"width: 100%; height: 100%; object-fit: cover;",src:E.bookData.coverImg},null)]),st.list.map(z=>W("div",{class:"page"},[W("div",{class:qt.wrap},[W("div",{class:qt.wrapItem},[z.map((wt,ct)=>W(Ue,null,[W("div",{class:[qt.item,wt.id&&qt.des],onTouchstart:j=>{j.stopPropagation()},onClick:j=>{j.stopPropagation(),ot(wt)}},[wt.id?W("img",{id:ct==1?"coursewareDetail-0":"",class:qt.icon,src:qn},null):null,W("div",{class:qt.name,style:{lineHeight:"20Px"}},[wt.name,st.lastTime===wt.id&&W("span",{class:qt.last},[Bt("上次观看")])])])]))])])])),st.list.length%2===1&&W("div",{class:"page"},[W("div",{class:qt.wrap},[W("div",{class:qt.wrapItem},null)])]),W("div",{class:"page","data-density":"hard"},[W("div",{class:qt.wrap},[W("div",{class:qt.wrapItem,style:{background:"#FFD8A1"}},null)])])])]),$.value?W(Gn,null,null):null])}}),Xn=Me({name:"courseware-list",emits:["close"],setup(E,{emit:B}){const Q=ke({box:{},show:!1,steps:[{ele:"",eleRect:{},img:me("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:me("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:me("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:me("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}),st=ae(!1),$=ae({});(async()=>{var at;try{const ot=await ci({guideTag:"guideInfo"});ot.data?$.value=JSON.parse((at=ot.data)==null?void 0:at.guideValue)||null:$.value={},$.value&&$.value.courseware?st.value=!1:st.value=!0}catch(ot){console.log(ot)}})();const Z=()=>{var ot,Et,Mt,St;const at=document.getElementById(`courseware-${Q.step}`);if(at){const X=at.getBoundingClientRect(),z=((ot=Q.steps[Q.step].eleRectPadding)==null?void 0:ot.left)||0,wt=((Et=Q.steps[Q.step].eleRectPadding)==null?void 0:Et.top)||0,ct=((Mt=Q.steps[Q.step].eleRectPadding)==null?void 0:Mt.width)||0,j=((St=Q.steps[Q.step].eleRectPadding)==null?void 0:St.height)||0;Q.box={left:X.x-z+"px",top:X.y-wt+"px",width:X.width+ct+"px",height:X.height+j+"px"}}else bt()};Fe(()=>{Z(),window.addEventListener("resize",ut)});const ut=()=>{Z()};li(()=>{window.removeEventListener("resize",ut)});const bt=()=>{if(Q.step>=3){At();return}Q.step=Q.step+1,Z()},At=async()=>{$.value?$.value.courseware=!0:$.value={courseware:!0};try{const at=await di({guideTag:"guideInfo",guideValue:JSON.stringify($.value)})}catch(at){console.log(at)}st.value=!1};return()=>W(Ge,{teleport:"body",overlay:!1,closeOnClickOverlay:!1,class:["popup-custom",kt.guidePopup],show:st.value,"onUpdate:show":at=>st.value=at},{default:()=>[W("div",{class:kt.content,onClick:()=>bt()},[Q.step!=Q.steps.length-1&&W("div",{class:kt.backBtn,onClick:at=>{at.stopPropagation(),At()}},[Bt("跳过")]),W("div",{class:kt.box,style:{...Q.box,...Q.steps[Q.step].boxStyle},id:`modeType-${Q.step}`},[Q.steps.map((at,ot)=>{var Et,Mt;return W("div",{onClick:St=>St.stopPropagation(),class:kt.item,style:{display:ot===Q.step?"":"none",left:`${(Et=at.eleRect)==null?void 0:Et.left}px`,top:`${(Mt=at.eleRect)==null?void 0:Mt.top}px`}},[W("img",{class:kt.img,style:at.imgStyle,src:at.img},null),W("img",{class:kt.iconHead,style:at.handStyle,src:me("indexDot.png")},null),W("div",{class:kt.btns,style:at.btnsStyle},[Q.step+1==Q.steps.length?W(Ue,null,[W(ce,{class:[kt.btn],round:!0,type:"primary",onClick:()=>At()},{default:()=>[Bt("完成")]}),W(ce,{class:[kt.btn,kt.endBtn],round:!0,color:"transparent",style:{"border-color":"#fff"},type:"primary",onClick:()=>{Q.step=0,Z()}},{default:()=>[Bt("再看一遍")]})]):W(ce,{class:kt.btn,round:!0,type:"primary",onClick:()=>bt()},{default:()=>[Bt("下一步 ("),Q.step+1,Bt("/"),Q.steps.length,Bt(")")]})])])})])])]})}});/*! jQuery v1.7 jquery.com | jquery.org/license */(function(E,B){function Q(t){return e.isWindow(t)?t:t.nodeType===9?t.defaultView||t.parentWindow:!1}function st(t){if(!He[t]){var i=H.body,n=e("<"+t+">").appendTo(i),s=n.css("display");n.remove(),(s==="none"||s==="")&&($t||($t=H.createElement("iframe"),$t.frameBorder=$t.width=$t.height=0),i.appendChild($t),(!Se||!$t.createElement)&&(Se=($t.contentWindow||$t.contentDocument).document,Se.write((H.compatMode==="CSS1Compat"?"":"")+""),Se.close()),n=Se.createElement(t),Se.body.appendChild(n),s=e.css(n,"display"),i.removeChild($t)),He[t]=s}return He[t]}function $(t,i){var n={};return e.each(ii.concat.apply([],ii.slice(0,i)),function(){n[this]=t}),n}function Wt(){Ne=B}function Z(){return setTimeout(Wt,0),Ne=e.now()}function ut(){try{return new E.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}function bt(){try{return new E.XMLHttpRequest}catch(t){}}function At(t,i){t.dataFilter&&(i=t.dataFilter(i,t.dataType));var n=t.dataTypes,s={},l,u,d=n.length,p,w=n[0],P,x,A,C,N;for(l=1;l0?(n!=="border"&&e.each(l,function(){n||(s-=parseFloat(e.css(t,"padding"+this))||0),n==="margin"?s+=parseFloat(e.css(t,n+this))||0:s-=parseFloat(e.css(t,"border"+this+"Width"))||0}),s+"px"):(s=Ae(t,i,i),(s<0||s==null)&&(s=t.style[i]||0),s=parseFloat(s)||0,n&&e.each(l,function(){s+=parseFloat(e.css(t,"padding"+this))||0,n!=="padding"&&(s+=parseFloat(e.css(t,"border"+this+"Width"))||0),n==="margin"&&(s+=parseFloat(e.css(t,n+this))||0)}),s+"px")}function z(t,i){i.src?e.ajax({url:i.src,async:!1,dataType:"script"}):e.globalEval((i.text||i.textContent||i.innerHTML||"").replace(oe,"/*$0*/")),i.parentNode&&i.parentNode.removeChild(i)}function wt(t){var i=(t.nodeName||"").toLowerCase();i==="input"?ct(t):i!=="script"&&typeof t.getElementsByTagName<"u"&&e.grep(t.getElementsByTagName("input"),ct)}function ct(t){(t.type==="checkbox"||t.type==="radio")&&(t.defaultChecked=t.checked)}function j(t){return typeof t.getElementsByTagName<"u"?t.getElementsByTagName("*"):typeof t.querySelectorAll<"u"?t.querySelectorAll("*"):[]}function a(t,i){var n;i.nodeType===1&&(i.clearAttributes&&i.clearAttributes(),i.mergeAttributes&&i.mergeAttributes(t),n=i.nodeName.toLowerCase(),n==="object"?i.outerHTML=t.outerHTML:n!=="input"||t.type!=="checkbox"&&t.type!=="radio"?n==="option"?i.selected=t.defaultSelected:(n==="input"||n==="textarea")&&(i.defaultValue=t.defaultValue):(t.checked&&(i.defaultChecked=i.checked=t.checked),i.value!==t.value&&(i.value=t.value)),i.removeAttribute(e.expando))}function h(t,i){if(i.nodeType===1&&e.hasData(t)){var n,s,l,u=e._data(t),d=e._data(i,u),p=u.events;if(p){delete d.handle,d.events={};for(n in p)for(s=0,l=p[n].length;s=0===n})}function F(t){return!t||!t.parentNode||t.parentNode.nodeType===11}function tt(){return!0}function it(){return!1}function mt(t,i,n){var s=i+"defer",l=i+"queue",u=i+"mark",d=e._data(t,s);d&&(n==="queue"||!e._data(t,l))&&(n==="mark"||!e._data(t,u))&&setTimeout(function(){!e._data(t,l)&&!e._data(t,u)&&(e.removeData(t,s,!0),d.fire())},0)}function xt(t){for(var i in t)if(!(i==="data"&&e.isEmptyObject(t[i]))&&i!=="toJSON")return!1;return!0}function Ct(t,i,n){if(n===B&&t.nodeType===1){var s="data-"+i.replace(V,"-$1").toLowerCase();if(n=t.getAttribute(s),typeof n=="string"){try{n=n==="true"?!0:n==="false"?!1:n==="null"?null:e.isNumeric(n)?parseFloat(n):M.test(n)?e.parseJSON(n):n}catch(l){}e.data(t,i,n)}else n=B}return n}function Xt(t){var i=f[t]={},n,s;for(t=t.split(/\s+/),n=0,s=t.length;n)[^>]*$|#([\w\-]*)$)/,d=/\S/,p=/^\s+/,w=/\s+$/,P=/\d/,x=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,A=/^[\],:{}\s]*$/,C=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,N=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,O=/(?:^|:|,)(?:\s*\[)+/g,J=/(webkit)[ \/]([\w.]+)/,lt=/(opera)(?:.*version)?[ \/]([\w.]+)/,rt=/(msie) ([\w.]+)/,It=/(mozilla)(?:.*? rv:([\w.]+))?/,Lt=/-([a-z]|[0-9])/ig,et=/^-ms-/,c=function(g,L){return(L+"").toUpperCase()},m=r.userAgent,S,T,D,_=Object.prototype.toString,R=Object.prototype.hasOwnProperty,U=Array.prototype.push,q=Array.prototype.slice,Y=String.prototype.trim,Ot=Array.prototype.indexOf,_t={};return i.fn=i.prototype={constructor:i,init:function(g,L,G){var I,ht,dt,ft;if(!g)return this;if(g.nodeType)return this.context=this[0]=g,this.length=1,this;if(g==="body"&&!L&&H.body)return this.context=H,this[0]=H.body,this.selector=g,this.length=1,this;if(typeof g=="string"){if(g.charAt(0)!=="<"||g.charAt(g.length-1)!==">"||g.length<3?I=u.exec(g):I=[null,g,null],I&&(I[1]||!L)){if(I[1])return L=L instanceof i?L[0]:L,ft=L?L.ownerDocument||L:H,dt=x.exec(g),dt?i.isPlainObject(L)?(g=[H.createElement(dt[1])],i.fn.attr.call(g,L,!0)):g=[ft.createElement(dt[1])]:(dt=i.buildFragment([I[1]],[ft]),g=(dt.cacheable?i.clone(dt.fragment):dt.fragment).childNodes),i.merge(this,g);if(ht=H.getElementById(I[2]),ht&&ht.parentNode){if(ht.id!==I[2])return G.find(g);this.length=1,this[0]=ht}return this.context=H,this.selector=g,this}return!L||L.jquery?(L||G).find(g):this.constructor(L).find(g)}return i.isFunction(g)?G.ready(g):(g.selector!==B&&(this.selector=g.selector,this.context=g.context),i.makeArray(g,this))},selector:"",jquery:"1.7",length:0,size:function(){return this.length},toArray:function(){return q.call(this,0)},get:function(g){return g==null?this.toArray():g<0?this[this.length+g]:this[g]},pushStack:function(g,L,G){var I=this.constructor();return i.isArray(g)?U.apply(I,g):i.merge(I,g),I.prevObject=this,I.context=this.context,L==="find"?I.selector=this.selector+(this.selector?" ":"")+G:L&&(I.selector=this.selector+"."+L+"("+G+")"),I},each:function(g,L){return i.each(this,g,L)},ready:function(g){return i.bindReady(),T.add(g),this},eq:function(g){return g===-1?this.slice(g):this.slice(g,+g+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(q.apply(this,arguments),"slice",q.call(arguments).join(","))},map:function(g){return this.pushStack(i.map(this,function(L,G){return g.call(L,G,L)}))},end:function(){return this.prevObject||this.constructor(null)},push:U,sort:[].sort,splice:[].splice},i.fn.init.prototype=i.fn,i.extend=i.fn.extend=function(){var g,L,G,I,ht,dt,ft=arguments[0]||{},Ht=1,Yt=arguments.length,je=!1;for(typeof ft=="boolean"&&(je=ft,ft=arguments[1]||{},Ht=2),typeof ft!="object"&&!i.isFunction(ft)&&(ft={}),Yt===Ht&&(ft=this,--Ht);Ht0)return;T.fireWith(H,[i]),i.fn.trigger&&i(H).trigger("ready").unbind("ready")}},bindReady:function(){if(!T){if(T=i.Callbacks("once memory"),H.readyState==="complete")return setTimeout(i.ready,1);if(H.addEventListener)H.addEventListener("DOMContentLoaded",D,!1),E.addEventListener("load",i.ready,!1);else if(H.attachEvent){H.attachEvent("onreadystatechange",D),E.attachEvent("onload",i.ready);var g=!1;try{g=E.frameElement==null}catch(L){}H.documentElement.doScroll&&g&&t()}}},isFunction:function(g){return i.type(g)==="function"},isArray:Array.isArray||function(g){return i.type(g)==="array"},isWindow:function(g){return g&&typeof g=="object"&&"setInterval"in g},isNumeric:function(g){return g!=null&&P.test(g)&&!isNaN(g)},type:function(g){return g==null?String(g):_t[_.call(g)]||"object"},isPlainObject:function(g){if(!g||i.type(g)!=="object"||g.nodeType||i.isWindow(g))return!1;try{if(g.constructor&&!R.call(g,"constructor")&&!R.call(g.constructor.prototype,"isPrototypeOf"))return!1}catch(G){return!1}var L;for(L in g);return L===B||R.call(g,L)},isEmptyObject:function(g){for(var L in g)return!1;return!0},error:function(g){throw g},parseJSON:function(g){if(typeof g!="string"||!g)return null;if(g=i.trim(g),E.JSON&&E.JSON.parse)return E.JSON.parse(g);if(A.test(g.replace(C,"@").replace(N,"]").replace(O,"")))return new Function("return "+g)();i.error("Invalid JSON: "+g)},parseXML:function(g){var L,G;try{E.DOMParser?(G=new DOMParser,L=G.parseFromString(g,"text/xml")):(L=new ActiveXObject("Microsoft.XMLDOM"),L.async="false",L.loadXML(g))}catch(I){L=B}return(!L||!L.documentElement||L.getElementsByTagName("parsererror").length)&&i.error("Invalid XML: "+g),L},noop:function(){},globalEval:function(g){g&&d.test(g)&&(E.execScript||function(L){E.eval.call(E,L)})(g)},camelCase:function(g){return g.replace(et,"ms-").replace(Lt,c)},nodeName:function(g,L){return g.nodeName&&g.nodeName.toUpperCase()===L.toUpperCase()},each:function(g,L,G){var I,ht=0,dt=g.length,ft=dt===B||i.isFunction(g);if(G)if(ft){for(I in g)if(L.apply(g[I],G)===!1)break}else for(;ht0&&g[0]&&g[Ht-1]||Ht===0||i.isArray(g));if(Yt)for(;ft1?y.call(arguments,0):A,w.notifyWith(P,d)}}function n(x){return function(A){s[x]=arguments.length>1?y.call(arguments,0):A,--p||w.resolveWith(w,s)}}var s=y.call(arguments,0),l=0,u=s.length,d=Array(u),p=u,w=u<=1&&t&&e.isFunction(t.promise)?t:e.Deferred(),P=w.promise();if(u>1){for(;l
a",n=t.getElementsByTagName("*"),s=t.getElementsByTagName("a")[0],!n||!n.length||!s)return{};l=H.createElement("select"),u=l.appendChild(H.createElement("option")),d=t.getElementsByTagName("input")[0],w={leadingWhitespace:t.firstChild.nodeType===3,tbody:!t.getElementsByTagName("tbody").length,htmlSerialize:!!t.getElementsByTagName("link").length,style:/top/.test(s.getAttribute("style")),hrefNormalized:s.getAttribute("href")==="/a",opacity:/^0.55/.test(s.style.opacity),cssFloat:!!s.style.cssFloat,unknownElems:!!t.getElementsByTagName("nav").length,checkOn:d.value==="on",optSelected:u.selected,getSetAttribute:t.className!=="t",enctype:!!H.createElement("form").enctype,submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},d.checked=!0,w.noCloneChecked=d.cloneNode(!0).checked,l.disabled=!0,w.optDisabled=!u.disabled;try{delete t.test}catch(It){w.deleteExpando=!1}!t.addEventListener&&t.attachEvent&&t.fireEvent&&(t.attachEvent("onclick",function(){w.noCloneEvent=!1}),t.cloneNode(!0).fireEvent("onclick")),d=H.createElement("input"),d.value="t",d.setAttribute("type","radio"),w.radioValue=d.value==="t",d.setAttribute("checked","checked"),t.appendChild(d),P=H.createDocumentFragment(),P.appendChild(t.lastChild),w.checkClone=P.cloneNode(!0).cloneNode(!0).lastChild.checked,t.innerHTML="",t.style.width=t.style.paddingLeft="1px",x=H.getElementsByTagName("body")[0],C=H.createElement(x?"div":"body"),N={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},x&&e.extend(N,{position:"absolute",left:"-999px",top:"-999px"});for(lt in N)C.style[lt]=N[lt];if(C.appendChild(t),A=x||i,A.insertBefore(C,A.firstChild),w.appendChecked=d.checked,w.boxModel=t.offsetWidth===2,"zoom"in t.style&&(t.style.display="inline",t.style.zoom=1,w.inlineBlockNeedsLayout=t.offsetWidth===2,t.style.display="",t.innerHTML="
",w.shrinkWrapBlocks=t.offsetWidth!==2),t.innerHTML="
t
",O=t.getElementsByTagName("td"),rt=O[0].offsetHeight===0,O[0].style.display="",O[1].style.display="none",w.reliableHiddenOffsets=rt&&O[0].offsetHeight===0,t.innerHTML="",H.defaultView&&H.defaultView.getComputedStyle&&(p=H.createElement("div"),p.style.width="0",p.style.marginRight="0",t.appendChild(p),w.reliableMarginRight=(parseInt((H.defaultView.getComputedStyle(p,null)||{marginRight:0}).marginRight,10)||0)===0),t.attachEvent)for(lt in{submit:1,change:1,focusin:1})J="on"+lt,rt=J in t,rt||(t.setAttribute(J,"return;"),rt=typeof t[J]=="function"),w[lt+"Bubbles"]=rt;return e(function(){var It,Lt,et,c,m,S=1,T="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",D="visibility:hidden;border:0;",_="style='"+T+"border:5px solid #000;padding:0;'",R="
";x=H.getElementsByTagName("body")[0],!x||(It=H.createElement("div"),It.style.cssText=D+"width:0;height:0;position:static;top:0;margin-top:"+S+"px",x.insertBefore(It,x.firstChild),C=H.createElement("div"),C.style.cssText=T+D,C.innerHTML=R,It.appendChild(C),Lt=C.firstChild,et=Lt.firstChild,c=Lt.nextSibling.firstChild.firstChild,m={doesNotAddBorder:et.offsetTop!==5,doesAddBorderForTableAndCells:c.offsetTop===5},et.style.position="fixed",et.style.top="20px",m.fixedPosition=et.offsetTop===20||et.offsetTop===15,et.style.position=et.style.top="",Lt.style.overflow="hidden",Lt.style.position="relative",m.subtractsBorderForOverflowNotVisible=et.offsetTop===-5,m.doesNotIncludeMarginInBodyOffset=x.offsetTop!==S,x.removeChild(It),C=It=null,e.extend(w,m))}),C.innerHTML="",A.removeChild(C),C=P=l=u=x=p=t=d=null,w}(),e.boxModel=e.support.boxModel;var M=/^(?:\{.*\}|\[.*\])$/,V=/([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&&!xt(t)},data:function(t,i,n,s){if(e.acceptData(t)){var l,u,d;e.expando;var p=typeof i=="string",w=t.nodeType,P=w?e.cache:t,x=w?t[e.expando]:t[e.expando]&&e.expando,A=i==="events";return(!x||!P[x]||!A&&!s&&!P[x].data)&&p&&n===B?void 0:(x||(w?t[e.expando]=x=++e.uuid:x=e.expando),P[x]||(P[x]={},w||(P[x].toJSON=e.noop)),(typeof i=="object"||typeof i=="function")&&(s?P[x]=e.extend(P[x],i):P[x].data=e.extend(P[x].data,i)),l=u=P[x],s||(u.data||(u.data={}),u=u.data),n!==B&&(u[e.camelCase(i)]=n),A&&!u[i]?l.events:(p?(d=u[i],d==null&&(d=u[e.camelCase(i)])):d=u,d))}},removeData:function(t,i,n){if(e.acceptData(t)){var s,l,u;e.expando;var d=t.nodeType,p=d?e.cache:t,w=d?t[e.expando]:e.expando;if(!p[w])return;if(i&&(s=n?p[w]:p[w].data,s)){for(e.isArray(i)?i=i:(i in s)?i=[i]:(i=e.camelCase(i),i in s?i=[i]:i=i.split(" ")),l=0,u=i.length;l"u"){if(this.length&&(u=e.data(this[0]),this[0].nodeType===1&&!e._data(this[0],"parsedAttrs"))){s=this[0].attributes;for(var d=0,p=s.length;d-1)return!0;return!1},val:function(t){var i,n,s,l=this[0];return arguments.length?(s=e.isFunction(t),this.each(function(u){var d=e(this),p;this.nodeType===1&&(s?p=t.call(this,u,d.val()):p=t,p==null?p="":typeof p=="number"?p+="":e.isArray(p)&&(p=e.map(p,function(w){return w==null?"":w+""})),i=e.valHooks[this.nodeName.toLowerCase()]||e.valHooks[this.type],(!i||!("set"in i)||i.set(this,p,"value")===B)&&(this.value=p))})):l?(i=e.valHooks[l.nodeName.toLowerCase()]||e.valHooks[l.type],i&&"get"in i&&(n=i.get(l,"value"))!==B?n:(n=l.value,typeof n=="string"?n.replace(pt,""):n==null?"":n)):B}}),e.extend({valHooks:{option:{get:function(t){var i=t.attributes.value;return!i||i.specified?t.value:t.text}},select:{get:function(t){var i,n,s,l,u=t.selectedIndex,d=[],p=t.options,w=t.type==="select-one";if(u<0)return null;for(n=w?u:0,s=w?u+1:p.length;n=0}),n.length||(t.selectedIndex=-1),n}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(t,i,n,s){var l,u,d,p=t.nodeType;return!t||p===3||p===8||p===2?B:s&&i in e.attrFn?e(t)[i](n):"getAttribute"in t?(d=p!==1||!e.isXMLDoc(t),d&&(i=i.toLowerCase(),u=e.attrHooks[i]||(zt.test(i)?Qt:Nt)),n!==B?n===null?(e.removeAttr(t,i),B):u&&"set"in u&&d&&(l=u.set(t,n,i))!==B?l:(t.setAttribute(i,""+n),n):u&&"get"in u&&d&&(l=u.get(t,i))!==null?l:(l=t.getAttribute(i),l===null?B:l)):e.prop(t,i,n)},removeAttr:function(t,i){var n,s,l,u,d=0;if(t.nodeType===1)for(s=(i||"").split(nt),u=s.length;d=0}})});var Kt=/^(?:textarea|input|select)$/i,ye=/^([^\.]*)?(?:\.(.+))?$/,te=/\bhover(\.\S+)?/,ee=/^key/,ve=/^(?:mouse|contextmenu)|click/,Jt=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,we=function(t){var i=Jt.exec(t);return i&&(i[1]=(i[1]||"").toLowerCase(),i[3]=i[3]&&new RegExp("(?:^|\\s)"+i[3]+"(?:\\s|$)")),i},De=function(t,i){return(!i[1]||t.nodeName.toLowerCase()===i[1])&&(!i[2]||t.id===i[2])&&(!i[3]||i[3].test(t.className))},Ut=function(t){return e.event.special.hover?t:t.replace(te,"mouseenter$1 mouseleave$1")};e.event={add:function(t,i,n,s,l){var u,d,p,w,P,x,A,C,N,O,J;if(!(t.nodeType===3||t.nodeType===8||!i||!n||!(u=e._data(t)))){for(n.handler&&(N=n,n=N.handler),n.guid||(n.guid=e.guid++),p=u.events,p||(u.events=p={}),d=u.handle,d||(u.handle=d=function(lt){return typeof e<"u"&&(!lt||e.event.triggered!==lt.type)?e.event.dispatch.apply(d.elem,arguments):B},d.elem=t),i=Ut(i).split(" "),w=0;w=0&&(l=l.slice(0,-1),p=!0),l.indexOf(".")>=0&&(u=l.split("."),l=u.shift(),u.sort()),(!n||e.event.customEvent[l])&&!e.event.global[l])return;if(t=typeof t=="object"?t[e.expando]?t:new e.Event(l,t):new e.Event(l),t.type=l,t.isTrigger=!0,t.exclusive=p,t.namespace=u.join("."),t.namespace_re=t.namespace?new RegExp("(^|\\.)"+u.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,A=l.indexOf(":")<0?"on"+l:"",(s||!n)&&t.preventDefault(),!n){d=e.cache;for(w in d)d[w].events&&d[w].events[l]&&e.event.trigger(t,i,d[w].handle.elem,!0);return}if(t.result=B,t.target||(t.target=n),i=i!=null?e.makeArray(i):[],i.unshift(t),C=e.event.special[l]||{},C.trigger&&C.trigger.apply(n,i)===!1)return;if(O=[[n,C.bindType||l]],!s&&!C.noBubble&&!e.isWindow(n)){for(J=C.delegateType||l,x=null,P=n.parentNode;P;P=P.parentNode)O.push([P,J]),x=P;x&&x===n.ownerDocument&&O.push([x.defaultView||x.parentWindow||E,J])}for(w=0;w=0:lt===B&&(lt=A[J]=O.quick?De(P,O.quick):e(P).is(J)),lt&&N.push(O);N.length&&d.push({elem:P,matches:N})}for(i.length>n&&d.push({elem:this,matches:i.slice(n)}),p=0;p0?this.bind(i,n,s):this.trigger(i)},e.attrFn&&(e.attrFn[i]=!0),ee.test(i)&&(e.event.fixHooks[i]=e.event.keyHooks),ve.test(i)&&(e.event.fixHooks[i]=e.event.mouseHooks)}),function(){function t(c,m,S,T,D,_){for(var R=0,U=T.length;R0){Y=q;break}}q=q[c]}T[R]=Y}}}function i(c,m,S,T,D,_){for(var R=0,U=T.length;R+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,s="sizcache"+(Math.random()+"").replace(".",""),l=0,u=Object.prototype.toString,d=!1,p=!0,w=/\\/g,P=/\r\n/g,x=/\W/;[0,0].sort(function(){return p=!1,0});var A=function(c,m,S,T){S=S||[],m=m||H;var D=m;if(m.nodeType!==1&&m.nodeType!==9)return[];if(!c||typeof c!="string")return S;var _,R,U,q,Y,Ot,_t,g,L=!0,G=A.isXML(m),I=[],ht=c;do if(n.exec(""),_=n.exec(ht),_&&(ht=_[3],I.push(_[1]),_[2])){q=_[3];break}while(_);if(I.length>1&&O.exec(c))if(I.length===2&&N.relative[I[0]])R=et(I[0]+I[1],m,T);else for(R=N.relative[I[0]]?[m]:A(I.shift(),m);I.length;)c=I.shift(),N.relative[c]&&(c+=I.shift()),R=et(c,R,T);else if(!T&&I.length>1&&m.nodeType===9&&!G&&N.match.ID.test(I[0])&&!N.match.ID.test(I[I.length-1])&&(Y=A.find(I.shift(),m,G),m=Y.expr?A.filter(Y.expr,Y.set)[0]:Y.set[0]),m)for(Y=T?{expr:I.pop(),set:rt(T)}:A.find(I.pop(),I.length===1&&(I[0]==="~"||I[0]==="+")&&m.parentNode?m.parentNode:m,G),R=Y.expr?A.filter(Y.expr,Y.set):Y.set,I.length>0?U=rt(R):L=!1;I.length;)Ot=I.pop(),_t=Ot,N.relative[Ot]?_t=I.pop():Ot="",_t==null&&(_t=m),N.relative[Ot](U,_t,G);else U=I=[];if(U||(U=R),U||A.error(Ot||c),u.call(U)==="[object Array]")if(!L)S.push.apply(S,U);else if(m&&m.nodeType===1)for(g=0;U[g]!=null;g++)U[g]&&(U[g]===!0||U[g].nodeType===1&&A.contains(m,U[g]))&&S.push(R[g]);else for(g=0;U[g]!=null;g++)U[g]&&U[g].nodeType===1&&S.push(R[g]);else rt(U,S);return q&&(A(q,D,S,T),A.uniqueSort(S)),S};A.uniqueSort=function(c){if(It&&(d=p,c.sort(It),d))for(var m=1;m0},A.find=function(c,m,S){var T,D,_,R,U,q;if(!c)return[];for(D=0,_=N.order.length;D<_;D++)if(U=N.order[D],(R=N.leftMatch[U].exec(c))&&(q=R[1],R.splice(1,1),q.substr(q.length-1)!=="\\"&&(R[1]=(R[1]||"").replace(w,""),T=N.find[U](R,m,S),T!=null))){c=c.replace(N.match[U],"");break}return T||(T=typeof m.getElementsByTagName<"u"?m.getElementsByTagName("*"):[]),{set:T,expr:c}},A.filter=function(c,m,S,T){for(var D,_,R,U,q,Y,Ot,_t,g,L=c,G=[],I=m,ht=m&&m[0]&&A.isXML(m[0]);c&&m.length;){for(R in N.filter)if((D=N.leftMatch[R].exec(c))!=null&&D[2]){if(Y=N.filter[R],Ot=D[1],_=!1,D.splice(1,1),Ot.substr(Ot.length-1)==="\\")continue;if(I===G&&(G=[]),N.preFilter[R]){if(D=N.preFilter[R](D,I,S,G,T,ht),!D)_=U=!0;else if(D===!0)continue}if(D)for(_t=0;(q=I[_t])!=null;_t++)q&&(U=Y(q,D,_t,I),g=T^U,S&&U!=null?g?_=!0:I[_t]=!1:g&&(G.push(q),_=!0));if(U!==B){if(S||(I=G),c=c.replace(N.match[R],""),!_)return[];break}}if(c===L)if(_==null)A.error(c);else break;L=c}return I},A.error=function(c){throw"Syntax error, unrecognized expression: "+c};var C=A.getText=function(c){var m,S,T=c.nodeType,D="";if(T){if(T===1){if(typeof c.textContent=="string")return c.textContent;if(typeof c.innerText=="string")return c.innerText.replace(P,"");for(c=c.firstChild;c;c=c.nextSibling)D+=C(c)}else if(T===3||T===4)return c.nodeValue}else for(m=0;S=c[m];m++)S.nodeType!==8&&(D+=C(S));return D},N=A.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{class:"className",for:"htmlFor"},attrHandle:{href:function(c){return c.getAttribute("href")},type:function(c){return c.getAttribute("type")}},relative:{"+":function(c,m){var S=typeof m=="string",T=S&&!x.test(m),D=S&&!T;T&&(m=m.toLowerCase());for(var _=0,R=c.length,U;_":function(c,m){var S,T=typeof m=="string",D=0,_=c.length;if(T&&!x.test(m)){for(m=m.toLowerCase();D<_;D++)if(S=c[D],S){var R=S.parentNode;c[D]=R.nodeName.toLowerCase()===m?R:!1}}else{for(;D<_;D++)S=c[D],S&&(c[D]=T?S.parentNode:S.parentNode===m);T&&A.filter(m,c,!0)}},"":function(c,m,S){var T,D=l++,_=t;typeof m=="string"&&!x.test(m)&&(m=m.toLowerCase(),T=m,_=i),_("parentNode",m,D,c,T,S)},"~":function(c,m,S){var T,D=l++,_=t;typeof m=="string"&&!x.test(m)&&(m=m.toLowerCase(),T=m,_=i),_("previousSibling",m,D,c,T,S)}},find:{ID:function(c,m,S){if(typeof m.getElementById<"u"&&!S){var T=m.getElementById(c[1]);return T&&T.parentNode?[T]:[]}},NAME:function(c,m){if(typeof m.getElementsByName<"u"){for(var S=[],T=m.getElementsByName(c[1]),D=0,_=T.length;D<_;D++)T[D].getAttribute("name")===c[1]&&S.push(T[D]);return S.length===0?null:S}},TAG:function(c,m){if(typeof m.getElementsByTagName<"u")return m.getElementsByTagName(c[1])}},preFilter:{CLASS:function(c,m,S,T,D,_){if(c=" "+c[1].replace(w,"")+" ",_)return c;for(var R=0,U;(U=m[R])!=null;R++)U&&(D^(U.className&&(" "+U.className+" ").replace(/[\t\n\r]/g," ").indexOf(c)>=0)?S||T.push(U):S&&(m[R]=!1));return!1},ID:function(c){return c[1].replace(w,"")},TAG:function(c,m){return c[1].replace(w,"").toLowerCase()},CHILD:function(c){if(c[1]==="nth"){c[2]||A.error(c[0]),c[2]=c[2].replace(/^\+|\s*/g,"");var m=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(c[2]==="even"&&"2n"||c[2]==="odd"&&"2n+1"||!/\D/.test(c[2])&&"0n+"+c[2]||c[2]);c[2]=m[1]+(m[2]||1)-0,c[3]=m[3]-0}else c[2]&&A.error(c[0]);return c[0]=l++,c},ATTR:function(c,m,S,T,D,_){var R=c[1]=c[1].replace(w,"");return!_&&N.attrMap[R]&&(c[1]=N.attrMap[R]),c[4]=(c[4]||c[5]||"").replace(w,""),c[2]==="~="&&(c[4]=" "+c[4]+" "),c},PSEUDO:function(c,m,S,T,D){if(c[1]==="not")if((n.exec(c[3])||"").length>1||/^\w/.test(c[3]))c[3]=A(c[3],null,null,m);else{var _=A.filter(c[3],m,S,!0^D);return S||T.push.apply(T,_),!1}else if(N.match.POS.test(c[0])||N.match.CHILD.test(c[0]))return!0;return c},POS:function(c){return c.unshift(!0),c}},filters:{enabled:function(c){return c.disabled===!1&&c.type!=="hidden"},disabled:function(c){return c.disabled===!0},checked:function(c){return c.checked===!0},selected:function(c){return c.parentNode&&c.parentNode.selectedIndex,c.selected===!0},parent:function(c){return!!c.firstChild},empty:function(c){return!c.firstChild},has:function(c,m,S){return!!A(S[3],c).length},header:function(c){return/h\d/i.test(c.nodeName)},text:function(c){var m=c.getAttribute("type"),S=c.type;return c.nodeName.toLowerCase()==="input"&&S==="text"&&(m===S||m===null)},radio:function(c){return c.nodeName.toLowerCase()==="input"&&c.type==="radio"},checkbox:function(c){return c.nodeName.toLowerCase()==="input"&&c.type==="checkbox"},file:function(c){return c.nodeName.toLowerCase()==="input"&&c.type==="file"},password:function(c){return c.nodeName.toLowerCase()==="input"&&c.type==="password"},submit:function(c){var m=c.nodeName.toLowerCase();return(m==="input"||m==="button")&&c.type==="submit"},image:function(c){return c.nodeName.toLowerCase()==="input"&&c.type==="image"},reset:function(c){var m=c.nodeName.toLowerCase();return(m==="input"||m==="button")&&c.type==="reset"},button:function(c){var m=c.nodeName.toLowerCase();return m==="input"&&c.type==="button"||m==="button"},input:function(c){return/input|select|textarea|button/i.test(c.nodeName)},focus:function(c){return c===c.ownerDocument.activeElement}},setFilters:{first:function(c,m){return m===0},last:function(c,m,S,T){return m===T.length-1},even:function(c,m){return m%2===0},odd:function(c,m){return m%2===1},lt:function(c,m,S){return mS[3]-0},nth:function(c,m,S){return S[3]-0===m},eq:function(c,m,S){return S[3]-0===m}},filter:{PSEUDO:function(c,m,S,T){var D=m[1],_=N.filters[D];if(_)return _(c,S,m,T);if(D==="contains")return(c.textContent||c.innerText||C([c])||"").indexOf(m[3])>=0;if(D==="not"){for(var R=m[3],U=0,q=R.length;U=0}},ID:function(c,m){return c.nodeType===1&&c.getAttribute("id")===m},TAG:function(c,m){return m==="*"&&c.nodeType===1||!!c.nodeName&&c.nodeName.toLowerCase()===m},CLASS:function(c,m){return(" "+(c.className||c.getAttribute("class"))+" ").indexOf(m)>-1},ATTR:function(c,m){var S=m[1],T=A.attr?A.attr(c,S):N.attrHandle[S]?N.attrHandle[S](c):c[S]!=null?c[S]:c.getAttribute(S),D=T+"",_=m[2],R=m[4];return T==null?_==="!=":!_&&A.attr?T!=null:_==="="?D===R:_==="*="?D.indexOf(R)>=0:_==="~="?(" "+D+" ").indexOf(R)>=0:R?_==="!="?D!==R:_==="^="?D.indexOf(R)===0:_==="$="?D.substr(D.length-R.length)===R:_==="|="?D===R||D.substr(0,R.length+1)===R+"-":!1:D&&T!==!1},POS:function(c,m,S,T){var D=m[2],_=N.setFilters[D];if(_)return _(c,S,m,T)}}},O=N.match.POS,J=function(c,m){return"\\"+(m-0+1)};for(var lt in N.match)N.match[lt]=new RegExp(N.match[lt].source+/(?![^\[]*\])(?![^\(]*\))/.source),N.leftMatch[lt]=new RegExp(/(^(?:.|\r|\n)*?)/.source+N.match[lt].source.replace(/\\(\d+)/g,J));var rt=function(c,m){return c=Array.prototype.slice.call(c,0),m?(m.push.apply(m,c),m):c};try{Array.prototype.slice.call(H.documentElement.childNodes,0)[0].nodeType}catch(c){rt=function(m,S){var T=0,D=S||[];if(u.call(m)==="[object Array]")Array.prototype.push.apply(D,m);else if(typeof m.length=="number")for(var _=m.length;T<_;T++)D.push(m[T]);else for(;m[T];T++)D.push(m[T]);return D}}var It,Lt;H.documentElement.compareDocumentPosition?It=function(c,m){return c===m?(d=!0,0):!c.compareDocumentPosition||!m.compareDocumentPosition?c.compareDocumentPosition?-1:1:c.compareDocumentPosition(m)&4?-1:1}:(It=function(c,m){if(c===m)return d=!0,0;if(c.sourceIndex&&m.sourceIndex)return c.sourceIndex-m.sourceIndex;var S,T,D=[],_=[],R=c.parentNode,U=m.parentNode,q=R;if(R===U)return Lt(c,m);if(!R)return-1;if(!U)return 1;for(;q;)D.unshift(q),q=q.parentNode;for(q=U;q;)_.unshift(q),q=q.parentNode;S=D.length,T=_.length;for(var Y=0;Y",S.insertBefore(c,S.firstChild),H.getElementById(m)&&(N.find.ID=function(T,D,_){if(typeof D.getElementById<"u"&&!_){var R=D.getElementById(T[1]);return R?R.id===T[1]||typeof R.getAttributeNode<"u"&&R.getAttributeNode("id").nodeValue===T[1]?[R]:B:[]}},N.filter.ID=function(T,D){var _=typeof T.getAttributeNode<"u"&&T.getAttributeNode("id");return T.nodeType===1&&_&&_.nodeValue===D}),S.removeChild(c),S=c=null}(),function(){var c=H.createElement("div");c.appendChild(H.createComment("")),c.getElementsByTagName("*").length>0&&(N.find.TAG=function(m,S){var T=S.getElementsByTagName(m[1]);if(m[1]==="*"){for(var D=[],_=0;T[_];_++)T[_].nodeType===1&&D.push(T[_]);T=D}return T}),c.innerHTML="",c.firstChild&&typeof c.firstChild.getAttribute<"u"&&c.firstChild.getAttribute("href")!=="#"&&(N.attrHandle.href=function(m){return m.getAttribute("href",2)}),c=null}(),H.querySelectorAll&&function(){var c=A,m=H.createElement("div"),S="__sizzle__";if(m.innerHTML="

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