const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./builder-DygomDiV.js","./builder-XzaUob7u.css","./index.es-CikUGx6W.js","./defineProperty-DbXIQDXj.js","./typeof-QjJsDpFa.js"])))=>i.map(i=>d[i]); import{a as P1,u as C1,_ as I1}from"./index-uyPmpNtD.js";import{cQ as rr,ft as Xe,cq as kt,fX as Ro,gN as rt,c9 as si,fV as Fe,g$ as Ae,cw as we,cp as Pe,h2 as hr,cv as fn,gx as it,fM as Je,eX as Ln,e2 as iu,fW as To,cs as vn,ee as ic,h0 as qn,ff as ii,gY as ni,cr as un,F as E1,fS as F1,fT as R1,ac as qa,gT as ws,gS as ac,gR as Oo,gV as ta,af as Li,f5 as ko,gs as hn,fr as sc,dT as ai,fa as Ji,fL as Fh,fF as Ma,y as T1,w as O1,fe as oc,c5 as ro,ab as _l,du as j1,aO as B1,o as D1,aP as M1,eU as au,gP as q1,fm as U1}from"./builder-DygomDiV.js";import{_ as Rh}from"./ResetPassword.vue_vue_type_script_setup_true_lang-CzP7eN99.js";import{_ as z1}from"./500-CPkRZzc6.js";import{_ as jt}from"./typeof-QjJsDpFa.js";import"./index-nvbCnfCT.js";import"./call-DEw87b3m.js";import"./index-OafMcnGN.js";const $1=Object.freeze(Object.defineProperty({__proto__:null,get default(){return Kg}},Symbol.toStringTag,{value:"Module"}));function su(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);ta.modelValue,set:c=>{r("update:modelValue",c)}});return(c,o)=>(Xe(),kt(Ro(rt(t)[`/src/views/chat/auth/component/${n.auth_type}.vue`].default),{modelValue:i.value,"onUpdate:modelValue":o[0]||(o[0]=u=>i.value=u),applicationProfile:n.application_profile},null,8,["modelValue","applicationProfile"]))}}),G1=Object.freeze(Object.defineProperty({__proto__:null,default:V1},Symbol.toStringTag,{value:"Module"})),Y1={class:"dialog-footer"},J1=rr({__name:"EditTitleDialog",emits:["refresh"],setup(n,{expose:e,emit:t}){const r=t,a=Je(),i=Je(!1),c=Je(""),o=Je(""),u=Je({abstract:""}),f=Je(!1),p=(v,d)=>{c.value=d,o.value=v.id,u.value.abstract=v.abstract,f.value=!0},w=async v=>{v&&await v.validate(d=>{d&&Ln.modifyChat(o.value,u.value,i).then(()=>{r("refresh",o.value,u.value.abstract),f.value=!1})})};return e({open:p,close}),(v,d)=>{const E=Fe("el-input"),C=Fe("el-form-item"),F=Fe("el-form"),L=Fe("el-button"),D=Fe("el-dialog");return Xe(),kt(D,{class:"responsive-dialog",title:v.$t("chat.editTitle"),modelValue:f.value,"onUpdate:modelValue":d[4]||(d[4]=q=>f.value=q),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"append-to-body":""},{footer:Ae(()=>[Pe("span",Y1,[we(L,{onClick:d[2]||(d[2]=hr(q=>f.value=!1,["prevent"]))},{default:Ae(()=>[fn(it(v.$t("common.cancel")),1)]),_:1}),we(L,{type:"primary",onClick:d[3]||(d[3]=q=>w(a.value)),loading:i.value},{default:Ae(()=>[fn(it(v.$t("common.save")),1)]),_:1},8,["loading"])])]),default:Ae(()=>[we(F,{"label-position":"top",ref_key:"fieldFormRef",ref:a,model:u.value,"require-asterisk-position":"right"},{default:Ae(()=>[we(C,{prop:"abstract",rules:[{required:!0,message:v.$t("common.inputPlaceholder"),trigger:"blur"}]},{default:Ae(()=>[we(E,{modelValue:u.value.abstract,"onUpdate:modelValue":d[0]||(d[0]=q=>u.value.abstract=q),maxlength:"1024","show-word-limit":"",type:"textarea",onBlur:d[1]||(d[1]=q=>u.value.abstract=u.value.abstract.trim())},null,8,["modelValue"])]),_:1},8,["rules"])]),_:1},8,["model"])]),_:1},8,["title","modelValue"])}}}),Z1={class:"history-component h-full"},X1={style:{padding:"16px 18px 0 18px"}},K1={class:"flex align-center mb-16"},Q1={class:"flex mr-8"},ed=["src"],td=["title"],nd={class:"ml-4"},rd={key:0,class:"flex-between p-8 pb-0 color-secondary mt-8"},id={key:0,class:"left-height"},ad={class:"p-16 pt-0"},sd={class:"flex-between"},od=["title"],ld={class:"text-center"},cd={class:"flex-between p-8 ml-8"},ud={class:"left-height"},hd={class:"flex-between w-full lighter"},fd=["title"],dd={key:0,class:"text-center"},pd=rr({__name:"HistoryPanel",props:{applicationDetail:{},chatLogData:{},leftLoading:{type:Boolean},currentChatId:{},isPcCollapse:{type:Boolean},chat_loading:{type:Boolean}},emits:["newChat","clickLog","deleteLog","refreshFieldTitle","clearChat","clickShare"],setup(n,{emit:e}){const t=iu("scrollData"),a=iu("chatLogPagination")(),i=n,c=e,o=si(()=>i.applicationDetail?.show_history!=null?i.applicationDetail?.show_history:!0),u=Je(),f=Je("");function p(D){f.value=D.id}const w=()=>{c("clickShare")},v=()=>{c("newChat")},d=D=>{c("clickLog",D)},E=D=>{c("deleteLog",D)},C=()=>{c("clearChat")};function F(D){u.value.open(D,i.applicationDetail.id)}function L(D,q){c("refreshFieldTitle",D,q)}return(D,q)=>{const M=Fe("el-avatar"),Q=Fe("LogoIcon"),ae=Fe("AppIcon"),se=Fe("el-button"),V=Fe("el-tooltip"),B=Fe("el-dropdown-item"),X=Fe("el-dropdown-menu"),_=Fe("el-dropdown"),N=Fe("el-text"),U=Fe("common-list"),$=Fe("InfiniteScroll"),re=Fe("el-scrollbar"),oe=Fe("el-menu-item"),he=Fe("el-sub-menu"),ee=Fe("el-menu"),ue=To("loading");return Xe(),vn("div",Z1,[we(ee,{"default-active":n.currentChatId,collapse:n.isPcCollapse,"collapse-transition":!1,"popper-class":"chat-pc-popper",class:"h-full"},{default:Ae(()=>[Pe("div",X1,[Pe("div",K1,[Pe("div",Q1,[rt(ic)(n.applicationDetail?.icon)?(Xe(),kt(M,{key:0,shape:"square",size:32,style:{background:"none"}},{default:Ae(()=>[Pe("img",{src:n.applicationDetail?.icon,alt:""},null,8,ed)]),_:1})):(Xe(),kt(Q,{key:1,height:"32px"}))]),qn(Pe("h4",{style:ii([{color:n.applicationDetail?.custom_theme?.header_font_color},{"max-width":"185px"}]),class:"ellipsis",title:n.applicationDetail?.name},it(n.applicationDetail?.name),13,td),[[ni,!n.isPcCollapse]])]),qn(we(se,{type:"primary",plain:"",class:"add-button primary medium w-full",onClick:v},{default:Ae(()=>[we(ae,{iconName:"app-create-chat"}),Pe("span",nd,it(D.$t("chat.createChat")),1)]),_:1},512),[[ni,!n.isPcCollapse]]),o.value?qn((Xe(),vn("div",rd,[Pe("span",null,it(D.$t("chat.history")),1),we(V,{effect:"dark",content:D.$t("chat.clearChat"),placement:"right"},{default:Ae(()=>[we(se,{text:"",onClick:hr(C,["stop"])},{default:Ae(()=>[we(ae,{iconName:"app-delete"})]),_:1})]),_:1},8,["content"])],512)),[[ni,!n.isPcCollapse]]):un("",!0)]),o.value?qn((Xe(),vn("div",id,[we(re,null,{default:Ae(()=>[we($,{size:n.chatLogData.length,total:rt(a)?.total||0,page_size:rt(a)?.page_size||20,current_page:rt(a).current_page,"onUpdate:current_page":q[3]||(q[3]=me=>rt(a).current_page=me),onLoad:rt(t),loading:n.leftLoading},{default:Ae(()=>[Pe("div",ad,[qn((Xe(),kt(U,{data:n.chatLogData,class:"mt-8",defaultActive:n.currentChatId,onClick:d,onMouseenter:p,onMouseleave:q[2]||(q[2]=me=>f.value="")},{default:Ae(({row:me})=>[Pe("div",sd,[Pe("span",{title:me.abstract,class:"ellipsis",style:{"max-width":"180px"}},it(me.abstract),9,od),qn(Pe("div",{onClick:q[1]||(q[1]=hr(()=>{},["stop"]))},[we(_,{trigger:"click",teleported:!1},{dropdown:Ae(()=>[we(X,null,{default:Ae(()=>[we(B,{onClick:q[0]||(q[0]=hr(be=>w(),["stop"])),disabled:n.currentChatId!==me.id||n.chat_loading},{default:Ae(()=>[we(ae,{iconName:"app-share",class:"color-secondary"}),fn(" "+it(D.$t("chat.share")),1)]),_:1},8,["disabled"]),we(B,{onClick:hr(be=>F(me),["stop"])},{default:Ae(()=>[we(ae,{iconName:"app-edit",class:"color-secondary"}),fn(" "+it(D.$t("common.edit")),1)]),_:1},8,["onClick"]),we(B,{onClick:hr(be=>E(me),["stop"])},{default:Ae(()=>[we(ae,{iconName:"app-delete",class:"color-secondary"}),fn(" "+it(D.$t("common.delete")),1)]),_:1},8,["onClick"])]),_:2},1024)]),default:Ae(()=>[we(se,{text:""},{default:Ae(()=>[we(ae,{iconName:"app-more"})]),_:1})]),_:2},1024)],512),[[ni,f.value===me.id&&me.id!=="new"]])])]),empty:Ae(()=>[Pe("div",ld,[we(N,{type:"info"},{default:Ae(()=>[fn(it(D.$t("chat.noHistory")),1)]),_:1})])]),_:1},8,["data","defaultActive"])),[[ue,n.leftLoading]])])]),_:1},8,["size","total","page_size","current_page","onLoad","loading"])]),_:1})],512)),[[ni,!n.isPcCollapse]]):un("",!0),qn(we(oe,{index:"1",onClick:v},{title:Ae(()=>[fn(it(D.$t("chat.createChat")),1)]),default:Ae(()=>[we(ae,{iconName:"app-create-chat"})]),_:1},512),[[ni,n.isPcCollapse]]),o.value?qn((Xe(),kt(he,{key:1,index:"2",teleported:!1},{title:Ae(()=>[we(ae,{iconName:"app-history-outlined"})]),default:Ae(()=>[Pe("div",cd,[Pe("span",null,it(D.$t("chat.history")),1),we(V,{effect:"dark",content:D.$t("chat.clearChat"),placement:"right"},{default:Ae(()=>[we(se,{text:"",onClick:hr(C,["stop"])},{default:Ae(()=>[we(ae,{iconName:"app-delete",class:"color-secondary",style:{"font-size":"16px"}})]),_:1})]),_:1},8,["content"])]),Pe("div",ud,[we(re,null,{default:Ae(()=>[we($,{size:n.chatLogData.length,total:rt(a)?.total||0,page_size:rt(a)?.page_size||20,current_page:rt(a).current_page,"onUpdate:current_page":q[6]||(q[6]=me=>rt(a).current_page=me),onLoad:rt(t),loading:n.leftLoading},{default:Ae(()=>[qn((Xe(),vn("div",null,[(Xe(!0),vn(E1,null,F1(n.chatLogData,me=>(Xe(),kt(oe,{index:me.id,key:me.id,onClick:be=>d(me),onMouseenter:be=>p(me),onMouseleave:q[5]||(q[5]=be=>f.value="")},{default:Ae(()=>[Pe("div",hd,[Pe("span",{title:me.abstract,class:"ellipsis"},it(me.abstract),9,fd),qn(Pe("div",{onClick:q[4]||(q[4]=hr(()=>{},["stop"])),class:"flex"},[we(_,{trigger:"click",teleported:!1},{dropdown:Ae(()=>[we(X,null,{default:Ae(()=>[we(B,{onClick:hr(be=>F(me),["stop"])},{default:Ae(()=>[we(ae,{iconName:"app-edit",style:{color:"var(--app-text-color-secondary)"},class:"mr-4"}),fn(" "+it(D.$t("common.edit")),1)]),_:1},8,["onClick"]),we(B,{onClick:hr(be=>E(me),["stop"])},{default:Ae(()=>[we(ae,{iconName:"app-delete",style:{color:"var(--app-text-color-secondary)"},class:"mr-4"}),fn(" "+it(D.$t("common.delete")),1)]),_:1},8,["onClick"])]),_:2},1024)]),default:Ae(()=>[we(se,{text:"",class:"lighter",style:{padding:"1px !important"}},{default:Ae(()=>[we(ae,{iconName:"app-more",style:{"margin-right":"0"}})]),_:1})]),_:2},1024)],512),[[ni,f.value===me.id&&me.id!=="new"]])])]),_:2},1032,["index","onClick","onMouseenter"]))),128))])),[[ue,n.leftLoading]])]),_:1},8,["size","total","page_size","current_page","onLoad","loading"])]),_:1})]),n.chatLogData?.length?un("",!0):(Xe(),vn("div",dd,[we(N,{type:"info"},{default:Ae(()=>[fn(it(D.$t("chat.noHistory")),1)]),_:1})]))]),_:1},512)),[[ni,n.isPcCollapse]]):un("",!0)]),_:1},8,["default-active","collapse"]),R1(D.$slots,"default",{},void 0,!0),we(J1,{ref_key:"EditTitleDialogRef",ref:u,onRefresh:L},null,512)])}}}),lc=qa(pd,[["__scopeId","data-v-5ad693da"]]),gd={class:"user-info p-16 cursor"},md={class:"flex align-center"},vd={class:"ml-8 color-text-primary"},bd={class:"flex align-center p-8"},wd={class:"mr-8 flex align-center"},yd={class:"medium mb-4"},_d={class:"color-secondary"},xd=rr({__name:"ChatHistoryDrawer",props:ko({applicationDetail:{},chatLogData:{},leftLoading:{type:Boolean},currentChatId:{}},{show:{type:Boolean},showModifiers:{}}),emits:ko(["newChat","clickLog","deleteLog","refreshFieldTitle","clearChat","clickShare"],["update:show"]),setup(n,{emit:e}){const t=ws(),r=ac(),a=Oo(n,"show"),i=e,{chatUser:c}=ta(),o=()=>{i("clickShare")},u=()=>{i("clearChat")},f=()=>{i("newChat")},p=L=>{i("clickLog",L)},w=L=>{i("deleteLog",L)};function v(L,D){i("refreshFieldTitle",L,D)}const d=Je(),E=()=>{d.value?.open()},C=L=>{Ln.resetCurrentPassword(L).then(()=>{t.push({name:"login"})})},F=()=>{c.logout().then(()=>{t.push({name:"login",params:{accessToken:c.accessToken},query:r.query})})};return(L,D)=>{const q=Fe("el-icon"),M=Fe("el-button"),Q=Fe("el-avatar"),ae=Fe("AppIcon"),se=Fe("el-dropdown-item"),V=Fe("el-dropdown-menu"),B=Fe("el-dropdown"),X=Fe("el-drawer");return Xe(),vn("div",null,[we(X,{modelValue:a.value,"onUpdate:modelValue":D[1]||(D[1]=_=>a.value=_),"with-header":!1,class:"chat-history-drawer",direction:"ltr",size:280,style:{"--el-drawer-padding-primary":"0"}},{default:Ae(()=>[we(M,{class:"collapse cursor",circle:"",onClick:D[0]||(D[0]=_=>a.value=!a.value)},{default:Ae(()=>[we(q,null,{default:Ae(()=>[(Xe(),kt(Ro(a.value?"ArrowLeftBold":"ArrowRightBold")))]),_:1})]),_:1}),we(lc,{"application-detail":n.applicationDetail,"chat-log-data":n.chatLogData,"left-loading":n.leftLoading,currentChatId:n.currentChatId,onNewChat:f,onClickLog:p,onDeleteLog:w,onRefreshFieldTitle:v,onClearChat:u,onClickShare:o},{default:Ae(()=>[Pe("div",gd,[!rt(c).chat_profile?.authentication||rt(c).chat_profile.authentication_type==="password"?(Xe(),kt(Q,{key:0,size:32},{default:Ae(()=>[...D[2]||(D[2]=[Pe("img",{src:Li,style:{width:"54%"},alt:""},null,-1)])]),_:1})):(Xe(),kt(B,{key:1,trigger:"click",type:"primary",class:"w-full"},{dropdown:Ae(()=>[we(V,{style:{"min-width":"260px"}},{default:Ae(()=>[Pe("div",bd,[Pe("div",wd,[we(Q,{size:40},{default:Ae(()=>[...D[4]||(D[4]=[Pe("img",{src:Li,style:{width:"54%"},alt:""},null,-1)])]),_:1})]),Pe("div",null,[Pe("h4",yd,it(rt(c).chatUserProfile?.nick_name),1),Pe("div",_d,it(`${L.$t("common.username")}: ${rt(c).chatUserProfile?.username}`),1)])]),rt(c).chatUserProfile?.source==="LOCAL"?(Xe(),kt(se,{key:0,class:"border-t",style:{"padding-top":"8px","padding-bottom":"8px"},onClick:E},{default:Ae(()=>[we(ae,{iconName:"app-key",class:"color-secondary"}),fn(" "+it(L.$t("views.login.resetPassword")),1)]),_:1})):un("",!0),we(se,{class:"border-t",style:{"padding-top":"8px","padding-bottom":"8px"},onClick:F},{default:Ae(()=>[we(ae,{iconName:"app-export",class:"color-secondary"}),fn(" "+it(L.$t("layout.logout")),1)]),_:1})]),_:1})]),default:Ae(()=>[Pe("div",md,[we(Q,{size:32},{default:Ae(()=>[...D[3]||(D[3]=[Pe("img",{src:Li,style:{width:"54%"},alt:""},null,-1)])]),_:1}),Pe("span",vd,it(rt(c).chatUserProfile?.nick_name),1)])]),_:1}))])]),_:1},8,["application-detail","chat-log-data","left-loading","currentChatId"])]),_:1},8,["modelValue"]),we(Rh,{ref_key:"resetPasswordRef",ref:d,emitConfirm:"",onConfirm:C},null,512)])}}}),kd=qa(xd,[["__scopeId","data-v-2c455533"]]),Ad={class:"flex-between"},Ld={class:"flex align-center"},Sd={class:"mr-12 ml-16 flex"},Nd=["src"],Pd=["title"],Cd={style:{"margin-right":"85px"}},Id={class:"chat-embed__main"},Ed=rr({__name:"index",props:{application_profile:{},applicationAvailable:{type:Boolean}},setup(n){Ma("scrollData",Q),Ma("chatLogPagination",()=>q);const e=Je(),t=Je(!1),r=Je(!1),a=Je([]),i=Je(!1),c=n,o=si({get:()=>c.application_profile,set:_=>{}}),u=Fh({current_page:1,page_size:20,total:0}),f=Je([]),p=Je("new"),w=si(()=>({background:o.value?.custom_theme?.theme_color,color:o.value?.custom_theme?.header_font_color})),v=Je(!1),d=()=>{v.value=!0,i.value=!1};function E(){Ln.clearChat(r).then(()=>{p.value="new",u.current_page=1,u.total=0,f.value=[],M()})}function C(_){Ln.deleteChat(_.id).then(()=>{p.value===_.id&&(p.value="new",u.current_page=1,u.total=0,f.value=[]),a.value=a.value.filter(N=>N.id!==_.id)})}function F(_){if(p.value!=="new"&&_.scrollTop===0&&u.total>f.value.length){const N=_.dialogScrollbar.offsetHeight;u.current_page+=1,ae().then(()=>{_.scrollDiv.setScrollTop(_.dialogScrollbar.offsetHeight-N)})}}const L={id:"new",abstract:hn("chat.createChat")};function D(){u.current_page=1,f.value=[],a.value.some(_=>_.id==="new")||a.value.unshift(L),p.value="new",i.value=!1}const q=Je({total:0,page_size:20,current_page:1});function M(_){Ln.pageChat(q.value.current_page,q.value.page_size,r).then(N=>{q.value.total=N.data.total,a.value=[...a.value,...N.data.records],_||(u.current_page=1,u.total=0,f.value=[],p.value="new")})}function Q(){M(!0)}function ae(){return Ln.pageChatRecord(p.value,u.current_page,u.page_size,t).then(_=>{u.total=_.data.total;const N=_.data.records;N.map(U=>{U.write_ed=!0,U.record_id=U.id}),f.value=[...N,...f.value].sort((U,$)=>U.create_time.localeCompare($.create_time)),u.current_page===1&&Ji(()=>{e.value.setScrollBottom()})})}const se=_=>{_.id!==p.value&&(v.value=!1,u.current_page=1,f.value=[],p.value=_.id,p.value!=="new"&&ae(),i.value=!1)};function V(_,N){const U=a.value.find($=>$.id==_);U&&(U.abstract=N)}function B(_){p.value=_,q.value.current_page=1,a.value=[],M(!0)}const X=()=>{M()};return sc(()=>{X()}),(_,N)=>{const U=Fe("AppIcon"),$=Fe("el-avatar"),re=Fe("LogoIcon"),oe=Fe("el-button"),he=Fe("el-tooltip"),ee=Fe("AiChat"),ue=To("loading");return qn((Xe(),vn("div",{class:"chat-embed layout-bg chat-background",style:ii({"--el-color-primary":o.value?.custom_theme?.theme_color,"--el-color-primary-light-9":rt(ai)(o.value?.custom_theme?.theme_color||"#3370FF",.1),"--el-color-primary-light-6":rt(ai)(o.value?.custom_theme?.theme_color||"#3370FF",.4),"--el-color-primary-light-06":rt(ai)(o.value?.custom_theme?.theme_color||"#3370FF",.04),backgroundImage:`url(${o.value?.chat_background})`})},[Pe("div",{class:"chat-embed__header",style:ii(w.value)},[Pe("div",Ad,[Pe("div",Ld,[we(U,{iconName:"app-mobile-open-history",style:{"font-size":"20px"},class:"ml-16 cursor",onClick:N[0]||(N[0]=hr(me=>i.value=!0,["prevent","stop"]))}),Pe("div",Sd,[rt(ic)(o.value?.icon)?(Xe(),kt($,{key:0,shape:"square",size:32,style:{background:"none"}},{default:Ae(()=>[Pe("img",{src:o.value?.icon,alt:""},null,8,Nd)]),_:1})):(Xe(),kt(re,{key:1,height:"32px"}))]),Pe("h4",{class:"ellipsis",style:{"max-width":"270px"},title:o.value?.name},it(o.value?.name),9,Pd)]),Pe("div",Cd,[v.value?un("",!0):(Xe(),kt(oe,{key:0,text:"",onClick:D,style:ii({color:o.value?.custom_theme?.header_font_color})},{default:Ae(()=>[we(U,{iconName:"app-create-chat",style:{"font-size":"20px"}})]),_:1},8,["style"])),!v.value&&p.value!=="new"?(Xe(),kt(he,{key:1,effect:"dark",content:_.$t("chat.share"),placement:"top"},{default:Ae(()=>[we(oe,{text:"",onClick:d,disabled:e.value?.loading},{default:Ae(()=>[we(U,{iconName:"app-share"})]),_:1},8,["disabled"])]),_:1},8,["content"])):un("",!0)])])],4),Pe("div",null,[Pe("div",Id,[we(ee,{ref_key:"AiChatRef",ref:e,applicationDetails:o.value,"onUpdate:applicationDetails":N[1]||(N[1]=me=>o.value=me),available:n.applicationAvailable,appId:o.value?.id,record:f.value,chatId:p.value,type:"ai-chat",onRefresh:B,onScroll:F,class:"AiChat-embed",selection:v.value,"onUpdate:selection":N[2]||(N[2]=me=>v.value=me)},null,8,["applicationDetails","available","appId","record","chatId","selection"])]),we(kd,{show:i.value,"onUpdate:show":N[3]||(N[3]=me=>i.value=me),"application-detail":o.value,"chat-log-data":a.value,"left-loading":r.value,currentChatId:p.value,onNewChat:D,onClickLog:se,onDeleteLog:C,onRefreshFieldTitle:V,onClearChat:E,onClickShare:d},null,8,["show","application-detail","chat-log-data","left-loading","currentChatId"])])],4)),[[ue,t.value]])}}}),Fd=Object.freeze(Object.defineProperty({__proto__:null,default:Ed},Symbol.toStringTag,{value:"Module"})),Rd={class:"navigation flex align-center mb-16"},Td={class:"mb-16"},Od=rr({__name:"ResetPasswordDrawer",props:{show:{type:Boolean,required:!0},showModifiers:{}},emits:["update:show"],setup(n){const e=ws();ta();const t=Oo(n,"show"),r=Je(),a=Je({password:"",re_password:""}),i=Je({password:[{required:!0,message:hn("views.login.loginForm.new_password.placeholder"),trigger:"blur"},{min:6,max:20,message:hn("views.login.loginForm.password.lengthMessage"),trigger:"blur"}],re_password:[{required:!0,message:hn("views.login.loginForm.re_password.requiredMessage"),trigger:"blur"},{min:6,max:20,message:hn("views.login.loginForm.password.lengthMessage"),trigger:"blur"},{validator:(o,u,f)=>{a.value.password!=a.value.re_password?f(new Error(hn("views.login.loginForm.re_password.validatorMessage"))):f()},trigger:"blur"}]});function c(){r.value?.validate().then(()=>{Ln.resetCurrentPassword(a.value).then(()=>{T1(hn("common.modifySuccess")),e.push({name:"login"})})})}return(o,u)=>{const f=Fe("ArrowLeftBold"),p=Fe("el-icon"),w=Fe("el-input"),v=Fe("el-form-item"),d=Fe("el-form"),E=Fe("el-button"),C=Fe("el-drawer");return Xe(),kt(C,{modelValue:t.value,"onUpdate:modelValue":u[3]||(u[3]=F=>t.value=F),"with-header":!1,class:"reset-password-drawer",size:"100%"},{default:Ae(()=>[Pe("div",Rd,[we(p,{size:"16",onClick:u[0]||(u[0]=F=>t.value=!1)},{default:Ae(()=>[we(f)]),_:1})]),Pe("h2",Td,it(o.$t("views.login.resetPassword")),1),we(d,{ref_key:"resetPasswordFormRef",ref:r,model:a.value,rules:i.value},{default:Ae(()=>[we(v,{prop:"password"},{default:Ae(()=>[we(w,{type:"password",size:"large",modelValue:a.value.password,"onUpdate:modelValue":u[1]||(u[1]=F=>a.value.password=F),placeholder:o.$t("views.login.loginForm.new_password.placeholder"),"show-password":""},null,8,["modelValue","placeholder"])]),_:1}),we(v,{prop:"re_password"},{default:Ae(()=>[we(w,{type:"password",size:"large",modelValue:a.value.re_password,"onUpdate:modelValue":u[2]||(u[2]=F=>a.value.re_password=F),placeholder:o.$t("views.login.loginForm.re_password.placeholder"),"show-password":""},null,8,["modelValue","placeholder"])]),_:1})]),_:1},8,["model","rules"]),we(E,{type:"primary",size:"large",class:"w-full",onClick:c},{default:Ae(()=>[fn(it(o.$t("chat.confirmModification")),1)]),_:1})]),_:1},8,["modelValue"])}}}),jd={class:"flex-center navigation mb-8"},Bd={class:"medium"},Dd={class:"card-item info p-16"},Md={class:"mt-12 mb-4"},qd={class:"color-secondary lighter"},Ud={class:"flex align-center"},zd={class:"lighter"},$d={class:"lighter"},Hd=rr({__name:"UserCenterDrawer",props:{show:{type:Boolean,required:!0},showModifiers:{}},emits:["update:show"],setup(n){const e=ws(),{chatUser:t}=ta(),r=Oo(n,"show"),a=Je(!1);function i(){a.value=!0}function c(){O1(hn("layout.logout"),hn("chat.logoutContent"),{confirmButtonText:hn("layout.logout"),confirmButtonClass:"danger"}).then(()=>{t.logout().then(()=>{e.push({name:"login"})})})}return(o,u)=>{const f=Fe("ArrowLeftBold"),p=Fe("el-icon"),w=Fe("el-avatar"),v=Fe("AppIcon"),d=Fe("ArrowRight"),E=Fe("el-drawer");return Xe(),kt(E,{modelValue:r.value,"onUpdate:modelValue":u[2]||(u[2]=C=>r.value=C),"with-header":!1,class:"user-center-drawer",size:"100%"},{default:Ae(()=>[Pe("div",jd,[we(p,{size:"16",onClick:u[0]||(u[0]=C=>r.value=!1)},{default:Ae(()=>[we(f)]),_:1}),Pe("h4",Bd,it(o.$t("chat.mine")),1)]),Pe("div",Dd,[we(w,{size:64},{default:Ae(()=>[...u[3]||(u[3]=[Pe("img",{src:Li,style:{width:"54%"},alt:""},null,-1)])]),_:1}),Pe("h2",Md,it(rt(t).chatUserProfile?.nick_name),1),Pe("div",qd,it(`${o.$t("common.username")}: ${rt(t).chatUserProfile?.username}`),1)]),rt(t).chatUserProfile?.source==="LOCAL"?(Xe(),vn("div",{key:0,class:"card-item reset-password flex-between",onClick:i},[Pe("div",Ud,[we(v,{iconName:"app-key",class:"mr-12"}),Pe("h4",zd,it(o.$t("views.login.resetPassword")),1)]),we(p,{size:"16"},{default:Ae(()=>[we(d)]),_:1})])):un("",!0),Pe("div",{class:"card-item logout",onClick:c},[Pe("h4",$d,it(o.$t("layout.logout")),1)]),we(Od,{show:a.value,"onUpdate:show":u[1]||(u[1]=C=>a.value=C)},null,8,["show"])]),_:1},8,["modelValue"])}}}),Wd={key:0,class:"ml-8 color-text-primary"},Vd=rr({__name:"ChatHistoryDrawer",props:ko({applicationDetail:{},chatLogData:{},leftLoading:{type:Boolean},currentChatId:{}},{show:{type:Boolean},showModifiers:{}}),emits:ko(["newChat","clickLog","deleteLog","refreshFieldTitle","clearChat","clickShare"],["update:show"]),setup(n,{emit:e}){const t=Oo(n,"show"),r=e,{chatUser:a}=ta(),i=()=>{r("clickShare")},c=()=>{r("clearChat")},o=()=>{r("newChat")},u=d=>{r("clickLog",d)},f=d=>{r("deleteLog",d)};function p(d,E){r("refreshFieldTitle",d,E)}const w=Je(!1);function v(){!a.chat_profile?.authentication||a.chat_profile.authentication_type==="password"||(w.value=!0)}return(d,E)=>{const C=Fe("el-avatar"),F=Fe("el-drawer");return Xe(),vn("div",null,[we(F,{modelValue:t.value,"onUpdate:modelValue":E[0]||(E[0]=L=>t.value=L),"with-header":!1,class:"chat-history-drawer",direction:"ltr",size:280,style:{"--el-drawer-padding-primary":"0"}},{default:Ae(()=>[we(lc,{"application-detail":n.applicationDetail,"chat-log-data":n.chatLogData,"left-loading":n.leftLoading,currentChatId:n.currentChatId,onNewChat:o,onClickLog:u,onDeleteLog:f,onRefreshFieldTitle:p,onClearChat:c,onClickShare:i},{default:Ae(()=>[Pe("div",{class:"flex align-center user-info p-16",onClick:v},[we(C,{size:32,class:oc(`${!rt(a).chat_profile?.authentication||rt(a).chat_profile.authentication_type==="password"?"cursor-default":""}`)},{default:Ae(()=>[...E[2]||(E[2]=[Pe("img",{src:Li,style:{width:"54%"},alt:""},null,-1)])]),_:1},8,["class"]),rt(a).chat_profile?.authentication?(Xe(),vn("span",Wd,it(rt(a).chatUserProfile?.nick_name),1)):un("",!0)])]),_:1},8,["application-detail","chat-log-data","left-loading","currentChatId"])]),_:1},8,["modelValue"]),we(Hd,{show:w.value,"onUpdate:show":E[1]||(E[1]=L=>w.value=L)},null,8,["show"])])}}}),Gd=qa(Vd,[["__scopeId","data-v-18a912b2"]]),Yd={class:"flex-between"},Jd={class:"flex align-center"},Zd={class:"mr-12 ml-16 flex"},Xd=["src"],Kd=["title"],Qd={class:"chat-mobile__main"},e2=rr({__name:"index",props:{application_profile:{},applicationAvailable:{type:Boolean}},setup(n){Ma("scrollData",Q),Ma("chatLogPagination",()=>q),ta();const e=Je(),t=Je(!1),r=Je(!1),a=Je([]),i=Je(!1),c=n,o=si({get:()=>c.application_profile,set:_=>{}}),u=Fh({current_page:1,page_size:20,total:0}),f=Je([]),p=Je("new"),w=si(()=>({background:o.value?.custom_theme?.theme_color,color:o.value?.custom_theme?.header_font_color})),v=Je(!1),d=()=>{v.value=!0,i.value=!1};function E(){Ln.clearChat(r).then(()=>{p.value="new",u.current_page=1,u.total=0,f.value=[],q.value.current_page=1,a.value=[],M()})}function C(_){Ln.deleteChat(_.id).then(()=>{p.value===_.id&&(p.value="new",u.current_page=1,u.total=0,f.value=[]),a.value=a.value.filter(N=>N.id!==_.id)})}function F(_){if(p.value!=="new"&&_.scrollTop===0&&u.total>f.value.length){const N=_.dialogScrollbar.offsetHeight;u.current_page+=1,ae().then(()=>{_.scrollDiv.setScrollTop(_.dialogScrollbar.offsetHeight-N)})}}const L={id:"new",abstract:hn("chat.createChat")};function D(){u.current_page=1,f.value=[],a.value.some(_=>_.id==="new")||a.value.unshift(L),p.value="new",i.value=!1}const q=Je({total:0,page_size:20,current_page:1});function M(_){Ln.pageChat(q.value.current_page,q.value.page_size,r).then(N=>{q.value.total=N.data.total,a.value=[...a.value,...N.data.records],_||(u.current_page=1,u.total=0,f.value=[],p.value="new")})}function Q(){M(!0)}function ae(){return Ln.pageChatRecord(p.value,u.current_page,u.page_size,t).then(_=>{u.total=_.data.total;const N=_.data.records;N.map(U=>{U.write_ed=!0,U.record_id=U.id}),f.value=[...N,...f.value].sort((U,$)=>U.create_time.localeCompare($.create_time)),u.current_page===1&&Ji(()=>{e.value.setScrollBottom()})})}const se=_=>{_.id!==p.value&&(v.value=!1,u.current_page=1,f.value=[],p.value=_.id,p.value!=="new"&&ae(),i.value=!1)};function V(_,N){const U=a.value.find($=>$.id==_);U&&(U.abstract=N)}function B(_){p.value=_,q.value.current_page=1,a.value=[],M(!0)}const X=()=>{M()};return sc(()=>{X()}),(_,N)=>{const U=Fe("AppIcon"),$=Fe("el-avatar"),re=Fe("LogoIcon"),oe=Fe("el-button"),he=Fe("el-tooltip"),ee=Fe("AiChat");return Xe(),vn("div",{class:"chat-mobile layout-bg chat-background",style:ii({"--el-color-primary":o.value?.custom_theme?.theme_color,"--el-color-primary-light-9":rt(ai)(o.value?.custom_theme?.theme_color||"#3370FF",.1),"--el-color-primary-light-6":rt(ai)(o.value?.custom_theme?.theme_color||"#3370FF",.4),"--el-color-primary-light-06":rt(ai)(o.value?.custom_theme?.theme_color||"#3370FF",.04),backgroundImage:`url(${o.value?.chat_background})`})},[Pe("div",{class:"chat-mobile__header",style:ii(w.value)},[Pe("div",Yd,[Pe("div",Jd,[we(U,{iconName:"app-mobile-open-history",style:{"font-size":"20px"},class:"ml-16 cursor",onClick:N[0]||(N[0]=hr(ue=>i.value=!0,["prevent","stop"]))}),Pe("div",Zd,[rt(ic)(o.value?.icon)?(Xe(),kt($,{key:0,shape:"square",size:32,style:{background:"none"}},{default:Ae(()=>[Pe("img",{src:o.value?.icon,alt:""},null,8,Xd)]),_:1})):(Xe(),kt(re,{key:1,height:"32px"}))]),Pe("h4",{class:"ellipsis",style:{"max-width":"270px"},title:o.value?.name},it(o.value?.name),9,Kd)]),Pe("div",null,[v.value?un("",!0):(Xe(),kt(oe,{key:0,text:"",onClick:D,class:oc(p.value==="new"?"mr-16":""),style:ii({color:o.value?.custom_theme?.header_font_color})},{default:Ae(()=>[we(U,{iconName:"app-create-chat",style:{"font-size":"20px"}})]),_:1},8,["class","style"])),!v.value&&p.value!=="new"?(Xe(),kt(he,{key:1,effect:"dark",content:_.$t("chat.share"),placement:"top"},{default:Ae(()=>[we(oe,{class:"mr-16",text:"",onClick:d,disabled:e.value?.loading},{default:Ae(()=>[we(U,{iconName:"app-share"})]),_:1},8,["disabled"])]),_:1},8,["content"])):un("",!0)])])],4),Pe("div",null,[Pe("div",Qd,[we(ee,{ref_key:"AiChatRef",ref:e,applicationDetails:o.value,"onUpdate:applicationDetails":N[1]||(N[1]=ue=>o.value=ue),available:n.applicationAvailable,appId:o.value?.id,record:f.value,chatId:p.value,type:"ai-chat",onRefresh:B,onScroll:F,selection:v.value,"onUpdate:selection":N[2]||(N[2]=ue=>v.value=ue)},null,8,["applicationDetails","available","appId","record","chatId","selection"])])]),we(Gd,{show:i.value,"onUpdate:show":N[3]||(N[3]=ue=>i.value=ue),"application-detail":o.value,"chat-log-data":a.value,"left-loading":r.value,currentChatId:p.value,onNewChat:D,onClickLog:se,onDeleteLog:C,onRefreshFieldTitle:V,onClearChat:E,onClickShare:d},null,8,["show","application-detail","chat-log-data","left-loading","currentChatId"])],4)}}}),t2=qa(e2,[["__scopeId","data-v-c8b2dcb6"]]),n2=Object.freeze(Object.defineProperty({__proto__:null,default:t2},Symbol.toStringTag,{value:"Module"})),r2={class:"not-found-container flex-center"},i2={class:"text-center"},a2=rr({__name:"index",setup(n){return ws(),(e,t)=>(Xe(),vn("div",r2,[Pe("div",null,[t[0]||(t[0]=Pe("img",{src:z1,width:"250",alt:""},null,-1)),Pe("h4",i2,it(e.$t("common.notFound.NoService")),1)])]))}}),s2=qa(a2,[["__scopeId","data-v-ca189467"]]),o2=Object.freeze(Object.defineProperty({__proto__:null,default:s2},Symbol.toStringTag,{value:"Module"}));function cc(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let na=cc();function Th(n){na=n}const Oh=/[&<>"']/,l2=new RegExp(Oh.source,"g"),jh=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,c2=new RegExp(jh.source,"g"),u2={"&":"&","<":"<",">":">",'"':""","'":"'"},ou=n=>u2[n];function tr(n,e){if(e){if(Oh.test(n))return n.replace(l2,ou)}else if(jh.test(n))return n.replace(c2,ou);return n}const h2=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function f2(n){return n.replace(h2,(e,t)=>(t=t.toLowerCase(),t==="colon"?":":t.charAt(0)==="#"?t.charAt(1)==="x"?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const d2=/(^|[^\[])\^/g;function Ft(n,e){let t=typeof n=="string"?n:n.source;e=e||"";const r={replace:(a,i)=>{let c=typeof i=="string"?i:i.source;return c=c.replace(d2,"$1"),t=t.replace(a,c),r},getRegex:()=>new RegExp(t,e)};return r}function lu(n){try{n=encodeURI(n).replace(/%25/g,"%")}catch{return null}return n}const ps={exec:()=>null};function cu(n,e){const t=n.replace(/\|/g,(i,c,o)=>{let u=!1,f=c;for(;--f>=0&&o[f]==="\\";)u=!u;return u?"|":" |"}),r=t.split(/ \|/);let a=0;if(r[0].trim()||r.shift(),r.length>0&&!r[r.length-1].trim()&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length{const i=a.match(/^\s+/);if(i===null)return a;const[c]=i;return c.length>=r.length?a.slice(r.length):a}).join(` `)}class Ao{options;rules;lexer;constructor(e){this.options=e||na}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const r=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?r:io(r,` `)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const r=t[0],a=g2(r,t[3]||"");return{type:"code",raw:r,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:a}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let r=t[2].trim();if(/#$/.test(r)){const a=io(r,"#");(this.options.pedantic||!a||/ $/.test(a))&&(r=a.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let r=t[0].replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,` $1`);r=io(r.replace(/^ *>[ \t]?/gm,""),` `);const a=this.lexer.state.top;this.lexer.state.top=!0;const i=this.lexer.blockTokens(r);return this.lexer.state.top=a,{type:"blockquote",raw:t[0],tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let r=t[1].trim();const a=r.length>1,i={type:"list",raw:"",ordered:a,start:a?+r.slice(0,-1):"",loose:!1,items:[]};r=a?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=a?r:"[*+-]");const c=new RegExp(`^( {0,3}${r})((?:[ ][^\\n]*)?(?:\\n|$))`);let o="",u="",f=!1;for(;e;){let p=!1;if(!(t=c.exec(e))||this.rules.block.hr.test(e))break;o=t[0],e=e.substring(o.length);let w=t[2].split(` `,1)[0].replace(/^\t+/,L=>" ".repeat(3*L.length)),v=e.split(` `,1)[0],d=0;this.options.pedantic?(d=2,u=w.trimStart()):(d=t[2].search(/[^ ]/),d=d>4?1:d,u=w.slice(d),d+=t[1].length);let E=!1;if(!w&&/^ *$/.test(v)&&(o+=v+` `,e=e.substring(v.length+1),p=!0),!p){const L=new RegExp(`^ {0,${Math.min(3,d-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),D=new RegExp(`^ {0,${Math.min(3,d-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),q=new RegExp(`^ {0,${Math.min(3,d-1)}}(?:\`\`\`|~~~)`),M=new RegExp(`^ {0,${Math.min(3,d-1)}}#`);for(;e;){const Q=e.split(` `,1)[0];if(v=Q,this.options.pedantic&&(v=v.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),q.test(v)||M.test(v)||L.test(v)||D.test(e))break;if(v.search(/[^ ]/)>=d||!v.trim())u+=` `+v.slice(d);else{if(E||w.search(/[^ ]/)>=4||q.test(w)||M.test(w)||D.test(w))break;u+=` `+v}!E&&!v.trim()&&(E=!0),o+=Q+` `,e=e.substring(Q.length+1),w=v.slice(d)}}i.loose||(f?i.loose=!0:/\n *\n *$/.test(o)&&(f=!0));let C=null,F;this.options.gfm&&(C=/^\[[ xX]\] /.exec(u),C&&(F=C[0]!=="[ ] ",u=u.replace(/^\[[ xX]\] +/,""))),i.items.push({type:"list_item",raw:o,task:!!C,checked:F,loose:!1,text:u,tokens:[]}),i.raw+=o}i.items[i.items.length-1].raw=o.trimEnd(),i.items[i.items.length-1].text=u.trimEnd(),i.raw=i.raw.trimEnd();for(let p=0;pd.type==="space"),v=w.length>0&&w.some(d=>/\n.*\n/.test(d.raw));i.loose=v}if(i.loose)for(let p=0;p$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:r,raw:t[0],href:a,title:i}}}table(e){const t=this.rules.block.table.exec(e);if(!t||!/[:|]/.test(t[2]))return;const r=cu(t[1]),a=t[2].replace(/^\||\| *$/g,"").split("|"),i=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split(` `):[],c={type:"table",raw:t[0],header:[],align:[],rows:[]};if(r.length===a.length){for(const o of a)/^ *-+: *$/.test(o)?c.align.push("right"):/^ *:-+: *$/.test(o)?c.align.push("center"):/^ *:-+ *$/.test(o)?c.align.push("left"):c.align.push(null);for(const o of r)c.header.push({text:o,tokens:this.lexer.inline(o)});for(const o of i)c.rows.push(cu(o,c.header.length).map(u=>({text:u,tokens:this.lexer.inline(u)})));return c}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const r=t[1].charAt(t[1].length-1)===` `?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:r,tokens:this.lexer.inline(r)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:tr(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const r=t[2].trim();if(!this.options.pedantic&&/^$/.test(r))return;const c=io(r.slice(0,-1),"\\");if((r.length-c.length)%2===0)return}else{const c=p2(t[2],"()");if(c>-1){const u=(t[0].indexOf("!")===0?5:4)+t[1].length+c;t[2]=t[2].substring(0,c),t[0]=t[0].substring(0,u).trim(),t[3]=""}}let a=t[2],i="";if(this.options.pedantic){const c=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(a);c&&(a=c[1],i=c[3])}else i=t[3]?t[3].slice(1,-1):"";return a=a.trim(),/^$/.test(r)?a=a.slice(1):a=a.slice(1,-1)),uu(t,{href:a&&a.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer)}}reflink(e,t){let r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){const a=(r[2]||r[1]).replace(/\s+/g," "),i=t[a.toLowerCase()];if(!i){const c=r[0].charAt(0);return{type:"text",raw:c,text:c}}return uu(r,i,r[0],this.lexer)}}emStrong(e,t,r=""){let a=this.rules.inline.emStrongLDelim.exec(e);if(!a||a[3]&&r.match(/[\p{L}\p{N}]/u))return;if(!(a[1]||a[2]||"")||!r||this.rules.inline.punctuation.exec(r)){const c=[...a[0]].length-1;let o,u,f=c,p=0;const w=a[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(w.lastIndex=0,t=t.slice(-1*e.length+c);(a=w.exec(t))!=null;){if(o=a[1]||a[2]||a[3]||a[4]||a[5]||a[6],!o)continue;if(u=[...o].length,a[3]||a[4]){f+=u;continue}else if((a[5]||a[6])&&c%3&&!((c+u)%3)){p+=u;continue}if(f-=u,f>0)continue;u=Math.min(u,u+f+p);const v=[...a[0]][0].length,d=e.slice(0,c+a.index+v+u);if(Math.min(c,u)%2){const C=d.slice(1,-1);return{type:"em",raw:d,text:C,tokens:this.lexer.inlineTokens(C)}}const E=d.slice(2,-2);return{type:"strong",raw:d,text:E,tokens:this.lexer.inlineTokens(E)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let r=t[2].replace(/\n/g," ");const a=/[^ ]/.test(r),i=/^ /.test(r)&&/ $/.test(r);return a&&i&&(r=r.substring(1,r.length-1)),r=tr(r,!0),{type:"codespan",raw:t[0],text:r}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let r,a;return t[2]==="@"?(r=tr(t[1]),a="mailto:"+r):(r=tr(t[1]),a=r),{type:"link",raw:t[0],text:r,href:a,tokens:[{type:"text",raw:r,text:r}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let r,a;if(t[2]==="@")r=tr(t[0]),a="mailto:"+r;else{let i;do i=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(i!==t[0]);r=tr(t[0]),t[1]==="www."?a="http://"+t[0]:a=t[0]}return{type:"link",raw:t[0],text:r,href:a,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let r;return this.lexer.state.inRawBlock?r=t[0]:r=tr(t[0]),{type:"text",raw:t[0],text:r}}}}const m2=/^(?: *(?:\n|$))+/,v2=/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,b2=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ys=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,w2=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Bh=/(?:[*+-]|\d{1,9}[.)])/,Dh=Ft(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,Bh).replace(/blockCode/g,/ {4}/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),uc=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,y2=/^[^\n]+/,hc=/(?!\s*\])(?:\\.|[^\[\]\\])+/,_2=Ft(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",hc).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),x2=Ft(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Bh).getRegex(),jo="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",fc=/|$))/,k2=Ft("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",fc).replace("tag",jo).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Mh=Ft(uc).replace("hr",ys).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",jo).getRegex(),A2=Ft(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Mh).getRegex(),dc={blockquote:A2,code:v2,def:_2,fences:b2,heading:w2,hr:ys,html:k2,lheading:Dh,list:x2,newline:m2,paragraph:Mh,table:ps,text:y2},hu=Ft("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ys).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",jo).getRegex(),L2={...dc,table:hu,paragraph:Ft(uc).replace("hr",ys).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",hu).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",jo).getRegex()},S2={...dc,html:Ft(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",fc).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ps,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Ft(uc).replace("hr",ys).replace("heading",` *#{1,6} *[^ ]`).replace("lheading",Dh).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},qh=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,N2=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Uh=/^( {2,}|\\)\n(?!\s*$)/,P2=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\]*?>/g,E2=Ft(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,_s).getRegex(),F2=Ft("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,_s).getRegex(),R2=Ft("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,_s).getRegex(),T2=Ft(/\\([punct])/,"gu").replace(/punct/g,_s).getRegex(),O2=Ft(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),j2=Ft(fc).replace("(?:-->|$)","-->").getRegex(),B2=Ft("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",j2).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Lo=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,D2=Ft(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",Lo).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),zh=Ft(/^!?\[(label)\]\[(ref)\]/).replace("label",Lo).replace("ref",hc).getRegex(),$h=Ft(/^!?\[(ref)\](?:\[\])?/).replace("ref",hc).getRegex(),M2=Ft("reflink|nolink(?!\\()","g").replace("reflink",zh).replace("nolink",$h).getRegex(),pc={_backpedal:ps,anyPunctuation:T2,autolink:O2,blockSkip:I2,br:Uh,code:N2,del:ps,emStrongLDelim:E2,emStrongRDelimAst:F2,emStrongRDelimUnd:R2,escape:qh,link:D2,nolink:$h,punctuation:C2,reflink:zh,reflinkSearch:M2,tag:B2,text:P2,url:ps},q2={...pc,link:Ft(/^!?\[(label)\]\((.*?)\)/).replace("label",Lo).getRegex(),reflink:Ft(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Lo).getRegex()},Wl={...pc,escape:Ft(qh).replace("])","~|])").getRegex(),url:Ft(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\u+" ".repeat(f.length));let r,a,i,c;for(;e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(o=>(r=o.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))){if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length),r.raw.length===1&&t.length>0?t[t.length-1].raw+=` `:t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length),a=t[t.length-1],a&&(a.type==="paragraph"||a.type==="text")?(a.raw+=` `+r.raw,a.text+=` `+r.text,this.inlineQueue[this.inlineQueue.length-1].src=a.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length),a=t[t.length-1],a&&(a.type==="paragraph"||a.type==="text")?(a.raw+=` `+r.raw,a.text+=` `+r.raw,this.inlineQueue[this.inlineQueue.length-1].src=a.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title});continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(i=e,this.options.extensions&&this.options.extensions.startBlock){let o=1/0;const u=e.slice(1);let f;this.options.extensions.startBlock.forEach(p=>{f=p.call({lexer:this},u),typeof f=="number"&&f>=0&&(o=Math.min(o,f))}),o<1/0&&o>=0&&(i=e.substring(0,o+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){a=t[t.length-1],c&&a.type==="paragraph"?(a.raw+=` `+r.raw,a.text+=` `+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=a.text):t.push(r),c=i.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length),a=t[t.length-1],a&&a.type==="text"?(a.raw+=` `+r.raw,a.text+=` `+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=a.text):t.push(r);continue}if(e){const o="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(o);break}else throw new Error(o)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let r,a,i,c=e,o,u,f;if(this.tokens.links){const p=Object.keys(this.tokens.links);if(p.length>0)for(;(o=this.tokenizer.rules.inline.reflinkSearch.exec(c))!=null;)p.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(c=c.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(o=this.tokenizer.rules.inline.blockSkip.exec(c))!=null;)c=c.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(o=this.tokenizer.rules.inline.anyPunctuation.exec(c))!=null;)c=c.slice(0,o.index)+"++"+c.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(u||(f=""),u=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(p=>(r=p.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))){if(r=this.tokenizer.escape(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.tag(e)){e=e.substring(r.raw.length),a=t[t.length-1],a&&r.type==="text"&&a.type==="text"?(a.raw+=r.raw,a.text+=r.text):t.push(r);continue}if(r=this.tokenizer.link(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length),a=t[t.length-1],a&&r.type==="text"&&a.type==="text"?(a.raw+=r.raw,a.text+=r.text):t.push(r);continue}if(r=this.tokenizer.emStrong(e,c,f)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.codespan(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.br(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.del(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.autolink(e)){e=e.substring(r.raw.length),t.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),t.push(r);continue}if(i=e,this.options.extensions&&this.options.extensions.startInline){let p=1/0;const w=e.slice(1);let v;this.options.extensions.startInline.forEach(d=>{v=d.call({lexer:this},w),typeof v=="number"&&v>=0&&(p=Math.min(p,v))}),p<1/0&&p>=0&&(i=e.substring(0,p+1))}if(r=this.tokenizer.inlineText(i)){e=e.substring(r.raw.length),r.raw.slice(-1)!=="_"&&(f=r.raw.slice(-1)),u=!0,a=t[t.length-1],a&&a.type==="text"?(a.raw+=r.raw,a.text+=r.text):t.push(r);continue}if(e){const p="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(p);break}else throw new Error(p)}}return t}}class So{options;constructor(e){this.options=e||na}code(e,t,r){const a=(t||"").match(/^\S*/)?.[0];return e=e.replace(/\n$/,"")+` `,a?'
'+(r?e:tr(e,!0))+`
`:"
"+(r?e:tr(e,!0))+`
`}blockquote(e){return`
${e}
`}html(e,t){return e}heading(e,t,r){return`${e} `}hr(){return`
`}list(e,t,r){const a=t?"ol":"ul",i=t&&r!==1?' start="'+r+'"':"";return"<"+a+i+`> `+e+" `}listitem(e,t,r){return`
  • ${e}
  • `}checkbox(e){return"'}paragraph(e){return`

    ${e}

    `}table(e,t){return t&&(t=`${t}`),` `+e+` `+t+`
    `}tablerow(e){return` ${e} `}tablecell(e,t){const r=t.header?"th":"td";return(t.align?`<${r} align="${t.align}">`:`<${r}>`)+e+` `}strong(e){return`${e}`}em(e){return`${e}`}codespan(e){return`${e}`}br(){return"
    "}del(e){return`${e}`}link(e,t,r){const a=lu(e);if(a===null)return r;e=a;let i='
    ",i}image(e,t,r){const a=lu(e);if(a===null)return r;e=a;let i=`${r}0&&v.tokens[0].type==="paragraph"?(v.tokens[0].text=F+" "+v.tokens[0].text,v.tokens[0].tokens&&v.tokens[0].tokens.length>0&&v.tokens[0].tokens[0].type==="text"&&(v.tokens[0].tokens[0].text=F+" "+v.tokens[0].tokens[0].text)):v.tokens.unshift({type:"text",text:F+" "}):C+=F+" "}C+=this.parse(v.tokens,f),p+=this.renderer.listitem(C,E,!!d)}r+=this.renderer.list(p,o,u);continue}case"html":{const c=i;r+=this.renderer.html(c.text,c.block);continue}case"paragraph":{const c=i;r+=this.renderer.paragraph(this.parseInline(c.tokens));continue}case"text":{let c=i,o=c.tokens?this.parseInline(c.tokens):c.text;for(;a+1{const o=i[c].flat(1/0);r=r.concat(this.walkTokens(o,t))}):i.tokens&&(r=r.concat(this.walkTokens(i.tokens,t)))}}return r}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(r=>{const a={...r};if(a.async=this.defaults.async||a.async||!1,r.extensions&&(r.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){const c=t.renderers[i.name];c?t.renderers[i.name]=function(...o){let u=i.renderer.apply(this,o);return u===!1&&(u=c.apply(this,o)),u}:t.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const c=t[i.level];c?c.unshift(i.tokenizer):t[i.level]=[i.tokenizer],i.start&&(i.level==="block"?t.startBlock?t.startBlock.push(i.start):t.startBlock=[i.start]:i.level==="inline"&&(t.startInline?t.startInline.push(i.start):t.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(t.childTokens[i.name]=i.childTokens)}),a.extensions=t),r.renderer){const i=this.defaults.renderer||new So(this.defaults);for(const c in r.renderer){if(!(c in i))throw new Error(`renderer '${c}' does not exist`);if(c==="options")continue;const o=c,u=r.renderer[o],f=i[o];i[o]=(...p)=>{let w=u.apply(i,p);return w===!1&&(w=f.apply(i,p)),w||""}}a.renderer=i}if(r.tokenizer){const i=this.defaults.tokenizer||new Ao(this.defaults);for(const c in r.tokenizer){if(!(c in i))throw new Error(`tokenizer '${c}' does not exist`);if(["options","rules","lexer"].includes(c))continue;const o=c,u=r.tokenizer[o],f=i[o];i[o]=(...p)=>{let w=u.apply(i,p);return w===!1&&(w=f.apply(i,p)),w}}a.tokenizer=i}if(r.hooks){const i=this.defaults.hooks||new go;for(const c in r.hooks){if(!(c in i))throw new Error(`hook '${c}' does not exist`);if(c==="options")continue;const o=c,u=r.hooks[o],f=i[o];go.passThroughHooks.has(c)?i[o]=p=>{if(this.defaults.async)return Promise.resolve(u.call(i,p)).then(v=>f.call(i,v));const w=u.call(i,p);return f.call(i,w)}:i[o]=(...p)=>{let w=u.apply(i,p);return w===!1&&(w=f.apply(i,p)),w}}a.hooks=i}if(r.walkTokens){const i=this.defaults.walkTokens,c=r.walkTokens;a.walkTokens=function(o){let u=[];return u.push(c.call(this,o)),i&&(u=u.concat(i.call(this,o))),u}}this.defaults={...this.defaults,...a}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return jr.lex(e,t??this.defaults)}parser(e,t){return Br.parse(e,t??this.defaults)}#e(e,t){return(r,a)=>{const i={...a},c={...this.defaults,...i};this.defaults.async===!0&&i.async===!1&&(c.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),c.async=!0);const o=this.#t(!!c.silent,!!c.async);if(typeof r>"u"||r===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(c.hooks&&(c.hooks.options=c),c.async)return Promise.resolve(c.hooks?c.hooks.preprocess(r):r).then(u=>e(u,c)).then(u=>c.hooks?c.hooks.processAllTokens(u):u).then(u=>c.walkTokens?Promise.all(this.walkTokens(u,c.walkTokens)).then(()=>u):u).then(u=>t(u,c)).then(u=>c.hooks?c.hooks.postprocess(u):u).catch(o);try{c.hooks&&(r=c.hooks.preprocess(r));let u=e(r,c);c.hooks&&(u=c.hooks.processAllTokens(u)),c.walkTokens&&this.walkTokens(u,c.walkTokens);let f=t(u,c);return c.hooks&&(f=c.hooks.postprocess(f)),f}catch(u){return o(u)}}}#t(e,t){return r=>{if(r.message+=` Please report this to https://github.com/markedjs/marked.`,e){const a="

    An error occurred:

    "+tr(r.message+"",!0)+"
    ";return t?Promise.resolve(a):a}if(t)return Promise.reject(r);throw r}}}const Xi=new z2;function It(n,e){return Xi.parse(n,e)}It.options=It.setOptions=function(n){return Xi.setOptions(n),It.defaults=Xi.defaults,Th(It.defaults),It};It.getDefaults=cc;It.defaults=na;It.use=function(...n){return Xi.use(...n),It.defaults=Xi.defaults,Th(It.defaults),It};It.walkTokens=function(n,e){return Xi.walkTokens(n,e)};It.parseInline=Xi.parseInline;It.Parser=Br;It.parser=Br.parse;It.Renderer=So;It.TextRenderer=gc;It.Lexer=jr;It.lexer=jr.lex;It.Tokenizer=Ao;It.Hooks=go;It.parse=It;It.options;It.setOptions;It.use;It.walkTokens;It.parseInline;Br.parse;jr.lex;var mo={exports:{}},$2=mo.exports,fu;function H2(){return fu||(fu=1,(function(n,e){(function(t,r){r()})($2,function(){function t(f,p){return typeof p>"u"?p={autoBom:!1}:typeof p!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),p={autoBom:!p}),p.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(f.type)?new Blob(["\uFEFF",f],{type:f.type}):f}function r(f,p,w){var v=new XMLHttpRequest;v.open("GET",f),v.responseType="blob",v.onload=function(){u(v.response,p,w)},v.onerror=function(){console.error("could not download file")},v.send()}function a(f){var p=new XMLHttpRequest;p.open("HEAD",f,!1);try{p.send()}catch{}return 200<=p.status&&299>=p.status}function i(f){try{f.dispatchEvent(new MouseEvent("click"))}catch{var p=document.createEvent("MouseEvents");p.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),f.dispatchEvent(p)}}var c=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof ro=="object"&&ro.global===ro?ro:void 0,o=c.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),u=c.saveAs||(typeof window!="object"||window!==c?function(){}:"download"in HTMLAnchorElement.prototype&&!o?function(f,p,w){var v=c.URL||c.webkitURL,d=document.createElement("a");p=p||f.name||"download",d.download=p,d.rel="noopener",typeof f=="string"?(d.href=f,d.origin===location.origin?i(d):a(d.href)?r(f,p,w):i(d,d.target="_blank")):(d.href=v.createObjectURL(f),setTimeout(function(){v.revokeObjectURL(d.href)},4e4),setTimeout(function(){i(d)},0))}:"msSaveOrOpenBlob"in navigator?function(f,p,w){if(p=p||f.name||"download",typeof f!="string")navigator.msSaveOrOpenBlob(t(f,w),p);else if(a(f))r(f,p,w);else{var v=document.createElement("a");v.href=f,v.target="_blank",setTimeout(function(){i(v)})}}:function(f,p,w,v){if(v=v||open("","_blank"),v&&(v.document.title=v.document.body.innerText="downloading..."),typeof f=="string")return r(f,p,w);var d=f.type==="application/octet-stream",E=/constructor/i.test(c.HTMLElement)||c.safari,C=/CriOS\/[\d]+/.test(navigator.userAgent);if((C||d&&E||o)&&typeof FileReader<"u"){var F=new FileReader;F.onloadend=function(){var q=F.result;q=C?q:q.replace(/^data:[^;]*;/,"data:attachment/file;"),v?v.location.href=q:location=q,v=null},F.readAsDataURL(f)}else{var L=c.URL||c.webkitURL,D=L.createObjectURL(f);v?v.location=D:location.href=D,v=null,setTimeout(function(){L.revokeObjectURL(D)},4e4)}});c.saveAs=u.saveAs=u,n.exports=u})})(mo)),mo.exports}var du=H2();function W2(n,e){if(n.match(/^[a-z]+:\/\//i))return n;if(n.match(/^\/\//))return window.location.protocol+n;if(n.match(/^[a-z]+:/i))return n;const t=document.implementation.createHTMLDocument(),r=t.createElement("base"),a=t.createElement("a");return t.head.appendChild(r),t.body.appendChild(a),e&&(r.href=e),a.href=n,a.href}const V2=(()=>{let n=0;const e=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(n+=1,`u${e()}${n}`)})();function Si(n){const e=[];for(let t=0,r=n.length;tQn||n.height>Qn)&&(n.width>Qn&&n.height>Qn?n.width>n.height?(n.height*=Qn/n.width,n.width=Qn):(n.width*=Qn/n.height,n.height=Qn):n.width>Qn?(n.height*=Qn/n.width,n.width=Qn):(n.width*=Qn/n.height,n.height=Qn))}function Po(n){return new Promise((e,t)=>{const r=new Image;r.onload=()=>{r.decode().then(()=>{requestAnimationFrame(()=>e(r))})},r.onerror=t,r.crossOrigin="anonymous",r.decoding="async",r.src=n})}async function X2(n){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(n)).then(encodeURIComponent).then(e=>`data:image/svg+xml;charset=utf-8,${e}`)}async function K2(n,e,t){const r="http://www.w3.org/2000/svg",a=document.createElementNS(r,"svg"),i=document.createElementNS(r,"foreignObject");return a.setAttribute("width",`${e}`),a.setAttribute("height",`${t}`),a.setAttribute("viewBox",`0 0 ${e} ${t}`),i.setAttribute("width","100%"),i.setAttribute("height","100%"),i.setAttribute("x","0"),i.setAttribute("y","0"),i.setAttribute("externalResourcesRequired","true"),a.appendChild(i),i.appendChild(n),X2(a)}const Hn=(n,e)=>{if(n instanceof e)return!0;const t=Object.getPrototypeOf(n);return t===null?!1:t.constructor.name===e.name||Hn(t,e)};function Q2(n){const e=n.getPropertyValue("content");return`${n.cssText} content: '${e.replace(/'|"/g,"")}';`}function ep(n,e){return Hh(e).map(t=>{const r=n.getPropertyValue(t),a=n.getPropertyPriority(t);return`${t}: ${r}${a?" !important":""};`}).join(" ")}function tp(n,e,t,r){const a=`.${n}:${e}`,i=t.cssText?Q2(t):ep(t,r);return document.createTextNode(`${a}{${i}}`)}function pu(n,e,t,r){const a=window.getComputedStyle(n,t),i=a.getPropertyValue("content");if(i===""||i==="none")return;const c=V2();try{e.className=`${e.className} ${c}`}catch{return}const o=document.createElement("style");o.appendChild(tp(c,t,a,r)),e.appendChild(o)}function np(n,e,t){pu(n,e,":before",t),pu(n,e,":after",t)}const gu="application/font-woff",mu="image/jpeg",rp={woff:gu,woff2:gu,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:mu,jpeg:mu,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function ip(n){const e=/\.([^./]*?)$/g.exec(n);return e?e[1]:""}function mc(n){const e=ip(n).toLowerCase();return rp[e]||""}function ap(n){return n.split(/,/)[1]}function Vl(n){return n.search(/^(data:)/)!==-1}function sp(n,e){return`data:${e};base64,${n}`}async function Vh(n,e,t){const r=await fetch(n,e);if(r.status===404)throw new Error(`Resource "${r.url}" not found`);const a=await r.blob();return new Promise((i,c)=>{const o=new FileReader;o.onerror=c,o.onloadend=()=>{try{i(t({res:r,result:o.result}))}catch(u){c(u)}},o.readAsDataURL(a)})}const xl={};function op(n,e,t){let r=n.replace(/\?.*/,"");return t&&(r=n),/ttf|otf|eot|woff2?/i.test(r)&&(r=r.replace(/.*\//,"")),e?`[${e}]${r}`:r}async function vc(n,e,t){const r=op(n,e,t.includeQueryParams);if(xl[r]!=null)return xl[r];t.cacheBust&&(n+=(/\?/.test(n)?"&":"?")+new Date().getTime());let a;try{const i=await Vh(n,t.fetchRequestInit,({res:c,result:o})=>(e||(e=c.headers.get("Content-Type")||""),ap(o)));a=sp(i,e)}catch(i){a=t.imagePlaceholder||"";let c=`Failed to fetch resource: ${n}`;i&&(c=typeof i=="string"?i:i.message),c&&console.warn(c)}return xl[r]=a,a}async function lp(n){const e=n.toDataURL();return e==="data:,"?n.cloneNode(!1):Po(e)}async function cp(n,e){if(n.currentSrc){const i=document.createElement("canvas"),c=i.getContext("2d");i.width=n.clientWidth,i.height=n.clientHeight,c?.drawImage(n,0,0,i.width,i.height);const o=i.toDataURL();return Po(o)}const t=n.poster,r=mc(t),a=await vc(t,r,e);return Po(a)}async function up(n,e){var t;try{if(!((t=n?.contentDocument)===null||t===void 0)&&t.body)return await Bo(n.contentDocument.body,e,!0)}catch{}return n.cloneNode(!1)}async function hp(n,e){return Hn(n,HTMLCanvasElement)?lp(n):Hn(n,HTMLVideoElement)?cp(n,e):Hn(n,HTMLIFrameElement)?up(n,e):n.cloneNode(Gh(n))}const fp=n=>n.tagName!=null&&n.tagName.toUpperCase()==="SLOT",Gh=n=>n.tagName!=null&&n.tagName.toUpperCase()==="SVG";async function dp(n,e,t){var r,a;if(Gh(e))return e;let i=[];return fp(n)&&n.assignedNodes?i=Si(n.assignedNodes()):Hn(n,HTMLIFrameElement)&&(!((r=n.contentDocument)===null||r===void 0)&&r.body)?i=Si(n.contentDocument.body.childNodes):i=Si(((a=n.shadowRoot)!==null&&a!==void 0?a:n).childNodes),i.length===0||Hn(n,HTMLVideoElement)||await i.reduce((c,o)=>c.then(()=>Bo(o,t)).then(u=>{u&&e.appendChild(u)}),Promise.resolve()),e}function pp(n,e,t){const r=e.style;if(!r)return;const a=window.getComputedStyle(n);a.cssText?(r.cssText=a.cssText,r.transformOrigin=a.transformOrigin):Hh(t).forEach(i=>{let c=a.getPropertyValue(i);i==="font-size"&&c.endsWith("px")&&(c=`${Math.floor(parseFloat(c.substring(0,c.length-2)))-.1}px`),Hn(n,HTMLIFrameElement)&&i==="display"&&c==="inline"&&(c="block"),i==="d"&&e.getAttribute("d")&&(c=`path(${e.getAttribute("d")})`),r.setProperty(i,c,a.getPropertyPriority(i))})}function gp(n,e){Hn(n,HTMLTextAreaElement)&&(e.innerHTML=n.value),Hn(n,HTMLInputElement)&&e.setAttribute("value",n.value)}function mp(n,e){if(Hn(n,HTMLSelectElement)){const r=Array.from(e.children).find(a=>n.value===a.getAttribute("value"));r&&r.setAttribute("selected","")}}function vp(n,e,t){return Hn(e,Element)&&(pp(n,e,t),np(n,e,t),gp(n,e),mp(n,e)),e}async function bp(n,e){const t=n.querySelectorAll?n.querySelectorAll("use"):[];if(t.length===0)return n;const r={};for(let i=0;ihp(r,e)).then(r=>dp(n,r,e)).then(r=>vp(n,r,e)).then(r=>bp(r,e))}const Yh=/url\((['"]?)([^'"]+?)\1\)/g,wp=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,yp=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function _p(n){const e=n.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${e})(['"]?\\))`,"g")}function xp(n){const e=[];return n.replace(Yh,(t,r,a)=>(e.push(a),t)),e.filter(t=>!Vl(t))}async function kp(n,e,t,r,a){try{const i=t?W2(e,t):e,c=mc(e);let o;return a||(o=await vc(i,c,r)),n.replace(_p(e),`$1${o}$3`)}catch{}return n}function Ap(n,{preferredFontFormat:e}){return e?n.replace(yp,t=>{for(;;){const[r,,a]=wp.exec(t)||[];if(!a)return"";if(a===e)return`src: ${r};`}}):n}function Jh(n){return n.search(Yh)!==-1}async function Zh(n,e,t){if(!Jh(n))return n;const r=Ap(n,t);return xp(r).reduce((i,c)=>i.then(o=>kp(o,c,e,t)),Promise.resolve(r))}async function Pa(n,e,t){var r;const a=(r=e.style)===null||r===void 0?void 0:r.getPropertyValue(n);if(a){const i=await Zh(a,null,t);return e.style.setProperty(n,i,e.style.getPropertyPriority(n)),!0}return!1}async function Lp(n,e){await Pa("background",n,e)||await Pa("background-image",n,e),await Pa("mask",n,e)||await Pa("-webkit-mask",n,e)||await Pa("mask-image",n,e)||await Pa("-webkit-mask-image",n,e)}async function Sp(n,e){const t=Hn(n,HTMLImageElement);if(!(t&&!Vl(n.src))&&!(Hn(n,SVGImageElement)&&!Vl(n.href.baseVal)))return;const r=t?n.src:n.href.baseVal,a=await vc(r,mc(r),e);await new Promise((i,c)=>{n.onload=i,n.onerror=e.onImageErrorHandler?(...u)=>{try{i(e.onImageErrorHandler(...u))}catch(f){c(f)}}:c;const o=n;o.decode&&(o.decode=i),o.loading==="lazy"&&(o.loading="eager"),t?(n.srcset="",n.src=a):n.href.baseVal=a})}async function Np(n,e){const r=Si(n.childNodes).map(a=>Xh(a,e));await Promise.all(r).then(()=>n)}async function Xh(n,e){Hn(n,Element)&&(await Lp(n,e),await Sp(n,e),await Np(n,e))}function Pp(n,e){const{style:t}=n;e.backgroundColor&&(t.backgroundColor=e.backgroundColor),e.width&&(t.width=`${e.width}px`),e.height&&(t.height=`${e.height}px`);const r=e.style;return r!=null&&Object.keys(r).forEach(a=>{t[a]=r[a]}),n}const vu={};async function bu(n){let e=vu[n];if(e!=null)return e;const r=await(await fetch(n)).text();return e={url:n,cssText:r},vu[n]=e,e}async function wu(n,e){let t=n.cssText;const r=/url\(["']?([^"')]+)["']?\)/g,i=(t.match(/url\([^)]+\)/g)||[]).map(async c=>{let o=c.replace(r,"$1");return o.startsWith("https://")||(o=new URL(o,n.url).href),Vh(o,e.fetchRequestInit,({result:u})=>(t=t.replace(c,`url(${u})`),[c,u]))});return Promise.all(i).then(()=>t)}function yu(n){if(n==null)return[];const e=[],t=/(\/\*[\s\S]*?\*\/)/gi;let r=n.replace(t,"");const a=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const u=a.exec(r);if(u===null)break;e.push(u[0])}r=r.replace(a,"");const i=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,c="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",o=new RegExp(c,"gi");for(;;){let u=i.exec(r);if(u===null){if(u=o.exec(r),u===null)break;i.lastIndex=o.lastIndex}else o.lastIndex=i.lastIndex;e.push(u[0])}return e}async function Cp(n,e){const t=[],r=[];return n.forEach(a=>{if("cssRules"in a)try{Si(a.cssRules||[]).forEach((i,c)=>{if(i.type===CSSRule.IMPORT_RULE){let o=c+1;const u=i.href,f=bu(u).then(p=>wu(p,e)).then(p=>yu(p).forEach(w=>{try{a.insertRule(w,w.startsWith("@import")?o+=1:a.cssRules.length)}catch(v){console.error("Error inserting rule from remote css",{rule:w,error:v})}})).catch(p=>{console.error("Error loading remote css",p.toString())});r.push(f)}})}catch(i){const c=n.find(o=>o.href==null)||document.styleSheets[0];a.href!=null&&r.push(bu(a.href).then(o=>wu(o,e)).then(o=>yu(o).forEach(u=>{c.insertRule(u,c.cssRules.length)})).catch(o=>{console.error("Error loading remote stylesheet",o)})),console.error("Error inlining remote css file",i)}}),Promise.all(r).then(()=>(n.forEach(a=>{if("cssRules"in a)try{Si(a.cssRules||[]).forEach(i=>{t.push(i)})}catch(i){console.error(`Error while reading CSS rules from ${a.href}`,i)}}),t))}function Ip(n){return n.filter(e=>e.type===CSSRule.FONT_FACE_RULE).filter(e=>Jh(e.style.getPropertyValue("src")))}async function Ep(n,e){if(n.ownerDocument==null)throw new Error("Provided element is not within a Document");const t=Si(n.ownerDocument.styleSheets),r=await Cp(t,e);return Ip(r)}function Kh(n){return n.trim().replace(/["']/g,"")}function Fp(n){const e=new Set;function t(r){(r.style.fontFamily||getComputedStyle(r).fontFamily).split(",").forEach(i=>{e.add(Kh(i))}),Array.from(r.children).forEach(i=>{i instanceof HTMLElement&&t(i)})}return t(n),e}async function Rp(n,e){const t=await Ep(n,e),r=Fp(n);return(await Promise.all(t.filter(i=>r.has(Kh(i.style.fontFamily))).map(i=>{const c=i.parentStyleSheet?i.parentStyleSheet.href:null;return Zh(i.cssText,c,e)}))).join(` `)}async function Tp(n,e){const t=e.fontEmbedCSS!=null?e.fontEmbedCSS:e.skipFonts?null:await Rp(n,e);if(t){const r=document.createElement("style"),a=document.createTextNode(t);r.appendChild(a),n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r)}}async function Op(n,e={}){const{width:t,height:r}=Wh(n,e),a=await Bo(n,e,!0);return await Tp(a,e),await Xh(a,e),Pp(a,e),await K2(a,t,r)}async function kl(n,e={}){const{width:t,height:r}=Wh(n,e),a=await Op(n,e),i=await Po(a),c=document.createElement("canvas"),o=c.getContext("2d"),u=e.pixelRatio||J2(),f=e.canvasWidth||t,p=e.canvasHeight||r;return c.width=f*u,c.height=p*u,e.skipAutoScale||Z2(c),c.style.width=`${f}`,c.style.height=`${p}`,e.backgroundColor&&(o.fillStyle=e.backgroundColor,o.fillRect(0,0,c.width,c.height)),o.drawImage(i,0,0,c.width,c.height),c}var _r=Uint8Array,nr=Uint16Array,bc=Int32Array,wc=new _r([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),yc=new _r([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),_u=new _r([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Qh=function(n,e){for(var t=new nr(31),r=0;r<31;++r)t[r]=e+=1<>1|($t&21845)<<1;xi=(xi&52428)>>2|(xi&13107)<<2,xi=(xi&61680)>>4|(xi&3855)<<4,Yl[$t]=((xi&65280)>>8|(xi&255)<<8)>>1}var gs=(function(n,e,t){for(var r=n.length,a=0,i=new nr(e);a>u]=f}else for(o=new nr(r),a=0;a>15-n[a]);return o}),Ki=new _r(288);for(var $t=0;$t<144;++$t)Ki[$t]=8;for(var $t=144;$t<256;++$t)Ki[$t]=9;for(var $t=256;$t<280;++$t)Ki[$t]=7;for(var $t=280;$t<288;++$t)Ki[$t]=8;var Co=new _r(32);for(var $t=0;$t<32;++$t)Co[$t]=5;var Dp=gs(Ki,9,0),Mp=gs(Co,5,0),tf=function(n){return(n+7)/8|0},qp=function(n,e,t){return(t==null||t>n.length)&&(t=n.length),new _r(n.subarray(e,t))},ei=function(n,e,t){t<<=e&7;var r=e/8|0;n[r]|=t,n[r+1]|=t>>8},fs=function(n,e,t){t<<=e&7;var r=e/8|0;n[r]|=t,n[r+1]|=t>>8,n[r+2]|=t>>16},Al=function(n,e){for(var t=[],r=0;rv&&(v=i[r].s);var d=new nr(v+1),E=Jl(t[p-1],d,0);if(E>e){var r=0,C=0,F=E-e,L=1<e)C+=L-(1<>=F;C>0;){var q=i[r].s;d[q]=0&&C;--r){var M=i[r].s;d[M]==e&&(--d[M],++C)}E=e}return{t:new _r(d),l:E}},Jl=function(n,e,t){return n.s==-1?Math.max(Jl(n.l,e,t+1),Jl(n.r,e,t+1)):e[n.s]=t},ku=function(n){for(var e=n.length;e&&!n[--e];);for(var t=new nr(++e),r=0,a=n[0],i=1,c=function(u){t[r++]=u},o=1;o<=e;++o)if(n[o]==a&&o!=e)++i;else{if(!a&&i>2){for(;i>138;i-=138)c(32754);i>2&&(c(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(c(a),--i;i>6;i-=6)c(8304);i>2&&(c(i-3<<5|8208),i=0)}for(;i--;)c(a);i=1,a=n[o]}return{c:t.subarray(0,r),n:e}},ds=function(n,e){for(var t=0,r=0;r>8,n[a+2]=n[a]^255,n[a+3]=n[a+1]^255;for(var i=0;i4&&!X[_u[N-1]];--N);var U=f+5<<3,$=ds(a,Ki)+ds(i,Co)+c,re=ds(a,v)+ds(i,C)+c+14+3*N+ds(se,X)+2*se[16]+3*se[17]+7*se[18];if(u>=0&&U<=$&&U<=re)return nf(e,p,n.subarray(u,u+f));var oe,he,ee,ue;if(ei(e,p,1+(re<$)),p+=2,re<$){oe=gs(v,d,0),he=v,ee=gs(C,F,0),ue=C;var me=gs(X,_,0);ei(e,p,q-257),ei(e,p+5,ae-1),ei(e,p+10,N-4),p+=14;for(var V=0;V15&&(ei(e,p,j[V]>>5&127),p+=j[V]>>12)}}else oe=Dp,he=Ki,ee=Mp,ue=Co;for(var V=0;V255){var z=W>>18&31;fs(e,p,oe[z+257]),p+=he[z+257],z>7&&(ei(e,p,W>>23&31),p+=wc[z]);var Y=W&31;fs(e,p,ee[Y]),p+=ue[Y],Y>3&&(fs(e,p,W>>5&8191),p+=yc[Y])}else fs(e,p,oe[W]),p+=he[W]}return fs(e,p,oe[256]),p+he[256]},Up=new bc([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),rf=new _r(0),zp=function(n,e,t,r,a,i){var c=i.z||n.length,o=new _r(r+c+5*(1+Math.ceil(c/7e3))+a),u=o.subarray(r,o.length-a),f=i.l,p=(i.r||0)&7;if(e){p&&(u[0]=i.r>>3);for(var w=Up[e-1],v=w>>13,d=w&8191,E=(1<7e3||X>24576)&&(oe>423||!f)){p=Au(n,u,0,M,Q,ae,V,X,N,B-N,p),X=se=V=0,N=B;for(var he=0;he<286;++he)Q[he]=0;for(var he=0;he<30;++he)ae[he]=0}var ee=2,ue=0,me=d,be=$-re&32767;if(oe>2&&U==q(B-be))for(var A=Math.min(v,oe)-1,j=Math.min(32767,B),z=Math.min(258,oe);be<=j&&--me&&$!=re;){if(n[B+ee]==n[B+ee-be]){for(var W=0;Wee){if(ee=W,ue=be,W>A)break;for(var Y=Math.min(be,W-2),te=0,he=0;hete&&(te=ve,re=ce)}}}$=re,re=C[$],be+=$-re&32767}if(ue){M[X++]=268435456|Gl[ee]<<18|xu[ue];var Se=Gl[ee]&31,Ee=xu[ue]&31;V+=wc[Se]+yc[Ee],++Q[257+Se],++ae[Ee],_=B+ee,++se}else M[X++]=n[B],++Q[n[B]]}}for(B=Math.max(B,_);B=c&&(u[p/8|0]=f,Ie=c),p=nf(u,p+1,n.subarray(B,Ie))}i.i=c}return qp(o,0,r+tf(p)+a)},af=function(){var n=1,e=0;return{p:function(t){for(var r=n,a=e,i=t.length|0,c=0;c!=i;){for(var o=Math.min(c+2655,i);c>16),a=(a&65535)+15*(a>>16)}n=r,e=a},d:function(){return n%=65521,e%=65521,(n&255)<<24|(n&65280)<<8|(e&255)<<8|e>>8}}},$p=function(n,e,t,r,a){if(!a&&(a={l:1},e.dictionary)){var i=e.dictionary.subarray(-32768),c=new _r(i.length+n.length);c.set(i),c.set(n,i.length),n=c,a.w=i.length}return zp(n,e.level==null?6:e.level,e.mem==null?a.l?Math.ceil(Math.max(8,Math.min(13,Math.log(n.length)))*1.5):20:12+e.mem,t,r,a)},sf=function(n,e,t){for(;t;++e)n[e]=t,t>>>=8},Hp=function(n,e){var t=e.level,r=t==0?0:t<6?1:t==9?3:2;if(n[0]=120,n[1]=r<<6|(e.dictionary&&32),n[1]|=31-(n[0]<<8|n[1])%31,e.dictionary){var a=af();a.p(e.dictionary),sf(n,2,a.d())}};function Zl(n,e){e||(e={});var t=af();t.p(n);var r=$p(n,e,e.dictionary?6:2,4);return Hp(r,e),sf(r,r.length-4,t.d()),r}var Wp=typeof TextDecoder<"u"&&new TextDecoder,Vp=0;try{Wp.decode(rf,{stream:!0}),Vp=1}catch{}function Gp(n){if(Array.isArray(n))return n}function Yp(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,a,i,c,o=[],u=!0,f=!1;try{if(i=(t=t.call(n)).next,e!==0)for(;!(u=(r=i.call(t)).done)&&(o.push(r.value),o.length!==e);u=!0);}catch(p){f=!0,a=p}finally{try{if(!u&&t.return!=null&&(c=t.return(),Object(c)!==c))return}finally{if(f)throw a}}return o}}function Jp(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Lu(n,e){return Gp(n)||Yp(n,e)||H1(n,e)||Jp()}function Su(n,e="utf8"){return new TextDecoder(e).decode(n)}const Zp=new TextEncoder;function Xp(n){return Zp.encode(n)}const Kp=1024*8,Qp=(()=>{const n=new Uint8Array(4),e=new Uint32Array(n.buffer);return!((e[0]=1)&n[0])})(),Ll={int8:globalThis.Int8Array,uint8:globalThis.Uint8Array,int16:globalThis.Int16Array,uint16:globalThis.Uint16Array,int32:globalThis.Int32Array,uint32:globalThis.Uint32Array,uint64:globalThis.BigUint64Array,int64:globalThis.BigInt64Array,float32:globalThis.Float32Array,float64:globalThis.Float64Array};class _c{buffer;byteLength;byteOffset;length;offset;lastWrittenByte;littleEndian;_data;_mark;_marks;constructor(e=Kp,t={}){let r=!1;typeof e=="number"?e=new ArrayBuffer(e):(r=!0,this.lastWrittenByte=e.byteLength);const a=t.offset?t.offset>>>0:0,i=e.byteLength-a;let c=a;(ArrayBuffer.isView(e)||e instanceof _c)&&(e.byteLength!==e.buffer.byteLength&&(c=e.byteOffset+a),e=e.buffer),r?this.lastWrittenByte=i:this.lastWrittenByte=0,this.buffer=e,this.length=i,this.byteLength=i,this.byteOffset=c,this.offset=0,this.littleEndian=!0,this._data=new DataView(this.buffer,c,i),this._mark=0,this._marks=[]}available(e=1){return this.offset+e<=this.length}isLittleEndian(){return this.littleEndian}setLittleEndian(){return this.littleEndian=!0,this}isBigEndian(){return!this.littleEndian}setBigEndian(){return this.littleEndian=!1,this}skip(e=1){return this.offset+=e,this}back(e=1){return this.offset-=e,this}seek(e){return this.offset=e,this}mark(){return this._mark=this.offset,this}reset(){return this.offset=this._mark,this}pushMark(){return this._marks.push(this.offset),this}popMark(){const e=this._marks.pop();if(e===void 0)throw new Error("Mark stack empty");return this.seek(e),this}rewind(){return this.offset=0,this}ensureAvailable(e=1){if(!this.available(e)){const r=(this.offset+e)*2,a=new Uint8Array(r);a.set(new Uint8Array(this.buffer)),this.buffer=a.buffer,this.length=r,this.byteLength=r,this._data=new DataView(this.buffer)}return this}readBoolean(){return this.readUint8()!==0}readInt8(){return this._data.getInt8(this.offset++)}readUint8(){return this._data.getUint8(this.offset++)}readByte(){return this.readUint8()}readBytes(e=1){return this.readArray(e,"uint8")}readArray(e,t){const r=Ll[t].BYTES_PER_ELEMENT*e,a=this.byteOffset+this.offset,i=this.buffer.slice(a,a+r);if(this.littleEndian===Qp&&t!=="uint8"&&t!=="int8"){const o=new Uint8Array(this.buffer.slice(a,a+r));o.reverse();const u=new Ll[t](o.buffer);return this.offset+=r,u.reverse(),u}const c=new Ll[t](i);return this.offset+=r,c}readInt16(){const e=this._data.getInt16(this.offset,this.littleEndian);return this.offset+=2,e}readUint16(){const e=this._data.getUint16(this.offset,this.littleEndian);return this.offset+=2,e}readInt32(){const e=this._data.getInt32(this.offset,this.littleEndian);return this.offset+=4,e}readUint32(){const e=this._data.getUint32(this.offset,this.littleEndian);return this.offset+=4,e}readFloat32(){const e=this._data.getFloat32(this.offset,this.littleEndian);return this.offset+=4,e}readFloat64(){const e=this._data.getFloat64(this.offset,this.littleEndian);return this.offset+=8,e}readBigInt64(){const e=this._data.getBigInt64(this.offset,this.littleEndian);return this.offset+=8,e}readBigUint64(){const e=this._data.getBigUint64(this.offset,this.littleEndian);return this.offset+=8,e}readChar(){return String.fromCharCode(this.readInt8())}readChars(e=1){let t="";for(let r=0;rthis.lastWrittenByte&&(this.lastWrittenByte=this.offset)}}function Ua(n){let e=n.length;for(;--e>=0;)n[e]=0}const e5=3,t5=258,of=29,n5=256,r5=n5+1+of,lf=30,i5=512,a5=new Array((r5+2)*2);Ua(a5);const s5=new Array(lf*2);Ua(s5);const o5=new Array(i5);Ua(o5);const l5=new Array(t5-e5+1);Ua(l5);const c5=new Array(of);Ua(c5);const u5=new Array(lf);Ua(u5);const h5=(n,e,t,r)=>{let a=n&65535|0,i=n>>>16&65535|0,c=0;for(;t!==0;){c=t>2e3?2e3:t,t-=c;do a=a+e[r++]|0,i=i+a|0;while(--c);a%=65521,i%=65521}return a|i<<16|0};var Xl=h5;const f5=()=>{let n,e=[];for(var t=0;t<256;t++){n=t;for(var r=0;r<8;r++)n=n&1?3988292384^n>>>1:n>>>1;e[t]=n}return e},d5=new Uint32Array(f5()),p5=(n,e,t,r)=>{const a=d5,i=r+t;n^=-1;for(let c=r;c>>8^a[(n^e[c])&255];return n^-1};var Tr=p5,Kl={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},cf={Z_NO_FLUSH:0,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_DEFLATED:8};const g5=(n,e)=>Object.prototype.hasOwnProperty.call(n,e);var m5=function(n){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const t=e.shift();if(t){if(typeof t!="object")throw new TypeError(t+"must be non-object");for(const r in t)g5(t,r)&&(n[r]=t[r])}}return n},v5=n=>{let e=0;for(let r=0,a=n.length;r=252?6:n>=248?5:n>=240?4:n>=224?3:n>=192?2:1;vs[254]=vs[254]=1;var b5=n=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(n);let e,t,r,a,i,c=n.length,o=0;for(a=0;a>>6,e[i++]=128|t&63):t<65536?(e[i++]=224|t>>>12,e[i++]=128|t>>>6&63,e[i++]=128|t&63):(e[i++]=240|t>>>18,e[i++]=128|t>>>12&63,e[i++]=128|t>>>6&63,e[i++]=128|t&63);return e};const w5=(n,e)=>{if(e<65534&&n.subarray&&hf)return String.fromCharCode.apply(null,n.length===e?n:n.subarray(0,e));let t="";for(let r=0;r{const t=e||n.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(n.subarray(0,e));let r,a;const i=new Array(t*2);for(a=0,r=0;r4){i[a++]=65533,r+=o-1;continue}for(c&=o===2?31:o===3?15:7;o>1&&r1){i[a++]=65533;continue}c<65536?i[a++]=c:(c-=65536,i[a++]=55296|c>>10&1023,i[a++]=56320|c&1023)}return w5(i,a)},_5=(n,e)=>{e=e||n.length,e>n.length&&(e=n.length);let t=e-1;for(;t>=0&&(n[t]&192)===128;)t--;return t<0||t===0?e:t+vs[n[t]]>e?t:e},Ql={string2buf:b5,buf2string:y5,utf8border:_5};function x5(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var k5=x5;const so=16209,A5=16191;var L5=function(e,t){let r,a,i,c,o,u,f,p,w,v,d,E,C,F,L,D,q,M,Q,ae,se,V,B,X;const _=e.state;r=e.next_in,B=e.input,a=r+(e.avail_in-5),i=e.next_out,X=e.output,c=i-(t-e.avail_out),o=i+(e.avail_out-257),u=_.dmax,f=_.wsize,p=_.whave,w=_.wnext,v=_.window,d=_.hold,E=_.bits,C=_.lencode,F=_.distcode,L=(1<<_.lenbits)-1,D=(1<<_.distbits)-1;e:do{E<15&&(d+=B[r++]<>>24,d>>>=M,E-=M,M=q>>>16&255,M===0)X[i++]=q&65535;else if(M&16){Q=q&65535,M&=15,M&&(E>>=M,E-=M),E<15&&(d+=B[r++]<>>24,d>>>=M,E-=M,M=q>>>16&255,M&16){if(ae=q&65535,M&=15,Eu){e.msg="invalid distance too far back",_.mode=so;break e}if(d>>>=M,E-=M,M=i-c,ae>M){if(M=ae-M,M>p&&_.sane){e.msg="invalid distance too far back",_.mode=so;break e}if(se=0,V=v,w===0){if(se+=f-M,M2;)X[i++]=V[se++],X[i++]=V[se++],X[i++]=V[se++],Q-=3;Q&&(X[i++]=V[se++],Q>1&&(X[i++]=V[se++]))}else{se=i-ae;do X[i++]=X[se++],X[i++]=X[se++],X[i++]=X[se++],Q-=3;while(Q>2);Q&&(X[i++]=X[se++],Q>1&&(X[i++]=X[se++]))}}else if((M&64)===0){q=F[(q&65535)+(d&(1<>3,r-=Q,E-=Q<<3,d&=(1<{const u=o.bits;let f=0,p=0,w=0,v=0,d=0,E=0,C=0,F=0,L=0,D=0,q,M,Q,ae,se,V=null,B;const X=new Uint16Array(Ca+1),_=new Uint16Array(Ca+1);let N=null,U,$,re;for(f=0;f<=Ca;f++)X[f]=0;for(p=0;p=1&&X[v]===0;v--);if(d>v&&(d=v),v===0)return a[i++]=1<<24|64<<16|0,a[i++]=1<<24|64<<16|0,o.bits=1,0;for(w=1;w0&&(n===Cu||v!==1))return-1;for(_[1]=0,f=1;fNu||n===Iu&&L>Pu)return 1;for(;;){U=f-C,c[p]+1=B?($=N[c[p]-B],re=V[c[p]-B]):($=96,re=0),q=1<>C)+M]=U<<24|$<<16|re|0;while(M!==0);for(q=1<>=1;if(q!==0?(D&=q-1,D+=q):D=0,p++,--X[f]===0){if(f===v)break;f=e[t+c[p]]}if(f>d&&(D&ae)!==Q){for(C===0&&(C=d),se+=w,E=f-C,F=1<Nu||n===Iu&&L>Pu)return 1;Q=D&ae,a[Q]=d<<24|E<<16|se-i|0}}return D!==0&&(a[se+D]=f-C<<24|64<<16|0),o.bits=d,0};var ms=I5;const E5=0,ff=1,df=2,{Z_FINISH:Eu,Z_BLOCK:F5,Z_TREES:oo,Z_OK:Qi,Z_STREAM_END:R5,Z_NEED_DICT:T5,Z_STREAM_ERROR:fr,Z_DATA_ERROR:pf,Z_MEM_ERROR:gf,Z_BUF_ERROR:O5,Z_DEFLATED:Fu}=cf,Do=16180,Ru=16181,Tu=16182,Ou=16183,ju=16184,Bu=16185,Du=16186,Mu=16187,qu=16188,Uu=16189,Io=16190,ti=16191,Nl=16192,zu=16193,Pl=16194,$u=16195,Hu=16196,Wu=16197,Vu=16198,lo=16199,co=16200,Gu=16201,Yu=16202,Ju=16203,Zu=16204,Xu=16205,Cl=16206,Ku=16207,Qu=16208,Vt=16209,mf=16210,vf=16211,j5=852,B5=592,D5=15,M5=D5,eh=n=>(n>>>24&255)+(n>>>8&65280)+((n&65280)<<8)+((n&255)<<24);function q5(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const ra=n=>{if(!n)return 1;const e=n.state;return!e||e.strm!==n||e.modevf?1:0},bf=n=>{if(ra(n))return fr;const e=n.state;return n.total_in=n.total_out=e.total=0,n.msg="",e.wrap&&(n.adler=e.wrap&1),e.mode=Do,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(j5),e.distcode=e.distdyn=new Int32Array(B5),e.sane=1,e.back=-1,Qi},wf=n=>{if(ra(n))return fr;const e=n.state;return e.wsize=0,e.whave=0,e.wnext=0,bf(n)},yf=(n,e)=>{let t;if(ra(n))return fr;const r=n.state;return e<0?(t=0,e=-e):(t=(e>>4)+5,e<48&&(e&=15)),e&&(e<8||e>15)?fr:(r.window!==null&&r.wbits!==e&&(r.window=null),r.wrap=t,r.wbits=e,wf(n))},_f=(n,e)=>{if(!n)return fr;const t=new q5;n.state=t,t.strm=n,t.window=null,t.mode=Do;const r=yf(n,e);return r!==Qi&&(n.state=null),r},U5=n=>_f(n,M5);let th=!0,Il,El;const z5=n=>{if(th){Il=new Int32Array(512),El=new Int32Array(32);let e=0;for(;e<144;)n.lens[e++]=8;for(;e<256;)n.lens[e++]=9;for(;e<280;)n.lens[e++]=7;for(;e<288;)n.lens[e++]=8;for(ms(ff,n.lens,0,288,Il,0,n.work,{bits:9}),e=0;e<32;)n.lens[e++]=5;ms(df,n.lens,0,32,El,0,n.work,{bits:5}),th=!1}n.lencode=Il,n.lenbits=9,n.distcode=El,n.distbits=5},xf=(n,e,t,r)=>{let a;const i=n.state;return i.window===null&&(i.wsize=1<=i.wsize?(i.window.set(e.subarray(t-i.wsize,t),0),i.wnext=0,i.whave=i.wsize):(a=i.wsize-i.wnext,a>r&&(a=r),i.window.set(e.subarray(t-r,t-r+a),i.wnext),r-=a,r?(i.window.set(e.subarray(t-r,t),0),i.wnext=r,i.whave=i.wsize):(i.wnext+=a,i.wnext===i.wsize&&(i.wnext=0),i.whave{let t,r,a,i,c,o,u,f,p,w,v,d,E,C,F=0,L,D,q,M,Q,ae,se,V;const B=new Uint8Array(4);let X,_;const N=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(ra(n)||!n.output||!n.input&&n.avail_in!==0)return fr;t=n.state,t.mode===ti&&(t.mode=Nl),c=n.next_out,a=n.output,u=n.avail_out,i=n.next_in,r=n.input,o=n.avail_in,f=t.hold,p=t.bits,w=o,v=u,V=Qi;e:for(;;)switch(t.mode){case Do:if(t.wrap===0){t.mode=Nl;break}for(;p<16;){if(o===0)break e;o--,f+=r[i++]<>>8&255,t.check=Tr(t.check,B,2,0),f=0,p=0,t.mode=Ru;break}if(t.head&&(t.head.done=!1),!(t.wrap&1)||(((f&255)<<8)+(f>>8))%31){n.msg="incorrect header check",t.mode=Vt;break}if((f&15)!==Fu){n.msg="unknown compression method",t.mode=Vt;break}if(f>>>=4,p-=4,se=(f&15)+8,t.wbits===0&&(t.wbits=se),se>15||se>t.wbits){n.msg="invalid window size",t.mode=Vt;break}t.dmax=1<>8&1),t.flags&512&&t.wrap&4&&(B[0]=f&255,B[1]=f>>>8&255,t.check=Tr(t.check,B,2,0)),f=0,p=0,t.mode=Tu;case Tu:for(;p<32;){if(o===0)break e;o--,f+=r[i++]<>>8&255,B[2]=f>>>16&255,B[3]=f>>>24&255,t.check=Tr(t.check,B,4,0)),f=0,p=0,t.mode=Ou;case Ou:for(;p<16;){if(o===0)break e;o--,f+=r[i++]<>8),t.flags&512&&t.wrap&4&&(B[0]=f&255,B[1]=f>>>8&255,t.check=Tr(t.check,B,2,0)),f=0,p=0,t.mode=ju;case ju:if(t.flags&1024){for(;p<16;){if(o===0)break e;o--,f+=r[i++]<>>8&255,t.check=Tr(t.check,B,2,0)),f=0,p=0}else t.head&&(t.head.extra=null);t.mode=Bu;case Bu:if(t.flags&1024&&(d=t.length,d>o&&(d=o),d&&(t.head&&(se=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Uint8Array(t.head.extra_len)),t.head.extra.set(r.subarray(i,i+d),se)),t.flags&512&&t.wrap&4&&(t.check=Tr(t.check,r,d,i)),o-=d,i+=d,t.length-=d),t.length))break e;t.length=0,t.mode=Du;case Du:if(t.flags&2048){if(o===0)break e;d=0;do se=r[i+d++],t.head&&se&&t.length<65536&&(t.head.name+=String.fromCharCode(se));while(se&&d>9&1,t.head.done=!0),n.adler=t.check=0,t.mode=ti;break;case Uu:for(;p<32;){if(o===0)break e;o--,f+=r[i++]<>>=p&7,p-=p&7,t.mode=Cl;break}for(;p<3;){if(o===0)break e;o--,f+=r[i++]<>>=1,p-=1,f&3){case 0:t.mode=zu;break;case 1:if(z5(t),t.mode=lo,e===oo){f>>>=2,p-=2;break e}break;case 2:t.mode=Hu;break;case 3:n.msg="invalid block type",t.mode=Vt}f>>>=2,p-=2;break;case zu:for(f>>>=p&7,p-=p&7;p<32;){if(o===0)break e;o--,f+=r[i++]<>>16^65535)){n.msg="invalid stored block lengths",t.mode=Vt;break}if(t.length=f&65535,f=0,p=0,t.mode=Pl,e===oo)break e;case Pl:t.mode=$u;case $u:if(d=t.length,d){if(d>o&&(d=o),d>u&&(d=u),d===0)break e;a.set(r.subarray(i,i+d),c),o-=d,i+=d,u-=d,c+=d,t.length-=d;break}t.mode=ti;break;case Hu:for(;p<14;){if(o===0)break e;o--,f+=r[i++]<>>=5,p-=5,t.ndist=(f&31)+1,f>>>=5,p-=5,t.ncode=(f&15)+4,f>>>=4,p-=4,t.nlen>286||t.ndist>30){n.msg="too many length or distance symbols",t.mode=Vt;break}t.have=0,t.mode=Wu;case Wu:for(;t.have>>=3,p-=3}for(;t.have<19;)t.lens[N[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,X={bits:t.lenbits},V=ms(E5,t.lens,0,19,t.lencode,0,t.work,X),t.lenbits=X.bits,V){n.msg="invalid code lengths set",t.mode=Vt;break}t.have=0,t.mode=Vu;case Vu:for(;t.have>>24,D=F>>>16&255,q=F&65535,!(L<=p);){if(o===0)break e;o--,f+=r[i++]<>>=L,p-=L,t.lens[t.have++]=q;else{if(q===16){for(_=L+2;p<_;){if(o===0)break e;o--,f+=r[i++]<>>=L,p-=L,t.have===0){n.msg="invalid bit length repeat",t.mode=Vt;break}se=t.lens[t.have-1],d=3+(f&3),f>>>=2,p-=2}else if(q===17){for(_=L+3;p<_;){if(o===0)break e;o--,f+=r[i++]<>>=L,p-=L,se=0,d=3+(f&7),f>>>=3,p-=3}else{for(_=L+7;p<_;){if(o===0)break e;o--,f+=r[i++]<>>=L,p-=L,se=0,d=11+(f&127),f>>>=7,p-=7}if(t.have+d>t.nlen+t.ndist){n.msg="invalid bit length repeat",t.mode=Vt;break}for(;d--;)t.lens[t.have++]=se}}if(t.mode===Vt)break;if(t.lens[256]===0){n.msg="invalid code -- missing end-of-block",t.mode=Vt;break}if(t.lenbits=9,X={bits:t.lenbits},V=ms(ff,t.lens,0,t.nlen,t.lencode,0,t.work,X),t.lenbits=X.bits,V){n.msg="invalid literal/lengths set",t.mode=Vt;break}if(t.distbits=6,t.distcode=t.distdyn,X={bits:t.distbits},V=ms(df,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,X),t.distbits=X.bits,V){n.msg="invalid distances set",t.mode=Vt;break}if(t.mode=lo,e===oo)break e;case lo:t.mode=co;case co:if(o>=6&&u>=258){n.next_out=c,n.avail_out=u,n.next_in=i,n.avail_in=o,t.hold=f,t.bits=p,L5(n,v),c=n.next_out,a=n.output,u=n.avail_out,i=n.next_in,r=n.input,o=n.avail_in,f=t.hold,p=t.bits,t.mode===ti&&(t.back=-1);break}for(t.back=0;F=t.lencode[f&(1<>>24,D=F>>>16&255,q=F&65535,!(L<=p);){if(o===0)break e;o--,f+=r[i++]<>M)],L=F>>>24,D=F>>>16&255,q=F&65535,!(M+L<=p);){if(o===0)break e;o--,f+=r[i++]<>>=M,p-=M,t.back+=M}if(f>>>=L,p-=L,t.back+=L,t.length=q,D===0){t.mode=Xu;break}if(D&32){t.back=-1,t.mode=ti;break}if(D&64){n.msg="invalid literal/length code",t.mode=Vt;break}t.extra=D&15,t.mode=Gu;case Gu:if(t.extra){for(_=t.extra;p<_;){if(o===0)break e;o--,f+=r[i++]<>>=t.extra,p-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=Yu;case Yu:for(;F=t.distcode[f&(1<>>24,D=F>>>16&255,q=F&65535,!(L<=p);){if(o===0)break e;o--,f+=r[i++]<>M)],L=F>>>24,D=F>>>16&255,q=F&65535,!(M+L<=p);){if(o===0)break e;o--,f+=r[i++]<>>=M,p-=M,t.back+=M}if(f>>>=L,p-=L,t.back+=L,D&64){n.msg="invalid distance code",t.mode=Vt;break}t.offset=q,t.extra=D&15,t.mode=Ju;case Ju:if(t.extra){for(_=t.extra;p<_;){if(o===0)break e;o--,f+=r[i++]<>>=t.extra,p-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){n.msg="invalid distance too far back",t.mode=Vt;break}t.mode=Zu;case Zu:if(u===0)break e;if(d=v-u,t.offset>d){if(d=t.offset-d,d>t.whave&&t.sane){n.msg="invalid distance too far back",t.mode=Vt;break}d>t.wnext?(d-=t.wnext,E=t.wsize-d):E=t.wnext-d,d>t.length&&(d=t.length),C=t.window}else C=a,E=c-t.offset,d=t.length;d>u&&(d=u),u-=d,t.length-=d;do a[c++]=C[E++];while(--d);t.length===0&&(t.mode=co);break;case Xu:if(u===0)break e;a[c++]=t.length,u--,t.mode=co;break;case Cl:if(t.wrap){for(;p<32;){if(o===0)break e;o--,f|=r[i++]<{if(ra(n))return fr;let e=n.state;return e.window&&(e.window=null),n.state=null,Qi},W5=(n,e)=>{if(ra(n))return fr;const t=n.state;return(t.wrap&2)===0?fr:(t.head=e,e.done=!1,Qi)},V5=(n,e)=>{const t=e.length;let r,a,i;return ra(n)||(r=n.state,r.wrap!==0&&r.mode!==Io)?fr:r.mode===Io&&(a=1,a=Xl(a,e,t,0),a!==r.check)?pf:(i=xf(n,e,t,t),i?(r.mode=mf,gf):(r.havedict=1,Qi))};var G5=wf,Y5=yf,J5=bf,Z5=U5,X5=_f,K5=$5,Q5=H5,e0=W5,t0=V5,n0="pako inflate (from Nodeca project)",ri={inflateReset:G5,inflateReset2:Y5,inflateResetKeep:J5,inflateInit:Z5,inflateInit2:X5,inflate:K5,inflateEnd:Q5,inflateGetHeader:e0,inflateSetDictionary:t0,inflateInfo:n0};function r0(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var i0=r0;const kf=Object.prototype.toString,{Z_NO_FLUSH:a0,Z_FINISH:s0,Z_OK:bs,Z_STREAM_END:Fl,Z_NEED_DICT:Rl,Z_STREAM_ERROR:o0,Z_DATA_ERROR:nh,Z_MEM_ERROR:l0}=cf;function xs(n){this.options=uf.assign({chunkSize:1024*64,windowBits:15,to:""},n||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(n&&n.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15)===0&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new k5,this.strm.avail_out=0;let t=ri.inflateInit2(this.strm,e.windowBits);if(t!==bs)throw new Error(Kl[t]);if(this.header=new i0,ri.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=Ql.string2buf(e.dictionary):kf.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(t=ri.inflateSetDictionary(this.strm,e.dictionary),t!==bs)))throw new Error(Kl[t])}xs.prototype.push=function(n,e){const t=this.strm,r=this.options.chunkSize,a=this.options.dictionary;let i,c,o;if(this.ended)return!1;for(e===~~e?c=e:c=e===!0?s0:a0,kf.call(n)==="[object ArrayBuffer]"?t.input=new Uint8Array(n):t.input=n,t.next_in=0,t.avail_in=t.input.length;;){for(t.avail_out===0&&(t.output=new Uint8Array(r),t.next_out=0,t.avail_out=r),i=ri.inflate(t,c),i===Rl&&a&&(i=ri.inflateSetDictionary(t,a),i===bs?i=ri.inflate(t,c):i===nh&&(i=Rl));t.avail_in>0&&i===Fl&&t.state.wrap>0&&n[t.next_in]!==0;)ri.inflateReset(t),i=ri.inflate(t,c);switch(i){case o0:case nh:case Rl:case l0:return this.onEnd(i),this.ended=!0,!1}if(o=t.avail_out,t.next_out&&(t.avail_out===0||i===Fl))if(this.options.to==="string"){let u=Ql.utf8border(t.output,t.next_out),f=t.next_out-u,p=Ql.buf2string(t.output,u);t.next_out=f,t.avail_out=r-f,f&&t.output.set(t.output.subarray(u,u+f),0),this.onData(p)}else this.onData(t.output.length===t.next_out?t.output:t.output.subarray(0,t.next_out));if(!(i===bs&&o===0)){if(i===Fl)return i=ri.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,!0;if(t.avail_in===0)break}}return!0};xs.prototype.onData=function(n){this.chunks.push(n)};xs.prototype.onEnd=function(n){n===bs&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=uf.flattenChunks(this.chunks)),this.chunks=[],this.err=n,this.msg=this.strm.msg};function c0(n,e){const t=new xs(e);if(t.push(n),t.err)throw t.msg||Kl[t.err];return t.result}var u0=xs,h0=c0,f0={Inflate:u0,inflate:h0};const{Inflate:d0,inflate:p0}=f0;var rh=d0,g0=p0;const Af=[];for(let n=0;n<256;n++){let e=n;for(let t=0;t<8;t++)e&1?e=3988292384^e>>>1:e=e>>>1;Af[n]=e}const ih=4294967295;function m0(n,e,t){let r=n;for(let a=0;a>>8;return r}function v0(n,e){return(m0(ih,n,e)^ih)>>>0}function ah(n,e,t){const r=n.readUint32(),a=v0(new Uint8Array(n.buffer,n.byteOffset+n.offset-e-4,e),e);if(a!==r)throw new Error(`CRC mismatch for chunk ${t}. Expected ${r}, found ${a}`)}function Lf(n,e,t){for(let r=0;r>1)&255}else{for(;i>1)&255;for(;i>1)&255}}function Cf(n,e,t,r,a){let i=0;if(t.length===0){for(;i=t||ae>=r))for(let se=0;se>8&255}const L0=new Uint16Array([255]),S0=new Uint8Array(L0.buffer),N0=S0[0]===255,P0=new Uint8Array(0);function sh(n){const{data:e,width:t,height:r,channels:a,depth:i}=n,c=Math.ceil(i/8)*a,o=Math.ceil(i/8*a*t),u=new Uint8Array(r*o);let f=P0,p=0,w,v;for(let d=0;d>8&255}const vo=Uint8Array.of(137,80,78,71,13,10,26,10);function oh(n){if(!I0(n.readBytes(vo.length)))throw new Error("wrong PNG signature")}function I0(n){if(n.length79)throw new Error("keyword length must be between 1 and 79")}const T0=/^[\u0000-\u00FF]*$/;function O0(n){if(!T0.test(n))throw new Error("invalid latin1 text")}function j0(n,e,t){const r=Ef(e);n[r]=B0(e,t-r.length-1)}function Ef(n){for(n.mark();n.readByte()!==F0;);const e=n.offset;n.reset();const t=If.decode(n.readBytes(e-n.offset-1));return n.skip(1),R0(t),t}function B0(n,e){return If.decode(n.readBytes(e))}const er={UNKNOWN:-1,GREYSCALE:0,TRUECOLOUR:2,INDEXED_COLOUR:3,GREYSCALE_ALPHA:4,TRUECOLOUR_ALPHA:6},Tl={UNKNOWN:-1,DEFLATE:0},lh={UNKNOWN:-1,ADAPTIVE:0},Ol={UNKNOWN:-1,NO_INTERLACE:0,ADAM7:1},uo={NONE:0,BACKGROUND:1,PREVIOUS:2},jl={SOURCE:0,OVER:1};class D0 extends _c{_checkCrc;_inflator;_png;_apng;_end;_hasPalette;_palette;_hasTransparency;_transparency;_compressionMethod;_filterMethod;_interlaceMethod;_colorType;_isAnimated;_numberOfFrames;_numberOfPlays;_frames;_writingDataChunks;constructor(e,t={}){super(e);const{checkCrc:r=!1}=t;this._checkCrc=r,this._inflator=new rh,this._png={width:-1,height:-1,channels:-1,data:new Uint8Array(0),depth:1,text:{}},this._apng={width:-1,height:-1,channels:-1,depth:1,numberOfFrames:1,numberOfPlays:0,text:{},frames:[]},this._end=!1,this._hasPalette=!1,this._palette=[],this._hasTransparency=!1,this._transparency=new Uint16Array(0),this._compressionMethod=Tl.UNKNOWN,this._filterMethod=lh.UNKNOWN,this._interlaceMethod=Ol.UNKNOWN,this._colorType=er.UNKNOWN,this._isAnimated=!1,this._numberOfFrames=1,this._numberOfPlays=0,this._frames=[],this._writingDataChunks=!1,this.setBigEndian()}decode(){for(oh(this);!this._end;){const e=this.readUint32(),t=this.readChars(4);this.decodeChunk(e,t)}return this.decodeImage(),this._png}decodeApng(){for(oh(this);!this._end;){const e=this.readUint32(),t=this.readChars(4);this.decodeApngChunk(e,t)}return this.decodeApngImage(),this._apng}decodeChunk(e,t){const r=this.offset;switch(t){case"IHDR":this.decodeIHDR();break;case"PLTE":this.decodePLTE(e);break;case"IDAT":this.decodeIDAT(e);break;case"IEND":this._end=!0;break;case"tRNS":this.decodetRNS(e);break;case"iCCP":this.decodeiCCP(e);break;case E0:j0(this._png.text,this,e);break;case"pHYs":this.decodepHYs();break;default:this.skip(e);break}if(this.offset-r!==e)throw new Error(`Length mismatch while decoding chunk ${t}`);this._checkCrc?ah(this,e+4,t):this.skip(4)}decodeApngChunk(e,t){const r=this.offset;switch(t!=="fdAT"&&t!=="IDAT"&&this._writingDataChunks&&this.pushDataToFrame(),t){case"acTL":this.decodeACTL();break;case"fcTL":this.decodeFCTL();break;case"fdAT":this.decodeFDAT(e);break;default:this.decodeChunk(e,t),this.offset=r+e;break}if(this.offset-r!==e)throw new Error(`Length mismatch while decoding chunk ${t}`);this._checkCrc?ah(this,e+4,t):this.skip(4)}decodeIHDR(){const e=this._png;e.width=this.readUint32(),e.height=this.readUint32(),e.depth=M0(this.readUint8());const t=this.readUint8();this._colorType=t;let r;switch(t){case er.GREYSCALE:r=1;break;case er.TRUECOLOUR:r=3;break;case er.INDEXED_COLOUR:r=1;break;case er.GREYSCALE_ALPHA:r=2;break;case er.TRUECOLOUR_ALPHA:r=4;break;case er.UNKNOWN:default:throw new Error(`Unknown color type: ${t}`)}if(this._png.channels=r,this._compressionMethod=this.readUint8(),this._compressionMethod!==Tl.DEFLATE)throw new Error(`Unsupported compression method: ${this._compressionMethod}`);this._filterMethod=this.readUint8(),this._interlaceMethod=this.readUint8()}decodeACTL(){this._numberOfFrames=this.readUint32(),this._numberOfPlays=this.readUint32(),this._isAnimated=!0}decodeFCTL(){const e={sequenceNumber:this.readUint32(),width:this.readUint32(),height:this.readUint32(),xOffset:this.readUint32(),yOffset:this.readUint32(),delayNumber:this.readUint16(),delayDenominator:this.readUint16(),disposeOp:this.readUint8(),blendOp:this.readUint8(),data:new Uint8Array(0)};this._frames.push(e)}decodePLTE(e){if(e%3!==0)throw new RangeError(`PLTE field length must be a multiple of 3. Got ${e}`);const t=e/3;this._hasPalette=!0;const r=[];this._palette=r;for(let a=0;athis._png.width*this._png.height)throw new Error(`tRNS chunk contains more alpha values than there are pixels (${e/2} vs ${this._png.width*this._png.height})`);this._hasTransparency=!0,this._transparency=new Uint16Array(e/2);for(let t=0;tthis._palette.length)throw new Error(`tRNS chunk contains more alpha values than there are palette colors (${e} vs ${this._palette.length})`);let t=0;for(;t{const o=((i+t.yOffset)*this._png.width+t.xOffset+c)*this._png.channels,u=(i*t.width+c)*this._png.channels;return{index:o,frameIndex:u}};switch(t.blendOp){case jl.SOURCE:for(let i=0;i=200&&e.status<=299}function ho(n){try{n.dispatchEvent(new MouseEvent("click"))}catch{var e=document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),n.dispatchEvent(e)}}var Gi=nt.saveAs||((typeof window>"u"?"undefined":jt(window))!=="object"||window!==nt?function(){}:typeof HTMLAnchorElement<"u"&&"download"in HTMLAnchorElement.prototype?function(n,e,t){var r=nt.URL||nt.webkitURL,a=document.createElement("a");e=e||n.name||"download",a.download=e,a.rel="noopener",typeof n=="string"?(a.href=n,a.origin!==location.origin?uh(a.href)?Dl(n,e,t):ho(a,a.target="_blank"):ho(a)):(a.href=r.createObjectURL(n),setTimeout(function(){r.revokeObjectURL(a.href)},4e4),setTimeout(function(){ho(a)},0))}:"msSaveOrOpenBlob"in navigator?function(n,e,t){if(e=e||n.name||"download",typeof n=="string")if(uh(n))Dl(n,e,t);else{var r=document.createElement("a");r.href=n,r.target="_blank",setTimeout(function(){ho(r)})}else navigator.msSaveOrOpenBlob((function(a,i){return i===void 0?i={autoBom:!1}:jt(i)!=="object"&&(Ot.warn("Deprecated: Expected third argument to be a object"),i={autoBom:!i}),i.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(a.type)?new Blob(["\uFEFF",a],{type:a.type}):a})(n,t),e)}:function(n,e,t,r){if((r=r||open("","_blank"))&&(r.document.title=r.document.body.innerText="downloading..."),typeof n=="string")return Dl(n,e,t);var a=n.type==="application/octet-stream",i=/constructor/i.test(nt.HTMLElement)||nt.safari,c=/CriOS\/[\d]+/.test(navigator.userAgent);if((c||a&&i)&&(typeof FileReader>"u"?"undefined":jt(FileReader))==="object"){var o=new FileReader;o.onloadend=function(){var p=o.result;p=c?p:p.replace(/^data:[^;]*;/,"data:attachment/file;"),r?r.location.href=p:location=p,r=null},o.readAsDataURL(n)}else{var u=nt.URL||nt.webkitURL,f=u.createObjectURL(n);r?r.location=f:location.href=f,r=null,setTimeout(function(){u.revokeObjectURL(f)},4e4)}});/** * A class to parse color values * @author Stoyan Stefanov * {@link http://www.phpied.com/rgb-color-parser-in-javascript/} * @license Use it if you like it */function Ff(n){var e;n=n||"",this.ok=!1,n.charAt(0)=="#"&&(n=n.substr(1,6)),n={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"}[n=(n=n.replace(/ /g,"")).toLowerCase()]||n;for(var t=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(o){return[parseInt(o[1]),parseInt(o[2]),parseInt(o[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function(o){return[parseInt(o[1],16),parseInt(o[2],16),parseInt(o[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(o){return[parseInt(o[1]+o[1],16),parseInt(o[2]+o[2],16),parseInt(o[3]+o[3],16)]}}],r=0;r255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toHex=function(){var o=this.r.toString(16),u=this.g.toString(16),f=this.b.toString(16);return o.length==1&&(o="0"+o),u.length==1&&(u="0"+u),f.length==1&&(f="0"+f),"#"+o+u+f}}var bo=nt.atob.bind(nt),hh=nt.btoa.bind(nt);/** * @license * Joseph Myers does not specify a particular license for his work. * * Author: Joseph Myers * Accessed from: http://www.myersdaily.org/joseph/javascript/md5.js * * Modified by: Owen Leong */function Ml(n,e){var t=n[0],r=n[1],a=n[2],i=n[3];t=En(t,r,a,i,e[0],7,-680876936),i=En(i,t,r,a,e[1],12,-389564586),a=En(a,i,t,r,e[2],17,606105819),r=En(r,a,i,t,e[3],22,-1044525330),t=En(t,r,a,i,e[4],7,-176418897),i=En(i,t,r,a,e[5],12,1200080426),a=En(a,i,t,r,e[6],17,-1473231341),r=En(r,a,i,t,e[7],22,-45705983),t=En(t,r,a,i,e[8],7,1770035416),i=En(i,t,r,a,e[9],12,-1958414417),a=En(a,i,t,r,e[10],17,-42063),r=En(r,a,i,t,e[11],22,-1990404162),t=En(t,r,a,i,e[12],7,1804603682),i=En(i,t,r,a,e[13],12,-40341101),a=En(a,i,t,r,e[14],17,-1502002290),t=Fn(t,r=En(r,a,i,t,e[15],22,1236535329),a,i,e[1],5,-165796510),i=Fn(i,t,r,a,e[6],9,-1069501632),a=Fn(a,i,t,r,e[11],14,643717713),r=Fn(r,a,i,t,e[0],20,-373897302),t=Fn(t,r,a,i,e[5],5,-701558691),i=Fn(i,t,r,a,e[10],9,38016083),a=Fn(a,i,t,r,e[15],14,-660478335),r=Fn(r,a,i,t,e[4],20,-405537848),t=Fn(t,r,a,i,e[9],5,568446438),i=Fn(i,t,r,a,e[14],9,-1019803690),a=Fn(a,i,t,r,e[3],14,-187363961),r=Fn(r,a,i,t,e[8],20,1163531501),t=Fn(t,r,a,i,e[13],5,-1444681467),i=Fn(i,t,r,a,e[2],9,-51403784),a=Fn(a,i,t,r,e[7],14,1735328473),t=Rn(t,r=Fn(r,a,i,t,e[12],20,-1926607734),a,i,e[5],4,-378558),i=Rn(i,t,r,a,e[8],11,-2022574463),a=Rn(a,i,t,r,e[11],16,1839030562),r=Rn(r,a,i,t,e[14],23,-35309556),t=Rn(t,r,a,i,e[1],4,-1530992060),i=Rn(i,t,r,a,e[4],11,1272893353),a=Rn(a,i,t,r,e[7],16,-155497632),r=Rn(r,a,i,t,e[10],23,-1094730640),t=Rn(t,r,a,i,e[13],4,681279174),i=Rn(i,t,r,a,e[0],11,-358537222),a=Rn(a,i,t,r,e[3],16,-722521979),r=Rn(r,a,i,t,e[6],23,76029189),t=Rn(t,r,a,i,e[9],4,-640364487),i=Rn(i,t,r,a,e[12],11,-421815835),a=Rn(a,i,t,r,e[15],16,530742520),t=Tn(t,r=Rn(r,a,i,t,e[2],23,-995338651),a,i,e[0],6,-198630844),i=Tn(i,t,r,a,e[7],10,1126891415),a=Tn(a,i,t,r,e[14],15,-1416354905),r=Tn(r,a,i,t,e[5],21,-57434055),t=Tn(t,r,a,i,e[12],6,1700485571),i=Tn(i,t,r,a,e[3],10,-1894986606),a=Tn(a,i,t,r,e[10],15,-1051523),r=Tn(r,a,i,t,e[1],21,-2054922799),t=Tn(t,r,a,i,e[8],6,1873313359),i=Tn(i,t,r,a,e[15],10,-30611744),a=Tn(a,i,t,r,e[6],15,-1560198380),r=Tn(r,a,i,t,e[13],21,1309151649),t=Tn(t,r,a,i,e[4],6,-145523070),i=Tn(i,t,r,a,e[11],10,-1120210379),a=Tn(a,i,t,r,e[2],15,718787259),r=Tn(r,a,i,t,e[9],21,-343485551),n[0]=Ai(t,n[0]),n[1]=Ai(r,n[1]),n[2]=Ai(a,n[2]),n[3]=Ai(i,n[3])}function Mo(n,e,t,r,a,i){return e=Ai(Ai(e,n),Ai(r,i)),Ai(e<>>32-a,t)}function En(n,e,t,r,a,i,c){return Mo(e&t|~e&r,n,e,a,i,c)}function Fn(n,e,t,r,a,i,c){return Mo(e&r|t&~r,n,e,a,i,c)}function Rn(n,e,t,r,a,i,c){return Mo(e^t^r,n,e,a,i,c)}function Tn(n,e,t,r,a,i,c){return Mo(t^(e|~r),n,e,a,i,c)}function Rf(n){var e,t=n.length,r=[1732584193,-271733879,-1732584194,271733878];for(e=64;e<=n.length;e+=64)Ml(r,U0(n.substring(e-64,e)));n=n.substring(e-64);var a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(e=0;e>2]|=n.charCodeAt(e)<<(e%4<<3);if(a[e>>2]|=128<<(e%4<<3),e>55)for(Ml(r,a),e=0;e<16;e++)a[e]=0;return a[14]=8*t,Ml(r,a),r}function U0(n){var e,t=[];for(e=0;e<64;e+=4)t[e>>2]=n.charCodeAt(e)+(n.charCodeAt(e+1)<<8)+(n.charCodeAt(e+2)<<16)+(n.charCodeAt(e+3)<<24);return t}var fh="0123456789abcdef".split("");function z0(n){for(var e="",t=0;t<4;t++)e+=fh[n>>8*t+4&15]+fh[n>>8*t&15];return e}function $0(n){return String.fromCharCode(255&n,(65280&n)>>8,(16711680&n)>>16,(4278190080&n)>>24)}function ec(n){return Rf(n).map($0).join("")}var H0=(function(n){for(var e=0;e>16)+(e>>16)+(t>>16)<<16|65535&t}return n+e&4294967295}/** * @license * FPDF is released under a permissive license: there is no usage restriction. * You may embed it freely in your application (commercial or not), with or * without modifications. * * Reference: http://www.fpdf.org/en/script/script37.php */function tc(n,e){var t,r,a,i;if(n!==t){for(var c=(a=n,i=1+(256/n.length|0),new Array(i+1).join(a)),o=[],u=0;u<256;u++)o[u]=u;var f=0;for(u=0;u<256;u++){var p=o[u];f=(f+p+c.charCodeAt(u))%256,o[u]=o[f],o[f]=p}t=n,r=o}else o=r;var w=e.length,v=0,d=0,E="";for(u=0;u€/\f©þdSiz";var i=(e+this.padding).substr(0,32),c=(t+this.padding).substr(0,32);this.O=this.processOwnerPassword(i,c),this.P=-(1+(255^a)),this.encryptionKey=ec(i+this.O+this.lsbFirstWord(this.P)+this.hexToBytes(r)).substr(0,5),this.U=tc(this.encryptionKey,this.padding)}function Ra(n){if(/[^\u0000-\u00ff]/.test(n))throw new Error("Invalid PDF Name Object: "+n+", Only accept ASCII characters.");for(var e="",t=n.length,r=0;r126?"#"+("0"+a.toString(16)).slice(-2):n[r]}return e}function ph(n){if(jt(n)!=="object")throw new Error("Invalid Context passed to initialize PubSub (jsPDF-module)");var e={};this.subscribe=function(t,r,a){if(a=a||!1,typeof t!="string"||typeof r!="function"||typeof a!="boolean")throw new Error("Invalid arguments passed to PubSub.subscribe (jsPDF-module)");e.hasOwnProperty(t)||(e[t]={});var i=Math.random().toString(35);return e[t][i]=[r,!!a],i},this.unsubscribe=function(t){for(var r in e)if(e[r][t])return delete e[r][t],Object.keys(e[r]).length===0&&delete e[r],!0;return!1},this.publish=function(t){if(e.hasOwnProperty(t)){var r=Array.prototype.slice.call(arguments,1),a=[];for(var i in e[t]){var c=e[t][i];try{c[0].apply(n,r)}catch(o){nt.console&&Ot.error("jsPDF PubSub Error",o.message,o)}c[1]&&a.push(i)}a.length&&a.forEach(this.unsubscribe)}},this.getTopics=function(){return e}}function Eo(n){if(!(this instanceof Eo))return new Eo(n);var e="opacity,stroke-opacity".split(",");for(var t in n)n.hasOwnProperty(t)&&e.indexOf(t)>=0&&(this[t]=n[t]);this.id="",this.objectNumber=-1}function Tf(n,e){this.gState=n,this.matrix=e,this.id="",this.objectNumber=-1}function Yi(n,e,t,r,a){if(!(this instanceof Yi))return new Yi(n,e,t,r,a);this.type=n==="axial"?2:3,this.coords=e,this.colors=t,Tf.call(this,r,a)}function Ta(n,e,t,r,a){if(!(this instanceof Ta))return new Ta(n,e,t,r,a);this.boundingBox=n,this.xStep=e,this.yStep=t,this.stream="",this.cloneIndex=0,Tf.call(this,r,a)}function We(n){var e,t=typeof arguments[0]=="string"?arguments[0]:"p",r=arguments[1],a=arguments[2],i=arguments[3],c=[],o=1,u=16,f="S",p=null;jt(n=n||{})==="object"&&(t=n.orientation,r=n.unit||r,a=n.format||a,i=n.compress||n.compressPdf||i,(p=n.encryption||null)!==null&&(p.userPassword=p.userPassword||"",p.ownerPassword=p.ownerPassword||"",p.userPermissions=p.userPermissions||[]),o=typeof n.userUnit=="number"?Math.abs(n.userUnit):1,n.precision!==void 0&&(e=n.precision),n.floatPrecision!==void 0&&(u=n.floatPrecision),f=n.defaultPathOperation||"S"),c=n.filters||(i===!0?["FlateEncode"]:c),r=r||"mm",t=(""+(t||"P")).toLowerCase();var w=n.putOnlyUsedFonts||!1,v={},d={internal:{},__private__:{}};d.__private__.PubSub=ph;var E="1.3",C=d.__private__.getPdfVersion=function(){return E};d.__private__.setPdfVersion=function(h){E=h};var F={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};d.__private__.getPageFormats=function(){return F};var L=d.__private__.getPageFormat=function(h){return F[h]};a=a||"a4";var D="compat",q="advanced",M=D;function Q(){this.saveGraphicsState(),P(new Qe(ht,0,0,-ht,0,Ti()*ht).toString()+" cm"),this.setFontSize(this.getFontSize()/ht),f="n",M=q}function ae(){this.restoreGraphicsState(),f="S",M=D}var se=d.__private__.combineFontStyleAndFontWeight=function(h,b){if(h=="bold"&&b=="normal"||h=="bold"&&b==400||h=="normal"&&b=="italic"||h=="bold"&&b=="italic")throw new Error("Invalid Combination of fontweight and fontstyle");return b&&(h=b==400||b==="normal"?h==="italic"?"italic":"normal":b!=700&&b!=="bold"||h!=="normal"?(b==700?"bold":b)+""+h:"bold"),h};d.advancedAPI=function(h){var b=M===D;return b&&Q.call(this),typeof h!="function"||(h(this),b&&ae.call(this)),this},d.compatAPI=function(h){var b=M===q;return b&&ae.call(this),typeof h!="function"||(h(this),b&&Q.call(this)),this},d.isAdvancedAPI=function(){return M===q};var V,B=function(h){if(M!==q)throw new Error(h+" is only available in 'advanced' API mode. You need to call advancedAPI() first.")},X=d.roundToPrecision=d.__private__.roundToPrecision=function(h,b){var R=e||b;if(isNaN(h)||isNaN(R))throw new Error("Invalid argument passed to jsPDF.roundToPrecision");return h.toFixed(R).replace(/0+$/,"")};V=d.hpf=d.__private__.hpf=typeof u=="number"?function(h){if(isNaN(h))throw new Error("Invalid argument passed to jsPDF.hpf");return X(h,u)}:u==="smart"?function(h){if(isNaN(h))throw new Error("Invalid argument passed to jsPDF.hpf");return X(h,h>-1&&h<1?16:5)}:function(h){if(isNaN(h))throw new Error("Invalid argument passed to jsPDF.hpf");return X(h,16)};var _=d.f2=d.__private__.f2=function(h){if(isNaN(h))throw new Error("Invalid argument passed to jsPDF.f2");return X(h,2)},N=d.__private__.f3=function(h){if(isNaN(h))throw new Error("Invalid argument passed to jsPDF.f3");return X(h,3)},U=d.scale=d.__private__.scale=function(h){if(isNaN(h))throw new Error("Invalid argument passed to jsPDF.scale");return M===D?h*ht:M===q?h:void 0},$=function(h){return U((function(b){return M===D?Ti()-b:M===q?b:void 0})(h))};d.__private__.setPrecision=d.setPrecision=function(h){typeof parseInt(h,10)=="number"&&(e=parseInt(h,10))};var re,oe="00000000000000000000000000000000",he=d.__private__.getFileId=function(){return oe},ee=d.__private__.setFileId=function(h){return oe=h!==void 0&&/^[a-fA-F0-9]{32}$/.test(h)?h.toUpperCase():oe.split("").map(function(){return"ABCDEF0123456789".charAt(Math.floor(16*Math.random()))}).join(""),p!==null&&(_n=new Fa(p.userPermissions,p.userPassword,p.ownerPassword,oe)),oe};d.setFileId=function(h){return ee(h),this},d.getFileId=function(){return he()};var ue=d.__private__.convertDateToPDFDate=function(h){var b=h.getTimezoneOffset(),R=b<0?"+":"-",H=Math.floor(Math.abs(b/60)),Z=Math.abs(b%60),fe=[R,z(H),"'",z(Z),"'"].join("");return["D:",h.getFullYear(),z(h.getMonth()+1),z(h.getDate()),z(h.getHours()),z(h.getMinutes()),z(h.getSeconds()),fe].join("")},me=d.__private__.convertPDFDateToDate=function(h){var b=parseInt(h.substr(2,4),10),R=parseInt(h.substr(6,2),10)-1,H=parseInt(h.substr(8,2),10),Z=parseInt(h.substr(10,2),10),fe=parseInt(h.substr(12,2),10),_e=parseInt(h.substr(14,2),10);return new Date(b,R,H,Z,fe,_e,0)},be=d.__private__.setCreationDate=function(h){var b;if(h===void 0&&(h=new Date),h instanceof Date)b=ue(h);else{if(!/^D:(20[0-2][0-9]|203[0-7]|19[7-9][0-9])(0[0-9]|1[0-2])([0-2][0-9]|3[0-1])(0[0-9]|1[0-9]|2[0-3])(0[0-9]|[1-5][0-9])(0[0-9]|[1-5][0-9])(\+0[0-9]|\+1[0-4]|-0[0-9]|-1[0-1])'(0[0-9]|[1-5][0-9])'?$/.test(h))throw new Error("Invalid argument passed to jsPDF.setCreationDate");b=h}return re=b},A=d.__private__.getCreationDate=function(h){var b=re;return h==="jsDate"&&(b=me(re)),b};d.setCreationDate=function(h){return be(h),this},d.getCreationDate=function(h){return A(h)};var j,z=d.__private__.padd2=function(h){return("0"+parseInt(h)).slice(-2)},W=d.__private__.padd2Hex=function(h){return("00"+(h=h.toString())).substr(h.length)},Y=0,te=[],ce=[],le=0,ve=[],Se=[],Ee=!1,Ie=ce;d.__private__.setCustomOutputDestination=function(h){Ee=!0,Ie=h};var ke=function(h){Ee||(Ie=h)};d.__private__.resetCustomOutputDestination=function(){Ee=!1,Ie=ce};var P=d.__private__.out=function(h){return h=h.toString(),le+=h.length+1,Ie.push(h),Ie},Ne=d.__private__.write=function(h){return P(arguments.length===1?h.toString():Array.prototype.join.call(arguments," "))},ze=d.__private__.getArrayBuffer=function(h){for(var b=h.length,R=new ArrayBuffer(b),H=new Uint8Array(R);b--;)H[b]=h.charCodeAt(b);return R},Te=[["Helvetica","helvetica","normal","WinAnsiEncoding"],["Helvetica-Bold","helvetica","bold","WinAnsiEncoding"],["Helvetica-Oblique","helvetica","italic","WinAnsiEncoding"],["Helvetica-BoldOblique","helvetica","bolditalic","WinAnsiEncoding"],["Courier","courier","normal","WinAnsiEncoding"],["Courier-Bold","courier","bold","WinAnsiEncoding"],["Courier-Oblique","courier","italic","WinAnsiEncoding"],["Courier-BoldOblique","courier","bolditalic","WinAnsiEncoding"],["Times-Roman","times","normal","WinAnsiEncoding"],["Times-Bold","times","bold","WinAnsiEncoding"],["Times-Italic","times","italic","WinAnsiEncoding"],["Times-BoldItalic","times","bolditalic","WinAnsiEncoding"],["ZapfDingbats","zapfdingbats","normal",null],["Symbol","symbol","normal",null]];d.__private__.getStandardFonts=function(){return Te};var ye=n.fontSize||16;d.__private__.setFontSize=d.setFontSize=function(h){return ye=M===q?h/ht:h,this};var Ge,Re=d.__private__.getFontSize=d.getFontSize=function(){return M===D?ye:ye*ht},$e=n.R2L||!1;d.__private__.setR2L=d.setR2L=function(h){return $e=h,this},d.__private__.getR2L=d.getR2L=function(){return $e};var Ye,St=d.__private__.setZoomMode=function(h){if(/^(?:\d+\.\d*|\d*\.\d+|\d+)%$/.test(h))Ge=h;else if(isNaN(h)){if([void 0,null,"fullwidth","fullheight","fullpage","original"].indexOf(h)===-1)throw new Error('zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. "'+h+'" is not recognized.');Ge=h}else Ge=parseInt(h,10)};d.__private__.getZoomMode=function(){return Ge};var vt,at=d.__private__.setPageMode=function(h){if([void 0,null,"UseNone","UseOutlines","UseThumbs","FullScreen"].indexOf(h)==-1)throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "'+h+'" is not recognized.');Ye=h};d.__private__.getPageMode=function(){return Ye};var bt=d.__private__.setLayoutMode=function(h){if([void 0,null,"continuous","single","twoleft","tworight","two"].indexOf(h)==-1)throw new Error('Layout mode must be one of continuous, single, twoleft, tworight. "'+h+'" is not recognized.');vt=h};d.__private__.getLayoutMode=function(){return vt},d.__private__.setDisplayMode=d.setDisplayMode=function(h,b,R){return St(h),bt(b),at(R),this};var ft={title:"",subject:"",author:"",keywords:"",creator:""};d.__private__.getDocumentProperty=function(h){if(Object.keys(ft).indexOf(h)===-1)throw new Error("Invalid argument passed to jsPDF.getDocumentProperty");return ft[h]},d.__private__.getDocumentProperties=function(){return ft},d.__private__.setDocumentProperties=d.setProperties=d.setDocumentProperties=function(h){for(var b in ft)ft.hasOwnProperty(b)&&h[b]&&(ft[b]=h[b]);return this},d.__private__.setDocumentProperty=function(h,b){if(Object.keys(ft).indexOf(h)===-1)throw new Error("Invalid arguments passed to jsPDF.setDocumentProperty");return ft[h]=b};var Ue,ht,Ve,Qt,At,gt={},mt={},Ht=[],Ze={},Bt={},et={},lt={},Wt=null,wt=0,Ke=[],Nt=new ph(d),Pi=n.hotfixes||[],Sn={},qr={},Ar=[],Qe=function h(b,R,H,Z,fe,_e){if(!(this instanceof h))return new h(b,R,H,Z,fe,_e);isNaN(b)&&(b=1),isNaN(R)&&(R=0),isNaN(H)&&(H=0),isNaN(Z)&&(Z=1),isNaN(fe)&&(fe=0),isNaN(_e)&&(_e=0),this._matrix=[b,R,H,Z,fe,_e]};Object.defineProperty(Qe.prototype,"sx",{get:function(){return this._matrix[0]},set:function(h){this._matrix[0]=h}}),Object.defineProperty(Qe.prototype,"shy",{get:function(){return this._matrix[1]},set:function(h){this._matrix[1]=h}}),Object.defineProperty(Qe.prototype,"shx",{get:function(){return this._matrix[2]},set:function(h){this._matrix[2]=h}}),Object.defineProperty(Qe.prototype,"sy",{get:function(){return this._matrix[3]},set:function(h){this._matrix[3]=h}}),Object.defineProperty(Qe.prototype,"tx",{get:function(){return this._matrix[4]},set:function(h){this._matrix[4]=h}}),Object.defineProperty(Qe.prototype,"ty",{get:function(){return this._matrix[5]},set:function(h){this._matrix[5]=h}}),Object.defineProperty(Qe.prototype,"a",{get:function(){return this._matrix[0]},set:function(h){this._matrix[0]=h}}),Object.defineProperty(Qe.prototype,"b",{get:function(){return this._matrix[1]},set:function(h){this._matrix[1]=h}}),Object.defineProperty(Qe.prototype,"c",{get:function(){return this._matrix[2]},set:function(h){this._matrix[2]=h}}),Object.defineProperty(Qe.prototype,"d",{get:function(){return this._matrix[3]},set:function(h){this._matrix[3]=h}}),Object.defineProperty(Qe.prototype,"e",{get:function(){return this._matrix[4]},set:function(h){this._matrix[4]=h}}),Object.defineProperty(Qe.prototype,"f",{get:function(){return this._matrix[5]},set:function(h){this._matrix[5]=h}}),Object.defineProperty(Qe.prototype,"rotation",{get:function(){return Math.atan2(this.shx,this.sx)}}),Object.defineProperty(Qe.prototype,"scaleX",{get:function(){return this.decompose().scale.sx}}),Object.defineProperty(Qe.prototype,"scaleY",{get:function(){return this.decompose().scale.sy}}),Object.defineProperty(Qe.prototype,"isIdentity",{get:function(){return this.sx===1&&this.shy===0&&this.shx===0&&this.sy===1&&this.tx===0&&this.ty===0}}),Qe.prototype.join=function(h){return[this.sx,this.shy,this.shx,this.sy,this.tx,this.ty].map(V).join(h)},Qe.prototype.multiply=function(h){var b=h.sx*this.sx+h.shy*this.shx,R=h.sx*this.shy+h.shy*this.sy,H=h.shx*this.sx+h.sy*this.shx,Z=h.shx*this.shy+h.sy*this.sy,fe=h.tx*this.sx+h.ty*this.shx+this.tx,_e=h.tx*this.shy+h.ty*this.sy+this.ty;return new Qe(b,R,H,Z,fe,_e)},Qe.prototype.decompose=function(){var h=this.sx,b=this.shy,R=this.shx,H=this.sy,Z=this.tx,fe=this.ty,_e=Math.sqrt(h*h+b*b),De=(h/=_e)*R+(b/=_e)*H;R-=h*De,H-=b*De;var Be=Math.sqrt(R*R+H*H);return De/=Be,h*(H/=Be)>16&255,H=Be>>8&255,Z=255&Be}if(H===void 0||fe===void 0&&R===H&&H===Z)b=typeof R=="string"?R+" "+_e[0]:h.precision===2?_(R/255)+" "+_e[0]:N(R/255)+" "+_e[0];else if(fe===void 0||jt(fe)==="object"){if(fe&&!isNaN(fe.a)&&fe.a===0)return["1.","1.","1.",_e[1]].join(" ");b=typeof R=="string"?[R,H,Z,_e[1]].join(" "):h.precision===2?[_(R/255),_(H/255),_(Z/255),_e[1]].join(" "):[N(R/255),N(H/255),N(Z/255),_e[1]].join(" ")}else b=typeof R=="string"?[R,H,Z,fe,_e[2]].join(" "):h.precision===2?[_(R),_(H),_(Z),_(fe),_e[2]].join(" "):[N(R),N(H),N(Z),N(fe),_e[2]].join(" ");return b},gr=d.__private__.getFilters=function(){return c},sr=d.__private__.putStream=function(h){var b=(h=h||{}).data||"",R=h.filters||gr(),H=h.alreadyAppliedFilters||[],Z=h.addLength1||!1,fe=b.length,_e=h.objectId,De=function(Ut){return Ut};if(p!==null&&_e===void 0)throw new Error("ObjectId must be passed to putStream for file encryption");p!==null&&(De=_n.encryptor(_e,0));var Be={};R===!0&&(R=["FlateEncode"]);var st=h.additionalKeyValues||[],ct=(Be=We.API.processDataByFilters!==void 0?We.API.processDataByFilters(b,R):{data:b,reverseChain:[]}).reverseChain+(Array.isArray(H)?H.join(" "):H.toString());if(Be.data.length!==0&&(st.push({key:"Length",value:Be.data.length}),Z===!0&&st.push({key:"Length1",value:fe})),ct.length!=0)if(ct.split("/").length-1==1)st.push({key:"Filter",value:ct});else{st.push({key:"Filter",value:"["+ct+"]"});for(var _t=0;_t>"),Be.data.length!==0&&(P("stream"),P(De(Be.data)),P("endstream"))},Ii=d.__private__.putPage=function(h){var b=h.number,R=h.data,H=h.objId,Z=h.contentsObjId;yn(H,!0),P("<>"),P("endobj");var fe=R.join(` `);return M===q&&(fe+=` Q`),yn(Z,!0),sr({data:fe,filters:gr(),objectId:Z}),P("endobj"),H},Sr=d.__private__.putPages=function(){var h,b,R=[];for(h=1;h<=wt;h++)Ke[h].objId=bn(),Ke[h].contentsObjId=bn();for(h=1;h<=wt;h++)R.push(Ii({number:h,data:Se[h],objId:Ke[h].objId,contentsObjId:Ke[h].contentsObjId,mediaBox:Ke[h].mediaBox,cropBox:Ke[h].cropBox,bleedBox:Ke[h].bleedBox,trimBox:Ke[h].trimBox,artBox:Ke[h].artBox,userUnit:Ke[h].userUnit,rootDictionaryObjId:oi,resourceDictionaryObjId:dr}));yn(oi,!0),P("<>"),P("endobj"),Nt.publish("postPutPages")},Ei=function(h){Nt.publish("putFont",{font:h,out:P,newObject:Jt,putStream:sr}),h.isAlreadyPutted!==!0&&(h.objectNumber=Jt(),P("<<"),P("/Type /Font"),P("/BaseFont /"+Ra(h.postScriptName)),P("/Subtype /Type1"),typeof h.encoding=="string"&&P("/Encoding /"+h.encoding),P("/FirstChar 32"),P("/LastChar 255"),P(">>"),P("endobj"))},aa=function(h){h.objectNumber=Jt();var b=[];b.push({key:"Type",value:"/XObject"}),b.push({key:"Subtype",value:"/Form"}),b.push({key:"BBox",value:"["+[V(h.x),V(h.y),V(h.x+h.width),V(h.y+h.height)].join(" ")+"]"}),b.push({key:"Matrix",value:"["+h.matrix.toString()+"]"});var R=h.pages[1].join(` `);sr({data:R,additionalKeyValues:b,objectId:h.objectNumber}),P("endobj")},sa=function(h,b){b||(b=21);var R=Jt(),H=(function(_e,De){var Be,st=[],ct=1/(De-1);for(Be=0;Be<1;Be+=ct)st.push(Be);if(st.push(1),_e[0].offset!=0){var _t={offset:0,color:_e[0].color};_e.unshift(_t)}if(_e[_e.length-1].offset!=1){var ln={offset:1,color:_e[_e.length-1].color};_e.push(ln)}for(var Rt="",Et=0,Ut=0;Ut_e[Et+1].offset;)Et++;var Gt=_e[Et].offset,Yt=(Be-Gt)/(_e[Et+1].offset-Gt),Nn=_e[Et].color,Yr=_e[Et+1].color;Rt+=W(Math.round((1-Yt)*Nn[0]+Yt*Yr[0]).toString(16))+W(Math.round((1-Yt)*Nn[1]+Yt*Yr[1]).toString(16))+W(Math.round((1-Yt)*Nn[2]+Yt*Yr[2]).toString(16))}return Rt.trim()})(h.colors,b),Z=[];Z.push({key:"FunctionType",value:"0"}),Z.push({key:"Domain",value:"[0.0 1.0]"}),Z.push({key:"Size",value:"["+b+"]"}),Z.push({key:"BitsPerSample",value:"8"}),Z.push({key:"Range",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),Z.push({key:"Decode",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),sr({data:H,additionalKeyValues:Z,alreadyAppliedFilters:["/ASCIIHexDecode"],objectId:R}),P("endobj"),h.objectNumber=Jt(),P("<< /ShadingType "+h.type),P("/ColorSpace /DeviceRGB");var fe="/Coords ["+V(parseFloat(h.coords[0]))+" "+V(parseFloat(h.coords[1]))+" ";h.type===2?fe+=V(parseFloat(h.coords[2]))+" "+V(parseFloat(h.coords[3])):fe+=V(parseFloat(h.coords[2]))+" "+V(parseFloat(h.coords[3]))+" "+V(parseFloat(h.coords[4]))+" "+V(parseFloat(h.coords[5])),P(fe+="]"),h.matrix&&P("/Matrix ["+h.matrix.toString()+"]"),P("/Function "+R+" 0 R"),P("/Extend [true true]"),P(">>"),P("endobj")},oa=function(h,b){var R=bn(),H=Jt();b.push({resourcesOid:R,objectOid:H}),h.objectNumber=H;var Z=[];Z.push({key:"Type",value:"/Pattern"}),Z.push({key:"PatternType",value:"1"}),Z.push({key:"PaintType",value:"1"}),Z.push({key:"TilingType",value:"1"}),Z.push({key:"BBox",value:"["+h.boundingBox.map(V).join(" ")+"]"}),Z.push({key:"XStep",value:V(h.xStep)}),Z.push({key:"YStep",value:V(h.yStep)}),Z.push({key:"Resources",value:R+" 0 R"}),h.matrix&&Z.push({key:"Matrix",value:"["+h.matrix.toString()+"]"}),sr({data:h.stream,additionalKeyValues:Z,objectId:h.objectNumber}),P("endobj")},qo=function(h){for(var b in h.objectNumber=Jt(),P("<<"),h)switch(b){case"opacity":P("/ca "+_(h[b]));break;case"stroke-opacity":P("/CA "+_(h[b]))}P(">>"),P("endobj")},za=function(h){yn(h.resourcesOid,!0),P("<<"),P("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),(function(){for(var b in P("/Font <<"),gt)gt.hasOwnProperty(b)&&(w===!1||w===!0&&v.hasOwnProperty(b))&&P("/"+b+" "+gt[b].objectNumber+" 0 R");P(">>")})(),(function(){if(Object.keys(Ze).length>0){for(var b in P("/Shading <<"),Ze)Ze.hasOwnProperty(b)&&Ze[b]instanceof Yi&&Ze[b].objectNumber>=0&&P("/"+b+" "+Ze[b].objectNumber+" 0 R");Nt.publish("putShadingPatternDict"),P(">>")}})(),(function(b){if(Object.keys(Ze).length>0){for(var R in P("/Pattern <<"),Ze)Ze.hasOwnProperty(R)&&Ze[R]instanceof d.TilingPattern&&Ze[R].objectNumber>=0&&Ze[R].objectNumber>")}})(h.objectOid),(function(){if(Object.keys(et).length>0){var b;for(b in P("/ExtGState <<"),et)et.hasOwnProperty(b)&&et[b].objectNumber>=0&&P("/"+b+" "+et[b].objectNumber+" 0 R");Nt.publish("putGStateDict"),P(">>")}})(),(function(){for(var b in P("/XObject <<"),Sn)Sn.hasOwnProperty(b)&&Sn[b].objectNumber>=0&&P("/"+b+" "+Sn[b].objectNumber+" 0 R");Nt.publish("putXobjectDict"),P(">>")})(),P(">>"),P("endobj")},ks=function(h){mt[h.fontName]=mt[h.fontName]||{},mt[h.fontName][h.fontStyle]=h.id},As=function(h,b,R,H,Z){var fe={id:"F"+(Object.keys(gt).length+1).toString(10),postScriptName:h,fontName:b,fontStyle:R,encoding:H,isStandardFont:Z||!1,metadata:{}};return Nt.publish("addFont",{font:fe,instance:this}),gt[fe.id]=fe,ks(fe),fe.id},or=d.__private__.pdfEscape=d.pdfEscape=function(h,b){return(function(R,H){var Z,fe,_e,De,Be,st,ct,_t,ln;if(_e=(H=H||{}).sourceEncoding||"Unicode",Be=H.outputEncoding,(H.autoencode||Be)&>[Ue].metadata&>[Ue].metadata[_e]&>[Ue].metadata[_e].encoding&&(De=gt[Ue].metadata[_e].encoding,!Be&>[Ue].encoding&&(Be=gt[Ue].encoding),!Be&&De.codePages&&(Be=De.codePages[0]),typeof Be=="string"&&(Be=De[Be]),Be)){for(ct=!1,st=[],Z=0,fe=R.length;Z>8&&(ct=!0);R=st.join("")}for(Z=R.length;ct===void 0&&Z!==0;)R.charCodeAt(Z-1)>>8&&(ct=!0),Z--;if(!ct)return R;for(st=H.noBOM?[]:[254,255],Z=0,fe=R.length;Z>8)>>8)throw new Error("Character at position "+Z+" of string '"+R+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");st.push(ln),st.push(_t-(ln<<8))}return String.fromCharCode.apply(void 0,st)})(h,b).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},$a=d.__private__.beginPage=function(h){Se[++wt]=[],Ke[wt]={objId:0,contentsObjId:0,userUnit:Number(o),artBox:null,bleedBox:null,cropBox:null,trimBox:null,mediaBox:{bottomLeftX:0,bottomLeftY:0,topRightX:Number(h[0]),topRightY:Number(h[1])}},Ss(wt),ke(Se[j])},Ls=function(h,b){var R,H,Z;switch(t=b||t,typeof h=="string"&&(R=L(h.toLowerCase()),Array.isArray(R)&&(H=R[0],Z=R[1])),Array.isArray(h)&&(H=h[0]*ht,Z=h[1]*ht),isNaN(H)&&(H=a[0],Z=a[1]),(H>14400||Z>14400)&&(Ot.warn("A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400"),H=Math.min(14400,H),Z=Math.min(14400,Z)),a=[H,Z],t.substr(0,1)){case"l":Z>H&&(a=[Z,H]);break;case"p":H>Z&&(a=[Z,H])}$a(a),Zo(tt),P(da),Ya!==0&&P(Ya+" J"),ui!==0&&P(ui+" j"),Nt.publish("addPage",{pageNumber:wt})},Ha=function(h){h>0&&h<=wt&&(Se.splice(h,1),Ke.splice(h,1),wt--,j>wt&&(j=wt),this.setPage(j))},Ss=function(h){h>0&&h<=wt&&(j=h)},Ns=d.__private__.getNumberOfPages=d.getNumberOfPages=function(){return Se.length-1},Ps=function(h,b,R){var H,Z=void 0;return R=R||{},h=h!==void 0?h:gt[Ue].fontName,b=b!==void 0?b:gt[Ue].fontStyle,H=h.toLowerCase(),mt[H]!==void 0&&mt[H][b]!==void 0?Z=mt[H][b]:mt[h]!==void 0&&mt[h][b]!==void 0?Z=mt[h][b]:R.disableWarning===!1&&Ot.warn("Unable to look up font label for font '"+h+"', '"+b+"'. Refer to getFontList() for available fonts."),Z||R.noFallback||(Z=mt.times[b])==null&&(Z=mt.times.normal),Z},Nr=d.__private__.putInfo=function(){var h=Jt(),b=function(H){return H};for(var R in p!==null&&(b=_n.encryptor(h,0)),P("<<"),P("/Producer ("+or(b("jsPDF "+We.version))+")"),ft)ft.hasOwnProperty(R)&&ft[R]&&P("/"+R.substr(0,1).toUpperCase()+R.substr(1)+" ("+or(b(ft[R]))+")");P("/CreationDate ("+or(b(re))+")"),P(">>"),P("endobj")},la=d.__private__.putCatalog=function(h){var b=(h=h||{}).rootDictionaryObjId||oi;switch(Jt(),P("<<"),P("/Type /Catalog"),P("/Pages "+b+" 0 R"),Ge||(Ge="fullwidth"),Ge){case"fullwidth":P("/OpenAction [3 0 R /FitH null]");break;case"fullheight":P("/OpenAction [3 0 R /FitV null]");break;case"fullpage":P("/OpenAction [3 0 R /Fit]");break;case"original":P("/OpenAction [3 0 R /XYZ null null 1]");break;default:var R=""+Ge;R.substr(R.length-1)==="%"&&(Ge=parseInt(Ge)/100),typeof Ge=="number"&&P("/OpenAction [3 0 R /XYZ null null "+_(Ge)+"]")}switch(vt||(vt="continuous"),vt){case"continuous":P("/PageLayout /OneColumn");break;case"single":P("/PageLayout /SinglePage");break;case"two":case"twoleft":P("/PageLayout /TwoColumnLeft");break;case"tworight":P("/PageLayout /TwoColumnRight")}Ye&&P("/PageMode /"+Ye),Nt.publish("putCatalog"),P(">>"),P("endobj")},Uo=d.__private__.putTrailer=function(){P("trailer"),P("<<"),P("/Size "+(Y+1)),P("/Root "+Y+" 0 R"),P("/Info "+(Y-1)+" 0 R"),p!==null&&P("/Encrypt "+_n.oid+" 0 R"),P("/ID [ <"+oe+"> <"+oe+"> ]"),P(">>")},on=d.__private__.putHeader=function(){P("%PDF-"+E),P("%ºß¬à")},Cs=d.__private__.putXRef=function(){var h="0000000000";P("xref"),P("0 "+(Y+1)),P("0000000000 65535 f ");for(var b=1;b<=Y;b++)typeof te[b]=="function"?P((h+te[b]()).slice(-10)+" 00000 n "):te[b]!==void 0?P((h+te[b]).slice(-10)+" 00000 n "):P("0000000000 00000 n ")},Pr=d.__private__.buildDocument=function(){var h;Y=0,le=0,ce=[],te=[],ve=[],oi=bn(),dr=bn(),ke(ce),Nt.publish("buildDocument"),on(),Sr(),(function(){Nt.publish("putAdditionalObjects");for(var R=0;R"),P("/O <"+_n.toHexString(_n.O)+">"),P("/P "+_n.P),P(">>"),P("endobj")),Nr(),la();var b=le;return Cs(),Uo(),P("startxref"),P(""+b),P("%%EOF"),ke(Se[j]),ce.join(` `)},ca=d.__private__.getBlob=function(h){return new Blob([ze(h)],{type:"application/pdf"})},Wa=function(h){for(;h.firstChild;)h.removeChild(h.firstChild)},Vn=function(h){var b,R=h.document,H=R.documentElement,Z=R.head,fe=R.body;return Z||(Z=R.createElement("head"),H.appendChild(Z)),fe||(fe=R.createElement("body"),H.appendChild(fe)),Wa(Z),Wa(fe),(b=R.createElement("style")).appendChild(R.createTextNode("html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;}")),Z.appendChild(b),{document:R,body:fe}},ua=d.output=d.__private__.output=(ar=function(h,b){switch(typeof(b=b||{})=="string"?b={filename:b}:b.filename=b.filename||"generated.pdf",h){case void 0:return Pr();case"save":d.save(b.filename);break;case"arraybuffer":return ze(Pr());case"blob":return ca(Pr());case"bloburi":case"bloburl":if(nt.URL!==void 0&&typeof nt.URL.createObjectURL=="function")return nt.URL&&nt.URL.createObjectURL(ca(Pr()))||void 0;Ot.warn("bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.");break;case"datauristring":case"dataurlstring":var R="",H=Pr();try{R=hh(H)}catch{R=hh(unescape(encodeURIComponent(H)))}return"data:application/pdf;filename="+encodeURIComponent(b.filename)+";base64,"+R;case"pdfobjectnewwindow":if(Object.prototype.toString.call(nt)==="[object Window]"){var Z="https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js",fe=!b.pdfObjectUrl;fe||(Z=b.pdfObjectUrl);var _e=nt.open();if(_e!==null){var De=Vn(_e),Be=De.document.createElement("script"),st=this;Be.src=Z,fe&&(Be.integrity="sha512-4ze/a9/4jqu+tX9dfOqJYSvyYd5M6qum/3HpCLr+/Jqf0whc37VUbkpNGHR7/8pSnCFw47T1fmIpwBV7UySh3g==",Be.crossOrigin="anonymous"),Be.onload=function(){_e.PDFObject.embed(st.output("dataurlstring"),b)},De.body.appendChild(Be)}return _e}throw new Error("The option pdfobjectnewwindow just works in a browser-environment.");case"pdfjsnewwindow":if(Object.prototype.toString.call(nt)==="[object Window]"){var ct=b.pdfJsUrl||"examples/PDF.js/web/viewer.html",_t=nt.open();if(_t!==null){var ln=Vn(_t),Rt=ln.document.createElement("iframe"),Et=ct.indexOf("?")===-1?"?":"&";st=this,Rt.id="pdfViewer",Rt.width="500px",Rt.height="400px",Rt.src=ct+Et+"file=&downloadName="+encodeURIComponent(b.filename),Rt.onload=function(){_t.document.title=b.filename,Rt.contentWindow.PDFViewerApplication.open(st.output("bloburl"))},ln.body.appendChild(Rt)}return _t}throw new Error("The option pdfjsnewwindow just works in a browser-environment.");case"dataurlnewwindow":if(Object.prototype.toString.call(nt)!=="[object Window]")throw new Error("The option dataurlnewwindow just works in a browser-environment.");var Ut=nt.open();if(Ut!==null){var Gt=Vn(Ut),Yt=Gt.document.createElement("iframe");Yt.src=this.output("datauristring",b),Gt.body.appendChild(Yt),Ut.document.title=b.filename}if(Ut||typeof safari>"u")return Ut;break;case"datauri":case"dataurl":return nt.document.location.href=this.output("datauristring",b);default:return null}},ar.foo=function(){try{return ar.apply(this,arguments)}catch(R){var h=R.stack||"";~h.indexOf(" at ")&&(h=h.split(" at ")[1]);var b="Error in function "+h.split(` `)[0].split("<")[0]+": "+R.message;if(!nt.console)throw new Error(b);nt.console.error(b,R),nt.alert&&alert(b)}},ar.foo.bar=ar,ar.foo),$r=function(h){return Array.isArray(Pi)===!0&&Pi.indexOf(h)>-1};switch(r){case"pt":ht=1;break;case"mm":ht=72/25.4;break;case"cm":ht=72/2.54;break;case"in":ht=72;break;case"px":ht=$r("px_scaling")==1?.75:96/72;break;case"pc":case"em":ht=12;break;case"ex":ht=6;break;default:if(typeof r!="number")throw new Error("Invalid unit: "+r);ht=r}var _n=null;be(),ee();var Is=d.__private__.getPageInfo=d.getPageInfo=function(h){if(isNaN(h)||h%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfo");return{objId:Ke[h].objId,pageNumber:h,pageContext:Ke[h]}},zo=d.__private__.getPageInfoByObjId=function(h){if(isNaN(h)||h%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfoByObjId");for(var b in Ke)if(Ke[b].objId===h)break;return Is(b)},$o=d.__private__.getCurrentPageInfo=d.getCurrentPageInfo=function(){return{objId:Ke[j].objId,pageNumber:j,pageContext:Ke[j]}};d.addPage=function(){return Ls.apply(this,arguments),this},d.setPage=function(){return Ss.apply(this,arguments),ke.call(this,Se[j]),this},d.insertPage=function(h){return this.addPage(),this.movePage(j,h),this},d.movePage=function(h,b){var R,H;if(h>b){R=Se[h],H=Ke[h];for(var Z=h;Z>b;Z--)Se[Z]=Se[Z-1],Ke[Z]=Ke[Z-1];Se[b]=R,Ke[b]=H,this.setPage(b)}else if(h0&&(typeof h=="string"?h=Et.splitTextToSize(h,ct):Object.prototype.toString.call(h)==="[object Array]"&&(h=h.reduce(function(Dt,Mt){return Dt.concat(Et.splitTextToSize(Mt,ct))},[]))),fe={text:h,x:b,y:R,options:H,mutex:{pdfEscape:or,activeFontKey:Ue,fonts:gt,activeFontSize:ye}},Nt.publish("preProcessText",fe),h=fe.text,De=(H=fe.options).angle,Rt instanceof Qe==0&&De&&typeof De=="number"){De*=Math.PI/180,H.rotationDirection===0&&(De=-De),M===q&&(De=-De);var Qa=Math.cos(De),Er=Math.sin(De);Rt=new Qe(Qa,Er,-Er,Qa,0,0)}else De&&De instanceof Qe&&(Rt=De);M!==q||Rt||(Rt=zr),(st=H.charSpace||pa)!==void 0&&(Yt+=V(U(st))+` Tc `,this.setCharSpace(this.getCharSpace()||0)),(ln=H.horizontalScale)!==void 0&&(Yt+=V(100*ln)+` Tz `),H.lang;var On=-1,Ds=H.renderingMode!==void 0?H.renderingMode:H.stroke,wa=Et.internal.getCurrentPageInfo().pageContext;switch(Ds){case 0:case!1:case"fill":On=0;break;case 1:case!0:case"stroke":On=1;break;case 2:case"fillThenStroke":On=2;break;case 3:case"invisible":On=3;break;case 4:case"fillAndAddForClipping":On=4;break;case 5:case"strokeAndAddPathForClipping":On=5;break;case 6:case"fillThenStrokeAndAddToPathForClipping":On=6;break;case 7:case"addToPathForClipping":On=7}var Ms=wa.usedRenderingMode!==void 0?wa.usedRenderingMode:-1;On!==-1?Yt+=On+` Tr `:Ms!==-1&&(Yt+=`0 Tr `),On!==-1&&(wa.usedRenderingMode=On),Be=H.align||"left";var lr,qi=ye*Nn,es=Et.internal.pageSize.getWidth(),ya=gt[Ue];st=H.charSpace||pa,ct=H.maxWidth||0,_t=Object.assign({autoencode:!0,noBOM:!0},H.flags);var Ui=[],ts=function(Dt){return Et.getStringUnitWidth(Dt,{font:ya,charSpace:st,fontSize:ye,doKerning:!1})*ye/Yr};if(Object.prototype.toString.call(h)==="[object Array]"){var jn;_e=Oi(h),Be!=="left"&&(lr=_e.map(ts));var Un,_a=0;if(Be==="right"){b-=lr[0],h=[],Pn=_e.length;for(var fi=0;fi0?(ct-lr[cn])/ns:0;cn":")"),Hi=parseFloat(_e[Cn][1]),Wi=parseFloat(_e[Cn][2]);break;case 0:pi=(Gt?"<":"(")+_e[Cn]+(Gt?">":")"),Hi=Hr(b),Wi=Wr(R)}Ui!==void 0&&Ui[Cn]!==void 0&&(gi=Ui[Cn]+` Tw `),Cn===0?h.push(gi+Aa(Hi,Wi,Rt)+pi):Jr===0?h.push(gi+pi):Jr===1&&h.push(gi+Aa(Hi,Wi,Rt)+pi)}h=Jr===0?h.join(` Tj T* `):h.join(` Tj `),h+=` Tj `;var Rr=`BT /`;return Rr+=Ue+" "+ye+` Tf `,Rr+=V(ye*Nn)+` TL `,Rr+=Ir+` `,Rr+=Yt,Rr+=h,P(Rr+="ET"),v[Ue]=!0,Et};var Ho=d.__private__.clip=d.clip=function(h){return P(h==="evenodd"?"W*":"W"),this};d.clipEvenOdd=function(){return Ho("evenodd")},d.__private__.discardPath=d.discardPath=function(){return P("n"),this};var Cr=d.__private__.isValidStyle=function(h){var b=!1;return[void 0,null,"S","D","F","DF","FD","f","f*","B","B*","n"].indexOf(h)!==-1&&(b=!0),b};d.__private__.setDefaultPathOperation=d.setDefaultPathOperation=function(h){return Cr(h)&&(f=h),this};var Es=d.__private__.getStyle=d.getStyle=function(h){var b=f;switch(h){case"D":case"S":b="S";break;case"F":b="f";break;case"FD":case"DF":b="B";break;case"f":case"f*":case"B":case"B*":b=h}return b},ha=d.close=function(){return P("h"),this};d.stroke=function(){return P("S"),this},d.fill=function(h){return fa("f",h),this},d.fillEvenOdd=function(h){return fa("f*",h),this},d.fillStroke=function(h){return fa("B",h),this},d.fillStrokeEvenOdd=function(h){return fa("B*",h),this};var fa=function(h,b){jt(b)==="object"?Vo(b,h):P(h)},Va=function(h){h===null||M===q&&h===void 0||(h=Es(h),P(h))};function Wo(h,b,R,H,Z){var fe=new Ta(b||this.boundingBox,R||this.xStep,H||this.yStep,this.gState,Z||this.matrix);fe.stream=this.stream;var _e=h+"$$"+this.cloneIndex+++"$$";return ir(_e,fe),fe}var Vo=function(h,b){var R=Bt[h.key],H=Ze[R];if(H instanceof Yi)P("q"),P(Go(b)),H.gState&&d.setGState(H.gState),P(h.matrix.toString()+" cm"),P("/"+R+" sh"),P("Q");else if(H instanceof Ta){var Z=new Qe(1,0,0,-1,0,Ti());h.matrix&&(Z=Z.multiply(h.matrix||zr),R=Wo.call(H,h.key,h.boundingBox,h.xStep,h.yStep,Z).id),P("q"),P("/Pattern cs"),P("/"+R+" scn"),H.gState&&d.setGState(H.gState),P(b),P("Q")}},Go=function(h){switch(h){case"f":case"F":case"n":return"W n";case"f*":return"W* n";case"B":case"S":return"W S";case"B*":return"W* S"}},li=d.moveTo=function(h,b){return P(V(U(h))+" "+V($(b))+" m"),this},Fs=d.lineTo=function(h,b){return P(V(U(h))+" "+V($(b))+" l"),this},ci=d.curveTo=function(h,b,R,H,Z,fe){return P([V(U(h)),V($(b)),V(U(R)),V($(H)),V(U(Z)),V($(fe)),"c"].join(" ")),this};d.__private__.line=d.line=function(h,b,R,H,Z){if(isNaN(h)||isNaN(b)||isNaN(R)||isNaN(H)||!Cr(Z))throw new Error("Invalid arguments passed to jsPDF.line");return M===D?this.lines([[R-h,H-b]],h,b,[1,1],Z||"S"):this.lines([[R-h,H-b]],h,b,[1,1]).stroke()},d.__private__.lines=d.lines=function(h,b,R,H,Z,fe){var _e,De,Be,st,ct,_t,ln,Rt,Et,Ut,Gt,Yt;if(typeof h=="number"&&(Yt=R,R=b,b=h,h=Yt),H=H||[1,1],fe=fe||!1,isNaN(b)||isNaN(R)||!Array.isArray(h)||!Array.isArray(H)||!Cr(Z)||typeof fe!="boolean")throw new Error("Invalid arguments passed to jsPDF.lines");for(li(b,R),_e=H[0],De=H[1],st=h.length,Ut=b,Gt=R,Be=0;Be>8&255,n>>16&255,n>>24&255)},Fa.prototype.toHexString=function(n){return n.split("").map(function(e){return("0"+(255&e.charCodeAt(0)).toString(16)).slice(-2)}).join("")},Fa.prototype.hexToBytes=function(n){for(var e=[],t=0;t>8&255,n>>16&255,255&e,e>>8&255)).substr(0,10);return function(r){return tc(t,r)}},Eo.prototype.equals=function(n){var e,t="id,objectNumber,equals";if(!n||jt(n)!==jt(this))return!1;var r=0;for(e in this)if(!(t.indexOf(e)>=0)){if(this.hasOwnProperty(e)&&!n.hasOwnProperty(e)||this[e]!==n[e])return!1;r++}for(e in n)n.hasOwnProperty(e)&&t.indexOf(e)<0&&r--;return r===0},We.API={events:[]},We.version="4.2.1";var Kt=We.API,xc=1,ia=function(n){return n.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},Ia=function(n){return n.replace(/\\\\/g,"\\").replace(/\\\(/g,"(").replace(/\\\)/g,")")},ea=function(n){return n.toString().replace(/#/g,"#23").replace(/[\s\n\r()<>[\]{}\/%]/g,function(e){var t=e.charCodeAt(0).toString(16).toUpperCase();return"#"+(t.length===1?"0"+t:t)})},ot=function(n){return n.toFixed(2)},ki=function(n){return n.toFixed(5)};Kt.__acroform__={};var Wn=function(n,e){n.prototype=Object.create(e.prototype),n.prototype.constructor=n},gh=function(n){return n*xc},Or=function(n){var e=new jf,t=je.internal.getHeight(n)||0,r=je.internal.getWidth(n)||0;return e.BBox=[0,0,Number(ot(r)),Number(ot(t))],e},W0=Kt.__acroform__.setBit=function(n,e){if(n=n||0,e=e||0,isNaN(n)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBit");return n|1<0;){e="",i--;var f,p,w=fo("3",n,i).height,v=n.multiline?c-i:(c-w)/2,d=v+=2,E=0,C=0,F=0;if(i<=0){e=`(...) Tj `,e+="% Width of Text: "+fo(e,n,i=12).width+", FieldWidth:"+o+` `;break}for(var L="",D=0,q=0;qc)continue e;L+=a[q][F],M=!0,C=q,q--}else{L=(L+=a[q][F]+" ").substr(L.length-1)==" "?L.substr(0,L.length-1):L;var Q=parseInt(q),ae=u(Q,L,i),se=q>=a.length-1;if(ae&&!se){L+=" ",F=0;continue}if(ae||se){if(se)C=Q;else if(n.multiline&&(w+2)*(D+2)+2>c)continue e}else{if(!n.multiline||(w+2)*(D+2)+2>c)continue e;C=Q}}for(var V="",B=E;B<=C;B++){var X=a[B];if(n.multiline){if(B===C){V+=X[F]+" ",F=(F+1)%X.length;continue}if(B===E){V+=X[X.length-1]+" ";continue}}V+=X[0]+" "}switch(V=V.substr(V.length-1)==" "?V.substr(0,V.length-1):V,p=fo(V,n,i).width,n.textAlign){case"right":f=o-p-2;break;case"center":f=(o-p)/2;break;default:f=2}e+=ot(f)+" "+ot(d)+` Td `,e+="("+ia(V)+`) Tj `,e+=-ot(f)+` 0 Td `,d=-(i+2),p=0,E=M?C:C+1,D++,L=""}break}return r.text=e,r.fontSize=i,r},fo=function(n,e,t){var r=e.scope.internal.getFont(e.fontName,e.fontStyle),a=e.scope.getStringUnitWidth(n,{font:r,fontSize:parseFloat(t),charSpace:0})*parseFloat(t);return{height:e.scope.getStringUnitWidth("3",{font:r,fontSize:parseFloat(t),charSpace:0})*parseFloat(t)*1.5,width:a}},Z0={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},X0=function(n,e){var t={type:"reference",object:n};e.internal.getPageInfo(n.page).pageContext.annotations.find(function(r){return r.type===t.type&&r.object===t.object})===void 0&&e.internal.getPageInfo(n.page).pageContext.annotations.push(t)},K0=function(n,e){if(e.scope=n,n.internal!==void 0&&(n.internal.acroformPlugin===void 0||n.internal.acroformPlugin.isInitialized===!1)){if(xr.FieldNum=0,n.internal.acroformPlugin=JSON.parse(JSON.stringify(Z0)),n.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("Exception while creating AcroformDictionary");xc=n.internal.scaleFactor,n.internal.acroformPlugin.acroFormDictionaryRoot=new Bf,n.internal.acroformPlugin.acroFormDictionaryRoot.scope=n,n.internal.acroformPlugin.acroFormDictionaryRoot._eventID=n.internal.events.subscribe("postPutResources",function(){(function(t){t.internal.events.unsubscribe(t.internal.acroformPlugin.acroFormDictionaryRoot._eventID),delete t.internal.acroformPlugin.acroFormDictionaryRoot._eventID,t.internal.acroformPlugin.printedOut=!0})(n)}),n.internal.events.subscribe("buildDocument",function(){(function(t){t.internal.acroformPlugin.acroFormDictionaryRoot.objId=void 0;var r=t.internal.acroformPlugin.acroFormDictionaryRoot.Fields;for(var a in r)if(r.hasOwnProperty(a)){var i=r[a];i.objId=void 0,i.hasAnnotation&&X0(i,t)}})(n)}),n.internal.events.subscribe("putCatalog",function(){(function(t){if(t.internal.acroformPlugin.acroFormDictionaryRoot===void 0)throw new Error("putCatalogCallback: Root missing.");t.internal.write("/AcroForm "+t.internal.acroformPlugin.acroFormDictionaryRoot.objId+" 0 R")})(n)}),n.internal.events.subscribe("postPutPages",function(t){(function(r,a){var i=!r;for(var c in r||(a.internal.newObjectDeferredBegin(a.internal.acroformPlugin.acroFormDictionaryRoot.objId,!0),a.internal.acroformPlugin.acroFormDictionaryRoot.putStream()),r=r||a.internal.acroformPlugin.acroFormDictionaryRoot.Kids)if(r.hasOwnProperty(c)){var o=r[c],u=[],f=o.Rect;if(o.Rect&&(o.Rect=Y0(o.Rect,a)),a.internal.newObjectDeferredBegin(o.objId,!0),o.DA=je.createDefaultAppearanceStream(o),jt(o)==="object"&&typeof o.getKeyValueListForStream=="function"&&(u=o.getKeyValueListForStream()),o.Rect=f,o.hasAppearanceStream&&!o.appearanceStreamContent){var p=J0(o);u.push({key:"AP",value:"<>"}),a.internal.acroformPlugin.xForms.push(p)}if(o.appearanceStreamContent){var w="";for(var v in o.appearanceStreamContent)if(o.appearanceStreamContent.hasOwnProperty(v)){var d=o.appearanceStreamContent[v];if(w+="/"+v+" ",w+="<<",Object.keys(d).length>=1||Array.isArray(d)){for(var c in d)if(d.hasOwnProperty(c)){var E=d[c];typeof E=="function"&&(E=E.call(a,o)),w+="/"+c+" "+E+" ",a.internal.acroformPlugin.xForms.indexOf(E)>=0||a.internal.acroformPlugin.xForms.push(E)}}else typeof(E=d)=="function"&&(E=E.call(a,o)),w+="/"+c+" "+E,a.internal.acroformPlugin.xForms.indexOf(E)>=0||a.internal.acroformPlugin.xForms.push(E);w+=">>"}u.push({key:"AP",value:`<< `+w+">>"})}a.internal.putStream({additionalKeyValues:u,objectId:o.objId}),a.internal.out("endobj")}i&&(function(C,F){for(var L in C)if(C.hasOwnProperty(L)){var D=L,q=C[L];F.internal.newObjectDeferredBegin(q.objId,!0),jt(q)==="object"&&typeof q.putStream=="function"&&q.putStream(),delete C[D]}})(a.internal.acroformPlugin.xForms,a)})(t,n)}),n.internal.acroformPlugin.isInitialized=!0}},Of=Kt.__acroform__.arrayToPdfArray=function(n,e,t){var r=function(c){return c};if(Array.isArray(n)){for(var a="[",i=0;i0?e:void 0}}),Object.defineProperty(this,"Fields",{enumerable:!1,configurable:!1,get:function(){return e}}),Object.defineProperty(this,"DA",{enumerable:!1,configurable:!1,get:function(){if(n){var t=function(r){return r};return this.scope&&(t=this.scope.internal.getEncryptor(this.objId)),"("+ia(t(n))+")"}},set:function(t){n=t}})};Wn(Bf,Dr);var xr=function n(){Dr.call(this);var e=4;Object.defineProperty(this,"F",{enumerable:!1,configurable:!1,get:function(){return e},set:function(L){if(isNaN(L))throw new Error('Invalid value "'+L+'" for attribute F supplied.');e=L}}),Object.defineProperty(this,"showWhenPrinted",{enumerable:!0,configurable:!0,get:function(){return!!rn(e,3)},set:function(L){L?this.F=an(e,3):this.F=sn(e,3)}});var t=0;Object.defineProperty(this,"Ff",{enumerable:!1,configurable:!1,get:function(){return t},set:function(L){if(isNaN(L))throw new Error('Invalid value "'+L+'" for attribute Ff supplied.');t=L}});var r=[];Object.defineProperty(this,"Rect",{enumerable:!1,configurable:!1,get:function(){if(r.length!==0)return r},set:function(L){r=L!==void 0?L:[]}}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[0])?0:r[0]},set:function(L){r[0]=L}}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[1])?0:r[1]},set:function(L){r[1]=L}}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[2])?0:r[2]},set:function(L){r[2]=L}}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[3])?0:r[3]},set:function(L){r[3]=L}});var a="";Object.defineProperty(this,"FT",{enumerable:!0,configurable:!1,get:function(){return a},set:function(L){switch(L){case"/Btn":case"/Tx":case"/Ch":case"/Sig":a=L;break;default:throw new Error('Invalid value "'+L+'" for attribute FT supplied.')}}});var i=null;Object.defineProperty(this,"T",{enumerable:!0,configurable:!1,get:function(){if(!i||i.length<1){if(this instanceof Fo)return;i="FieldObject"+n.FieldNum++}var L=function(D){return D};return this.scope&&(L=this.scope.internal.getEncryptor(this.objId)),"("+ia(L(i))+")"},set:function(L){i=L.toString()}}),Object.defineProperty(this,"fieldName",{configurable:!0,enumerable:!0,get:function(){return i},set:function(L){i=L}});var c="helvetica";Object.defineProperty(this,"fontName",{enumerable:!0,configurable:!0,get:function(){return c},set:function(L){c=L}});var o="normal";Object.defineProperty(this,"fontStyle",{enumerable:!0,configurable:!0,get:function(){return o},set:function(L){o=L}});var u=0;Object.defineProperty(this,"fontSize",{enumerable:!0,configurable:!0,get:function(){return u},set:function(L){u=L}});var f=void 0;Object.defineProperty(this,"maxFontSize",{enumerable:!0,configurable:!0,get:function(){return f===void 0?50/xc:f},set:function(L){f=L}});var p="black";Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,get:function(){return p},set:function(L){p=L}});var w="/F1 0 Tf 0 g";Object.defineProperty(this,"DA",{enumerable:!0,configurable:!1,get:function(){if(!(!w||this instanceof Fo||this instanceof Zi))return ql(w,this.objId,this.scope)},set:function(L){L=L.toString(),w=L}});var v=null;Object.defineProperty(this,"DV",{enumerable:!1,configurable:!1,get:function(){if(v)return this instanceof wn==0?ql(v,this.objId,this.scope):v},set:function(L){L=L.toString(),v=this instanceof wn==0?L.substr(0,1)==="("?Ia(L.substr(1,L.length-2)):Ia(L):L}}),Object.defineProperty(this,"defaultValue",{enumerable:!0,configurable:!0,get:function(){return this instanceof wn==1?Ia(v.substr(1,v.length-1)):v},set:function(L){L=L.toString(),v=this instanceof wn==1?"/"+ea(L):L}});var d=null;Object.defineProperty(this,"_V",{enumerable:!1,configurable:!1,get:function(){if(d)return d},set:function(L){this.V=L}}),Object.defineProperty(this,"V",{enumerable:!1,configurable:!1,get:function(){if(d)return this instanceof wn==0?ql(d,this.objId,this.scope):d},set:function(L){L=L.toString(),d=this instanceof wn==0?L.substr(0,1)==="("?Ia(L.substr(1,L.length-2)):Ia(L):L}}),Object.defineProperty(this,"value",{enumerable:!0,configurable:!0,get:function(){return this instanceof wn==1?Ia(d.substr(1,d.length-1)):d},set:function(L){L=L.toString(),d=this instanceof wn==1?"/"+ea(L):L}}),Object.defineProperty(this,"hasAnnotation",{enumerable:!0,configurable:!0,get:function(){return this.Rect}}),Object.defineProperty(this,"Type",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Annot":null}}),Object.defineProperty(this,"Subtype",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Widget":null}});var E,C=!1;Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return C},set:function(L){L=!!L,C=L}}),Object.defineProperty(this,"page",{enumerable:!0,configurable:!0,get:function(){if(E)return E},set:function(L){E=L}}),Object.defineProperty(this,"readOnly",{enumerable:!0,configurable:!0,get:function(){return!!rn(this.Ff,1)},set:function(L){L?this.Ff=an(this.Ff,1):this.Ff=sn(this.Ff,1)}}),Object.defineProperty(this,"required",{enumerable:!0,configurable:!0,get:function(){return!!rn(this.Ff,2)},set:function(L){L?this.Ff=an(this.Ff,2):this.Ff=sn(this.Ff,2)}}),Object.defineProperty(this,"noExport",{enumerable:!0,configurable:!0,get:function(){return!!rn(this.Ff,3)},set:function(L){L?this.Ff=an(this.Ff,3):this.Ff=sn(this.Ff,3)}});var F=null;Object.defineProperty(this,"Q",{enumerable:!0,configurable:!1,get:function(){if(F!==null)return F},set:function(L){if([0,1,2].indexOf(L)===-1)throw new Error('Invalid value "'+L+'" for attribute Q supplied.');F=L}}),Object.defineProperty(this,"textAlign",{get:function(){var L;switch(F){case 0:default:L="left";break;case 1:L="center";break;case 2:L="right"}return L},configurable:!0,enumerable:!0,set:function(L){switch(L){case"right":case 2:F=2;break;case"center":case 1:F=1;break;default:F=0}}})};Wn(xr,Dr);var Oa=function(){xr.call(this),this.FT="/Ch",this.V="()",this.fontName="zapfdingbats";var n=0;Object.defineProperty(this,"TI",{enumerable:!0,configurable:!1,get:function(){return n},set:function(t){n=t}}),Object.defineProperty(this,"topIndex",{enumerable:!0,configurable:!0,get:function(){return n},set:function(t){n=t}});var e=[];Object.defineProperty(this,"Opt",{enumerable:!0,configurable:!1,get:function(){return Of(e,this.objId,this.scope)},set:function(t){var r,a;a=[],typeof(r=t)=="string"&&(a=(function(i,c,o){o||(o=1);for(var u,f=[];u=c.exec(i);)f.push(u[o]);return f})(r,/\((.*?)\)/g)),e=a}}),this.getOptions=function(){return e},this.setOptions=function(t){e=t,this.sort&&e.sort()},this.addOption=function(t){t=(t=t||"").toString(),e.push(t),this.sort&&e.sort()},this.removeOption=function(t,r){for(r=r||!1,t=(t=t||"").toString();e.indexOf(t)!==-1&&(e.splice(e.indexOf(t),1),r!==!1););},Object.defineProperty(this,"combo",{enumerable:!0,configurable:!0,get:function(){return!!rn(this.Ff,18)},set:function(t){t?this.Ff=an(this.Ff,18):this.Ff=sn(this.Ff,18)}}),Object.defineProperty(this,"edit",{enumerable:!0,configurable:!0,get:function(){return!!rn(this.Ff,19)},set:function(t){this.combo===!0&&(t?this.Ff=an(this.Ff,19):this.Ff=sn(this.Ff,19))}}),Object.defineProperty(this,"sort",{enumerable:!0,configurable:!0,get:function(){return!!rn(this.Ff,20)},set:function(t){t?(this.Ff=an(this.Ff,20),e.sort()):this.Ff=sn(this.Ff,20)}}),Object.defineProperty(this,"multiSelect",{enumerable:!0,configurable:!0,get:function(){return!!rn(this.Ff,22)},set:function(t){t?this.Ff=an(this.Ff,22):this.Ff=sn(this.Ff,22)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!rn(this.Ff,23)},set:function(t){t?this.Ff=an(this.Ff,23):this.Ff=sn(this.Ff,23)}}),Object.defineProperty(this,"commitOnSelChange",{enumerable:!0,configurable:!0,get:function(){return!!rn(this.Ff,27)},set:function(t){t?this.Ff=an(this.Ff,27):this.Ff=sn(this.Ff,27)}}),this.hasAppearanceStream=!1};Wn(Oa,xr);var ja=function(){Oa.call(this),this.fontName="helvetica",this.combo=!1};Wn(ja,Oa);var Ba=function(){ja.call(this),this.combo=!0};Wn(Ba,ja);var wo=function(){Ba.call(this),this.edit=!0};Wn(wo,Ba);var wn=function(){xr.call(this),this.FT="/Btn",Object.defineProperty(this,"noToggleToOff",{enumerable:!0,configurable:!0,get:function(){return!!rn(this.Ff,15)},set:function(t){t?this.Ff=an(this.Ff,15):this.Ff=sn(this.Ff,15)}}),Object.defineProperty(this,"radio",{enumerable:!0,configurable:!0,get:function(){return!!rn(this.Ff,16)},set:function(t){t?this.Ff=an(this.Ff,16):this.Ff=sn(this.Ff,16)}}),Object.defineProperty(this,"pushButton",{enumerable:!0,configurable:!0,get:function(){return!!rn(this.Ff,17)},set:function(t){t?this.Ff=an(this.Ff,17):this.Ff=sn(this.Ff,17)}}),Object.defineProperty(this,"radioIsUnison",{enumerable:!0,configurable:!0,get:function(){return!!rn(this.Ff,26)},set:function(t){t?this.Ff=an(this.Ff,26):this.Ff=sn(this.Ff,26)}});var n,e={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var t=function(i){return i};if(this.scope&&(t=this.scope.internal.getEncryptor(this.objId)),Object.keys(e).length!==0){var r,a=[];for(r in a.push("<<"),e)a.push("/"+r+" ("+ia(t(e[r]))+")");return a.push(">>"),a.join(` `)}},set:function(t){jt(t)==="object"&&(e=t)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return e.CA||""},set:function(t){typeof t=="string"&&(e.CA=t)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return n},set:function(t){var r=t==null?"":t.toString();r.substr(0,1)==="/"&&(r=r.substr(1)),n="/"+ea(r)}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return n.substr(1,n.length-1)},set:function(t){n="/"+ea(t)}})};Wn(wn,xr);var yo=function(){wn.call(this),this.pushButton=!0};Wn(yo,wn);var Da=function(){wn.call(this),this.radio=!0,this.pushButton=!1;var n=[];Object.defineProperty(this,"Kids",{enumerable:!0,configurable:!1,get:function(){return n},set:function(e){n=e!==void 0?e:[]}})};Wn(Da,wn);var Fo=function(){var n,e;xr.call(this),Object.defineProperty(this,"Parent",{enumerable:!1,configurable:!1,get:function(){return n},set:function(a){n=a}}),Object.defineProperty(this,"optionName",{enumerable:!1,configurable:!0,get:function(){return e},set:function(a){e=a}});var t,r={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var a=function(o){return o};this.scope&&(a=this.scope.internal.getEncryptor(this.objId));var i,c=[];for(i in c.push("<<"),r)c.push("/"+i+" ("+ia(a(r[i]))+")");return c.push(">>"),c.join(` `)},set:function(a){jt(a)==="object"&&(r=a)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return r.CA||""},set:function(a){typeof a=="string"&&(r.CA=a)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return t},set:function(a){var i=a==null?"":a.toString();i.substr(0,1)==="/"&&(i=i.substr(1)),t="/"+ea(i)}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return t.substr(1,t.length-1)},set:function(a){var i=a==null?"":a.toString();i.substr(0,1)==="/"&&(i=i.substr(1)),t="/"+ea(i)}}),this.caption="l",this.appearanceState="Off",this._AppearanceType=je.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(this.optionName)};Wn(Fo,xr),Da.prototype.setAppearance=function(n){if(!("createAppearanceStream"in n)||!("getCA"in n))throw new Error("Couldn't assign Appearance to RadioButton. Appearance was Invalid!");for(var e in this.Kids)if(this.Kids.hasOwnProperty(e)){var t=this.Kids[e];t.appearanceStreamContent=n.createAppearanceStream(t.optionName),t.caption=n.getCA()}},Da.prototype.createOption=function(n){var e=new Fo;return e.Parent=this,e.optionName=n,this.Kids.push(e),Q0.call(this.scope,e),e};var _o=function(){wn.call(this),this.fontName="zapfdingbats",this.caption="3",this.appearanceState="On",this.value="On",this.textAlign="center",this.appearanceStreamContent=je.CheckBox.createAppearanceStream()};Wn(_o,wn);var Zi=function(){xr.call(this),this.FT="/Tx",Object.defineProperty(this,"multiline",{enumerable:!0,configurable:!0,get:function(){return!!rn(this.Ff,13)},set:function(e){e?this.Ff=an(this.Ff,13):this.Ff=sn(this.Ff,13)}}),Object.defineProperty(this,"fileSelect",{enumerable:!0,configurable:!0,get:function(){return!!rn(this.Ff,21)},set:function(e){e?this.Ff=an(this.Ff,21):this.Ff=sn(this.Ff,21)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!rn(this.Ff,23)},set:function(e){e?this.Ff=an(this.Ff,23):this.Ff=sn(this.Ff,23)}}),Object.defineProperty(this,"doNotScroll",{enumerable:!0,configurable:!0,get:function(){return!!rn(this.Ff,24)},set:function(e){e?this.Ff=an(this.Ff,24):this.Ff=sn(this.Ff,24)}}),Object.defineProperty(this,"comb",{enumerable:!0,configurable:!0,get:function(){return!!rn(this.Ff,25)},set:function(e){e?this.Ff=an(this.Ff,25):this.Ff=sn(this.Ff,25)}}),Object.defineProperty(this,"richText",{enumerable:!0,configurable:!0,get:function(){return!!rn(this.Ff,26)},set:function(e){e?this.Ff=an(this.Ff,26):this.Ff=sn(this.Ff,26)}});var n=null;Object.defineProperty(this,"MaxLen",{enumerable:!0,configurable:!1,get:function(){return n},set:function(e){n=e}}),Object.defineProperty(this,"maxLength",{enumerable:!0,configurable:!0,get:function(){return n},set:function(e){Number.isInteger(e)&&(n=e)}}),Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return this.V||this.DV}})};Wn(Zi,xr);var xo=function(){Zi.call(this),Object.defineProperty(this,"password",{enumerable:!0,configurable:!0,get:function(){return!!rn(this.Ff,14)},set:function(n){n?this.Ff=an(this.Ff,14):this.Ff=sn(this.Ff,14)}}),this.password=!0};Wn(xo,Zi);var je={CheckBox:{createAppearanceStream:function(){return{N:{On:je.CheckBox.YesNormal},D:{On:je.CheckBox.YesPushDown,Off:je.CheckBox.OffPushDown}}},YesPushDown:function(n){var e=Or(n);e.scope=n.scope;var t=[],r=n.scope.internal.getFont(n.fontName,n.fontStyle).id,a=n.scope.__private__.encodeColorString(n.color),i=nc(n,n.caption);return t.push("0.749023 g"),t.push("0 0 "+ot(je.internal.getWidth(n))+" "+ot(je.internal.getHeight(n))+" re"),t.push("f"),t.push("BMC"),t.push("q"),t.push("0 0 1 rg"),t.push("/"+r+" "+ot(i.fontSize)+" Tf "+a),t.push("BT"),t.push(i.text),t.push("ET"),t.push("Q"),t.push("EMC"),e.stream=t.join(` `),e},YesNormal:function(n){var e=Or(n);e.scope=n.scope;var t=n.scope.internal.getFont(n.fontName,n.fontStyle).id,r=n.scope.__private__.encodeColorString(n.color),a=[],i=je.internal.getHeight(n),c=je.internal.getWidth(n),o=nc(n,n.caption);return a.push("1 g"),a.push("0 0 "+ot(c)+" "+ot(i)+" re"),a.push("f"),a.push("q"),a.push("0 0 1 rg"),a.push("0 0 "+ot(c-1)+" "+ot(i-1)+" re"),a.push("W"),a.push("n"),a.push("0 g"),a.push("BT"),a.push("/"+t+" "+ot(o.fontSize)+" Tf "+r),a.push(o.text),a.push("ET"),a.push("Q"),e.stream=a.join(` `),e},OffPushDown:function(n){var e=Or(n);e.scope=n.scope;var t=[];return t.push("0.749023 g"),t.push("0 0 "+ot(je.internal.getWidth(n))+" "+ot(je.internal.getHeight(n))+" re"),t.push("f"),e.stream=t.join(` `),e}},RadioButton:{Circle:{createAppearanceStream:function(n){var e={D:{Off:je.RadioButton.Circle.OffPushDown},N:{}};return e.N[n]=je.RadioButton.Circle.YesNormal,e.D[n]=je.RadioButton.Circle.YesPushDown,e},getCA:function(){return"l"},YesNormal:function(n){var e=Or(n);e.scope=n.scope;var t=[],r=je.internal.getWidth(n)<=je.internal.getHeight(n)?je.internal.getWidth(n)/4:je.internal.getHeight(n)/4;r=Number((.9*r).toFixed(5));var a=je.internal.Bezier_C,i=Number((r*a).toFixed(5));return t.push("q"),t.push("1 0 0 1 "+ki(je.internal.getWidth(n)/2)+" "+ki(je.internal.getHeight(n)/2)+" cm"),t.push(r+" 0 m"),t.push(r+" "+i+" "+i+" "+r+" 0 "+r+" c"),t.push("-"+i+" "+r+" -"+r+" "+i+" -"+r+" 0 c"),t.push("-"+r+" -"+i+" -"+i+" -"+r+" 0 -"+r+" c"),t.push(i+" -"+r+" "+r+" -"+i+" "+r+" 0 c"),t.push("f"),t.push("Q"),e.stream=t.join(` `),e},YesPushDown:function(n){var e=Or(n);e.scope=n.scope;var t=[],r=je.internal.getWidth(n)<=je.internal.getHeight(n)?je.internal.getWidth(n)/4:je.internal.getHeight(n)/4;r=Number((.9*r).toFixed(5));var a=Number((2*r).toFixed(5)),i=Number((a*je.internal.Bezier_C).toFixed(5)),c=Number((r*je.internal.Bezier_C).toFixed(5));return t.push("0.749023 g"),t.push("q"),t.push("1 0 0 1 "+ki(je.internal.getWidth(n)/2)+" "+ki(je.internal.getHeight(n)/2)+" cm"),t.push(a+" 0 m"),t.push(a+" "+i+" "+i+" "+a+" 0 "+a+" c"),t.push("-"+i+" "+a+" -"+a+" "+i+" -"+a+" 0 c"),t.push("-"+a+" -"+i+" -"+i+" -"+a+" 0 -"+a+" c"),t.push(i+" -"+a+" "+a+" -"+i+" "+a+" 0 c"),t.push("f"),t.push("Q"),t.push("0 g"),t.push("q"),t.push("1 0 0 1 "+ki(je.internal.getWidth(n)/2)+" "+ki(je.internal.getHeight(n)/2)+" cm"),t.push(r+" 0 m"),t.push(r+" "+c+" "+c+" "+r+" 0 "+r+" c"),t.push("-"+c+" "+r+" -"+r+" "+c+" -"+r+" 0 c"),t.push("-"+r+" -"+c+" -"+c+" -"+r+" 0 -"+r+" c"),t.push(c+" -"+r+" "+r+" -"+c+" "+r+" 0 c"),t.push("f"),t.push("Q"),e.stream=t.join(` `),e},OffPushDown:function(n){var e=Or(n);e.scope=n.scope;var t=[],r=je.internal.getWidth(n)<=je.internal.getHeight(n)?je.internal.getWidth(n)/4:je.internal.getHeight(n)/4;r=Number((.9*r).toFixed(5));var a=Number((2*r).toFixed(5)),i=Number((a*je.internal.Bezier_C).toFixed(5));return t.push("0.749023 g"),t.push("q"),t.push("1 0 0 1 "+ki(je.internal.getWidth(n)/2)+" "+ki(je.internal.getHeight(n)/2)+" cm"),t.push(a+" 0 m"),t.push(a+" "+i+" "+i+" "+a+" 0 "+a+" c"),t.push("-"+i+" "+a+" -"+a+" "+i+" -"+a+" 0 c"),t.push("-"+a+" -"+i+" -"+i+" -"+a+" 0 -"+a+" c"),t.push(i+" -"+a+" "+a+" -"+i+" "+a+" 0 c"),t.push("f"),t.push("Q"),e.stream=t.join(` `),e}},Cross:{createAppearanceStream:function(n){var e={D:{Off:je.RadioButton.Cross.OffPushDown},N:{}};return e.N[n]=je.RadioButton.Cross.YesNormal,e.D[n]=je.RadioButton.Cross.YesPushDown,e},getCA:function(){return"8"},YesNormal:function(n){var e=Or(n);e.scope=n.scope;var t=[],r=je.internal.calculateCross(n);return t.push("q"),t.push("1 1 "+ot(je.internal.getWidth(n)-2)+" "+ot(je.internal.getHeight(n)-2)+" re"),t.push("W"),t.push("n"),t.push(ot(r.x1.x)+" "+ot(r.x1.y)+" m"),t.push(ot(r.x2.x)+" "+ot(r.x2.y)+" l"),t.push(ot(r.x4.x)+" "+ot(r.x4.y)+" m"),t.push(ot(r.x3.x)+" "+ot(r.x3.y)+" l"),t.push("s"),t.push("Q"),e.stream=t.join(` `),e},YesPushDown:function(n){var e=Or(n);e.scope=n.scope;var t=je.internal.calculateCross(n),r=[];return r.push("0.749023 g"),r.push("0 0 "+ot(je.internal.getWidth(n))+" "+ot(je.internal.getHeight(n))+" re"),r.push("f"),r.push("q"),r.push("1 1 "+ot(je.internal.getWidth(n)-2)+" "+ot(je.internal.getHeight(n)-2)+" re"),r.push("W"),r.push("n"),r.push(ot(t.x1.x)+" "+ot(t.x1.y)+" m"),r.push(ot(t.x2.x)+" "+ot(t.x2.y)+" l"),r.push(ot(t.x4.x)+" "+ot(t.x4.y)+" m"),r.push(ot(t.x3.x)+" "+ot(t.x3.y)+" l"),r.push("s"),r.push("Q"),e.stream=r.join(` `),e},OffPushDown:function(n){var e=Or(n);e.scope=n.scope;var t=[];return t.push("0.749023 g"),t.push("0 0 "+ot(je.internal.getWidth(n))+" "+ot(je.internal.getHeight(n))+" re"),t.push("f"),e.stream=t.join(` `),e}}},createDefaultAppearanceStream:function(n){var e=n.scope.internal.getFont(n.fontName,n.fontStyle).id,t=n.scope.__private__.encodeColorString(n.color);return"/"+e+" "+n.fontSize+" Tf "+t}};je.internal={Bezier_C:.551915024494,calculateCross:function(n){var e=je.internal.getWidth(n),t=je.internal.getHeight(n),r=Math.min(e,t);return{x1:{x:(e-r)/2,y:(t-r)/2+r},x2:{x:(e-r)/2+r,y:(t-r)/2},x3:{x:(e-r)/2,y:(t-r)/2},x4:{x:(e-r)/2+r,y:(t-r)/2+r}}}},je.internal.getWidth=function(n){var e=0;return jt(n)==="object"&&(e=gh(n.Rect[2])),e},je.internal.getHeight=function(n){var e=0;return jt(n)==="object"&&(e=gh(n.Rect[3])),e};var Q0=Kt.addField=function(n){if(K0(this,n),!(n instanceof xr))throw new Error("Invalid argument passed to jsPDF.addField.");var e;return(e=n).scope.internal.acroformPlugin.printedOut&&(e.scope.internal.acroformPlugin.printedOut=!1,e.scope.internal.acroformPlugin.acroFormDictionaryRoot=null),e.scope.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(e),n.page=n.scope.internal.getCurrentPageInfo().pageNumber,this};Kt.AcroFormChoiceField=Oa,Kt.AcroFormListBox=ja,Kt.AcroFormComboBox=Ba,Kt.AcroFormEditBox=wo,Kt.AcroFormButton=wn,Kt.AcroFormPushButton=yo,Kt.AcroFormRadioButton=Da,Kt.AcroFormCheckBox=_o,Kt.AcroFormTextField=Zi,Kt.AcroFormPasswordField=xo,Kt.AcroFormAppearance=je,Kt.AcroForm={ChoiceField:Oa,ListBox:ja,ComboBox:Ba,EditBox:wo,Button:wn,PushButton:yo,RadioButton:Da,CheckBox:_o,TextField:Zi,PasswordField:xo,Appearance:je},We.AcroForm={ChoiceField:Oa,ListBox:ja,ComboBox:Ba,EditBox:wo,Button:wn,PushButton:yo,RadioButton:Da,CheckBox:_o,TextField:Zi,PasswordField:xo,Appearance:je};We.AcroForm;function Df(n){return n.reduce(function(e,t,r){return e[t]=r,e},{})}(function(n){var e="addImage_";n.__addimage__={};var t="UNKNOWN",r={PNG:[[137,80,78,71]],TIFF:[[77,77,0,42],[73,73,42,0]],JPEG:[[255,216,255,224,void 0,void 0,74,70,73,70,0],[255,216,255,225,void 0,void 0,69,120,105,102,0,0],[255,216,255,219],[255,216,255,238]],JPEG2000:[[0,0,0,12,106,80,32,32]],GIF87a:[[71,73,70,56,55,97]],GIF89a:[[71,73,70,56,57,97]],WEBP:[[82,73,70,70,void 0,void 0,void 0,void 0,87,69,66,80]],BMP:[[66,77],[66,65],[67,73],[67,80],[73,67],[80,84]]},a=n.__addimage__.getImageFileTypeByImageData=function(_,N){var U,$,re,oe,he,ee=t;if((N=N||t)==="RGBA"||_.data!==void 0&&_.data instanceof Uint8ClampedArray&&"height"in _&&"width"in _)return"RGBA";if(ae(_))for(he in r)for(re=r[he],U=0;U>"}),"transparency"in N&&Array.isArray(N.transparency)&&N.transparency.length>0){for(var he="",ee=0,ue=N.transparency.length;ee>",C.content=i;var q=C.objId+" 0 R";i="<>";else if(r.options.pageNumber)switch(i="<=0};n.__arabicParser__.arabicLetterHasIsolatedForm=function(C){return c(C)&&i(C)&&e[C.charCodeAt(0)].length>=1};var f=n.__arabicParser__.arabicLetterHasFinalForm=function(C){return c(C)&&i(C)&&e[C.charCodeAt(0)].length>=2};n.__arabicParser__.arabicLetterHasInitialForm=function(C){return c(C)&&i(C)&&e[C.charCodeAt(0)].length>=3};var p=n.__arabicParser__.arabicLetterHasMedialForm=function(C){return c(C)&&i(C)&&e[C.charCodeAt(0)].length==4},w=n.__arabicParser__.resolveLigatures=function(C){var F=0,L=t,D="",q=0;for(F=0;F>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){this.internal.out("/OpenAction "+e+" 0 R")})),this},(function(n){var e=function(){var t=void 0;Object.defineProperty(this,"pdf",{get:function(){return t},set:function(o){t=o}});var r=150;Object.defineProperty(this,"width",{get:function(){return r},set:function(o){r=isNaN(o)||Number.isInteger(o)===!1||o<0?150:o,this.getContext("2d").pageWrapXEnabled&&(this.getContext("2d").pageWrapX=r+1)}});var a=300;Object.defineProperty(this,"height",{get:function(){return a},set:function(o){a=isNaN(o)||Number.isInteger(o)===!1||o<0?300:o,this.getContext("2d").pageWrapYEnabled&&(this.getContext("2d").pageWrapY=a+1)}});var i=[];Object.defineProperty(this,"childNodes",{get:function(){return i},set:function(o){i=o}});var c={};Object.defineProperty(this,"style",{get:function(){return c},set:function(o){c=o}}),Object.defineProperty(this,"parentNode",{})};e.prototype.getContext=function(t,r){var a;if((t=t||"2d")!=="2d")return null;for(a in r)this.pdf.context2d.hasOwnProperty(a)&&(this.pdf.context2d[a]=r[a]);return this.pdf.context2d._canvas=this,this.pdf.context2d},e.prototype.toDataURL=function(){throw new Error("toDataURL is not implemented.")},n.events.push(["initialized",function(){this.canvas=new e,this.canvas.pdf=this}])})(We.API),(function(n){var e={left:0,top:0,bottom:0,right:0},t=!1,r=function(){this.internal.__cell__===void 0&&(this.internal.__cell__={},this.internal.__cell__.padding=3,this.internal.__cell__.headerFunction=void 0,this.internal.__cell__.margins=Object.assign({},e),this.internal.__cell__.margins.width=this.getPageWidth(),a.call(this))},a=function(){this.internal.__cell__.lastCell=new i,this.internal.__cell__.pages=1},i=function(){var u=arguments[0];Object.defineProperty(this,"x",{enumerable:!0,get:function(){return u},set:function(C){u=C}});var f=arguments[1];Object.defineProperty(this,"y",{enumerable:!0,get:function(){return f},set:function(C){f=C}});var p=arguments[2];Object.defineProperty(this,"width",{enumerable:!0,get:function(){return p},set:function(C){p=C}});var w=arguments[3];Object.defineProperty(this,"height",{enumerable:!0,get:function(){return w},set:function(C){w=C}});var v=arguments[4];Object.defineProperty(this,"text",{enumerable:!0,get:function(){return v},set:function(C){v=C}});var d=arguments[5];Object.defineProperty(this,"lineNumber",{enumerable:!0,get:function(){return d},set:function(C){d=C}});var E=arguments[6];return Object.defineProperty(this,"align",{enumerable:!0,get:function(){return E},set:function(C){E=C}}),this};i.prototype.clone=function(){return new i(this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align)},i.prototype.toArray=function(){return[this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align]},n.setHeaderFunction=function(u){return r.call(this),this.internal.__cell__.headerFunction=typeof u=="function"?u:void 0,this},n.getTextDimensions=function(u,f){r.call(this);var p=(f=f||{}).fontSize||this.getFontSize(),w=f.font||this.getFont(),v=f.scaleFactor||this.internal.scaleFactor,d=0,E=0,C=0,F=this;if(!Array.isArray(u)&&typeof u!="string"){if(typeof u!="number")throw new Error("getTextDimensions expects text-parameter to be of type String or type Number or an Array of Strings.");u=String(u)}var L=f.maxWidth;L>0?typeof u=="string"?u=this.splitTextToSize(u,L):Object.prototype.toString.call(u)==="[object Array]"&&(u=u.reduce(function(q,M){return q.concat(F.splitTextToSize(M,L))},[])):u=Array.isArray(u)?u:[u];for(var D=0;Dthis.getPageHeight()?(this.cellAddPage(),u.y=w.top,d&&v&&(this.printHeaderRow(u.lineNumber,!0),u.y+=v[0].height)):u.y=f.y+f.height||u.y),u.text[0]!==void 0&&(this.rect(u.x,u.y,u.width,u.height,t===!0?"FD":void 0),u.align==="right"?this.text(u.text,u.x+u.width-p,u.y+p,{align:"right",baseline:"top"}):u.align==="center"?this.text(u.text,u.x+u.width/2,u.y+p,{align:"center",baseline:"top",maxWidth:u.width-p-p}):this.text(u.text,u.x+p,u.y+p,{align:"left",baseline:"top",maxWidth:u.width-p-p})),this.internal.__cell__.lastCell=u,this};n.table=function(u,f,p,w,v){if(r.call(this),!p)throw new Error("No data for PDF table.");var d,E,C,F,L=[],D=[],q=[],M={},Q={},ae=[],se=[],V=(v=v||{}).autoSize||!1,B=v.printHeaders!==!1,X=v.css&&v.css["font-size"]!==void 0?16*v.css["font-size"]:v.fontSize||12,_=v.margins||Object.assign({width:this.getPageWidth()},e),N=typeof v.padding=="number"?v.padding:3,U=v.headerBackgroundColor||"#c8c8c8",$=v.headerTextColor||"#000";if(a.call(this),this.internal.__cell__.printHeaders=B,this.internal.__cell__.margins=_,this.internal.__cell__.table_font_size=X,this.internal.__cell__.padding=N,this.internal.__cell__.headerBackgroundColor=U,this.internal.__cell__.headerTextColor=$,this.setFontSize(X),w==null)D=L=Object.keys(p[0]),q=L.map(function(){return"left"});else if(Array.isArray(w)&&jt(w[0])==="object")for(L=w.map(function(me){return me.name}),D=w.map(function(me){return me.prompt||me.name||""}),q=w.map(function(me){return me.align||"left"}),d=0;d0&&this.setTableHeaderRow(v),this.setFont(void 0,"normal"),t=!1}})(We.API);var Mf={italic:["italic","oblique","normal"],oblique:["oblique","italic","normal"],normal:["normal","oblique","italic"]},qf=["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded"],rc=Df(qf),Uf=[100,200,300,400,500,600,700,800,900],eg=Df(Uf);function Ul(n){var e=n.family.replace(/"|'/g,"").toLowerCase(),t=(function(i){return Mf[i=i||"normal"]?i:"normal"})(n.style),r=(function(i){return i?typeof i=="number"?i>=100&&i<=900&&i%100==0?i:400:/^\d00$/.test(i)?parseInt(i):i==="bold"?700:400:400})(n.weight),a=(function(i){return typeof rc[i=i||"normal"]=="number"?i:"normal"})(n.stretch);return{family:e,style:t,weight:r,stretch:a,src:n.src||[],ref:n.ref||{name:e,style:[a,t,r].join(" ")}}}function mh(n,e,t,r){var a;for(a=t;a>=0&&a=0&&a>>1)&255}return a}function Nh(n,e,t){var r=n.length,a=[];a[0]=4;for(var i=0;i>i&c}function Ph(n,e,t,r){var a=t*r,i=Math.floor(a/8),c=16-(a-8*i+r),o=(1<>8&255;f.setUint8(p,v)}})(n,i,zf(n,i)&~(o<>7,c=1<<1+(7&a);n[e++],n[e++];var o=null,u=null;i&&(o=e,u=c,e+=3*c);var f=!0,p=[],w=0,v=null,d=0,E=null;for(this.width=t,this.height=r;f&&e=0))throw Error("Invalid block size");if(_===0)break;e+=_}break;case 249:if(n[e++]!==4||n[e+4]!==0)throw new Error("Invalid graphics extension block.");var C=n[e++];w=n[e++]|n[e++]<<8,v=n[e++],1&C||(v=null),d=C>>2&7,e++;break;case 254:for(;;){if(!((_=n[e++])>=0))throw Error("Invalid block size");if(_===0)break;e+=_}break;default:throw new Error("Unknown graphic control label: 0x"+n[e-1].toString(16))}break;case 44:var F=n[e++]|n[e++]<<8,L=n[e++]|n[e++]<<8,D=n[e++]|n[e++]<<8,q=n[e++]|n[e++]<<8,M=n[e++],Q=M>>6&1,ae=1<<1+(7&M),se=o,V=u,B=!1;M>>7&&(B=!0,se=e,V=ae,e+=3*ae);var X=e;for(e++;;){var _;if(!((_=n[e++])>=0))throw Error("Invalid block size");if(_===0)break;e+=_}p.push({x:F,y:L,width:D,height:q,has_local_palette:B,palette_offset:se,palette_size:V,data_offset:X,data_length:e-X,transparent_index:v,interlaced:!!Q,delay:w,disposal:d});break;case 59:f=!1;break;default:throw new Error("Unknown gif block: 0x"+n[e-1].toString(16))}this.numFrames=function(){return p.length},this.loopCount=function(){return E},this.frameInfo=function(N){if(N<0||N>=p.length)throw new Error("Frame index out of range.");return p[N]},this.decodeAndBlitFrameBGRA=function(N,U){var $=this.frameInfo(N),re=$.width*$.height;if(re>536870912)throw new Error("Image dimensions exceed 512MB, which is too large.");var oe=new Uint8Array(re);Ch(n,$.data_offset,oe,re);var he=$.palette_offset,ee=$.transparent_index;ee===null&&(ee=256);var ue=$.width,me=t-ue,be=ue,A=4*($.y*t+$.x),j=4*(($.y+$.height)*t+$.x),z=A,W=4*me;$.interlaced===!0&&(W+=4*t*7);for(var Y=8,te=0,ce=oe.length;te=j&&(W=4*me+4*t*(Y-1),z=A+(ue+me)*(Y<<1),Y>>=1)),le===ee)z+=4;else{var ve=n[he+3*le],Se=n[he+3*le+1],Ee=n[he+3*le+2];U[z++]=Ee,U[z++]=Se,U[z++]=ve,U[z++]=255}--be}},this.decodeAndBlitFrameRGBA=function(N,U){var $=this.frameInfo(N),re=$.width*$.height;if(re>536870912)throw new Error("Image dimensions exceed 512MB, which is too large.");var oe=new Uint8Array(re);Ch(n,$.data_offset,oe,re);var he=$.palette_offset,ee=$.transparent_index;ee===null&&(ee=256);var ue=$.width,me=t-ue,be=ue,A=4*($.y*t+$.x),j=4*(($.y+$.height)*t+$.x),z=A,W=4*me;$.interlaced===!0&&(W+=4*t*7);for(var Y=8,te=0,ce=oe.length;te=j&&(W=4*me+4*t*(Y-1),z=A+(ue+me)*(Y<<1),Y>>=1)),le===ee)z+=4;else{var ve=n[he+3*le],Se=n[he+3*le+1],Ee=n[he+3*le+2];U[z++]=ve,U[z++]=Se,U[z++]=Ee,U[z++]=255}--be}}}function Ch(n,e,t,r){for(var a=n[e++],i=1<>=u,p-=u,F!==i){if(F===c)break;for(var L=Fi;)q=E[q]>>8,++D;var M=q;if(v+D+(L!==F?1:0)>r)return void Ot.log("Warning, gif stream longer than expected.");t[v++]=M;var Q=v+=D;for(L!==F&&(t[v++]=M),q=L;D--;)q=E[q],t[--Q]=255&q,q>>=8;C!==null&&o<4096&&(E[o++]=C<<8|M,o>=f+1&&u<12&&(++u,f=f<<1|1)),C=F}else o=c+1,f=(1<<(u=a+1))-1,C=null}return v!==r&&Ot.log("Warning, gif stream shorter than expected."),t}/** * @license Copyright (c) 2008, Adobe Systems Incorporated All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Adobe Systems Incorporated nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */function Hl(n){var e,t,r,a,i,c=Math.floor,o=new Array(64),u=new Array(64),f=new Array(64),p=new Array(64),w=new Array(65535),v=new Array(65535),d=new Array(64),E=new Array(64),C=[],F=0,L=7,D=new Array(64),q=new Array(64),M=new Array(64),Q=new Array(256),ae=new Array(2048),se=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],V=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],B=[0,1,2,3,4,5,6,7,8,9,10,11],X=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],_=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],N=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],U=[0,1,2,3,4,5,6,7,8,9,10,11],$=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],re=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function oe(A,j){for(var z=0,W=0,Y=new Array,te=1;te<=16;te++){for(var ce=1;ce<=A[te];ce++)Y[j[W]]=[],Y[j[W]][0]=z,Y[j[W]][1]=te,W++,z++;z*=2}return Y}function he(A){for(var j=A[0],z=A[1]-1;z>=0;)j&1<>8&255),ee(255&A)}function me(A,j,z,W,Y){for(var te,ce=Y[0],le=Y[240],ve=(function(ye,Ge){var Re,$e,Ye,St,vt,at,bt,ft,Ue,ht,Ve=0;for(Ue=0;Ue<8;++Ue){Re=ye[Ve],$e=ye[Ve+1],Ye=ye[Ve+2],St=ye[Ve+3],vt=ye[Ve+4],at=ye[Ve+5],bt=ye[Ve+6];var Qt=Re+(ft=ye[Ve+7]),At=Re-ft,gt=$e+bt,mt=$e-bt,Ht=Ye+at,Ze=Ye-at,Bt=St+vt,et=St-vt,lt=Qt+Bt,Wt=Qt-Bt,wt=gt+Ht,Ke=gt-Ht;ye[Ve]=lt+wt,ye[Ve+4]=lt-wt;var Nt=.707106781*(Ke+Wt);ye[Ve+2]=Wt+Nt,ye[Ve+6]=Wt-Nt;var Pi=.382683433*((lt=et+Ze)-(Ke=mt+At)),Sn=.5411961*lt+Pi,qr=1.306562965*Ke+Pi,Ar=.707106781*(wt=Ze+mt),Qe=At+Ar,Ur=At-Ar;ye[Ve+5]=Ur+Sn,ye[Ve+3]=Ur-Sn,ye[Ve+1]=Qe+qr,ye[Ve+7]=Qe-qr,Ve+=8}for(Ve=0,Ue=0;Ue<8;++Ue){Re=ye[Ve],$e=ye[Ve+8],Ye=ye[Ve+16],St=ye[Ve+24],vt=ye[Ve+32],at=ye[Ve+40],bt=ye[Ve+48];var zr=Re+(ft=ye[Ve+56]),ir=Re-ft,ar=$e+bt,Jt=$e-bt,bn=Ye+at,yn=Ye-at,Ci=St+vt,oi=St-vt,dr=zr+Ci,Lr=zr-Ci,pr=ar+bn,gr=ar-bn;ye[Ve]=dr+pr,ye[Ve+32]=dr-pr;var sr=.707106781*(gr+Lr);ye[Ve+16]=Lr+sr,ye[Ve+48]=Lr-sr;var Ii=.382683433*((dr=oi+yn)-(gr=Jt+ir)),Sr=.5411961*dr+Ii,Ei=1.306562965*gr+Ii,aa=.707106781*(pr=yn+Jt),sa=ir+aa,oa=ir-aa;ye[Ve+40]=oa+Sr,ye[Ve+24]=oa-Sr,ye[Ve+8]=sa+Ei,ye[Ve+56]=sa-Ei,Ve++}for(Ue=0;Ue<64;++Ue)ht=ye[Ue]*Ge[Ue],d[Ue]=ht>0?ht+.5|0:ht-.5|0;return d})(A,j),Se=0;Se<64;++Se)E[se[Se]]=ve[Se];var Ee=E[0]-z;z=E[0],Ee==0?he(W[0]):(he(W[v[te=32767+Ee]]),he(w[te]));for(var Ie=63;Ie>0&&E[Ie]==0;)Ie--;if(Ie==0)return he(ce),z;for(var ke,P=1;P<=Ie;){for(var Ne=P;E[P]==0&&P<=Ie;)++P;var ze=P-Ne;if(ze>=16){ke=ze>>4;for(var Te=1;Te<=ke;++Te)he(le);ze&=15}te=32767+E[P],he(Y[(ze<<4)+v[te]]),he(w[te]),P++}return Ie!=63&&he(ce),z}function be(A){A=Math.min(Math.max(A,1),100),i!=A&&((function(j){for(var z=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],W=0;W<64;W++){var Y=c((z[W]*j+50)/100);Y=Math.min(Math.max(Y,1),255),o[se[W]]=Y}for(var te=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],ce=0;ce<64;ce++){var le=c((te[ce]*j+50)/100);le=Math.min(Math.max(le,1),255),u[se[ce]]=le}for(var ve=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],Se=0,Ee=0;Ee<8;Ee++)for(var Ie=0;Ie<8;Ie++)f[Se]=1/(o[se[Se]]*ve[Ee]*ve[Ie]*8),p[Se]=1/(u[se[Se]]*ve[Ee]*ve[Ie]*8),Se++})(A<50?Math.floor(5e3/A):Math.floor(200-2*A)),i=A)}this.encode=function(A,j){j&&be(j),C=new Array,F=0,L=7,ue(65496),ue(65504),ue(16),ee(74),ee(70),ee(73),ee(70),ee(0),ee(1),ee(1),ee(0),ue(1),ue(1),ee(0),ee(0),(function(){ue(65499),ue(132),ee(0);for(var $e=0;$e<64;$e++)ee(o[$e]);ee(1);for(var Ye=0;Ye<64;Ye++)ee(u[Ye])})(),(function($e,Ye){ue(65472),ue(17),ee(8),ue(Ye),ue($e),ee(3),ee(1),ee(17),ee(0),ee(2),ee(17),ee(1),ee(3),ee(17),ee(1)})(A.width,A.height),(function(){ue(65476),ue(418),ee(0);for(var $e=0;$e<16;$e++)ee(V[$e+1]);for(var Ye=0;Ye<=11;Ye++)ee(B[Ye]);ee(16);for(var St=0;St<16;St++)ee(X[St+1]);for(var vt=0;vt<=161;vt++)ee(_[vt]);ee(1);for(var at=0;at<16;at++)ee(N[at+1]);for(var bt=0;bt<=11;bt++)ee(U[bt]);ee(17);for(var ft=0;ft<16;ft++)ee($[ft+1]);for(var Ue=0;Ue<=161;Ue++)ee(re[Ue])})(),ue(65498),ue(12),ee(3),ee(1),ee(0),ee(2),ee(17),ee(3),ee(17),ee(0),ee(63),ee(0);var z=0,W=0,Y=0;F=0,L=7,this.encode.displayName="_encode_";for(var te,ce,le,ve,Se,Ee,Ie,ke,P,Ne=A.data,ze=A.width,Te=A.height,ye=4*ze,Ge=0;Ge>3)*ye+(Ie=4*(7&P)),Ge+ke>=Te&&(Ee-=ye*(Ge+1+ke-Te)),te+Ie>=ye&&(Ee-=te+Ie-ye+4),ce=Ne[Ee++],le=Ne[Ee++],ve=Ne[Ee++],D[P]=(ae[ce]+ae[le+256|0]+ae[ve+512|0]>>16)-128,q[P]=(ae[ce+768|0]+ae[le+1024|0]+ae[ve+1280|0]>>16)-128,M[P]=(ae[ce+1280|0]+ae[le+1536|0]+ae[ve+1792|0]>>16)-128;z=me(D,f,z,e,r),W=me(q,p,W,t,a),Y=me(M,p,Y,t,a),te+=32}Ge+=8}if(L>=0){var Re=[];Re[1]=L+1,Re[0]=(1<N;N++)if(B[X+N]!=_.charCodeAt(N))return!0;return!1}function r(B,X,_,N,U){for(var $=0;$$+1?[]:new X),!(re.length<$+1));he++)N(U[he],$+1,re)})(_,0,B),_}var u=function(){var B=this;function X(s,l){for(var g=1<>>0;s&g;)g>>>=1;return g?(s&g-1)+g:s}function _(s,l,g,m,y){e(!(m%g));do s[l+(m-=g)]=y;while(0=y),512>=y)var x=i(512);else if((x=i(y))==null)return 0;return(function(k,S,I,T,G,ie){var O,J,K=S,de=1<O;++O){if(ne[O]>1<(dt-=ne[O]))return 0;for(;0=O;++O,G<<=1){if(Oe+=dt<<=1,0>(dt-=ne[O]))return 0;for(;0Le&&!(0>=(ge-=ne[Le]));)++Le,ge<<=1;de+=Me=1<<(ge=Le-I),k[S+(Le=He&xe)].g=ge+I,k[S+Le].value=K-S-Le}T.g=O-I,T.value=ie[J++],_(k,K+(He>>I),G,Me,T),He=X(He,O)}}return Oe!=2*pe[15]-1?0:de})(s,l,g,m,y,x)}function U(){this.value=this.g=0}function $(){this.value=this.g=0}function re(){this.G=c(5,U),this.H=i(5),this.jc=this.Qb=this.qb=this.nd=0,this.pd=c(ya,$)}function oe(s,l,g,m){e(s!=null),e(l!=null),e(2147483648>m),s.Ca=254,s.I=0,s.b=-8,s.Ka=0,s.oa=l,s.pa=g,s.Jd=l,s.Yc=g+m,s.Zc=4<=m?g+m-4+1:g,ce(s)}function he(s,l){for(var g=0;0m),s.Sb=m,s.Ra=0,s.u=0,s.h=0,4>>=8,s.Ra+=s.oa[s.pa+s.bb]<>>0,++s.bb,s.u-=8;W(s)&&(s.h=1,s.u=0)}function be(s,l){if(e(0<=l),!s.h&&l<=ts){var g=z(s)&Ui[l];return s.u+=l,me(s),g}return s.h=1,s.u=0}function A(){this.b=this.Ca=this.I=0,this.oa=[],this.pa=0,this.Jd=[],this.Yc=0,this.Zc=[],this.Ka=0}function j(){this.Ra=0,this.oa=[],this.h=this.u=this.bb=this.Sb=this.pa=0}function z(s){return s.Ra>>>(s.u&jn-1)>>>0}function W(s){return e(s.bb<=s.Sb),s.h||s.bb==s.Sb&&s.u>jn}function Y(s,l){s.u=l,s.h=W(s)}function te(s){s.u>=Un&&(e(s.u>=Un),me(s))}function ce(s){e(s!=null&&s.oa!=null),s.pa>>0,s.b+=8):(e(s!=null&&s.oa!=null),s.pas.b&&ce(s);var m=s.b,y=g*l>>>8,x=(s.I>>>m>y)+0;for(x?(g-=y,s.I-=y+1<>>0):g=y+1,m=g,y=0;256<=m;)y+=8,m>>=8;return m=7^y+_a[m],s.b-=m,s.Ca=(g<>24&255,s[l+1]=g>>16&255,s[l+2]=g>>8&255,s[l+3]=255&g}function Ee(s,l){return s[l+0]|s[l+1]<<8}function Ie(s,l){return Ee(s,l)|s[l+2]<<16}function ke(s,l){return Ee(s,l)|Ee(s,l+2)<<16}function P(s,l){var g=1<=y||0>=x?0:(g[0]=y,m[0]=x,1)}function ye(s,l){return s+(1<>>l}function Ge(s,l){return((4278255360&s)+(4278255360&l)>>>0&4278255360)+((16711935&s)+(16711935&l)>>>0&16711935)>>>0}function Re(s,l){B[l]=function(g,m,y,x,k,S,I){var T;for(T=0;T>>1)+(s&l)>>>0}function St(s){return 0<=s&&256>s?s:0>s?0:255>1))}function at(s,l,g){return Math.abs(l-g)-Math.abs(s-g)}function bt(s,l,g,m,y,x,k){for(m=x[k-1],g=0;g>8&255,I=16711935&(I=(I=16711935&k)+((S<<16)+S));m[y+x]=(4278255360&k)+I>>>0}}function Ue(s,l){l.jd=255&s,l.hd=s>>8&255,l.ud=s>>16&255}function ht(s,l,g,m,y,x){var k;for(k=0;k>>8,T=S,G=255&(G=(G=S>>>16)+((s.jd<<24>>24)*(I<<24>>24)>>>5));T=255&(T=(T+=(s.hd<<24>>24)*(I<<24>>24)>>>5)+((s.ud<<24>>24)*(G<<24>>24)>>>5)),y[x+k]=(4278255360&S)+(G<<16)+T}}function Ve(s,l,g,m,y){B[l]=function(x,k,S,I,T,G,ie,O,J){for(I=ie;I>x.b,J=x.Ea,K=x.K[0],de=x.w;if(8>O)for(x=(1<>=O}else B["VP8LMapColor"+g](I,T,K,de,G,ie,k,S,J)}}function Qt(s,l,g,m,y){for(g=l+g;l>16&255,m[y++]=x>>8&255,m[y++]=255&x}}function At(s,l,g,m,y){for(g=l+g;l>16&255,m[y++]=x>>8&255,m[y++]=255&x,m[y++]=x>>24&255}}function gt(s,l,g,m,y){for(g=l+g;l>16&240|k>>12&15,k=240&k|k>>28&15;m[y++]=x,m[y++]=k}}function mt(s,l,g,m,y){for(g=l+g;l>16&248|k>>13&7,k=k>>5&224|k>>3&31;m[y++]=x,m[y++]=k}}function Ht(s,l,g,m,y){for(g=l+g;l>8&255,m[y++]=x>>16&255}}function Ze(s,l,g,m,y,x){if(x==0)for(g=l+g;l>24|x[1]>>8&65280|x[2]<<8&16711680|x[3]<<24)>>>0),y+=32;else r(m,y,s,l,g)}function Bt(s,l){B[l][0]=B[s+"0"],B[l][1]=B[s+"1"],B[l][2]=B[s+"2"],B[l][3]=B[s+"3"],B[l][4]=B[s+"4"],B[l][5]=B[s+"5"],B[l][6]=B[s+"6"],B[l][7]=B[s+"7"],B[l][8]=B[s+"8"],B[l][9]=B[s+"9"],B[l][10]=B[s+"10"],B[l][11]=B[s+"11"],B[l][12]=B[s+"12"],B[l][13]=B[s+"13"],B[l][14]=B[s+"0"],B[l][15]=B[s+"0"]}function et(s){return s==ol||s==ll||s==Vs||s==cl}function lt(){this.eb=[],this.size=this.A=this.fb=0}function Wt(){this.y=[],this.f=[],this.ea=[],this.F=[],this.Tc=this.Ed=this.Cd=this.Fd=this.lb=this.Db=this.Ab=this.fa=this.J=this.W=this.N=this.O=0}function wt(){this.Rd=this.height=this.width=this.S=0,this.f={},this.f.RGBA=new lt,this.f.kb=new Wt,this.sd=null}function Ke(){this.width=[0],this.height=[0],this.Pd=[0],this.Qd=[0],this.format=[0]}function Nt(){this.Id=this.fd=this.Md=this.hb=this.ib=this.da=this.bd=this.cd=this.j=this.v=this.Da=this.Sd=this.ob=0}function Pi(s){return alert("todo:WebPSamplerProcessPlane"),s.T}function Sn(s,l){var g=s.T,m=l.ba.f.RGBA,y=m.eb,x=m.fb+s.ka*m.A,k=ur[l.ba.S],S=s.y,I=s.O,T=s.f,G=s.N,ie=s.ea,O=s.W,J=l.cc,K=l.dc,de=l.Mc,ne=l.Nc,pe=s.ka,ge=s.ka+s.T,Le=s.U,xe=Le+1>>1;for(pe==0?k(S,I,null,null,T,G,ie,O,T,G,ie,O,y,x,null,null,Le):(k(l.ec,l.fc,S,I,J,K,de,ne,T,G,ie,O,y,x-m.A,y,x,Le),++g);pe+2g,y=g==$s||g==Hs||g==Ws||g==sl||g==12||et(g);if(l.memory=null,l.Ib=null,l.Jb=null,l.Nd=null,!lr(l.Oa,s,y?11:12))return 0;if(y&&et(g)&&Yr(),s.da)alert("todo:use_scaling");else{if(m){if(l.Ib=Pi,s.Kb){if(g=s.U+1>>1,l.memory=i(s.U+2*g),l.memory==null)return 0;l.ec=l.memory,l.fc=0,l.cc=l.ec,l.dc=l.fc+s.U,l.Mc=l.cc,l.Nc=l.dc+g,l.Ib=Sn,Yr()}}else alert("todo:EmitYUV");y&&(l.Jb=qr,m&&Yt())}if(m&&!Hc){for(s=0;256>s;++s)c1[s]=89858*(s-128)+Ys>>Gs,f1[s]=-22014*(s-128)+Ys,h1[s]=-45773*(s-128),u1[s]=113618*(s-128)+Ys>>Gs;for(s=os;s>Gs,d1[s-os]=Nr(l,255),p1[s-os]=Nr(l+8>>4,15);Hc=1}return 1}function Qe(s){var l=s.ma,g=s.U,m=s.T;return e(!(1&s.ka)),0>=g||0>=m?0:(g=l.Ib(s,l),l.Jb!=null&&l.Jb(s,l,g),l.Dc+=g,1)}function Ur(s){s.ma.memory=null}function zr(s,l,g,m){return be(s,8)!=47?0:(l[0]=be(s,14)+1,g[0]=be(s,14)+1,m[0]=be(s,1),be(s,3)!=0?0:!s.h)}function ir(s,l){if(4>s)return s+1;var g=s-2>>1;return(2+(1&s)<>4)*s+(8-(15&g)))?g:1;var g}function Jt(s,l,g){var m=z(g),y=s[l+=255&m].g-8;return 0>>0,e(8>=g.g),s.g}function yn(s,l,g){var m=s.xc;return e((l=m==0?0:s.vc[s.md*(g>>m)+(l>>m)])>Me.b)*Oe;deLe&&(qe=Le),(0,mr[yt[pn++]>>8&15])(O,J+ +pt,pe,ge+pt-Le,qe-pt,pe,ge+pt),pt=qe}J+=Le,ge+=Le,++de&He||(Me+=Oe)}ie!=T.nc&&r(I,S-K,I,S+(ie-G-1)*K,K);break;case 1:for(K=O,ne=J,Le=(O=T.Ea)-(ge=O&~(pe=(J=1<>T.b)*de;G=y),0x.o&&(m=x.o),g=m?g=0:(y[0]+=4*x.v,x.ka=g-x.j,x.U=x.va-x.v,x.T=m-g,g=1),g){if(S=S[0],11>(g=s.ca).S){var G=g.f.RGBA,ie=(m=g.S,y=x.U,x=x.T,T=G.eb,G.A),O=x;for(G=G.fb+s.Ma*G.A;0m){var y=s.l.width,x=g.ca,k=g.tb+y*m,S=s.V,I=s.Ba+s.c*m,T=s.gc;e(s.ab==1),e(T[0].hc==3),il(T[0],m,l,S,I,x,k),Lr(g,m,l,x,k,y)}s.C=s.Ma=l}function gr(s,l,g,m,y,x,k){var S=s.$/m,I=s.$%m,T=s.m,G=s.s,ie=g+s.$,O=ie;y=g+m*y;var J=g+m*x,K=280+G.ua,de=s.Pb?S:16777216,ne=0=de){var He=ie-g;e((de=s).Pb),de.wd=de.m,de.xd=He,0dt.g?(Y(xe,xe.u+dt.g),He[Oe]=dt.value,xe=0):(Y(xe,xe.u+dt.g-256),e(256<=dt.value),xe=dt.value),xe==0&&(Le=!0)}else xe=Jt(ge.G[0],ge.H[0],T);if(T.h)break;if(Le||256>xe){if(!Le)if(ge.nd)l[ie]=(ge.qb|xe<<8)>>>0;else{if(te(T),Le=Jt(ge.G[1],ge.H[1],T),te(T),He=Jt(ge.G[2],ge.H[2],T),Oe=Jt(ge.G[3],ge.H[3],T),T.h)break;l[ie]=(Oe<<24|Le<<16|xe<<8|He)>>>0}if(Le=!1,++ie,++I>=m&&(I=0,++S,k!=null&&S<=x&&!(S%16)&&k(s,S),ne!=null))for(;O>>ne.Mb]=xe}else if(280>xe){if(xe=ir(xe-256,T),He=Jt(ge.G[4],ge.H[4],T),te(T),He=ar(m,He=ir(He,T)),T.h)break;if(ie-g=m;)I-=m,++S,k!=null&&S<=x&&!(S%16)&&k(s,S);if(e(ie<=y),I&pe&&(ge=yn(G,I,S)),ne!=null)for(;O>>ne.Mb]=xe}else{if(!(xe>>ne.Mb]=xe;xe=ie,e(!(Le>>>(He=ne).Xa)),l[xe]=He.X[Le],Le=!0}Le||e(T.h==W(T))}if(s.Pb&&T.h&&iex?x:S),s.a=0,s.$=ie-g}return 1}return s.a=3,0}function sr(s){e(s!=null),s.vc=null,s.yc=null,s.Ya=null;var l=s.Wa;l!=null&&(l.X=null),s.vb=null,e(s!=null)}function Ii(){var s=new De;return s==null?null:(s.a=0,s.xb=Mc,Bt("Predictor","VP8LPredictors"),Bt("Predictor","VP8LPredictors_C"),Bt("PredictorAdd","VP8LPredictorsAdd"),Bt("PredictorAdd","VP8LPredictorsAdd_C"),xa=ft,$i=ht,ns=Qt,rs=At,ka=gt,Hi=mt,Wi=Ht,B.VP8LMapColor32b=cn,B.VP8LMapColor8b=Fr,s)}function Sr(s,l,g,m,y){var x=1,k=[s],S=[l],I=m.m,T=m.s,G=null,ie=0;e:for(;;){if(g)for(;x&&be(I,1);){var O=k,J=S,K=m,de=1,ne=K.m,pe=K.gc[K.ab],ge=be(ne,2);if(K.Oc&1<=K.ab),ge){case 0:case 1:pe.b=be(ne,3)+2,de=Sr(ye(pe.Ea,pe.b),ye(pe.nc,pe.b),0,K,pe.K),pe.K=pe.K[0];break;case 3:var Le,xe=be(ne,8)+1,He=16>Me.b),pn=i(yt);if(pn==null)Le=0;else{var pt=Me.K[0],qe=Me.w;for(pn[0]=Me.K[0][0],Oe=1;Oe<1*dt;++Oe)pn[Oe]=Ge(pt[qe+Oe],pn[Oe-1]);for(;Oe<4*yt;++Oe)pn[Oe]=0;Me.K[0]=null,Me.K[0]=pn,Le=1}}de=Le;break;case 2:break;default:e(0)}x=de}}if(k=k[0],S=S[0],x&&be(I,1)&&!(x=1<=(ie=be(I,4))&&11>=ie)){m.a=3;break e}var Ce;if(Ce=x)t:{var tn,ut,xt,zt=m,xn=k,Bn=S,Zt=ie,In=g,Dn=zt.m,gn=zt.s,Lt=[null],Pt=1,Xt=0,Ct=Zf[Zt];n:for(;;){if(In&&be(Dn,1)){var kn=be(Dn,3)+2,br=ye(xn,kn),nn=ye(Bn,kn),zn=br*nn;if(!Sr(br,nn,0,zt,Lt))break n;for(Lt=Lt[0],gn.xc=kn,tn=0;tn>8&65535;Lt[tn]=Tt,Tt>=Pt&&(Pt=Tt+1)}}if(Dn.h)break n;for(ut=0;5>ut;++ut){var mn=Bc[ut];!ut&&0=Mn),Zn=Jn;var $n=i(Xt);if(Zn==null||$n==null||Yn==null){zt.a=1;break n}var Xn=Yn;for(tn=xt=0;tnut;++ut){mn=Bc[ut],Kn[ut]=Xn,wr[ut]=xt,!ut&&0eo)break r}else gl=eo;for(cs=0;csSa)Xc[cs++]=Sa,Sa!=0&&(Kc=Sa);else{var A1=Sa==16,tu=Sa-16,L1=Vf[tu],nu=be(wi,Wf[tu])+L1;if(cs+nu>eo)break r;for(var S1=A1?Kc:0;0=ut){var us,vl=$n[0];for(us=1;usvl&&(vl=$n[us]);An+=vl}}if(qt.nd=Kr,qt.Qb=0,Kr&&(qt.qb=(Kn[3][wr[3]+0].value<<24|Kn[1][wr[1]+0].value<<16|Kn[2][wr[2]+0].value)>>>0,Vi==0&&256>Kn[0][wr[0]+0].value&&(qt.Qb=1,qt.qb+=Kn[0][wr[0]+0].value<<8)),qt.jc=!qt.Qb&&6>An,qt.jc){var to,Qr=qt;for(to=0;to>=bn(no,8,_i),yi>>=bn(Qr.G[1][Qr.H[1]+yi],16,_i),yi>>=bn(Qr.G[2][Qr.H[2]+yi],0,_i),bn(Qr.G[3][Qr.H[3]+yi],24,_i))}}}gn.vc=Lt,gn.Wb=Pt,gn.Ya=Zn,gn.yc=Yn,Ce=1;break t}Ce=0}if(!(x=Ce)){m.a=3;break e}if(0m+1?[]:0),!(y.lengths?0:s>l?l:s}function la(){this.T=this.U=this.ka=this.height=this.width=0,this.y=[],this.f=[],this.ea=[],this.Rc=this.fa=this.W=this.N=this.O=0,this.ma="void",this.put="VP8IoPutHook",this.ac="VP8IoSetupHook",this.bc="VP8IoTeardownHook",this.ha=this.Kb=0,this.data=[],this.hb=this.ib=this.da=this.o=this.j=this.va=this.v=this.Da=this.ob=this.w=0,this.F=[],this.J=0}function Uo(){var s=new Ps;return s!=null&&(s.a=0,s.sc="OK",s.cb=0,s.Xb=0,ss||(ss=ca)),s}function on(s,l,g){return s.a==0&&(s.a=l,s.sc=g,s.cb=0),0}function Cs(s,l,g){return 3<=g&&s[l+0]==157&&s[l+1]==1&&s[l+2]==42}function Pr(s,l){if(s==null)return 0;if(s.a=0,s.sc="OK",l==null)return on(s,2,"null VP8Io passed to VP8GetHeaders()");var g=l.data,m=l.w,y=l.ha;if(4>y)return on(s,7,"Truncated header.");var x=g[m+0]|g[m+1]<<8|g[m+2]<<16,k=s.Od;if(k.Rb=!(1&x),k.td=x>>1&7,k.yd=x>>4&1,k.ub=x>>5,3y)return on(s,7,"cannot parse picture header");if(!Cs(g,m,y))return on(s,3,"Bad code word");S.c=16383&(g[m+4]<<8|g[m+3]),S.Td=g[m+4]>>6,S.i=16383&(g[m+6]<<8|g[m+5]),S.Ud=g[m+6]>>6,m+=7,y-=7,s.za=S.c+15>>4,s.Ub=S.i+15>>4,l.width=S.c,l.height=S.i,l.Da=0,l.j=0,l.v=0,l.va=l.width,l.o=l.height,l.da=0,l.ib=l.width,l.hb=l.height,l.U=l.width,l.T=l.height,a((x=s.Pa).jb,0,255,x.jb.length),e((x=s.Qa)!=null),x.Cb=0,x.Bb=0,x.Fb=1,a(x.Zb,0,0,x.Zb.length),a(x.Lb,0,0,x.Lb)}if(k.ub>y)return on(s,7,"bad partition length");oe(x=s.m,g,m,k.ub),m+=k.ub,y-=k.ub,k.Rb&&(S.Ld=le(x),S.Kd=le(x)),S=s.Qa;var I,T=s.Pa;if(e(x!=null),e(S!=null),S.Cb=le(x),S.Cb){if(S.Bb=le(x),le(x)){for(S.Fb=le(x),I=0;4>I;++I)S.Zb[I]=le(x)?ee(x,7):0;for(I=0;4>I;++I)S.Lb[I]=le(x)?ee(x,6):0}if(S.Bb)for(I=0;3>I;++I)T.jb[I]=le(x)?he(x,8):255}else S.Bb=0;if(x.Ka)return on(s,3,"cannot parse segment header");if((S=s.ed).zd=le(x),S.Tb=he(x,6),S.wb=he(x,3),S.Pc=le(x),S.Pc&&le(x)){for(T=0;4>T;++T)le(x)&&(S.vd[T]=ee(x,6));for(T=0;4>T;++T)le(x)&&(S.od[T]=ee(x,6))}if(s.L=S.Tb==0?0:S.zd?1:2,x.Ka)return on(s,3,"cannot parse filter header");var G=y;if(y=I=m,m=I+G,S=G,s.Xb=(1<S&&(ie=S),oe(s.Jc[+G],g,I,ie),I+=ie,S-=ie,y+=3}oe(s.Jc[+T],g,I,S),g=Iie;++ie){if(G.Cb){var O=G.Zb[ie];G.Fb||(O+=g)}else{if(0>16,8>J.Eb[1]&&(J.Eb[1]=8),J.Qc[0]=ul[Nr(O+T,117)],J.Qc[1]=hl[Nr(O+I,127)],J.lc=O+I}if(!k.Rb)return on(s,4,"Not a key frame.");for(le(x),k=s.Pa,g=0;4>g;++g){for(y=0;8>y;++y)for(m=0;3>m;++m)for(S=0;11>S;++S)T=ve(x,n1[g][y][m][S])?he(x,8):e1[g][y][m][S],k.Wc[g][y].Yb[m][S]=T;for(y=0;17>y;++y)k.Xc[g][y]=k.Wc[g][r1[y]]}return s.kc=le(x),s.kc&&(s.Bd=he(x,8)),s.cb=1}function ca(s,l,g,m,y,x,k){var S=l[y].Yb[g];for(g=0;16>y;++y){if(!ve(s,S[g+0]))return y;for(;!ve(s,S[g+1]);)if(S=l[++y].Yb[0],g=0,y==16)return 16;var I=l[y+1].Yb;if(ve(s,S[g+2])){var T=s,G=0;if(ve(T,(O=S)[(ie=g)+3]))if(ve(T,O[ie+6])){for(S=0,ie=2*(G=ve(T,O[ie+8]))+(O=ve(T,O[ie+9+G])),G=0,O=Kf[ie];O[S];++S)G+=G+ve(T,O[S]);G+=3+(8<(T=s).b&&ce(T);var ie,O=T.b,J=(ie=T.Ca>>1)-(T.I>>O)>>31;--T.b,T.Ca+=J,T.Ca|=1,T.I-=(ie+1&J)<>3),s[l+g+32*m]=-256&y?0>y?0:255:y}function ua(s,l,g,m,y,x){Vn(s,l,0,g,m+y),Vn(s,l,1,g,m+x),Vn(s,l,2,g,m-x),Vn(s,l,3,g,m-y)}function $r(s){return(20091*s>>16)+s}function _n(s,l,g,m){var y,x=0,k=i(16);for(y=0;4>y;++y){var S=s[l+0]+s[l+8],I=s[l+0]-s[l+8],T=(35468*s[l+4]>>16)-$r(s[l+12]),G=$r(s[l+4])+(35468*s[l+12]>>16);k[x+0]=S+G,k[x+1]=I+T,k[x+2]=I-T,k[x+3]=S-G,x+=4,l++}for(y=x=0;4>y;++y)S=(s=k[x+0]+4)+k[x+8],I=s-k[x+8],T=(35468*k[x+4]>>16)-$r(k[x+12]),Vn(g,m,0,0,S+(G=$r(k[x+4])+(35468*k[x+12]>>16))),Vn(g,m,1,0,I+T),Vn(g,m,2,0,I-T),Vn(g,m,3,0,S-G),x++,m+=32}function Is(s,l,g,m){var y=s[l+0]+4,x=35468*s[l+4]>>16,k=$r(s[l+4]),S=35468*s[l+1]>>16;ua(g,m,0,y+k,s=$r(s[l+1]),S),ua(g,m,1,y+x,s,S),ua(g,m,2,y-x,s,S),ua(g,m,3,y-k,s,S)}function zo(s,l,g,m,y){_n(s,l,g,m),y&&_n(s,l+16,g,m+4)}function $o(s,l,g,m){Jr(s,l+0,g,m,1),Jr(s,l+32,g,m+128,1)}function Ho(s,l,g,m){var y;for(s=s[l+0]+4,y=0;4>y;++y)for(l=0;4>l;++l)Vn(g,m,l,y,s)}function Cr(s,l,g,m){s[l+0]&&Cn(s,l+0,g,m),s[l+16]&&Cn(s,l+16,g,m+4),s[l+32]&&Cn(s,l+32,g,m+128),s[l+48]&&Cn(s,l+48,g,m+128+4)}function Es(s,l,g,m){var y,x=i(16);for(y=0;4>y;++y){var k=s[l+0+y]+s[l+12+y],S=s[l+4+y]+s[l+8+y],I=s[l+4+y]-s[l+8+y],T=s[l+0+y]-s[l+12+y];x[0+y]=k+S,x[8+y]=k-S,x[4+y]=T+I,x[12+y]=T-I}for(y=0;4>y;++y)k=(s=x[0+4*y]+3)+x[3+4*y],S=x[1+4*y]+x[2+4*y],I=x[1+4*y]-x[2+4*y],T=s-x[3+4*y],g[m+0]=k+S>>3,g[m+16]=T+I>>3,g[m+32]=k-S>>3,g[m+48]=T-I>>3,m+=64}function ha(s,l,g){var m,y=l-32,x=Gn,k=255-s[y-1];for(m=0;mg;++g)r(s,l+32*g,s,l-32,16)}function Go(s,l){var g;for(g=16;0m;++m)a(l,g+32*m,s,16)}function Fs(s,l){var g,m=16;for(g=0;16>g;++g)m+=s[l-1+32*g]+s[l+g-32];li(m>>5,s,l)}function ci(s,l){var g,m=8;for(g=0;16>g;++g)m+=s[l-1+32*g];li(m>>4,s,l)}function Yo(s,l){var g,m=8;for(g=0;16>g;++g)m+=s[l+g-32];li(m>>4,s,l)}function Fi(s,l){li(128,s,l)}function tt(s,l,g){return s+2*l+g+2>>2}function Jo(s,l){var g,m=l-32;for(m=new Uint8Array([tt(s[m-1],s[m+0],s[m+1]),tt(s[m+0],s[m+1],s[m+2]),tt(s[m+1],s[m+2],s[m+3]),tt(s[m+2],s[m+3],s[m+4])]),g=0;4>g;++g)r(s,l+32*g,m,0,m.length)}function Zo(s,l){var g=s[l-1],m=s[l-1+32],y=s[l-1+64],x=s[l-1+96];Se(s,l+0,16843009*tt(s[l-1-32],g,m)),Se(s,l+32,16843009*tt(g,m,y)),Se(s,l+64,16843009*tt(m,y,x)),Se(s,l+96,16843009*tt(y,x,x))}function Xo(s,l){var g,m=4;for(g=0;4>g;++g)m+=s[l+g-32]+s[l-1+32*g];for(m>>=3,g=0;4>g;++g)a(s,l+32*g,m,4)}function Ko(s,l){var g=s[l-1+0],m=s[l-1+32],y=s[l-1+64],x=s[l-1-32],k=s[l+0-32],S=s[l+1-32],I=s[l+2-32],T=s[l+3-32];s[l+0+96]=tt(m,y,s[l-1+96]),s[l+1+96]=s[l+0+64]=tt(g,m,y),s[l+2+96]=s[l+1+64]=s[l+0+32]=tt(x,g,m),s[l+3+96]=s[l+2+64]=s[l+1+32]=s[l+0+0]=tt(k,x,g),s[l+3+64]=s[l+2+32]=s[l+1+0]=tt(S,k,x),s[l+3+32]=s[l+2+0]=tt(I,S,k),s[l+3+0]=tt(T,I,S)}function Qo(s,l){var g=s[l+1-32],m=s[l+2-32],y=s[l+3-32],x=s[l+4-32],k=s[l+5-32],S=s[l+6-32],I=s[l+7-32];s[l+0+0]=tt(s[l+0-32],g,m),s[l+1+0]=s[l+0+32]=tt(g,m,y),s[l+2+0]=s[l+1+32]=s[l+0+64]=tt(m,y,x),s[l+3+0]=s[l+2+32]=s[l+1+64]=s[l+0+96]=tt(y,x,k),s[l+3+32]=s[l+2+64]=s[l+1+96]=tt(x,k,S),s[l+3+64]=s[l+2+96]=tt(k,S,I),s[l+3+96]=tt(S,I,I)}function Hr(s,l){var g=s[l-1+0],m=s[l-1+32],y=s[l-1+64],x=s[l-1-32],k=s[l+0-32],S=s[l+1-32],I=s[l+2-32],T=s[l+3-32];s[l+0+0]=s[l+1+64]=x+k+1>>1,s[l+1+0]=s[l+2+64]=k+S+1>>1,s[l+2+0]=s[l+3+64]=S+I+1>>1,s[l+3+0]=I+T+1>>1,s[l+0+96]=tt(y,m,g),s[l+0+64]=tt(m,g,x),s[l+0+32]=s[l+1+96]=tt(g,x,k),s[l+1+32]=s[l+2+96]=tt(x,k,S),s[l+2+32]=s[l+3+96]=tt(k,S,I),s[l+3+32]=tt(S,I,T)}function Wr(s,l){var g=s[l+0-32],m=s[l+1-32],y=s[l+2-32],x=s[l+3-32],k=s[l+4-32],S=s[l+5-32],I=s[l+6-32],T=s[l+7-32];s[l+0+0]=g+m+1>>1,s[l+1+0]=s[l+0+64]=m+y+1>>1,s[l+2+0]=s[l+1+64]=y+x+1>>1,s[l+3+0]=s[l+2+64]=x+k+1>>1,s[l+0+32]=tt(g,m,y),s[l+1+32]=s[l+0+96]=tt(m,y,x),s[l+2+32]=s[l+1+96]=tt(y,x,k),s[l+3+32]=s[l+2+96]=tt(x,k,S),s[l+3+64]=tt(k,S,I),s[l+3+96]=tt(S,I,T)}function el(s,l){var g=s[l-1+0],m=s[l-1+32],y=s[l-1+64],x=s[l-1+96];s[l+0+0]=g+m+1>>1,s[l+2+0]=s[l+0+32]=m+y+1>>1,s[l+2+32]=s[l+0+64]=y+x+1>>1,s[l+1+0]=tt(g,m,y),s[l+3+0]=s[l+1+32]=tt(m,y,x),s[l+3+32]=s[l+1+64]=tt(y,x,x),s[l+3+64]=s[l+2+64]=s[l+0+96]=s[l+1+96]=s[l+2+96]=s[l+3+96]=x}function tl(s,l){var g=s[l-1+0],m=s[l-1+32],y=s[l-1+64],x=s[l-1+96],k=s[l-1-32],S=s[l+0-32],I=s[l+1-32],T=s[l+2-32];s[l+0+0]=s[l+2+32]=g+k+1>>1,s[l+0+32]=s[l+2+64]=m+g+1>>1,s[l+0+64]=s[l+2+96]=y+m+1>>1,s[l+0+96]=x+y+1>>1,s[l+3+0]=tt(S,I,T),s[l+2+0]=tt(k,S,I),s[l+1+0]=s[l+3+32]=tt(g,k,S),s[l+1+32]=s[l+3+64]=tt(m,g,k),s[l+1+64]=s[l+3+96]=tt(y,m,g),s[l+1+96]=tt(x,y,m)}function da(s,l){var g;for(g=0;8>g;++g)r(s,l+32*g,s,l-32,8)}function Ga(s,l){var g;for(g=0;8>g;++g)a(s,l,s[l-1],8),l+=32}function Ir(s,l,g){var m;for(m=0;8>m;++m)a(l,g+32*m,s,8)}function nl(s,l){var g,m=8;for(g=0;8>g;++g)m+=s[l+g-32]+s[l-1+32*g];Ir(m>>4,s,l)}function pa(s,l){var g,m=4;for(g=0;8>g;++g)m+=s[l+g-32];Ir(m>>3,s,l)}function rl(s,l){var g,m=4;for(g=0;8>g;++g)m+=s[l-1+32*g];Ir(m>>3,s,l)}function Ya(s,l){Ir(128,s,l)}function ui(s,l,g){var m=s[l-g],y=s[l+0],x=3*(y-m)+al[1020+s[l-2*g]-s[l+g]],k=Us[112+(x+4>>3)];s[l-g]=Gn[255+m+Us[112+(x+3>>3)]],s[l+0]=Gn[255+y-k]}function Ja(s,l,g,m){var y=s[l+0],x=s[l+g];return cr[255+s[l-2*g]-s[l-g]]>m||cr[255+x-y]>m}function Ri(s,l,g,m){return 4*cr[255+s[l-g]-s[l+0]]+cr[255+s[l-2*g]-s[l+g]]<=m}function Za(s,l,g,m,y){var x=s[l-3*g],k=s[l-2*g],S=s[l-g],I=s[l+0],T=s[l+g],G=s[l+2*g],ie=s[l+3*g];return 4*cr[255+S-I]+cr[255+k-T]>m?0:cr[255+s[l-4*g]-x]<=y&&cr[255+x-k]<=y&&cr[255+k-S]<=y&&cr[255+ie-G]<=y&&cr[255+G-T]<=y&&cr[255+T-I]<=y}function ga(s,l,g,m){var y=2*m+1;for(m=0;16>m;++m)Ri(s,l+m,g,y)&&ui(s,l+m,g)}function Xa(s,l,g,m){var y=2*m+1;for(m=0;16>m;++m)Ri(s,l+m*g,1,y)&&ui(s,l+m*g,1)}function ma(s,l,g,m){var y;for(y=3;0>7,pe=18*ge+63>>7,ge=9*ge+63>>7;I[T-3*G]=Gn[255+I[T-3*G]+ge],I[T-2*G]=Gn[255+ie+pe],I[T-G]=Gn[255+O+ne],I[T+0]=Gn[255+J-ne],I[T+G]=Gn[255+K-pe],I[T+2*G]=Gn[255+de-ge]}l+=m}}function Gr(s,l,g,m,y,x,k,S){for(x=2*x+1;0>3)],de=Us[112+(de+3>>3)],ne=K+1>>1;I[T-2*G]=Gn[255+I[T-2*G]+ne],I[T-G]=Gn[255+ie+de],I[T+0]=Gn[255+O-K],I[T+G]=Gn[255+J-ne]}l+=m}}function Ts(s,l,g,m,y,x){Vr(s,l,g,1,16,m,y,x)}function Os(s,l,g,m,y,x){Vr(s,l,1,g,16,m,y,x)}function js(s,l,g,m,y,x){var k;for(k=3;0T?0:255:T)&255,T=I,y[x+S]=G}}function ln(s,l,g,m){var y=l.width,x=l.o;if(e(s!=null&&l!=null),0>g||0>=m||g+m>x)return null;if(!s.Cc){if(s.ga==null){var k;if(s.ga=new Be,(k=s.ga==null)||(k=l.width*l.o,e(s.Gb.length==0),s.Gb=i(k),s.Uc=0,s.Gb==null?k=0:(s.mb=s.Gb,s.nb=s.Uc,s.rc=null,k=1),k=!k),!k){k=s.ga;var S=s.Fa,I=s.P,T=s.qc,G=s.mb,ie=s.nb,O=I+1,J=T-1,K=k.l;if(e(S!=null&&G!=null&&l!=null),vi[0]=null,vi[1]=st,vi[2]=ct,vi[3]=_t,k.ca=G,k.tb=ie,k.c=l.width,k.i=l.height,e(0=T)l=0;else if(k.$a=3&S[I+0],k.Z=S[I+0]>>2&3,k.Lc=S[I+0]>>4&3,I=S[I+0]>>6&3,0>k.$a||1=k.c*k.i;k=!l}if(k)return null;s.ga.Lc!=1?s.Ga=0:m=x-g}e(s.ga!=null),e(g+m<=x);e:{if(l=(S=s.ga).c,x=S.l.o,S.$a==0){if(O=s.rc,J=s.Vc,K=s.Fa,I=s.P+1+g*l,T=s.mb,G=s.nb+g*l,e(I<=s.P+s.qc),S.Z!=0)for(e(vi[S.Z]!=null),k=0;k=l)l=1;else if(S.ic||Yt(),S.ic){S=k.V,O=k.Ba,J=k.c;var de=k.i,ne=(K=1,I=k.$/J,T=k.$%J,G=k.m,ie=k.s,k.$),pe=J*de,ge=J*l,Le=ie.wc,xe=ne(de=Jt(xe.G[0],xe.H[0],G)))S[O+ne]=de,++ne,++T>=J&&(T=0,++I<=l&&!(I%16)&&pr(k,I));else{if(!(280>de)){K=0;break t}de=ir(de-256,G);var He,Oe=Jt(xe.G[4],xe.H[4],G);if(te(G),!(ne>=(Oe=ar(J,Oe=ir(Oe,G)))&&pe-ne>=de)){K=0;break t}for(He=0;He=J;)T-=J,++I<=l&&!(I%16)&&pr(k,I);nel?l:I);break t}!K||G.h&&ne=x&&(s.Cc=1),m=1}if(!m)return null;if(s.Cc&&((m=s.ga)!=null&&(m.mc=null),s.ga=null,0>23,S[I+4*k+1]=S[I+4*k+1]*ie>>23,S[I+4*k+2]=S[I+4*k+2]*ie>>23)}l+=x}}function Et(s,l,g,m,y){for(;0>4)*I>>16;s[l+2*x+0]=(240&k|k>>4)*I>>16&240|(15&k|k<<4)*I>>16>>4&15,s[l+2*x+1]=240&T|S}l+=y}}function Ut(s,l,g,m,y,x,k,S){var I,T,G=255;for(T=0;T>8}function Yt(){as=Rt,Nc=Et,Pc=Ut,Cc=Gt}function Nn(s,l,g){B[s]=function(m,y,x,k,S,I,T,G,ie,O,J,K,de,ne,pe,ge,Le){var xe,He=Le-1>>1,Oe=S[I+0]|T[G+0]<<16,dt=ie[O+0]|J[K+0]<<16;e(m!=null);var Me=3*Oe+dt+131074>>2;for(l(m[y+0],255&Me,Me>>16,de,ne),x!=null&&(Me=3*dt+Oe+131074>>2,l(x[k+0],255&Me,Me>>16,pe,ge)),xe=1;xe<=He;++xe){var yt=S[I+xe]|T[G+xe]<<16,pn=ie[O+xe]|J[K+xe]<<16,pt=Oe+yt+dt+pn+524296,qe=pt+2*(yt+dt)>>3;Me=qe+Oe>>1,Oe=(pt=pt+2*(Oe+pn)>>3)+yt>>1,l(m[y+2*xe-1],255&Me,Me>>16,de,ne+(2*xe-1)*g),l(m[y+2*xe-0],255&Oe,Oe>>16,de,ne+(2*xe-0)*g),x!=null&&(Me=pt+dt>>1,Oe=qe+pn>>1,l(x[k+2*xe-1],255&Me,Me>>16,pe,ge+(2*xe-1)*g),l(x[k+2*xe+0],255&Oe,Oe>>16,pe,ge+(2*xe+0)*g)),Oe=yt,dt=pn}1&Le||(Me=3*Oe+dt+131074>>2,l(m[y+Le-1],255&Me,Me>>16,de,ne+(Le-1)*g),x!=null&&(Me=3*dt+Oe+131074>>2,l(x[k+Le-1],255&Me,Me>>16,pe,ge+(Le-1)*g)))}}function Yr(){ur[zs]=a1,ur[$s]=qc,ur[Oc]=s1,ur[Hs]=Uc,ur[Ws]=zc,ur[sl]=$c,ur[jc]=o1,ur[ol]=qc,ur[ll]=Uc,ur[Vs]=zc,ur[cl]=$c}function Ka(s){return s&-16384?0>s?0:255:s>>l1}function Oi(s,l){return Ka((19077*s>>8)+(26149*l>>8)-14234)}function ji(s,l,g){return Ka((19077*s>>8)-(6419*l>>8)-(13320*g>>8)+8708)}function hi(s,l){return Ka((19077*s>>8)+(33050*l>>8)-17685)}function Bi(s,l,g,m,y){m[y+0]=Oi(s,g),m[y+1]=ji(s,l,g),m[y+2]=hi(s,l)}function va(s,l,g,m,y){m[y+0]=hi(s,l),m[y+1]=ji(s,l,g),m[y+2]=Oi(s,g)}function ba(s,l,g,m,y){var x=ji(s,l,g);l=x<<3&224|hi(s,l)>>3,m[y+0]=248&Oi(s,g)|x>>5,m[y+1]=l}function Pn(s,l,g,m,y){var x=240&hi(s,l)|15;m[y+0]=240&Oi(s,g)|ji(s,l,g)>>4,m[y+1]=x}function Di(s,l,g,m,y){m[y+0]=255,Bi(s,l,g,m,y+1)}function Mi(s,l,g,m,y){va(s,l,g,m,y),m[y+3]=255}function Qa(s,l,g,m,y){Bi(s,l,g,m,y),m[y+3]=255}function Er(s,l,g){B[s]=function(m,y,x,k,S,I,T,G,ie){for(var O=G+(-2&ie)*g;G!=O;)l(m[y+0],x[k+0],S[I+0],T,G),l(m[y+1],x[k+0],S[I+0],T,G+g),y+=2,++k,++I,G+=2*g;1&ie&&l(m[y+0],x[k+0],S[I+0],T,G)}}function On(s,l,g){return g==0?s==0?l==0?6:5:l==0?4:0:g}function Ds(s,l,g,m,y){switch(s>>>30){case 3:Jr(l,g,m,y,0);break;case 2:gi(l,g,m,y);break;case 1:Cn(l,g,m,y)}}function wa(s,l){var g,m,y=l.M,x=l.Nb,k=s.oc,S=s.pc+40,I=s.oc,T=s.pc+584,G=s.oc,ie=s.pc+600;for(g=0;16>g;++g)k[S+32*g-1]=129;for(g=0;8>g;++g)I[T+32*g-1]=129,G[ie+32*g-1]=129;for(0g;++g)r(k,S+32*g-4,k,S+32*g+12,4);for(g=-1;8>g;++g)r(I,T+32*g-4,I,T+32*g+4,4),r(G,ie+32*g-4,G,ie+32*g+4,4)}var J=s.Gd,K=s.Hd+m,de=O.ad,ne=O.Hc;if(0=s.za-1?a(pe,ge,J[K].y[15],4):r(pe,ge,J[K+1].y,0,4)),g=0;4>g;g++)pe[ge+128+g]=pe[ge+256+g]=pe[ge+384+g]=pe[ge+0+g];for(g=0;16>g;++g,ne<<=2)pe=k,ge=S+Wc[g],vr[O.Ob[g]](pe,ge),Ds(ne,de,16*+g,pe,ge)}else if(pe=On(m,y,O.Ob[0]),mi[pe](k,S),ne!=0)for(g=0;16>g;++g,ne<<=2)Ds(ne,de,16*+g,k,S+Wc[g]);for(g=O.Gc,pe=On(m,y,O.Dd),Xr[pe](I,T),Xr[pe](G,ie),ne=de,pe=I,ge=T,255&(O=0|g)&&(170&O?Aa(ne,256,pe,ge):Rr(ne,256,pe,ge)),O=G,ne=ie,255&(g>>=8)&&(170&g?Aa(de,320,O,ne):Rr(de,320,O,ne)),yg;++g)r(J,K+g*s.R,k,S+32*g,16);for(g=0;8>g;++g)r(de,O+g*s.B,I,T+32*g,8),r(ne,pe+g*s.B,G,ie+32*g,8)}}function Ms(s,l,g,m,y,x,k,S,I){var T=[0],G=[0],ie=0,O=I!=null?I.kd:0,J=I??new Z;if(s==null||12>g)return 7;J.data=s,J.w=l,J.ha=g,l=[l],g=[g],J.gb=[J.gb];e:{var K=l,de=g,ne=J.gb;if(e(s!=null),e(de!=null),e(ne!=null),ne[0]=0,12<=de[0]&&!t(s,K[0],"RIFF")){if(t(s,K[0]+8,"WEBP")){ne=3;break e}var pe=ke(s,K[0]+4);if(12>pe||4294967286de[0]-8){ne=7;break e}ne[0]=pe,K[0]+=12,de[0]-=12}ne=0}if(ne!=0)return ne;for(pe=0ne[0])ne=7;else{if(!t(ge,de[0],"VP8X")){if(ke(ge,de[0]+4)!=10){ne=3;break e}if(18>ne[0]){ne=7;break e}var Oe=ke(ge,de[0]+8),dt=1+Ie(ge,de[0]+12);if(2147483648<=dt*(ge=1+Ie(ge,de[0]+15))){ne=3;break e}He!=null&&(He[0]=Oe),Le!=null&&(Le[0]=dt),xe!=null&&(xe[0]=ge),de[0]+=18,ne[0]-=18,Me[0]=1}ne=0}}if(ie=ie[0],K=K[0],ne!=0)return ne;if(de=!!(2&K),!pe&&ie)return 3;if(x!=null&&(x[0]=!!(16&K)),k!=null&&(k[0]=de),S!=null&&(S[0]=0),k=T[0],K=G[0],ie&&de&&I==null){ne=0;break}if(4>g){ne=7;break}if(pe&&ie||!pe&&!ie&&!t(s,l[0],"ALPH")){g=[g],J.na=[J.na],J.P=[J.P],J.Sa=[J.Sa];e:{Oe=s,ne=l,pe=g;var Me=J.gb;Le=J.na,xe=J.P,He=J.Sa,dt=22,e(Oe!=null),e(pe!=null),ge=ne[0];var yt=pe[0];for(e(Le!=null),e(He!=null),Le[0]=null,xe[0]=null,He[0]=0;;){if(ne[0]=ge,pe[0]=yt,8>yt){ne=7;break e}var pn=ke(Oe,ge+4);if(4294967286Me){ne=3;break e}if(!t(Oe,ge,"VP8 ")||!t(Oe,ge,"VP8L")){ne=0;break e}if(yt[0]pe[0])ne=7;else{if(ge||dt){if(Me=ke(Me,Oe+4),12<=Le&&Me>Le-12){ne=3;break e}if(O&&Me>pe[0]-8){ne=7;break e}xe[0]=Me,ne[0]+=8,pe[0]-=8,He[0]=dt}else He[0]=5<=pe[0]&&Me[Oe+0]==47&&!(Me[Oe+4]>>5),xe[0]=pe[0];ne=0}if(g=g[0],J.Ja=J.Ja[0],J.xa=J.xa[0],l=l[0],ne!=0)break;if(4294967286g){ne=7;break}S=k,O=K,de=x,s==null||5>g?s=0:5<=g&&s[l+0]==47&&!(s[l+4]>>5)?(pe=[0],Me=[0],Le=[0],ue(xe=new j,s,l,g),zr(xe,pe,Me,Le)?(S!=null&&(S[0]=pe[0]),O!=null&&(O[0]=Me[0]),de!=null&&(de[0]=Le[0]),s=1):s=0):s=0}else{if(10>g){ne=7;break}S=K,s==null||10>g||!Cs(s,l+3,g-3)?s=0:(O=s[l+0]|s[l+1]<<8|s[l+2]<<16,de=16383&(s[l+7]<<8|s[l+6]),s=16383&(s[l+9]<<8|s[l+8]),1&O||3<(O>>1&7)||!(O>>4&1)||O>>5>=J.Ja||!de||!s?s=0:(k&&(k[0]=de),S&&(S[0]=s),s=1))}if(!s||(k=k[0],K=K[0],ie&&(T[0]!=k||G[0]!=K)))return 3;I!=null&&(I[0]=J,I.offset=l-I.w,e(4294967286>l-I.w),e(I.offset==I.ha-g));break}return ne==0||ne==7&&ie&&I==null?(x!=null&&(x[0]|=J.na!=null&&0g||(x&=-2,k&=-2),0>x||0>k||0>=S||0>=I||x+S>m||k+I>y))return 0;if(l.v=x,l.j=k,l.va=x+S,l.o=k+I,l.U=S,l.T=I,l.da=s!=null&&0s.S){var l=s.f.RGBA;l.fb+=(s.height-1)*l.A,l.A=-l.A}else l=s.f.kb,s=s.height,l.O+=(s-1)*l.fa,l.fa=-l.fa,l.N+=(s-1>>1)*l.Ab,l.Ab=-l.Ab,l.W+=(s-1>>1)*l.Db,l.Db=-l.Db,l.F!=null&&(l.J+=(s-1)*l.lb,l.lb=-l.lb);return 0}function es(s,l,g,m){if(m==null||0>=s||0>=l)return 2;if(g!=null){if(g.Da){var y=g.cd,x=g.bd,k=-2&g.v,S=-2&g.j;if(0>k||0>S||0>=y||0>=x||k+y>s||S+x>l)return 2;s=y,l=x}if(g.da){if(!Te(s,l,y=[g.ib],x=[g.hb]))return 2;s=y[0],l=x[0]}}m.width=s,m.height=l;e:{var I=m.width,T=m.height;if(s=m.S,0>=I||0>=T||!(s>=zs&&13>s))s=2;else{if(0>=m.Rd&&m.sd==null){k=x=y=l=0;var G=(S=I*Vc[s])*T;if(11>s||(x=(T+1)/2*(l=(I+1)/2),s==12&&(k=(y=I)*T)),(T=i(G+2*x+k))==null){s=1;break e}m.sd=T,11>s?((I=m.f.RGBA).eb=T,I.fb=0,I.A=S,I.size=G):((I=m.f.kb).y=T,I.O=0,I.fa=S,I.Fd=G,I.f=T,I.N=0+G,I.Ab=l,I.Cd=x,I.ea=T,I.W=0+G+x,I.Db=l,I.Ed=x,s==12&&(I.F=T,I.J=0+G+2*x),I.Tc=k,I.lb=y)}if(l=1,y=m.S,x=m.width,k=m.height,y>=zs&&13>y)if(11>y)s=m.f.RGBA,l&=(S=Math.abs(s.A))*(k-1)+x<=s.size,l&=S>=x*Vc[y],l&=s.eb!=null;else{s=m.f.kb,S=(x+1)/2,G=(k+1)/2,I=Math.abs(s.fa),T=Math.abs(s.Ab);var ie=Math.abs(s.Db),O=Math.abs(s.lb),J=O*(k-1)+x;l&=I*(k-1)+x<=s.Fd,l&=T*(G-1)+S<=s.Cd,l=(l&=ie*(G-1)+S<=s.Ed)&I>=x&T>=S&ie>=S,l&=s.y!=null,l&=s.f!=null,l&=s.ea!=null,y==12&&(l&=O>=x,l&=J<=s.Tc,l&=s.F!=null)}else l=0;s=l?0:2}}return s!=0||g!=null&&g.fd&&(s=qi(m)),s}var ya=64,Ui=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535,131071,262143,524287,1048575,2097151,4194303,8388607,16777215],ts=24,jn=32,Un=8,_a=[0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7];Re("Predictor0","PredictorAdd0"),B.Predictor0=function(){return 4278190080},B.Predictor1=function(s){return s},B.Predictor2=function(s,l,g){return l[g+0]},B.Predictor3=function(s,l,g){return l[g+1]},B.Predictor4=function(s,l,g){return l[g-1]},B.Predictor5=function(s,l,g){return Ye(Ye(s,l[g+1]),l[g+0])},B.Predictor6=function(s,l,g){return Ye(s,l[g-1])},B.Predictor7=function(s,l,g){return Ye(s,l[g+0])},B.Predictor8=function(s,l,g){return Ye(l[g-1],l[g+0])},B.Predictor9=function(s,l,g){return Ye(l[g+0],l[g+1])},B.Predictor10=function(s,l,g){return Ye(Ye(s,l[g-1]),Ye(l[g+0],l[g+1]))},B.Predictor11=function(s,l,g){var m=l[g+0];return 0>=at(m>>24&255,s>>24&255,(l=l[g-1])>>24&255)+at(m>>16&255,s>>16&255,l>>16&255)+at(m>>8&255,s>>8&255,l>>8&255)+at(255&m,255&s,255&l)?m:s},B.Predictor12=function(s,l,g){var m=l[g+0];return(St((s>>24&255)+(m>>24&255)-((l=l[g-1])>>24&255))<<24|St((s>>16&255)+(m>>16&255)-(l>>16&255))<<16|St((s>>8&255)+(m>>8&255)-(l>>8&255))<<8|St((255&s)+(255&m)-(255&l)))>>>0},B.Predictor13=function(s,l,g){var m=l[g-1];return(vt((s=Ye(s,l[g+0]))>>24&255,m>>24&255)<<24|vt(s>>16&255,m>>16&255)<<16|vt(s>>8&255,m>>8&255)<<8|vt(255&s,255&m))>>>0};var fi=B.PredictorAdd0;B.PredictorAdd1=bt,Re("Predictor2","PredictorAdd2"),Re("Predictor3","PredictorAdd3"),Re("Predictor4","PredictorAdd4"),Re("Predictor5","PredictorAdd5"),Re("Predictor6","PredictorAdd6"),Re("Predictor7","PredictorAdd7"),Re("Predictor8","PredictorAdd8"),Re("Predictor9","PredictorAdd9"),Re("Predictor10","PredictorAdd10"),Re("Predictor11","PredictorAdd11"),Re("Predictor12","PredictorAdd12"),Re("Predictor13","PredictorAdd13");var di=B.PredictorAdd2;Ve("ColorIndexInverseTransform","MapARGB","32b",function(s){return s>>8&255},function(s){return s}),Ve("VP8LColorIndexInverseTransformAlpha","MapAlpha","8b",function(s){return s},function(s){return s>>8&255});var xa,zi=B.ColorIndexInverseTransform,cn=B.MapARGB,il=B.VP8LColorIndexInverseTransformAlpha,Fr=B.MapAlpha,mr=B.VP8LPredictorsAdd=[];mr.length=16,(B.VP8LPredictors=[]).length=16,(B.VP8LPredictorsAdd_C=[]).length=16,(B.VP8LPredictors_C=[]).length=16;var $i,ns,rs,ka,Hi,Wi,pi,Jr,gi,Aa,Cn,Rr,Dt,Mt,en,dn,Zr,is,La,qs,kc,Ac,Lc,Sc,as,Nc,Pc,Cc,Ic=i(511),Ec=i(2041),Fc=i(225),Rc=i(767),Tc=0,al=Ec,Us=Fc,Gn=Rc,cr=Ic,zs=0,$s=1,Oc=2,Hs=3,Ws=4,sl=5,jc=6,ol=7,ll=8,Vs=9,cl=10,Wf=[2,3,7],Vf=[3,3,11],Bc=[280,256,256,256,40],Gf=[0,1,1,1,0],Yf=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],Jf=[24,7,23,25,40,6,39,41,22,26,38,42,56,5,55,57,21,27,54,58,37,43,72,4,71,73,20,28,53,59,70,74,36,44,88,69,75,52,60,3,87,89,19,29,86,90,35,45,68,76,85,91,51,61,104,2,103,105,18,30,102,106,34,46,84,92,67,77,101,107,50,62,120,1,119,121,83,93,17,31,100,108,66,78,118,122,33,47,117,123,49,63,99,109,82,94,0,116,124,65,79,16,32,98,110,48,115,125,81,95,64,114,126,97,111,80,113,127,96,112],Zf=[2954,2956,2958,2962,2970,2986,3018,3082,3212,3468,3980,5004],Xf=8,ul=[4,5,6,7,8,9,10,10,11,12,13,14,15,16,17,17,18,19,20,20,21,21,22,22,23,23,24,25,25,26,27,28,29,30,31,32,33,34,35,36,37,37,38,39,40,41,42,43,44,45,46,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,76,77,78,79,80,81,82,83,84,85,86,87,88,89,91,93,95,96,98,100,101,102,104,106,108,110,112,114,116,118,122,124,126,128,130,132,134,136,138,140,143,145,148,151,154,157],hl=[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,119,122,125,128,131,134,137,140,143,146,149,152,155,158,161,164,167,170,173,177,181,185,189,193,197,201,205,209,213,217,221,225,229,234,239,245,249,254,259,264,269,274,279,284],ss=null,Kf=[[173,148,140,0],[176,155,140,135,0],[180,157,141,134,130,0],[254,254,243,230,196,177,153,140,133,130,129,0]],Qf=[0,1,4,8,5,2,3,6,9,12,13,10,7,11,14,15],Dc=[-0,1,-1,2,-2,3,4,6,-3,5,-4,-5,-6,7,-7,8,-8,-9],e1=[[[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]],[[253,136,254,255,228,219,128,128,128,128,128],[189,129,242,255,227,213,255,219,128,128,128],[106,126,227,252,214,209,255,255,128,128,128]],[[1,98,248,255,236,226,255,255,128,128,128],[181,133,238,254,221,234,255,154,128,128,128],[78,134,202,247,198,180,255,219,128,128,128]],[[1,185,249,255,243,255,128,128,128,128,128],[184,150,247,255,236,224,128,128,128,128,128],[77,110,216,255,236,230,128,128,128,128,128]],[[1,101,251,255,241,255,128,128,128,128,128],[170,139,241,252,236,209,255,255,128,128,128],[37,116,196,243,228,255,255,255,128,128,128]],[[1,204,254,255,245,255,128,128,128,128,128],[207,160,250,255,238,128,128,128,128,128,128],[102,103,231,255,211,171,128,128,128,128,128]],[[1,152,252,255,240,255,128,128,128,128,128],[177,135,243,255,234,225,128,128,128,128,128],[80,129,211,255,194,224,128,128,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[246,1,255,128,128,128,128,128,128,128,128],[255,128,128,128,128,128,128,128,128,128,128]]],[[[198,35,237,223,193,187,162,160,145,155,62],[131,45,198,221,172,176,220,157,252,221,1],[68,47,146,208,149,167,221,162,255,223,128]],[[1,149,241,255,221,224,255,255,128,128,128],[184,141,234,253,222,220,255,199,128,128,128],[81,99,181,242,176,190,249,202,255,255,128]],[[1,129,232,253,214,197,242,196,255,255,128],[99,121,210,250,201,198,255,202,128,128,128],[23,91,163,242,170,187,247,210,255,255,128]],[[1,200,246,255,234,255,128,128,128,128,128],[109,178,241,255,231,245,255,255,128,128,128],[44,130,201,253,205,192,255,255,128,128,128]],[[1,132,239,251,219,209,255,165,128,128,128],[94,136,225,251,218,190,255,255,128,128,128],[22,100,174,245,186,161,255,199,128,128,128]],[[1,182,249,255,232,235,128,128,128,128,128],[124,143,241,255,227,234,128,128,128,128,128],[35,77,181,251,193,211,255,205,128,128,128]],[[1,157,247,255,236,231,255,255,128,128,128],[121,141,235,255,225,227,255,255,128,128,128],[45,99,188,251,195,217,255,224,128,128,128]],[[1,1,251,255,213,255,128,128,128,128,128],[203,1,248,255,255,128,128,128,128,128,128],[137,1,177,255,224,255,128,128,128,128,128]]],[[[253,9,248,251,207,208,255,192,128,128,128],[175,13,224,243,193,185,249,198,255,255,128],[73,17,171,221,161,179,236,167,255,234,128]],[[1,95,247,253,212,183,255,255,128,128,128],[239,90,244,250,211,209,255,255,128,128,128],[155,77,195,248,188,195,255,255,128,128,128]],[[1,24,239,251,218,219,255,205,128,128,128],[201,51,219,255,196,186,128,128,128,128,128],[69,46,190,239,201,218,255,228,128,128,128]],[[1,191,251,255,255,128,128,128,128,128,128],[223,165,249,255,213,255,128,128,128,128,128],[141,124,248,255,255,128,128,128,128,128,128]],[[1,16,248,255,255,128,128,128,128,128,128],[190,36,230,255,236,255,128,128,128,128,128],[149,1,255,128,128,128,128,128,128,128,128]],[[1,226,255,128,128,128,128,128,128,128,128],[247,192,255,128,128,128,128,128,128,128,128],[240,128,255,128,128,128,128,128,128,128,128]],[[1,134,252,255,255,128,128,128,128,128,128],[213,62,250,255,255,128,128,128,128,128,128],[55,93,255,128,128,128,128,128,128,128,128]],[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]]],[[[202,24,213,235,186,191,220,160,240,175,255],[126,38,182,232,169,184,228,174,255,187,128],[61,46,138,219,151,178,240,170,255,216,128]],[[1,112,230,250,199,191,247,159,255,255,128],[166,109,228,252,211,215,255,174,128,128,128],[39,77,162,232,172,180,245,178,255,255,128]],[[1,52,220,246,198,199,249,220,255,255,128],[124,74,191,243,183,193,250,221,255,255,128],[24,71,130,219,154,170,243,182,255,255,128]],[[1,182,225,249,219,240,255,224,128,128,128],[149,150,226,252,216,205,255,171,128,128,128],[28,108,170,242,183,194,254,223,255,255,128]],[[1,81,230,252,204,203,255,192,128,128,128],[123,102,209,247,188,196,255,233,128,128,128],[20,95,153,243,164,173,255,203,128,128,128]],[[1,222,248,255,216,213,128,128,128,128,128],[168,175,246,252,235,205,255,255,128,128,128],[47,116,215,255,211,212,255,255,128,128,128]],[[1,121,236,253,212,214,255,255,128,128,128],[141,84,213,252,201,202,255,219,128,128,128],[42,80,160,240,162,185,255,205,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[244,1,255,128,128,128,128,128,128,128,128],[238,1,255,128,128,128,128,128,128,128,128]]]],t1=[[[231,120,48,89,115,113,120,152,112],[152,179,64,126,170,118,46,70,95],[175,69,143,80,85,82,72,155,103],[56,58,10,171,218,189,17,13,152],[114,26,17,163,44,195,21,10,173],[121,24,80,195,26,62,44,64,85],[144,71,10,38,171,213,144,34,26],[170,46,55,19,136,160,33,206,71],[63,20,8,114,114,208,12,9,226],[81,40,11,96,182,84,29,16,36]],[[134,183,89,137,98,101,106,165,148],[72,187,100,130,157,111,32,75,80],[66,102,167,99,74,62,40,234,128],[41,53,9,178,241,141,26,8,107],[74,43,26,146,73,166,49,23,157],[65,38,105,160,51,52,31,115,128],[104,79,12,27,217,255,87,17,7],[87,68,71,44,114,51,15,186,23],[47,41,14,110,182,183,21,17,194],[66,45,25,102,197,189,23,18,22]],[[88,88,147,150,42,46,45,196,205],[43,97,183,117,85,38,35,179,61],[39,53,200,87,26,21,43,232,171],[56,34,51,104,114,102,29,93,77],[39,28,85,171,58,165,90,98,64],[34,22,116,206,23,34,43,166,73],[107,54,32,26,51,1,81,43,31],[68,25,106,22,64,171,36,225,114],[34,19,21,102,132,188,16,76,124],[62,18,78,95,85,57,50,48,51]],[[193,101,35,159,215,111,89,46,111],[60,148,31,172,219,228,21,18,111],[112,113,77,85,179,255,38,120,114],[40,42,1,196,245,209,10,25,109],[88,43,29,140,166,213,37,43,154],[61,63,30,155,67,45,68,1,209],[100,80,8,43,154,1,51,26,71],[142,78,78,16,255,128,34,197,171],[41,40,5,102,211,183,4,1,221],[51,50,17,168,209,192,23,25,82]],[[138,31,36,171,27,166,38,44,229],[67,87,58,169,82,115,26,59,179],[63,59,90,180,59,166,93,73,154],[40,40,21,116,143,209,34,39,175],[47,15,16,183,34,223,49,45,183],[46,17,33,183,6,98,15,32,183],[57,46,22,24,128,1,54,17,37],[65,32,73,115,28,128,23,128,205],[40,3,9,115,51,192,18,6,223],[87,37,9,115,59,77,64,21,47]],[[104,55,44,218,9,54,53,130,226],[64,90,70,205,40,41,23,26,57],[54,57,112,184,5,41,38,166,213],[30,34,26,133,152,116,10,32,134],[39,19,53,221,26,114,32,73,255],[31,9,65,234,2,15,1,118,73],[75,32,12,51,192,255,160,43,51],[88,31,35,67,102,85,55,186,85],[56,21,23,111,59,205,45,37,192],[55,38,70,124,73,102,1,34,98]],[[125,98,42,88,104,85,117,175,82],[95,84,53,89,128,100,113,101,45],[75,79,123,47,51,128,81,171,1],[57,17,5,71,102,57,53,41,49],[38,33,13,121,57,73,26,1,85],[41,10,67,138,77,110,90,47,114],[115,21,2,10,102,255,166,23,6],[101,29,16,10,85,128,101,196,26],[57,18,10,102,102,213,34,20,43],[117,20,15,36,163,128,68,1,26]],[[102,61,71,37,34,53,31,243,192],[69,60,71,38,73,119,28,222,37],[68,45,128,34,1,47,11,245,171],[62,17,19,70,146,85,55,62,70],[37,43,37,154,100,163,85,160,1],[63,9,92,136,28,64,32,201,85],[75,15,9,9,64,255,184,119,16],[86,6,28,5,64,255,25,248,1],[56,8,17,132,137,255,55,116,128],[58,15,20,82,135,57,26,121,40]],[[164,50,31,137,154,133,25,35,218],[51,103,44,131,131,123,31,6,158],[86,40,64,135,148,224,45,183,128],[22,26,17,131,240,154,14,1,209],[45,16,21,91,64,222,7,1,197],[56,21,39,155,60,138,23,102,213],[83,12,13,54,192,255,68,47,28],[85,26,85,85,128,128,32,146,171],[18,11,7,63,144,171,4,4,246],[35,27,10,146,174,171,12,26,128]],[[190,80,35,99,180,80,126,54,45],[85,126,47,87,176,51,41,20,32],[101,75,128,139,118,146,116,128,85],[56,41,15,176,236,85,37,9,62],[71,30,17,119,118,255,17,18,138],[101,38,60,138,55,70,43,26,142],[146,36,19,30,171,255,97,27,20],[138,45,61,62,219,1,81,188,64],[32,41,20,117,151,142,20,21,163],[112,19,12,61,195,128,48,4,24]]],n1=[[[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[176,246,255,255,255,255,255,255,255,255,255],[223,241,252,255,255,255,255,255,255,255,255],[249,253,253,255,255,255,255,255,255,255,255]],[[255,244,252,255,255,255,255,255,255,255,255],[234,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255]],[[255,246,254,255,255,255,255,255,255,255,255],[239,253,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[251,255,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[251,254,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,254,253,255,254,255,255,255,255,255,255],[250,255,254,255,254,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[217,255,255,255,255,255,255,255,255,255,255],[225,252,241,253,255,255,254,255,255,255,255],[234,250,241,250,253,255,253,254,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[223,254,254,255,255,255,255,255,255,255,255],[238,253,254,254,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[249,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,255,255,255,255,255,255,255,255,255],[247,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[252,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[186,251,250,255,255,255,255,255,255,255,255],[234,251,244,254,255,255,255,255,255,255,255],[251,251,243,253,254,255,254,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[236,253,254,255,255,255,255,255,255,255,255],[251,253,253,254,254,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[254,254,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[254,254,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[248,255,255,255,255,255,255,255,255,255,255],[250,254,252,254,255,255,255,255,255,255,255],[248,254,249,253,255,255,255,255,255,255,255]],[[255,253,253,255,255,255,255,255,255,255,255],[246,253,253,255,255,255,255,255,255,255,255],[252,254,251,254,254,255,255,255,255,255,255]],[[255,254,252,255,255,255,255,255,255,255,255],[248,254,253,255,255,255,255,255,255,255,255],[253,255,254,254,255,255,255,255,255,255,255]],[[255,251,254,255,255,255,255,255,255,255,255],[245,251,254,255,255,255,255,255,255,255,255],[253,253,254,255,255,255,255,255,255,255,255]],[[255,251,253,255,255,255,255,255,255,255,255],[252,253,254,255,255,255,255,255,255,255,255],[255,254,255,255,255,255,255,255,255,255,255]],[[255,252,255,255,255,255,255,255,255,255,255],[249,255,254,255,255,255,255,255,255,255,255],[255,255,254,255,255,255,255,255,255,255,255]],[[255,255,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]]],r1=[0,1,2,3,6,4,5,6,6,6,6,6,6,6,6,7,0],mi=[],vr=[],Xr=[],i1=1,Mc=2,vi=[],ur=[];Nn("UpsampleRgbLinePair",Bi,3),Nn("UpsampleBgrLinePair",va,3),Nn("UpsampleRgbaLinePair",Qa,4),Nn("UpsampleBgraLinePair",Mi,4),Nn("UpsampleArgbLinePair",Di,4),Nn("UpsampleRgba4444LinePair",Pn,2),Nn("UpsampleRgb565LinePair",ba,2);var a1=B.UpsampleRgbLinePair,s1=B.UpsampleBgrLinePair,qc=B.UpsampleRgbaLinePair,Uc=B.UpsampleBgraLinePair,zc=B.UpsampleArgbLinePair,$c=B.UpsampleRgba4444LinePair,o1=B.UpsampleRgb565LinePair,Gs=16,Ys=1<m.ca.S||(alert("todo:WebPInitConvertARGBToYUV"),m.ca.f.kb.F!=null&&Yt()),m.Pb&&0(I=g.Md)?0:100T;++T)12>(ie=y.pb[T]).lc&&(ie.ia=I*g1[0>ie.lc?0:ie.lc]>>3),G|=ie.ia;G&&(alert("todo:VP8InitRandom"),y.ia=1)}y.Ga=g.Id,100y.Ga&&(y.Ga=0)}(function(O,J){if(O==null)return 0;if(J==null)return on(O,2,"NULL VP8Io parameter in VP8Decode().");if(!O.cb&&!Pr(O,J))return 0;if(e(O.cb),J.ac==null||J.ac(J)){J.ob&&(O.L=0);var K=Js[O.L];if(O.L==2?(O.yb=0,O.zb=0):(O.yb=J.v-K>>4,O.zb=J.j-K>>4,0>O.yb&&(O.yb=0),0>O.zb&&(O.zb=0)),O.Va=J.o+15+K>>4,O.Hb=J.va+15+K>>4,O.Hb>O.za&&(O.Hb=O.za),O.Va>O.Ub&&(O.Va=O.Ub),0K;++K){var ne;if(O.Qa.Cb){var pe=O.Qa.Lb[K];O.Qa.Fb||(pe+=de.Tb)}else pe=de.Tb;for(ne=0;1>=ne;++ne){var ge=O.gd[K][ne],Le=pe;if(de.Pc&&(Le+=de.vd[0],ne&&(Le+=de.od[0])),0<(Le=0>Le?0:63>2:xe>>1)>9-de.wb&&(xe=9-de.wb),1>xe&&(xe=1),ge.dd=xe,ge.tc=2*Le+xe,ge.ld=40<=Le?2:15<=Le?1:0}else ge.tc=0;ge.La=ne}}}K=0}else on(O,6,"Frame setup failed"),K=O.a;if(K=K==0){if(K){O.$c=0,0O.Vb){if(O.Vb=0,O.Ec=i(ge),O.Fc=0,O.Ec==null){K=on(O,1,"no memory during frame initialization.");break t}O.Vb=ge}ge=O.Ec,Le=O.Fc,O.Ac=ge,O.Bc=Le,Le+=de,O.Gd=c(He,Ns),O.Hd=0,O.rb=c(Oe+1,$a),O.sb=1,O.wa=dt?c(dt,or):null,O.Y=0,O.D.Nb=0,O.D.wa=O.wa,O.D.Y=O.Y,0=K;++K)Ic[255+K]=0>K?-K:K;for(K=-1020;1020>=K;++K)Ec[1020+K]=-128>K?-128:127=K;++K)Fc[112+K]=-16>K?-16:15=K;++K)Rc[255+K]=0>K?0:255xt;++xt){var gn,Lt=Bn[0+xt];for(gn=0;4>gn;++gn){Lt=t1[zt[xn+gn]][Lt];for(var Pt=Dc[ve(ut,Lt[0])];0>3;for(Pt=0;256>Pt;Pt+=16)xt[In+Pt]=zn}kn=1,br=xn[0]}var Tt=15&ut.la,mn=15&Dn.la;for(Pt=0;4>Pt;++Pt){var Yn=1&mn;for(zn=Ct=0;4>zn;++zn)Tt=Tt>>1|(Yn=(nn=ss(zt,br,nn=Yn+(1&Tt),Zt.Sc,kn,xt,In))>kn)<<7,Ct=Ct<<2|(3>=4,mn=mn>>1|Yn<<7,gn=(gn<<8|Ct)>>>0}for(br=Tt,kn=mn>>4,Xt=0;4>Xt;Xt+=2){for(Ct=0,Tt=ut.la>>4+Xt,mn=Dn.la>>4+Xt,Pt=0;2>Pt;++Pt){for(Yn=1&mn,zn=0;2>zn;++zn)nn=Yn+(1&Tt),Tt=Tt>>1|(Yn=0<(nn=ss(zt,xn[2],nn,Zt.Qc,0,xt,In)))<<3,Ct=Ct<<2|(3>=2,mn=mn>>1|Yn<<5}Lt|=Ct<<4*Xt,br|=Tt<<4<=qe.zb&&qe.M<=qe.Va,qe.Aa==0)t:{if(pt.M=qe.M,pt.uc=ut,wa(qe,pt),tn=1,pt=(Ct=qe.D).Nb,ut=(Lt=Js[qe.L])*qe.R,zt=Lt/2*qe.B,Pt=16*pt*qe.R,zn=8*pt*qe.B,xn=qe.sa,Bn=qe.ta-ut+Pt,Zt=qe.qa,xt=qe.ra-zt+zn,In=qe.Ha,Dn=qe.Ia-zt+zn,mn=(Tt=Ct.M)==0,gn=Tt>=qe.Va-1,qe.Aa==2&&wa(qe,Ct),Ct.uc)for(Yn=(nn=qe).D.M,e(nn.D.uc),Ct=nn.yb;CtCe.o&&(Tt=Ce.o),Ce.F=null,Ce.J=null,qe.Fa!=null&&0>1),Ce.W+=qe.B*(Lt>>1),Ce.F!=null&&(Ce.J+=Ce.width*Lt)),Ct>1,Ce.W+=Ce.v>>1,Ce.F!=null&&(Ce.J+=Ce.v),Ce.ka=Ct-Ce.j,Ce.U=Ce.va-Ce.v,Ce.T=Tt-Ct,tn=Ce.put(Ce))}pt+1!=qe.Ic||gn||(r(qe.sa,qe.ta-ut,xn,Bn+16*qe.R,ut),r(qe.qa,qe.ra-zt,Zt,xt+8*qe.B,zt),r(qe.Ha,qe.Ia-zt,In,Dn+8*qe.B,zt))}if(!tn)return on(yt,6,"Output aborted.")}return 1})(O,J)),J.bc!=null&&J.bc(J),K&=1}return K?(O.cb=0,K):0})(s,m)||(l=s.a)}}else l=s.a}l==0&&k.Oa!=null&&k.Oa.fd&&(l=qi(k.ba))}k=l}x=k!=0?null:11>x?S.f.RGBA.eb:S.f.kb.y}else x=null;return x};var Vc=[3,4,3,4,4,2,2,4,4,4,2,1,1]};function f(B,X){for(var _="",N=0;N<4;N++)_+=String.fromCharCode(B[X++]);return _}function p(B,X){return B[X+0]|B[X+1]<<8}function w(B,X){return(B[X+0]|B[X+1]<<8|B[X+2]<<16)>>>0}function v(B,X){return(B[X+0]|B[X+1]<<8|B[X+2]<<16|B[X+3]<<24)>>>0}new u;var d=[0],E=[0],C=[],F=new u,L=n,D=(function(B,X){var _={},N=0,U=!1,$=0,re=0;if(_.frames=[],!(function(A,j){for(var z=0;z<4;z++)if(A[j+z]!="RIFF".charCodeAt(z))return!0;return!1})(B,X)){for(v(B,X+=4),X+=8;X>1&1}oe!="ANMF"&&(X+=ee)}return _}})(L,0);D.response=L,D.rgbaoutput=!0,D.dataurl=!1;var q=D.header?D.header:null,M=D.frames?D.frames:null;if(q){q.loop_counter=q.loop_count,d=[q.canvas_height],E=[q.canvas_width];for(var Q=0;Q'+t.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")+"",this.internal.__metadata__.metadataObjectNumber=this.internal.newObject(),this.internal.write("<< /Type /Metadata /Subtype /XML /Length "+n.length+" >>"),this.internal.write("stream"),this.internal.write(n),this.internal.write("endstream"),this.internal.write("endobj")}function cg(){this.internal.__metadata__.metadataObjectNumber&&this.internal.write("/Metadata "+this.internal.__metadata__.metadataObjectNumber+" 0 R")}(function(n){var e,t,r,a,i,c,o,u,f,p=function(A){return A=A||{},this.isStrokeTransparent=A.isStrokeTransparent||!1,this.strokeOpacity=A.strokeOpacity||1,this.strokeStyle=A.strokeStyle||"#000000",this.fillStyle=A.fillStyle||"#000000",this.isFillTransparent=A.isFillTransparent||!1,this.fillOpacity=A.fillOpacity||1,this.font=A.font||"10px sans-serif",this.textBaseline=A.textBaseline||"alphabetic",this.textAlign=A.textAlign||"left",this.lineWidth=A.lineWidth||1,this.lineJoin=A.lineJoin||"miter",this.lineCap=A.lineCap||"butt",this.path=A.path||[],this.transform=A.transform!==void 0?A.transform.clone():new u,this.globalCompositeOperation=A.globalCompositeOperation||"normal",this.globalAlpha=A.globalAlpha||1,this.clip_path=A.clip_path||[],this.currentPoint=A.currentPoint||new c,this.miterLimit=A.miterLimit||10,this.lastPoint=A.lastPoint||new c,this.lineDashOffset=A.lineDashOffset||0,this.lineDash=A.lineDash||[],this.margin=A.margin||[0,0,0,0],this.prevPageLastElemOffset=A.prevPageLastElemOffset||0,this.ignoreClearRect=typeof A.ignoreClearRect!="boolean"||A.ignoreClearRect,this};n.events.push(["initialized",function(){this.context2d=new w(this),e=this.internal.f2,t=this.internal.getCoordinateString,r=this.internal.getVerticalCoordinateString,a=this.internal.getHorizontalCoordinate,i=this.internal.getVerticalCoordinate,c=this.internal.Point,o=this.internal.Rectangle,u=this.internal.Matrix,f=new p}]);var w=function(A){Object.defineProperty(this,"canvas",{get:function(){return{parentNode:!1,style:!1}}});var j=A;Object.defineProperty(this,"pdf",{get:function(){return j}});var z=!1;Object.defineProperty(this,"pageWrapXEnabled",{get:function(){return z},set:function(P){z=!!P}});var W=!1;Object.defineProperty(this,"pageWrapYEnabled",{get:function(){return W},set:function(P){W=!!P}});var Y=0;Object.defineProperty(this,"posX",{get:function(){return Y},set:function(P){isNaN(P)||(Y=P)}});var te=0;Object.defineProperty(this,"posY",{get:function(){return te},set:function(P){isNaN(P)||(te=P)}}),Object.defineProperty(this,"margin",{get:function(){return f.margin},set:function(P){var Ne;typeof P=="number"?Ne=[P,P,P,P]:((Ne=new Array(4))[0]=P[0],Ne[1]=P.length>=2?P[1]:Ne[0],Ne[2]=P.length>=3?P[2]:Ne[0],Ne[3]=P.length>=4?P[3]:Ne[1]),f.margin=Ne}});var ce=!1;Object.defineProperty(this,"autoPaging",{get:function(){return ce},set:function(P){ce=P}});var le=0;Object.defineProperty(this,"lastBreak",{get:function(){return le},set:function(P){le=P}});var ve=[];Object.defineProperty(this,"pageBreaks",{get:function(){return ve},set:function(P){ve=P}}),Object.defineProperty(this,"ctx",{get:function(){return f},set:function(P){P instanceof p&&(f=P)}}),Object.defineProperty(this,"path",{get:function(){return f.path},set:function(P){f.path=P}});var Se=[];Object.defineProperty(this,"ctxStack",{get:function(){return Se},set:function(P){Se=P}}),Object.defineProperty(this,"fillStyle",{get:function(){return this.ctx.fillStyle},set:function(P){var Ne;Ne=v(P),this.ctx.fillStyle=Ne.style,this.ctx.isFillTransparent=Ne.a===0,this.ctx.fillOpacity=Ne.a,this.pdf.setFillColor(Ne.r,Ne.g,Ne.b,{a:Ne.a}),this.pdf.setTextColor(Ne.r,Ne.g,Ne.b,{a:Ne.a})}}),Object.defineProperty(this,"strokeStyle",{get:function(){return this.ctx.strokeStyle},set:function(P){var Ne=v(P);this.ctx.strokeStyle=Ne.style,this.ctx.isStrokeTransparent=Ne.a===0,this.ctx.strokeOpacity=Ne.a,Ne.a===0?this.pdf.setDrawColor(255,255,255):(Ne.a,this.pdf.setDrawColor(Ne.r,Ne.g,Ne.b))}}),Object.defineProperty(this,"lineCap",{get:function(){return this.ctx.lineCap},set:function(P){["butt","round","square"].indexOf(P)!==-1&&(this.ctx.lineCap=P,this.pdf.setLineCap(P))}}),Object.defineProperty(this,"lineWidth",{get:function(){return this.ctx.lineWidth},set:function(P){isNaN(P)||(this.ctx.lineWidth=P,this.pdf.setLineWidth(P))}}),Object.defineProperty(this,"lineJoin",{get:function(){return this.ctx.lineJoin},set:function(P){["bevel","round","miter"].indexOf(P)!==-1&&(this.ctx.lineJoin=P,this.pdf.setLineJoin(P))}}),Object.defineProperty(this,"miterLimit",{get:function(){return this.ctx.miterLimit},set:function(P){isNaN(P)||(this.ctx.miterLimit=P,this.pdf.setMiterLimit(P))}}),Object.defineProperty(this,"textBaseline",{get:function(){return this.ctx.textBaseline},set:function(P){this.ctx.textBaseline=P}}),Object.defineProperty(this,"textAlign",{get:function(){return this.ctx.textAlign},set:function(P){["right","end","center","left","start"].indexOf(P)!==-1&&(this.ctx.textAlign=P)}});var Ee=null,Ie=null,ke=null;Object.defineProperty(this,"fontFaces",{get:function(){return ke},set:function(P){Ee=null,Ie=null,ke=P}}),Object.defineProperty(this,"font",{get:function(){return this.ctx.font},set:function(P){var Ne;if(this.ctx.font=P,(Ne=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:\%|in|[cem]m|ex|p[ctx]))(?:\s*\/\s*(normal|[.\d]+(?:\%|in|[cem]m|ex|p[ctx])))?\s*([-_,\"\'\sa-z0-9]+?)\s*$/i.exec(P))!==null){var ze=Ne[1];Ne[2];var Te=Ne[3],ye=Ne[4];Ne[5];var Ge=Ne[6],Re=/^([.\d]+)((?:%|in|[cem]m|ex|p[ctx]))$/i.exec(ye)[2];ye=Math.floor(Re==="px"?parseFloat(ye)*this.pdf.internal.scaleFactor:Re==="em"?parseFloat(ye)*this.pdf.getFontSize():parseFloat(ye)*this.pdf.internal.scaleFactor),this.pdf.setFontSize(ye);var $e=(function(Ve){var Qt,At,gt=[],mt=Ve.trim();if(mt==="")return zl;if(mt in vh)return[vh[mt]];for(;mt!=="";){switch(At=null,Qt=(mt=wh(mt)).charAt(0)){case'"':case"'":At=ng(mt.substring(1),Qt);break;default:At=rg(mt)}if(At===null||(gt.push(At[0]),(mt=wh(At[1]))!==""&&mt.charAt(0)!==","))return zl;mt=mt.replace(/^,/,"")}return gt})(Ge);if(this.fontFaces){var Ye=(function(Ve,Qt){var At=Ve.getFontList(),gt=JSON.stringify(At);if(Ee===null||Ie!==gt){var mt=(function(Ht){var Ze=[];return Object.keys(Ht).forEach(function(Bt){Ht[Bt].forEach(function(et){var lt=null;switch(et){case"bold":lt={family:Bt,weight:"bold"};break;case"italic":lt={family:Bt,style:"italic"};break;case"bolditalic":lt={family:Bt,weight:"bold",style:"italic"};break;case"":case"normal":lt={family:Bt}}lt!==null&&(lt.ref={name:Bt,style:et},Ze.push(lt))})}),Ze})(At);Ee=(function(Ht){for(var Ze={},Bt=0;Bt=700||ze==="bold")&&(at="bold"),ze==="italic"&&(at+="italic"),at.length===0&&(at="normal");for(var bt="",ft={arial:"Helvetica",Arial:"Helvetica",verdana:"Helvetica",Verdana:"Helvetica",helvetica:"Helvetica",Helvetica:"Helvetica","sans-serif":"Helvetica",fixed:"Courier",monospace:"Courier",terminal:"Courier",cursive:"Times",fantasy:"Times",serif:"Times"},Ue=0;Ue<$e.length;Ue++){if(this.pdf.internal.getFont($e[Ue],at,{noFallback:!0,disableWarning:!0})!==void 0){bt=$e[Ue];break}if(at==="bolditalic"&&this.pdf.internal.getFont($e[Ue],"bold",{noFallback:!0,disableWarning:!0})!==void 0)bt=$e[Ue],at="bold";else if(this.pdf.internal.getFont($e[Ue],"normal",{noFallback:!0,disableWarning:!0})!==void 0){bt=$e[Ue],at="normal";break}}if(bt===""){for(var ht=0;ht<$e.length;ht++)if(ft[$e[ht]]){bt=ft[$e[ht]];break}}bt=bt===""?"Times":bt,this.pdf.setFont(bt,at)}}}}),Object.defineProperty(this,"globalCompositeOperation",{get:function(){return this.ctx.globalCompositeOperation},set:function(P){this.ctx.globalCompositeOperation=P}}),Object.defineProperty(this,"globalAlpha",{get:function(){return this.ctx.globalAlpha},set:function(P){this.ctx.globalAlpha=P}}),Object.defineProperty(this,"lineDashOffset",{get:function(){return this.ctx.lineDashOffset},set:function(P){this.ctx.lineDashOffset=P,be.call(this)}}),Object.defineProperty(this,"lineDash",{get:function(){return this.ctx.lineDash},set:function(P){this.ctx.lineDash=P,be.call(this)}}),Object.defineProperty(this,"ignoreClearRect",{get:function(){return this.ctx.ignoreClearRect},set:function(P){this.ctx.ignoreClearRect=!!P}})};w.prototype.setLineDash=function(A){this.lineDash=A},w.prototype.getLineDash=function(){return this.lineDash.length%2?this.lineDash.concat(this.lineDash):this.lineDash.slice()},w.prototype.fill=function(){M.call(this,"fill",!1)},w.prototype.stroke=function(){M.call(this,"stroke",!1)},w.prototype.beginPath=function(){this.path=[{type:"begin"}]},w.prototype.moveTo=function(A,j){if(isNaN(A)||isNaN(j))throw Ot.error("jsPDF.context2d.moveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.moveTo");var z=this.ctx.transform.applyToPoint(new c(A,j));this.path.push({type:"mt",x:z.x,y:z.y}),this.ctx.lastPoint=new c(A,j)},w.prototype.closePath=function(){var A=new c(0,0),j=0;for(j=this.path.length-1;j!==-1;j--)if(this.path[j].type==="begin"&&jt(this.path[j+1])==="object"&&typeof this.path[j+1].x=="number"){A=new c(this.path[j+1].x,this.path[j+1].y);break}this.path.push({type:"close"}),this.ctx.lastPoint=new c(A.x,A.y)},w.prototype.lineTo=function(A,j){if(isNaN(A)||isNaN(j))throw Ot.error("jsPDF.context2d.lineTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.lineTo");var z=this.ctx.transform.applyToPoint(new c(A,j));this.path.push({type:"lt",x:z.x,y:z.y}),this.ctx.lastPoint=new c(z.x,z.y)},w.prototype.clip=function(){this.ctx.clip_path=JSON.parse(JSON.stringify(this.path)),M.call(this,null,!0)},w.prototype.quadraticCurveTo=function(A,j,z,W){if(isNaN(z)||isNaN(W)||isNaN(A)||isNaN(j))throw Ot.error("jsPDF.context2d.quadraticCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.quadraticCurveTo");var Y=this.ctx.transform.applyToPoint(new c(z,W)),te=this.ctx.transform.applyToPoint(new c(A,j));this.path.push({type:"qct",x1:te.x,y1:te.y,x:Y.x,y:Y.y}),this.ctx.lastPoint=new c(Y.x,Y.y)},w.prototype.bezierCurveTo=function(A,j,z,W,Y,te){if(isNaN(Y)||isNaN(te)||isNaN(A)||isNaN(j)||isNaN(z)||isNaN(W))throw Ot.error("jsPDF.context2d.bezierCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.bezierCurveTo");var ce=this.ctx.transform.applyToPoint(new c(Y,te)),le=this.ctx.transform.applyToPoint(new c(A,j)),ve=this.ctx.transform.applyToPoint(new c(z,W));this.path.push({type:"bct",x1:le.x,y1:le.y,x2:ve.x,y2:ve.y,x:ce.x,y:ce.y}),this.ctx.lastPoint=new c(ce.x,ce.y)},w.prototype.arc=function(A,j,z,W,Y,te){if(isNaN(A)||isNaN(j)||isNaN(z)||isNaN(W)||isNaN(Y))throw Ot.error("jsPDF.context2d.arc: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.arc");if(te=!!te,!this.ctx.transform.isIdentity){var ce=this.ctx.transform.applyToPoint(new c(A,j));A=ce.x,j=ce.y;var le=this.ctx.transform.applyToPoint(new c(0,z)),ve=this.ctx.transform.applyToPoint(new c(0,0));z=Math.sqrt(Math.pow(le.x-ve.x,2)+Math.pow(le.y-ve.y,2))}Math.abs(Y-W)>=2*Math.PI&&(W=0,Y=2*Math.PI),this.path.push({type:"arc",x:A,y:j,radius:z,startAngle:W,endAngle:Y,counterclockwise:te})},w.prototype.arcTo=function(A,j,z,W,Y){throw new Error("arcTo not implemented.")},w.prototype.rect=function(A,j,z,W){if(isNaN(A)||isNaN(j)||isNaN(z)||isNaN(W))throw Ot.error("jsPDF.context2d.rect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rect");this.moveTo(A,j),this.lineTo(A+z,j),this.lineTo(A+z,j+W),this.lineTo(A,j+W),this.lineTo(A,j),this.lineTo(A+z,j),this.lineTo(A,j)},w.prototype.fillRect=function(A,j,z,W){if(isNaN(A)||isNaN(j)||isNaN(z)||isNaN(W))throw Ot.error("jsPDF.context2d.fillRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillRect");if(!d.call(this)){var Y={};this.lineCap!=="butt"&&(Y.lineCap=this.lineCap,this.lineCap="butt"),this.lineJoin!=="miter"&&(Y.lineJoin=this.lineJoin,this.lineJoin="miter"),this.beginPath(),this.rect(A,j,z,W),this.fill(),Y.hasOwnProperty("lineCap")&&(this.lineCap=Y.lineCap),Y.hasOwnProperty("lineJoin")&&(this.lineJoin=Y.lineJoin)}},w.prototype.strokeRect=function(A,j,z,W){if(isNaN(A)||isNaN(j)||isNaN(z)||isNaN(W))throw Ot.error("jsPDF.context2d.strokeRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeRect");E.call(this)||(this.beginPath(),this.rect(A,j,z,W),this.stroke())},w.prototype.clearRect=function(A,j,z,W){if(isNaN(A)||isNaN(j)||isNaN(z)||isNaN(W))throw Ot.error("jsPDF.context2d.clearRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.clearRect");this.ignoreClearRect||(this.fillStyle="#ffffff",this.fillRect(A,j,z,W))},w.prototype.save=function(A){A=typeof A!="boolean"||A;for(var j=this.pdf.internal.getCurrentPageInfo().pageNumber,z=0;z0||this.margin[1]>0||this.margin[2]>0||this.margin[3]>0};w.prototype.drawImage=function(A,j,z,W,Y,te,ce,le,ve){var Se=this.pdf.getImageProperties(A),Ee=1,Ie=1,ke=1,P=1;W!==void 0&&le!==void 0&&(ke=le/W,P=ve/Y,Ee=Se.width/W*le/W,Ie=Se.height/Y*ve/Y),te===void 0&&(te=j,ce=z,j=0,z=0),W!==void 0&&le===void 0&&(le=W,ve=Y),W===void 0&&le===void 0&&(le=Se.width,ve=Se.height);var Ne=this.ctx.transform.decompose(),ze=ee(Ne.rotate.shx),Te=new u,ye=(Te=(Te=(Te=Te.multiply(Ne.translate)).multiply(Ne.skew)).multiply(Ne.scale)).applyToRectangle(new o(te-j*ke,ce-z*P,W*Ee,Y*Ie));if(this.autoPaging){for(var Ge,Re=F.call(this,ye),$e=[],Ye=0;YeSt||atye||Re0)){for(;ve>=0;ve--)if(Y[ve-1].close!==!0&&Y[ve-1].begin!==!0){Y[ve-1].deltas.push(z),Y[ve-1].abs.push(le);break}}break;case"bct":z=[le.x1-te[ce-1].x,le.y1-te[ce-1].y,le.x2-te[ce-1].x,le.y2-te[ce-1].y,le.x-te[ce-1].x,le.y-te[ce-1].y],Y[Y.length-1].deltas.push(z);break;case"qct":var Se=te[ce-1].x+2/3*(le.x1-te[ce-1].x),Ee=te[ce-1].y+2/3*(le.y1-te[ce-1].y),Ie=le.x+2/3*(le.x1-le.x),ke=le.y+2/3*(le.y1-le.y),P=le.x,Ne=le.y;z=[Se-te[ce-1].x,Ee-te[ce-1].y,Ie-te[ce-1].x,ke-te[ce-1].y,P-te[ce-1].x,Ne-te[ce-1].y],Y[Y.length-1].deltas.push(z);break;case"arc":Y.push({deltas:[],abs:[],arc:!0}),Array.isArray(Y[Y.length-1].abs)&&Y[Y.length-1].abs.push(le)}}W=j?null:A==="stroke"?"stroke":"fill";for(var ze=!1,Te=0;Te=.01&&(W=this.pdf.internal.getFontSize(),this.pdf.setFontSize(W*A.scale),Y=this.lineWidth,this.lineWidth=Y*A.scale);var ht=this.autoPaging!=="text";if(ht||Ue.y+Ue.h<=Ye){if(ht||Ue.y>=Re&&Ue.x<=vt){var Ve=ht?A.text:this.pdf.splitTextToSize(A.text,A.maxWidth||vt-Ue.x)[0],Qt=D([JSON.parse(JSON.stringify(Ie))],this.posX+this.margin[3],-bt+Re+this.ctx.prevPageLastElemOffset)[0],At=ht&&(Ge>Te||Ge=.01&&(this.pdf.setFontSize(W),this.lineWidth=Y)}}else A.scale>=.01&&(W=this.pdf.internal.getFontSize(),this.pdf.setFontSize(W*A.scale),Y=this.lineWidth,this.lineWidth=Y*A.scale),this.pdf.text(A.text,ve.x+this.posX,ve.y+this.posY,{angle:A.angle,align:j,renderingMode:A.renderingMode,maxWidth:A.maxWidth}),A.scale>=.01&&(this.pdf.setFontSize(W),this.lineWidth=Y)},U=function(A,j,z,W){z=z||0,W=W||0,this.pdf.internal.out(t(A+z)+" "+r(j+W)+" l")},$=function(A,j,z){return this.pdf.lines(A,j,z,null,null)},re=function(A,j,z,W,Y,te,ce,le){this.pdf.internal.out([e(a(z+A)),e(i(W+j)),e(a(Y+A)),e(i(te+j)),e(a(ce+A)),e(i(le+j)),"c"].join(" "))},oe=function(A,j,z,W){for(var Y=2*Math.PI,te=Math.PI/2;j>z;)j-=Y;var ce=Math.abs(z-j);ce1e-5;){var Ee=Se+ve*Math.min(ce,te);le.push(he.call(this,A,Se,Ee)),ce-=Math.abs(Ee-Se),Se=Ee}return le},he=function(A,j,z){var W=(z-j)/2,Y=A*Math.cos(W),te=A*Math.sin(W),ce=Y,le=-te,ve=ce*ce+le*le,Se=ve+ce*Y+le*te,Ee=4/3*(Math.sqrt(2*ve*Se)-Se)/(ce*te-le*Y),Ie=ce-Ee*le,ke=le+Ee*ce,P=Ie,Ne=-ke,ze=W+j,Te=Math.cos(ze),ye=Math.sin(ze);return{x1:A*Math.cos(j),y1:A*Math.sin(j),x2:Ie*Te-ke*ye,y2:Ie*ye+ke*Te,x3:P*Te-Ne*ye,y3:P*ye+Ne*Te,x4:A*Math.cos(z),y4:A*Math.sin(z)}},ee=function(A){return 180*A/Math.PI},ue=function(A,j,z,W,Y,te){var ce=A+.5*(z-A),le=j+.5*(W-j),ve=Y+.5*(z-Y),Se=te+.5*(W-te),Ee=Math.min(A,Y,ce,ve),Ie=Math.max(A,Y,ce,ve),ke=Math.min(j,te,le,Se),P=Math.max(j,te,le,Se);return new o(Ee,ke,Ie-Ee,P-ke)},me=function(A,j,z,W,Y,te,ce,le){var ve,Se,Ee,Ie,ke,P,Ne,ze,Te,ye,Ge,Re,$e,Ye,St=z-A,vt=W-j,at=Y-z,bt=te-W,ft=ce-Y,Ue=le-te;for(Se=0;Se<41;Se++)Te=(Ne=(Ee=A+(ve=Se/40)*St)+ve*((ke=z+ve*at)-Ee))+ve*(ke+ve*(Y+ve*ft-ke)-Ne),ye=(ze=(Ie=j+ve*vt)+ve*((P=W+ve*bt)-Ie))+ve*(P+ve*(te+ve*Ue-P)-ze),Se==0?(Ge=Te,Re=ye,$e=Te,Ye=ye):(Ge=Math.min(Ge,Te),Re=Math.min(Re,ye),$e=Math.max($e,Te),Ye=Math.max(Ye,ye));return new o(Math.round(Ge),Math.round(Re),Math.round($e-Ge),Math.round(Ye-Re))},be=function(){if(this.prevLineDash||this.ctx.lineDash.length||this.ctx.lineDashOffset){var A,j,z=(A=this.ctx.lineDash,j=this.ctx.lineDashOffset,JSON.stringify({lineDash:A,lineDashOffset:j}));this.prevLineDash!==z&&(this.pdf.setLineDash(this.ctx.lineDash,this.ctx.lineDashOffset),this.prevLineDash=z)}}})(We.API),(function(n){var e=function(c){var o,u,f,p,w,v,d,E,C,F;for(u=[],f=0,p=(c+=o="\0\0\0\0".slice(c.length%4||4)).length;p>f;f+=4)(w=(c.charCodeAt(f)<<24)+(c.charCodeAt(f+1)<<16)+(c.charCodeAt(f+2)<<8)+c.charCodeAt(f+3))!==0?(v=(w=((w=((w=((w=(w-(F=w%85))/85)-(C=w%85))/85)-(E=w%85))/85)-(d=w%85))/85)%85,u.push(v+33,d+33,E+33,C+33,F+33)):u.push(122);return(function(L,D){for(var q=D;q>0;q--)L.pop()})(u,o.length),String.fromCharCode.apply(String,u)+"~>"},t=function(c){var o,u,f,p,w,v=String,d="length",E=255,C="charCodeAt",F="slice",L="replace";for(c[F](-2),c=c[F](0,-2)[L](/\s/g,"")[L]("z","!!!!!"),f=[],p=0,w=(c+=o="uuuuu"[F](c[d]%5||5))[d];w>p;p+=5)u=52200625*(c[C](p)-33)+614125*(c[C](p+1)-33)+7225*(c[C](p+2)-33)+85*(c[C](p+3)-33)+(c[C](p+4)-33),f.push(E&u>>24,E&u>>16,E&u>>8,E&u);return(function(D,q){for(var M=q;M>0;M--)D.pop()})(f,o[d]),v.fromCharCode.apply(v,f)},r=function(c){return c.split("").map(function(o){return("0"+o.charCodeAt().toString(16)).slice(-2)}).join("")+">"},a=function(c){var o=new RegExp(/^([0-9A-Fa-f]{2})+$/);if((c=c.replace(/\s/g,"")).indexOf(">")!==-1&&(c=c.substr(0,c.indexOf(">"))),c.length%2&&(c+="0"),o.test(c)===!1)return"";for(var u="",f=0;fimport("./html2canvas.esm-B0tyYwQk.js"),[],import.meta.url)).catch(function(o){return Promise.reject(new Error("Could not load html2canvas: "+o))}).then(function(o){return o.default?o.default:o})}function t(){return(nt.DOMPurify?Promise.resolve(nt.DOMPurify):_l(()=>import("./builder-DygomDiV.js").then(o=>o.fH),__vite__mapDeps([0,1]),import.meta.url)).catch(function(o){return Promise.reject(new Error("Could not load dompurify: "+o))}).then(function(o){return o.default?o.default:o})}var r=function(o){var u=jt(o);return u==="undefined"?"undefined":u==="string"||o instanceof String?"string":u==="number"||o instanceof Number?"number":u==="function"||o instanceof Function?"function":o&&o.constructor===Array?"array":o&&o.nodeType===1?"element":u==="object"?"object":"unknown"},a=function(o,u){var f=document.createElement(o);for(var p in u.className&&(f.className=u.className),u.innerHTML&&u.dompurify&&(f.innerHTML=u.dompurify.sanitize(u.innerHTML)),u.style)f.style[p]=u.style[p];return f},i=function o(u,f){for(var p=u.nodeType===3?document.createTextNode(u.nodeValue):u.cloneNode(!1),w=u.firstChild;w;w=w.nextSibling)f!==!0&&w.nodeType===1&&w.nodeName==="SCRIPT"||p.appendChild(o(w,f));return u.nodeType===1&&(u.nodeName==="CANVAS"?(p.width=u.width,p.height=u.height,p.getContext("2d").drawImage(u,0,0)):u.nodeName!=="TEXTAREA"&&u.nodeName!=="SELECT"||(p.value=u.value),p.addEventListener("load",function(){p.scrollTop=u.scrollTop,p.scrollLeft=u.scrollLeft},!0)),p},c=function o(u){var f=Object.assign(o.convert(Promise.resolve()),JSON.parse(JSON.stringify(o.template))),p=o.convert(Promise.resolve(),f);return(p=p.setProgress(1,o,1,[o])).set(u)};(c.prototype=Object.create(Promise.prototype)).constructor=c,c.convert=function(o,u){return o.__proto__=u||c.prototype,o},c.template={prop:{src:null,container:null,overlay:null,canvas:null,img:null,pdf:null,pageSize:null,callback:function(){}},progress:{val:0,state:null,n:0,stack:[]},opt:{filename:"file.pdf",margin:[0,0,0,0],enableLinks:!0,x:0,y:0,html2canvas:{},jsPDF:{},backgroundColor:"transparent"}},c.prototype.from=function(o,u){return this.then(function(){switch(u=u||(function(f){switch(r(f)){case"string":return"string";case"element":return f.nodeName.toLowerCase()==="canvas"?"canvas":"element";default:return"unknown"}})(o),u){case"string":return this.then(t).then(function(f){return this.set({src:a("div",{innerHTML:o,dompurify:f})})});case"element":return this.set({src:o});case"canvas":return this.set({canvas:o});case"img":return this.set({img:o});default:return this.error("Unknown source type.")}})},c.prototype.to=function(o){switch(o){case"container":return this.toContainer();case"canvas":return this.toCanvas();case"img":return this.toImg();case"pdf":return this.toPdf();default:return this.error("Invalid target.")}},c.prototype.toContainer=function(){return this.thenList([function(){return this.prop.src||this.error("Cannot duplicate - no source HTML.")},function(){return this.prop.pageSize||this.setPageSize()}]).then(function(){var o={position:"relative",display:"inline-block",width:(typeof this.opt.width!="number"||isNaN(this.opt.width)||typeof this.opt.windowWidth!="number"||isNaN(this.opt.windowWidth)?Math.max(this.prop.src.clientWidth,this.prop.src.scrollWidth,this.prop.src.offsetWidth):this.opt.windowWidth)+"px",left:0,right:0,top:0,margin:"auto",backgroundColor:this.opt.backgroundColor},u=i(this.prop.src,this.opt.html2canvas.javascriptEnabled);u.tagName==="BODY"&&(o.height=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)+"px"),this.prop.overlay=a("div",{className:"html2pdf__overlay",style:{position:"fixed",overflow:"hidden",zIndex:1e3,left:"-100000px",right:0,bottom:0,top:0}}),this.prop.container=a("div",{className:"html2pdf__container",style:o}),this.prop.container.appendChild(u),this.prop.container.firstChild.appendChild(a("div",{style:{clear:"both",border:"0 none transparent",margin:0,padding:0,height:0}})),this.prop.container.style.float="none",this.prop.overlay.appendChild(this.prop.container),document.body.appendChild(this.prop.overlay),this.prop.container.firstChild.style.position="relative",this.prop.container.height=Math.max(this.prop.container.firstChild.clientHeight,this.prop.container.firstChild.scrollHeight,this.prop.container.firstChild.offsetHeight)+"px"})},c.prototype.toCanvas=function(){var o=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(o).then(e).then(function(u){var f=Object.assign({},this.opt.html2canvas);return delete f.onrendered,u(this.prop.container,f)}).then(function(u){(this.opt.html2canvas.onrendered||function(){})(u),this.prop.canvas=u,document.body.removeChild(this.prop.overlay)})},c.prototype.toContext2d=function(){var o=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(o).then(e).then(function(u){var f=this.opt.jsPDF,p=this.opt.fontFaces,w=typeof this.opt.width!="number"||isNaN(this.opt.width)||typeof this.opt.windowWidth!="number"||isNaN(this.opt.windowWidth)?1:this.opt.width/this.opt.windowWidth,v=Object.assign({async:!0,allowTaint:!0,scale:w,scrollX:this.opt.scrollX||0,scrollY:this.opt.scrollY||0,backgroundColor:"#ffffff",imageTimeout:15e3,logging:!0,proxy:null,removeContainer:!0,foreignObjectRendering:!1,useCORS:!1},this.opt.html2canvas);if(delete v.onrendered,f.context2d.autoPaging=this.opt.autoPaging===void 0||this.opt.autoPaging,f.context2d.posX=this.opt.x,f.context2d.posY=this.opt.y,f.context2d.margin=this.opt.margin,f.context2d.fontFaces=p,p)for(var d=0;dC&&(E=F,F=C,C=E);else{if(o!=="l"&&o!=="landscape")throw"Invalid orientation: "+o;o="l",C>F&&(E=F,F=C,C=E)}return{width:F,height:C,unit:u,k:w,orientation:o}},n.html=function(o,u){(u=u||{}).callback=u.callback||function(){},u.html2canvas=u.html2canvas||{},u.html2canvas.canvas=u.html2canvas.canvas||this.canvas,u.jsPDF=u.jsPDF||this,u.fontFaces=u.fontFaces?u.fontFaces.map(Ul):null;var f=new c(u);return u.worker?f:f.from(o).doCallback()}})(We.API),We.API.addJS=function(n){var e,t,r=(function(a){for(var i="",c=0;c=0&&a[f]==="\\";f--)u++;i+=u%2==0?"\\"+o:o}else i+=o}return i})(n);return this.internal.events.subscribe("postPutResources",function(){e=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/Names [(EmbeddedJS) "+(e+1)+" 0 R]"),this.internal.out(">>"),this.internal.out("endobj"),t=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /JavaScript"),this.internal.out("/JS ("+r+")"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){e!==void 0&&t!==void 0&&this.internal.out("/Names <>")}),this},(function(n){var e;n.events.push(["postPutResources",function(){var t=this,r=/^(\d+) 0 obj$/;if(this.outline.root.children.length>0)for(var a=t.outline.render().split(/\r\n/),i=0;i> endobj")}var d=t.internal.newObject();for(t.internal.write("<< /Names [ "),i=0;i>","endobj"),e=t.internal.newObject(),t.internal.write("<< /Dests "+d+" 0 R"),t.internal.write(">>","endobj")}}]),n.events.push(["putCatalog",function(){var t=this;t.outline.root.children.length>0&&(t.internal.write("/Outlines",this.outline.makeRef(this.outline.root)),this.outline.createNamedDestinations&&t.internal.write("/Names "+e+" 0 R"))}]),n.events.push(["initialized",function(){var t=this;t.outline={createNamedDestinations:!1,root:{children:[]}},t.outline.add=function(r,a,i){var c={title:a,options:i,children:[]};return r==null&&(r=this.root),r.children.push(c),c},t.outline.render=function(){return this.ctx={},this.ctx.val="",this.ctx.pdf=t,this.genIds_r(this.root),this.renderRoot(this.root),this.renderItems(this.root),this.ctx.val},t.outline.genIds_r=function(r){r.id=t.internal.newObjectDeferred();for(var a=0;a0&&(this.line("/First "+this.makeRef(r.children[0])),this.line("/Last "+this.makeRef(r.children[r.children.length-1]))),this.line("/Count "+this.count_r({count:0},r)),this.objEnd()},t.outline.renderItems=function(r){for(var a=this.ctx.pdf.internal.getVerticalCoordinateString,i=0;i0&&this.line("/Prev "+this.makeRef(r.children[i-1])),i0&&(this.line("/First "+this.makeRef(c.children[0])),this.line("/Last "+this.makeRef(c.children[c.children.length-1])));var o=this.count=this.count_r({count:0},c);if(o>0&&this.line("/Count "+o),c.options&&c.options.pageNumber){var u=t.internal.getPageInfo(c.options.pageNumber);this.line("/Dest ["+u.objId+" 0 R /XYZ 0 "+a(0)+" 0]")}this.objEnd()}for(var f=0;f> \r endobj\r `},t.outline.count_r=function(r,a){for(var i=0;i1){$=!0,oe=void 0;var Y=B*X;he=new Uint8Array(Y);for(var te=new DataView(_.buffer),ce=0;ce536870912)throw new Error("Image dimensions exceed 512MB, which is too large.");this.data=new Uint8Array(e);try{this[n]()}catch(t){Ot.log("bit decode error:"+t)}},yr.prototype.bit1=function(){var n,e=Math.ceil(this.width/8),t=e%4;for(n=this.height-1;n>=0;n--){for(var r=this.bottom_up?n:this.height-1-n,a=0;a>7-o&1];this.data[c+4*o]=u.blue,this.data[c+4*o+1]=u.green,this.data[c+4*o+2]=u.red,this.data[c+4*o+3]=255}t!==0&&(this.pos+=4-t)}},yr.prototype.bit4=function(){for(var n=Math.ceil(this.width/2),e=n%4,t=this.height-1;t>=0;t--){for(var r=this.bottom_up?t:this.height-1-t,a=0;a>4,u=15&i,f=this.palette[o];if(this.data[c]=f.blue,this.data[c+1]=f.green,this.data[c+2]=f.red,this.data[c+3]=255,2*a+1>=this.width)break;f=this.palette[u],this.data[c+4]=f.blue,this.data[c+4+1]=f.green,this.data[c+4+2]=f.red,this.data[c+4+3]=255}e!==0&&(this.pos+=4-e)}},yr.prototype.bit8=function(){for(var n=this.width%4,e=this.height-1;e>=0;e--){for(var t=this.bottom_up?e:this.height-1-e,r=0;r=0;t--){for(var r=this.bottom_up?t:this.height-1-t,a=0;a>5&e)/e*255|0,u=(i>>10&e)/e*255|0,f=i>>15?255:0,p=r*this.width*4+4*a;this.data[p]=u,this.data[p+1]=o,this.data[p+2]=c,this.data[p+3]=f}this.pos+=n}},yr.prototype.bit16=function(){for(var n=this.width%3,e=parseInt("11111",2),t=parseInt("111111",2),r=this.height-1;r>=0;r--){for(var a=this.bottom_up?r:this.height-1-r,i=0;i>5&t)/t*255|0,f=(c>>11)/e*255|0,p=a*this.width*4+4*i;this.data[p]=f,this.data[p+1]=u,this.data[p+2]=o,this.data[p+3]=255}this.pos+=n}},yr.prototype.bit24=function(){for(var n=this.height-1;n>=0;n--){for(var e=this.bottom_up?n:this.height-1-n,t=0;t=0;n--)for(var e=this.bottom_up?n:this.height-1-n,t=0;tr&&(a.push(n.slice(u,i)),o=0,u=i),o+=e[i],i++;return u!==i&&a.push(n.slice(u,i)),a},xh=function(n,e,t){t||(t={});var r,a,i,c,o,u,f,p=[],w=[p],v=t.textIndent||0,d=0,E=0,C=n.split(" "),F=po.apply(this,[" ",t])[0];if(u=t.lineIndent===-1?C[0].length+2:t.lineIndent||0){var L=Array(u).join(" "),D=[];C.map(function(M){(M=M.split(/\s*\n/)).length>1?D=D.concat(M.map(function(Q,ae){return(ae&&Q.length?` `:"")+Q})):D.push(M[0])}),C=D,u=yh.apply(this,[L,t])}for(i=0,c=C.length;ie||q){if(E>e){for(o=_h.apply(this,[r,a,e-(v+d),e]),p.push(o.shift()),p=[o.pop()];o.length;)w.push([o.shift()]);E=a.slice(r.length-(p[0]?p[0].length:0)).reduce(function(M,Q){return M+Q},0)}else p=[r];w.push(p),v=E+u,d=F}else p.push(r),v+=d+E,d=F}return f=u?function(M,Q){return(Q?L:"")+M.join(" ")}:function(M){return M.join(" ")},w.map(f)},Ea.splitTextToSize=function(n,e,t){var r,a=(t=t||{}).fontSize||this.internal.getFontSize(),i=function(p){if(p.widths&&p.kerning)return{widths:p.widths,kerning:p.kerning};var w=this.internal.getFont(p.fontName,p.fontStyle),v="Unicode";return w.metadata[v]?{widths:w.metadata[v].widths||{0:1},kerning:w.metadata[v].kerning||{}}:{font:w.metadata,fontSize:this.internal.getFontSize(),charSpace:this.internal.getCharSpace()}}.call(this,t);r=Array.isArray(n)?n:String(n).split(/\r?\n/);var c=1*this.internal.scaleFactor*e/a;i.textIndent=t.textIndent?1*t.textIndent*this.internal.scaleFactor/a:0,i.lineIndent=t.lineIndent;var o,u,f=[];for(o=0,u=r.length;oimport("./index.es-CikUGx6W.js"),__vite__mapDeps([2,0,1,3,4]),import.meta.url)).catch(function(v){return Promise.reject(new Error("Could not load canvg: "+v))}).then(function(v){return v.default?v.default:v}).then(function(v){return v.fromString(f,n,p)},function(){return Promise.reject(new Error("Could not load canvg."))}).then(function(v){return v.render(p)}).then(function(){w.addImage(u.toDataURL("image/jpeg",1),e,t,r,a,c,o)})},We.API.putTotalPages=function(n){var e,t=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(e=new RegExp(n,"g"),t=this.internal.getNumberOfPages()):(e=new RegExp(this.pdfEscape16(n,this.internal.getFont()),"g"),t=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var r=1;r<=this.internal.getNumberOfPages();r++)for(var a=0;a1){for(p=0;p>`)}),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=t,this},We.API.addMetadata=function(n,e){return this.internal.__metadata__===void 0&&(this.internal.__metadata__={metadata:n,namespaceUri:e??"http://jspdf.default.namespaceuri/",rawXml:typeof e=="boolean"&&e},this.internal.events.subscribe("putCatalog",cg),this.internal.events.subscribe("postPutResources",lg)),this},(function(n){var e=n.API,t=e.pdfEscape16=function(i,c){for(var o,u=c.metadata.Unicode.widths,f=["","0","00","000","0000"],p=[""],w=0,v=i.length;w> def /CMapName /Adobe-Identity-UCS def /CMapType 2 def 1 begincodespacerange <0000> endcodespacerange`,u=[],w=0,v=(o=Object.keys(i).sort(function(d,E){return d-E})).length;w=100&&(p+=` `+u.length+` beginbfchar `+u.join(` `)+` endbfchar`,u=[]),i[c]!==void 0&&i[c]!==null&&typeof i[c].toString=="function"&&(f=("0000"+i[c].toString(16)).slice(-4),c=("0000"+(+c).toString(16)).slice(-4),u.push("<"+c+"><"+f+">"));return u.length&&(p+=` `+u.length+` beginbfchar `+u.join(` `)+` endbfchar `),p+`endcmap CMapName currentdict /CMap defineresource pop end end`};e.events.push(["putFont",function(i){(function(c){var o=c.font,u=c.out,f=c.newObject,p=c.putStream;if(o.metadata instanceof n.API.TTFFont&&o.encoding==="Identity-H"){for(var w=o.metadata.Unicode.widths,v=o.metadata.subset.encode(o.metadata.glyIdsUsed,1),d="",E=0;E>"),u("endobj");var D=f();u("<<"),u("/Type /Font"),u("/BaseFont /"+Ra(o.fontName)),u("/FontDescriptor "+L+" 0 R"),u("/W "+n.API.PDFObject.convert(w)),u("/CIDToGIDMap /Identity"),u("/DW 1000"),u("/Subtype /CIDFontType2"),u("/CIDSystemInfo"),u("<<"),u("/Supplement 0"),u("/Registry (Adobe)"),u("/Ordering ("+o.encoding+")"),u(">>"),u(">>"),u("endobj"),o.objectNumber=f(),u("<<"),u("/Type /Font"),u("/Subtype /Type0"),u("/ToUnicode "+F+" 0 R"),u("/BaseFont /"+Ra(o.fontName)),u("/Encoding /"+o.encoding),u("/DescendantFonts ["+D+" 0 R]"),u(">>"),u("endobj"),o.isAlreadyPutted=!0}})(i)}]),e.events.push(["putFont",function(i){(function(c){var o=c.font,u=c.out,f=c.newObject,p=c.putStream;if(o.metadata instanceof n.API.TTFFont&&o.encoding==="WinAnsiEncoding"){for(var w=o.metadata.rawData,v="",d=0;d>"),u("endobj"),o.objectNumber=f();for(var L=0;L>"),u("endobj"),o.isAlreadyPutted=!0}})(i)}]);var a=function(i){var c,o=i.text||"",u=i.x,f=i.y,p=i.options||{},w=i.mutex||{},v=w.pdfEscape,d=w.activeFontKey,E=w.fonts,C=d,F="",L=0,D="",q=E[C].encoding;if(E[C].encoding!=="Identity-H")return{text:o,x:u,y:f,options:p,mutex:w};for(D=o,C=d,Array.isArray(o)&&(D=o[0]),L=0;L","<","[","]","[","{","}","{","«","»","«","‹","›","‹","⁅","⁆","⁅","⁽","⁾","⁽","₍","₎","₍","≤","≥","≤","〈","〉","〈","﹙","﹚","﹙","﹛","﹜","﹛","﹝","﹞","﹝","﹤","﹥","﹤"],L=new RegExp(/^([1-4|9]|1[0-9]|2[0-9]|3[0168]|4[04589]|5[012]|7[78]|159|16[0-9]|17[0-2]|21[569]|22[03489]|250)$/),D=!1,q=0;this.__bidiEngine__={};var M=function(_){var N=_.charCodeAt(),U=N>>8,$=C[U];return $!==void 0?w[256*$+(255&N)]:U===252||U===253?"AL":L.test(U)?"L":U===8?"R":"N"},Q=function(_){for(var N,U=0;U<_.length;U++){if((N=M(_.charAt(U)))==="L")return!1;if(N==="R")return!0}return!1},ae=function(_,N,U,$){var re,oe,he,ee,ue=N[$];switch(ue){case"L":case"R":case"LRE":case"RLE":case"LRO":case"RLO":case"PDF":D=!1;break;case"N":case"AN":break;case"EN":D&&(ue="AN");break;case"AL":D=!0,ue="R";break;case"WS":case"BN":ue="N";break;case"CS":$<1||$+1>=N.length||(re=U[$-1])!=="EN"&&re!=="AN"||(oe=N[$+1])!=="EN"&&oe!=="AN"?ue="N":D&&(oe="AN"),ue=oe===re?oe:"N";break;case"ES":ue=(re=$>0?U[$-1]:"B")==="EN"&&$+10&&U[$-1]==="EN"){ue="EN";break}if(D){ue="N";break}for(he=$+1,ee=N.length;he=1425&&me<=2303||me===64286;if(re=N[he],be&&(re==="R"||re==="AL")){ue="R";break}}}ue=$<1||(re=N[$-1])==="B"?"N":U[$-1];break;case"B":D=!1,a=!0,ue=q;break;case"S":i=!0,ue="N"}return ue},se=function(_,N,U){var $=_.split("");return U&&V($,U,{hiLevel:q}),$.reverse(),N&&N.reverse(),$.join("")},V=function(_,N,U){var $,re,oe,he,ee,ue=-1,me=_.length,be=0,A=[],j=q?d:v,z=[];for(D=!1,a=!1,i=!1,re=0;re0)if($===16){for(re=ue;re-1){for(re=ue;re=0&&W[le]==="WS";le--)Y[le]=q}})(z,N,me)},B=function(_,N,U,$,re){if(!(re.hiLevel<_)){if(_===1&&q===1&&!a)return N.reverse(),void(U&&U.reverse());for(var oe,he,ee,ue,me=N.length,be=0;be=_){for(ee=be+1;ee=_;)ee++;for(ue=be,he=ee-1;ue=0&&(oe[me]=F[ue+1])})($,U,re),B(2,$,N,U,re),B(1,$,N,U,re),$.join("")};return this.__bidiEngine__.doBidiReorder=function(_,N,U){if((function(re,oe){if(oe)for(var he=0;he>16)&&(t=-(1+(65535^t))),this.italicAngle=+(t+"."+r)):this.italicAngle=0,this.ascender=Math.round(this.ascender*this.scaleFactor),this.decender=Math.round(this.decender*this.scaleFactor),this.lineGap=Math.round(this.lineGap*this.scaleFactor),this.capHeight=this.os2.exists&&this.os2.capHeight||this.ascender,this.xHeight=this.os2.exists&&this.os2.xHeight||0,this.familyClass=(this.os2.exists&&this.os2.familyClass||0)>>8,this.isSerif=(i=this.familyClass)===1||i===2||i===3||i===4||i===5||i===7,this.isScript=this.familyClass===10,this.flags=0,this.post.isFixedPitch&&(this.flags|=1),this.isSerif&&(this.flags|=2),this.isScript&&(this.flags|=8),this.italicAngle!==0&&(this.flags|=64),this.flags|=32,!this.cmap.unicode)throw new Error("No unicode cmap for font")},n.prototype.characterToGlyph=function(e){var t;return((t=this.cmap.unicode)!=null?t.codeMap[e]:void 0)||0},n.prototype.widthOfGlyph=function(e){var t;return t=1e3/this.head.unitsPerEm,this.hmtx.forGlyph(e).advance*t},n.prototype.widthOfString=function(e,t,r){var a,i,c,o;for(c=0,i=0,o=(e=""+e).length;0<=o?io;i=0<=o?++i:--i)a=e.charCodeAt(i),c+=this.widthOfGlyph(this.characterToGlyph(a))+r*(1e3/t)||0;return c*(t/1e3)},n.prototype.lineHeight=function(e,t){var r;return t==null&&(t=!1),r=t?this.lineGap:0,(this.ascender+r-this.decender)/1e3*e},n})();var kr,Ni=(function(){function n(e){this.data=e??[],this.pos=0,this.length=this.data.length}return n.prototype.readByte=function(){return this.data[this.pos++]},n.prototype.writeByte=function(e){return this.data[this.pos++]=e},n.prototype.readUInt32=function(){return 16777216*this.readByte()+(this.readByte()<<16)+(this.readByte()<<8)+this.readByte()},n.prototype.writeUInt32=function(e){return this.writeByte(e>>>24&255),this.writeByte(e>>16&255),this.writeByte(e>>8&255),this.writeByte(255&e)},n.prototype.readInt32=function(){var e;return(e=this.readUInt32())>=2147483648?e-4294967296:e},n.prototype.writeInt32=function(e){return e<0&&(e+=4294967296),this.writeUInt32(e)},n.prototype.readUInt16=function(){return this.readByte()<<8|this.readByte()},n.prototype.writeUInt16=function(e){return this.writeByte(e>>8&255),this.writeByte(255&e)},n.prototype.readInt16=function(){var e;return(e=this.readUInt16())>=32768?e-65536:e},n.prototype.writeInt16=function(e){return e<0&&(e+=65536),this.writeUInt16(e)},n.prototype.readString=function(e){var t,r;for(r=[],t=0;0<=e?te;t=0<=e?++t:--t)r[t]=String.fromCharCode(this.readByte());return r.join("")},n.prototype.writeString=function(e){var t,r,a;for(a=[],t=0,r=e.length;0<=r?tr;t=0<=r?++t:--t)a.push(this.writeByte(e.charCodeAt(t)));return a},n.prototype.readShort=function(){return this.readInt16()},n.prototype.writeShort=function(e){return this.writeInt16(e)},n.prototype.readLongLong=function(){var e,t,r,a,i,c,o,u;return e=this.readByte(),t=this.readByte(),r=this.readByte(),a=this.readByte(),i=this.readByte(),c=this.readByte(),o=this.readByte(),u=this.readByte(),128&e?-1*(72057594037927940*(255^e)+281474976710656*(255^t)+1099511627776*(255^r)+4294967296*(255^a)+16777216*(255^i)+65536*(255^c)+256*(255^o)+(255^u)+1):72057594037927940*e+281474976710656*t+1099511627776*r+4294967296*a+16777216*i+65536*c+256*o+u},n.prototype.writeLongLong=function(e){var t,r;return t=Math.floor(e/4294967296),r=4294967295&e,this.writeByte(t>>24&255),this.writeByte(t>>16&255),this.writeByte(t>>8&255),this.writeByte(255&t),this.writeByte(r>>24&255),this.writeByte(r>>16&255),this.writeByte(r>>8&255),this.writeByte(255&r)},n.prototype.readInt=function(){return this.readInt32()},n.prototype.writeInt=function(e){return this.writeInt32(e)},n.prototype.read=function(e){var t,r;for(t=[],r=0;0<=e?re;r=0<=e?++r:--r)t.push(this.readByte());return t},n.prototype.write=function(e){var t,r,a,i;for(i=[],r=0,a=e.length;ri;a=0<=i?++a:--a)r={tag:t.readString(4),checksum:t.readInt(),offset:t.readInt(),length:t.readInt()},this.tables[r.tag]=r}return e.prototype.encode=function(t){var r,a,i,c,o,u,f,p,w,v,d,E,C;for(C in d=Object.keys(t).length,u=Math.log(2),w=16*Math.floor(Math.log(d)/u),c=Math.floor(w/u),p=16*d-w,(a=new Ni).writeInt(this.scalarType),a.writeShort(d),a.writeShort(w),a.writeShort(c),a.writeShort(p),i=16*d,f=a.pos+i,o=null,E=[],t)for(v=t[C],a.writeString(C),a.writeInt(n(v)),a.writeInt(f),a.writeInt(v.length),E=E.concat(v),C==="head"&&(o=f),f+=v.length;f%4;)E.push(0),f++;return a.write(E),r=2981146554-n(a.data),a.pos=o+8,a.writeUInt32(r),a.data},n=function(t){var r,a,i,c;for(t=Hf.call(t);t.length%4;)t.push(0);for(i=new Ni(t),a=0,r=0,c=t.length;rv;u=0<=v?++M:--M)Q.push(e.readUInt16());return Q})(),e.pos+=2,C=(function(){var M,Q;for(Q=[],u=M=0;0<=v?Mv;u=0<=v?++M:--M)Q.push(e.readUInt16());return Q})(),f=(function(){var M,Q;for(Q=[],u=M=0;0<=v?Mv;u=0<=v?++M:--M)Q.push(e.readUInt16());return Q})(),p=(function(){var M,Q;for(Q=[],u=M=0;0<=v?Mv;u=0<=v?++M:--M)Q.push(e.readUInt16());return Q})(),a=(this.length-e.pos+this.offset)/2,o=(function(){var M,Q;for(Q=[],u=M=0;0<=a?Ma;u=0<=a?++M:--M)Q.push(e.readUInt16());return Q})(),u=L=0,q=i.length;L=F;r=E<=F?++D:--D)p[u]===0?c=r+f[u]:(c=o[p[u]/2+(r-E)-(v-u)]||0)!==0&&(c+=f[u]),this.codeMap[r]=65535&c}e.pos=w}return n.encode=function(e,t){var r,a,i,c,o,u,f,p,w,v,d,E,C,F,L,D,q,M,Q,ae,se,V,B,X,_,N,U,$,re,oe,he,ee,ue,me,be,A,j,z,W,Y,te,ce,le,ve,Se,Ee;switch($=new Ni,c=Object.keys(e).sort(function(Ie,ke){return Ie-ke}),t){case"macroman":for(C=0,F=(function(){var Ie=[];for(E=0;E<256;++E)Ie.push(0);return Ie})(),D={0:0},i={},re=0,ue=c.length;re=32768)for(u.push(0),ae.push(2*(d.length+B-E)),a=ee=_;_<=p?ee<=p:ee>=p;a=_<=p?++ee:--ee)d.push(r[a].new);else u.push(U-_),ae.push(0)}for($.writeUInt16(3),$.writeUInt16(1),$.writeUInt32(12),$.writeUInt16(4),$.writeUInt16(16+8*B+2*d.length),$.writeUInt16(0),$.writeUInt16(X),$.writeUInt16(V),$.writeUInt16(v),$.writeUInt16(se),te=0,A=w.length;tea;r=0<=a?++r:--r)t=new Eh(e,this.offset),this.tables.push(t),t.isUnicode&&this.unicode==null&&(this.unicode=t);return!0},n.encode=function(e,t){var r,a;return t==null&&(t="macroman"),r=Eh.encode(e,t),(a=new Ni).writeUInt16(0),a.writeUInt16(1),r.table=a.data.concat(r.subtable),r},n})(),dg=(function(){function n(){return n.__super__.constructor.apply(this,arguments)}return Mr(n,kr),n.prototype.tag="hhea",n.prototype.parse=function(e){return e.pos=this.offset,this.version=e.readInt(),this.ascender=e.readShort(),this.decender=e.readShort(),this.lineGap=e.readShort(),this.advanceWidthMax=e.readShort(),this.minLeftSideBearing=e.readShort(),this.minRightSideBearing=e.readShort(),this.xMaxExtent=e.readShort(),this.caretSlopeRise=e.readShort(),this.caretSlopeRun=e.readShort(),this.caretOffset=e.readShort(),e.pos+=8,this.metricDataFormat=e.readShort(),this.numberOfMetrics=e.readUInt16()},n})(),pg=(function(){function n(){return n.__super__.constructor.apply(this,arguments)}return Mr(n,kr),n.prototype.tag="OS/2",n.prototype.parse=function(e){if(e.pos=this.offset,this.version=e.readUInt16(),this.averageCharWidth=e.readShort(),this.weightClass=e.readUInt16(),this.widthClass=e.readUInt16(),this.type=e.readShort(),this.ySubscriptXSize=e.readShort(),this.ySubscriptYSize=e.readShort(),this.ySubscriptXOffset=e.readShort(),this.ySubscriptYOffset=e.readShort(),this.ySuperscriptXSize=e.readShort(),this.ySuperscriptYSize=e.readShort(),this.ySuperscriptXOffset=e.readShort(),this.ySuperscriptYOffset=e.readShort(),this.yStrikeoutSize=e.readShort(),this.yStrikeoutPosition=e.readShort(),this.familyClass=e.readShort(),this.panose=(function(){var t,r;for(r=[],t=0;t<10;++t)r.push(e.readByte());return r})(),this.charRange=(function(){var t,r;for(r=[],t=0;t<4;++t)r.push(e.readInt());return r})(),this.vendorID=e.readString(4),this.selection=e.readShort(),this.firstCharIndex=e.readShort(),this.lastCharIndex=e.readShort(),this.version>0&&(this.ascent=e.readShort(),this.descent=e.readShort(),this.lineGap=e.readShort(),this.winAscent=e.readShort(),this.winDescent=e.readShort(),this.codePageRange=(function(){var t,r;for(r=[],t=0;t<2;t=++t)r.push(e.readInt());return r})(),this.version>1))return this.xHeight=e.readShort(),this.capHeight=e.readShort(),this.defaultChar=e.readShort(),this.breakChar=e.readShort(),this.maxContext=e.readShort()},n})(),gg=(function(){function n(){return n.__super__.constructor.apply(this,arguments)}return Mr(n,kr),n.prototype.tag="post",n.prototype.parse=function(e){var t,r,a;switch(e.pos=this.offset,this.format=e.readInt(),this.italicAngle=e.readInt(),this.underlinePosition=e.readShort(),this.underlineThickness=e.readShort(),this.isFixedPitch=e.readInt(),this.minMemType42=e.readInt(),this.maxMemType42=e.readInt(),this.minMemType1=e.readInt(),this.maxMemType1=e.readInt(),this.format){case 65536:case 196608:break;case 131072:var i;for(r=e.readUInt16(),this.glyphNameIndex=[],i=0;0<=r?ir;i=0<=r?++i:--i)this.glyphNameIndex.push(e.readUInt16());for(this.names=[],a=[];e.poso;i=0<=o?++c:--c)u.push(e.readUInt32());return u}.call(this)}},n})(),mg=function(n,e){this.raw=n,this.length=n.length,this.platformID=e.platformID,this.encodingID=e.encodingID,this.languageID=e.languageID},vg=(function(){function n(){return n.__super__.constructor.apply(this,arguments)}return Mr(n,kr),n.prototype.tag="name",n.prototype.parse=function(e){var t,r,a,i,c,o,u,f,p,w,v;for(e.pos=this.offset,e.readShort(),t=e.readShort(),o=e.readShort(),r=[],i=0;0<=t?it;i=0<=t?++i:--i)r.push({platformID:e.readShort(),encodingID:e.readShort(),languageID:e.readShort(),nameID:e.readShort(),length:e.readShort(),offset:this.offset+o+e.readShort()});for(u={},i=p=0,w=r.length;po;t=0<=o?++t:--t)this.metrics.push({advance:e.readUInt16(),lsb:e.readInt16()});for(a=this.file.maxp.numGlyphs-this.file.hhea.numberOfMetrics,this.leftSideBearings=(function(){var f,p;for(p=[],t=f=0;0<=a?fa;t=0<=a?++f:--f)p.push(e.readInt16());return p})(),this.widths=function(){var f,p,w,v;for(v=[],f=0,p=(w=this.metrics).length;fa;t=0<=a?++c:--c)u.push(this.widths.push(r));return u},n.prototype.forGlyph=function(e){return e in this.metrics?this.metrics[e]:{advance:this.metrics[this.metrics.length-1].advance,lsb:this.leftSideBearings[e-this.metrics.length]}},n})(),Hf=[].slice,yg=(function(){function n(){return n.__super__.constructor.apply(this,arguments)}return Mr(n,kr),n.prototype.tag="glyf",n.prototype.parse=function(){return this.cache={}},n.prototype.glyphFor=function(e){var t,r,a,i,c,o,u,f,p,w;return e in this.cache?this.cache[e]:(i=this.file.loca,t=this.file.contents,r=i.indexOf(e),(a=i.lengthOf(e))===0?this.cache[e]=null:(t.pos=this.offset+r,c=(o=new Ni(t.read(a))).readShort(),f=o.readShort(),w=o.readShort(),u=o.readShort(),p=o.readShort(),this.cache[e]=c===-1?new xg(o,f,w,u,p):new _g(o,c,f,w,u,p),this.cache[e]))},n.prototype.encode=function(e,t,r){var a,i,c,o,u;for(c=[],i=[],o=0,u=t.length;o0&&(a+=u)}for(var f=new Array(4*r.length),p=0;p>8,f[4*p+1]=(16711680&r[p])>>16,f[4*p]=(4278190080&r[p])>>24;return f},n})(),Ag=(function(){function n(e){this.font=e,this.subset={},this.unicodes={},this.next=33}return n.prototype.generateCmap=function(){var e,t,r,a,i;for(t in a=this.font.cmap.tables[0].codeMap,e={},i=this.subset)r=i[t],e[t]=a[r];return e},n.prototype.glyphsFor=function(e){var t,r,a,i,c,o,u;for(a={},c=0,o=e.length;c0)for(i in u=this.glyphsFor(t))r=u[i],a[i]=r;return a},n.prototype.encode=function(e,t){var r,a,i,c,o,u,f,p,w,v,d,E,C,F,L;for(a in r=$f.encode(this.generateCmap(),"unicode"),c=this.glyphsFor(e),d={0:0},L=r.charMap)d[(u=L[a]).old]=u.new;for(E in v=r.maxGlyphID,c)E in d||(d[E]=v++);return p=(function(D){var q,M;for(q in M={},D)M[D[q]]=q;return M})(d),w=Object.keys(p).sort(function(D,q){return D-q}),C=(function(){var D,q,M;for(M=[],D=0,q=w.length;D>"),i.join(` `)}return""+t},e})();const Lg={style:{"max-height":"calc(100vh - 200px)","overflow-y":"auto",display:"flex","justify-content":"center"}},Sg={class:"dialog-footer"},Ng=rr({__name:"index",setup(n,{expose:e}){const t=Je(!1),r=Je(),a=Je(!1),i=Je(null),c=v=>{if(a.value=!0,t.value=!0,!v){t.value=!1;return}i.value=v,Ji(()=>{kl(v,{pixelRatio:window.devicePixelRatio||1,quality:1,skipFonts:!1,backgroundColor:"#ffffff"}).then(d=>{r.value.innerHTML="",d.style.width="100%",d.style.height="auto",r.value.appendChild(d)}).finally(()=>{t.value=!1}).catch(d=>{console.error(d),t.value=!1})})},o=()=>{t.value=!0,setTimeout(()=>{Ji(async()=>{try{const v=i.value;if(!v)return;const d=await kl(v,{pixelRatio:2,quality:1,skipFonts:!1,backgroundColor:"#ffffff"});u(d)}catch(v){console.error("PDF export error:",v)}finally{t.value=!1}})})},u=v=>{const d=new We("p","mm","a4"),E=v.toDataURL("image/jpeg",1),C=d.internal.pageSize.getWidth(),F=d.internal.pageSize.getHeight(),L=C,D=v.height*L/v.width;d.addImage(E,"JPEG",0,0,L,D);let q=D-F;for(;q>0;){const M=-(D-q);d.addPage(),d.addImage(E,"JPEG",0,M,L,D),q-=F}d.save("导出文档.pdf")},f=()=>{t.value=!0,setTimeout(()=>{Ji(async()=>{try{const v=i.value;if(!v)return;const d=await kl(v,{pixelRatio:window.devicePixelRatio||1,quality:1,skipFonts:!1,backgroundColor:"#ffffff"});p(d)}catch(v){console.error("JPEG export error:",v)}finally{t.value=!1}})},1)},p=v=>{const d=document.createElement("canvas");d.width=v.width,d.height=v.height;const E=d.getContext("2d");E.fillStyle="#ffffff",E.fillRect(0,0,d.width,d.height),E.drawImage(v,0,0);const C=d.toDataURL("image/jpeg",1),F=document.createElement("a");F.download="webpage-screenshot.jpeg",F.href=C,document.body.appendChild(F),F.click(),document.body.removeChild(F)},w=()=>{a.value=!1,i.value=null,r.value&&(r.value.innerHTML="")};return e({open:c,close:w}),(v,d)=>{const E=Fe("el-button"),C=Fe("el-dialog"),F=To("loading");return Xe(),kt(C,{modelValue:a.value,"onUpdate:modelValue":d[1]||(d[1]=L=>a.value=L),title:v.$t("chat.preview"),style:{overflow:"auto"},width:"60%","before-close":w,"destroy-on-close":"","align-center":""},{footer:Ae(()=>[Pe("span",Sg,[we(E,{loading:t.value,onClick:o},{default:Ae(()=>[fn(it(v.$t("chat.exportPDF")),1)]),_:1},8,["loading"]),we(E,{loading:t.value,type:"primary",onClick:d[0]||(d[0]=()=>{t.value=!0,f()})},{default:Ae(()=>[fn(it(v.$t("chat.exportImg")),1)]),_:1},8,["loading"])])]),default:Ae(()=>[qn((Xe(),vn("div",Lg,[Pe("div",{ref_key:"svgContainerRef",ref:r},null,512)])),[[F,t.value]])]),_:1},8,["modelValue","title"])}}}),Pg={class:"flex h-full w-full"},Cg={class:"chat-pc__left"},Ig={class:"user-info p-16 cursor"},Eg={class:"flex align-center"},Fg={class:"flex align-center p-8"},Rg={class:"mr-8 flex align-center"},Tg={class:"medium mb-4"},Og={class:"color-secondary"},jg={style:{flex:"1",width:"calc(100% - var(--execution-detail-panel-width))"}},Bg={class:"p-16-24 flex-between"},Dg={class:"ellipsis-1",style:{width:"66%"}},Mg={key:0,class:"flex align-center"},qg={key:1,class:"lighter"},Ug={class:"right-height chat-width"},zg={class:"execution-detail-panel",resizable:!1,collapsible:""},$g={class:"p-16 flex-between border-b"},Hg=["title"],Wg={class:"flex align-center"},Vg={key:0,class:"mr-4"},Gg=["href","title"],Yg={class:"execution-detail-content mb-8"},Jg=rr({__name:"index",props:{application_profile:{},applicationAvailable:{type:Boolean}},setup(n){C1(),Ma("scrollData",he),Ma("chatLogPagination",()=>re);const e=Je(),{common:t,chatUser:r}=ta(),a=ws(),i=()=>{e.value?.open(document.getElementById("chatListId"))},c=ac(),o=Je(!1),u=()=>{r.logout().then(()=>{a.push({name:"login",query:c.query})})},f=Je(!1),p=()=>{f.value=!0},w=Je(),v=()=>{w.value?.open()},d=ke=>{Ln.resetCurrentPassword(ke).then(()=>{a.push({name:"login"})})},E=si(()=>({hideLeft:o.value,openLeft:!o.value})),C={id:"new",abstract:hn("chat.createChat")},F=n,L=Je(),D=Je(!1),q=Je(!1),M=si({get:()=>F.application_profile,set:ke=>{}}),Q=Je([]),ae=Je({current_page:1,page_size:20,total:0}),se=Je([]),V=Je("new"),B=Je(hn("chat.createChat"));function X(ke,P){const Ne=Q.value.find(ze=>ze.id==ke);Ne&&(Ne.abstract=P)}function _(ke){Ln.deleteChat(ke.id).then(()=>{V.value===ke.id&&(V.value="new",B.value=hn("chat.createChat"),ae.value.current_page=1,ae.value.total=0,se.value=[]),Q.value=Q.value.filter(P=>P.id!==ke.id)})}function N(){Ln.clearChat(q).then(()=>{V.value="new",B.value=hn("chat.createChat"),ae.value.current_page=1,ae.value.total=0,se.value=[],re.value.current_page=1,Q.value=[],oe()})}function U(ke){if(V.value!=="new"&&ke.scrollTop===0&&ae.value.total>se.value.length){const P=ke.dialogScrollbar.offsetHeight;ae.value.current_page+=1,ee().then(()=>{ke.scrollDiv.setScrollTop(ke.dialogScrollbar.offsetHeight-P)})}}function $(){f.value=!1,Q.value.some(ke=>ke.id==="new")?(ae.value.current_page=1,ae.value.total=0,se.value=[]):(ae.value.current_page=1,ae.value.total=0,se.value=[],Q.value.unshift(C)),Ie(),V.value="new",B.value=hn("chat.createChat")}const re=Je({total:0,page_size:20,current_page:1});function oe(ke){Ln.pageChat(re.value.current_page,re.value.page_size,q).then(P=>{re.value.total=P.data.total,Q.value=[...Q.value,...P.data.records],ke?B.value=Q.value?.[0]?.abstract:(ae.value.current_page=1,ae.value.total=0,se.value=[],V.value="new",B.value=hn("chat.createChat"))})}function he(){oe(!0)}function ee(){return Ln.pageChatRecord(V.value,ae.value.current_page,ae.value.page_size,D).then(ke=>{ae.value.total=ke.data.total;const P=ke.data.records;P.map(Ne=>{Ne.write_ed=!0,Ne.record_id=Ne.id}),se.value=[...P,...se.value].sort((Ne,ze)=>Ne.create_time.localeCompare(ze.create_time)),ae.value.current_page===1&&Ji(()=>{L.value.setScrollBottom()})})}const ue=ke=>{ke.id!==V.value&&(f.value=!1,ae.value.current_page=1,ae.value.total=0,se.value=[],V.value=ke.id,B.value=ke.abstract,Ie(),V.value!=="new"&&(ee(),window.speechSynthesis.paused&&window.speechSynthesis.speaking&&(window.speechSynthesis.resume(),Ji(()=>{window.speechSynthesis.cancel()}))))};function me(ke){V.value=ke,re.value.current_page=1,Q.value=[],oe(!0)}async function be(){const ke=`${V.value}.md`,P=se.value.map(ze=>{let Te="";return Array.isArray(ze.answer_text_list)?Te=ze.answer_text_list.flat().map(ye=>ye?.content||"").join(` `):Te=ze.answer_text||"",`# ${ze.problem_text} ${Te} `}).join(` `),Ne=new Blob([P],{type:"text/markdown;charset=utf-8"});du.saveAs(Ne,ke)}async function A(){const ke=`${V.value}.html`,P=se.value.map(Te=>{let ye="";return Array.isArray(Te.answer_text_list)?ye=Te.answer_text_list.flat().map(Ge=>Ge?.content||"").join(` `):ye=Te.answer_text||"",`# ${Te.problem_text} ${ye} `}).join(` `),Ne=It(P),ze=new Blob([Ne],{type:"text/html;charset=utf-8"});du.saveAs(ze,ke)}const j=()=>{oe()};sc(()=>{j()});const z=Je(0),W=Je(""),Y=Je(""),te=Je(!1),ce=Je([]),le=Je();async function ve(ke){if(z.value=400,W.value=hn("chat.executionDetails.title"),Y.value="executionDetail",ke.execution_details)ce.value=au.cloneDeep(ke.execution_details);else{const P=await Ln.getChatRecord(ke.chat_id,ke.record_id,te);ce.value=au.cloneDeep(P.data.execution_details)}}async function Se(ke){W.value=hn("chat.KnowledgeSource.title"),Y.value="knowledgeSource",le.value=ke,z.value=400}function Ee(ke,P){W.value=P.document_name,Y.value="paragraphDocument",z.value=400,le.value=P}function Ie(){z.value=0}return(ke,P)=>{const Ne=Fe("el-avatar"),ze=Fe("AppIcon"),Te=Fe("el-dropdown-item"),ye=Fe("el-dropdown-menu"),Ge=Fe("el-dropdown"),Re=Fe("el-icon"),$e=Fe("el-button"),Ye=Fe("el-tooltip"),St=Fe("AiChat"),vt=Fe("Close"),at=Fe("el-scrollbar"),bt=To("loading");return qn((Xe(),vn("div",{class:oc(["chat-pc",E.value]),style:ii({"--el-color-primary":M.value?.custom_theme?.theme_color,"--el-color-primary-light-9":rt(ai)(M.value?.custom_theme?.theme_color||"#3370FF",.1),"--el-color-primary-light-6":rt(ai)(M.value?.custom_theme?.theme_color||"#3370FF",.4),"--el-color-primary-light-06":rt(ai)(M.value?.custom_theme?.theme_color||"#3370FF",.04)})},[Pe("div",Pg,[Pe("div",Cg,[we(lc,{"application-detail":M.value,"chat-log-data":Q.value,"left-loading":q.value,currentChatId:V.value,onNewChat:$,onClickLog:ue,onDeleteLog:_,onClearChat:N,onRefreshFieldTitle:X,onClickShare:p,isPcCollapse:o.value,"chat-loading":L.value?.loading},{default:Ae(()=>[Pe("div",Ig,[!rt(r).chat_profile?.authentication||rt(r).chat_profile.authentication_type==="password"?(Xe(),kt(Ne,{key:0,size:32},{default:Ae(()=>[...P[3]||(P[3]=[Pe("img",{src:Li,style:{width:"54%"},alt:""},null,-1)])]),_:1})):(Xe(),kt(Ge,{key:1,trigger:"click",type:"primary",class:"w-full"},{dropdown:Ae(()=>[we(ye,{style:{"min-width":"260px"}},{default:Ae(()=>[Pe("div",Fg,[Pe("div",Rg,[we(Ne,{size:40},{default:Ae(()=>[...P[5]||(P[5]=[Pe("img",{src:Li,style:{width:"54%"},alt:""},null,-1)])]),_:1})]),Pe("div",null,[Pe("h4",Tg,it(rt(r).chatUserProfile?.nick_name),1),Pe("div",Og,it(`${rt(hn)("common.username")}: ${rt(r).chatUserProfile?.username}`),1)])]),rt(r).chatUserProfile?.source==="LOCAL"?(Xe(),kt(Te,{key:0,class:"border-t",style:{"padding-top":"8px","padding-bottom":"8px"},onClick:v},{default:Ae(()=>[we(ze,{iconName:"app-key",class:"color-secondary"}),fn(" "+it(ke.$t("views.login.resetPassword")),1)]),_:1})):un("",!0),we(Te,{class:"border-t",style:{"padding-top":"8px","padding-bottom":"8px"},onClick:u},{default:Ae(()=>[we(ze,{iconName:"app-export",class:"color-secondary"}),fn(" "+it(ke.$t("layout.logout")),1)]),_:1})]),_:1})]),default:Ae(()=>[Pe("div",Eg,[we(Ne,{size:32},{default:Ae(()=>[...P[4]||(P[4]=[Pe("img",{src:Li,style:{width:"54%"},alt:""},null,-1)])]),_:1}),qn(Pe("span",{class:"ml-8 color-text-primary"},it(rt(r).chatUserProfile?.nick_name),513),[[ni,!o.value]])])]),_:1}))])]),_:1},8,["application-detail","chat-log-data","left-loading","currentChatId","isPcCollapse","chat-loading"]),rt(t).isMobile()?un("",!0):(Xe(),kt($e,{key:0,class:"pc-collapse cursor",circle:"",onClick:P[0]||(P[0]=ft=>o.value=!o.value)},{default:Ae(()=>[we(Re,null,{default:Ae(()=>[(Xe(),kt(Ro(o.value?"ArrowRightBold":"ArrowLeftBold")))]),_:1})]),_:1}))]),Pe("div",{class:"chat-pc__right chat-background",style:ii({backgroundImage:`url(${M.value?.chat_background})`,"--execution-detail-panel-width":z.value+"px"})},[Pe("div",jg,[Pe("div",Bg,[Pe("h4",Dg,it(B.value),1),se.value.length?(Xe(),vn("span",Mg,[ae.value.total?(Xe(),kt(ze,{key:0,iconName:"app-chat-record",class:"color-secondary mr-8",style:{"font-size":"16px"}})):un("",!0),ae.value.total?(Xe(),vn("span",qg,it(ae.value.total)+" "+it(ke.$t("chat.question_count")),1)):un("",!0),f.value?un("",!0):(Xe(),kt(Ye,{key:2,effect:"dark",content:ke.$t("chat.share"),placement:"top"},{default:Ae(()=>[we($e,{text:"",class:"ml-12",onClick:p,disabled:L.value?.loading},{default:Ae(()=>[we(ze,{iconName:"app-share"})]),_:1},8,["disabled"])]),_:1},8,["content"])),f.value?un("",!0):(Xe(),kt(Ge,{key:3,class:"ml-8"},{dropdown:Ae(()=>[we(ye,null,{default:Ae(()=>[we(Te,{onClick:be},{default:Ae(()=>[fn(it(ke.$t("common.export"))+" Markdown",1)]),_:1}),we(Te,{onClick:A},{default:Ae(()=>[fn(it(ke.$t("common.export"))+" HTML",1)]),_:1}),we(Te,{onClick:i},{default:Ae(()=>[fn(it(ke.$t("common.export"))+" PDF",1)]),_:1})]),_:1})]),default:Ae(()=>[we($e,{text:""},{default:Ae(()=>[we(ze,{iconName:"app-export",title:ke.$t("chat.exportRecords")},null,8,["title"])]),_:1})]),_:1}))])):un("",!0)]),Pe("div",Ug,[we(St,{ref_key:"AiChatRef",ref:L,applicationDetails:M.value,"onUpdate:applicationDetails":P[1]||(P[1]=ft=>M.value=ft),available:n.applicationAvailable,type:"ai-chat",appId:M.value?.id,record:se.value,chatId:V.value,executionIsRightPanel:"",onRefresh:me,onScroll:U,onOpenExecutionDetail:ve,onOpenParagraph:Se,onOpenParagraphDocument:Ee,selection:f.value,"onUpdate:selection":P[2]||(P[2]=ft=>f.value=ft)},null,8,["applicationDetails","available","appId","record","chatId","selection"])])]),Pe("div",zg,[Pe("div",$g,[Pe("h4",{class:"medium ellipsis",style:{"max-width":"300px"},title:W.value},it(W.value),9,Hg),Pe("div",Wg,[Y.value==="paragraphDocument"?(Xe(),vn("span",Vg,[Pe("a",{href:rt(j1)(le.value?.meta?.source_file_id)||le.value?.meta?.source_url,target:"_blank",class:"ellipsis-1",title:le.value?.document_name?.trim()},[we($e,{text:""},{default:Ae(()=>[we(ze,{iconName:"app-pdf-export",class:"cursor"})]),_:1})],8,Gg)])):un("",!0),Pe("span",null,[we($e,{text:"",onClick:Ie},{default:Ae(()=>[we(Re,{size:"20"},{default:Ae(()=>[we(vt)]),_:1})]),_:1})])])]),qn((Xe(),vn("div",Yg,[we(at,null,{default:Ae(()=>[Y.value==="knowledgeSource"?(Xe(),kt(B1,{key:0,detail:le.value},null,8,["detail"])):un("",!0),Y.value==="executionDetail"?(Xe(),kt(D1,{key:1,detail:ce.value,appType:M.value?.type},null,8,["detail","appType"])):(Xe(),kt(M1,{key:2,detail:le.value},null,8,["detail"]))]),_:1})])),[[bt,te.value]])])],4)]),we(Rh,{ref_key:"resetPasswordRef",ref:w,emitConfirm:"",onConfirm:d},null,512),we(Ng,{ref_key:"pdfExportRef",ref:e},null,512)],6)),[[bt,D.value]])}}}),Zg=qa(Jg,[["__scopeId","data-v-d887082b"]]),Xg=Object.freeze(Object.defineProperty({__proto__:null,default:Zg},Symbol.toStringTag,{value:"Module"})),Kg=rr({__name:"index",setup(n){const{locale:e}=q1({useScope:"global"}),t=ac(),{chatUser:r,common:a}=ta(),i=Object.assign({"/src/views/chat/auth/index.vue":G1,"/src/views/chat/embed/index.vue":Fd,"/src/views/chat/index.vue":$1,"/src/views/chat/mobile/index.vue":n2,"/src/views/chat/no-service/index.vue":o2,"/src/views/chat/pc/index.vue":Xg,"/src/views/chat/user-login/index.vue":I1}),{query:{mode:c}}=t,o=si(()=>{let f="";r.application?!c||c==="pc"?f=a.isMobile()?"mobile":"pc":f=c:f="no-service";const p=`/src/views/chat/${f}/index.vue`;return i[p].default}),u=Je(!0);return U1(()=>{e.value=r.getLanguage()}),(f,p)=>(Xe(),kt(Ro(o.value),{applicationAvailable:u.value,application_profile:rt(r).application,key:rt(t).fullPath},null,8,["applicationAvailable","application_profile"]))}});export{Kg as default};