@billgangcom/theme-lib 1.114.2 → 1.115.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{builder-X2Lu6tjb.js → builder-CVbCKY8a.js} +5 -5
- package/dist/{builder-nPHbngbk.cjs → builder-Iu70o8Zi.cjs} +2 -2
- package/dist/{builder-components-D785h2tu.cjs → builder-components-3ULrMVTv.cjs} +1 -1
- package/dist/{builder-components-BNkxxpUw.js → builder-components-BuaB_nik.js} +4 -4
- package/dist/builder.cjs.js +1 -1
- package/dist/builder.es.js +22 -22
- package/dist/{charge-Jynnp_W-.js → charge-CqeINukp.js} +46 -38
- package/dist/{charge-DkQ14sNR.cjs → charge-pzp63q8N.cjs} +2 -2
- package/dist/{checkout-DPIHOxJF.cjs → checkout-B98fqO6J.cjs} +1 -1
- package/dist/{checkout-C-ZTxxGR.js → checkout-YVutPZ7f.js} +5 -5
- package/dist/exports.cjs.js +1 -1
- package/dist/exports.es.js +6 -6
- package/dist/{index-CgYqdTTw.js → index-B3WK0Wpu.js} +5 -5
- package/dist/{index-_Mr7z7VX.js → index-BUlydTOo.js} +5 -5
- package/dist/{index-AEcVqtPw.cjs → index-BV4ZiotJ.cjs} +1 -1
- package/dist/{index-CubqBfC_.js → index-C32vke_m.js} +5 -5
- package/dist/{index-ja-4kvwl.js → index-CiY9zOlN.js} +1 -1
- package/dist/{index-AgiKRTqt.cjs → index-Ck3jvxGA.cjs} +1 -1
- package/dist/{index-CqH6qeyf.cjs → index-D0izKDtJ.cjs} +1 -1
- package/dist/{index-C7nBO9Yk.cjs → index-D50xf07C.cjs} +1 -1
- package/dist/{index-BtN20SNf.cjs → index-Lf_IZiQr.cjs} +1 -1
- package/dist/{index-IyaVMeom.js → index-dHSb9Tg9.js} +5 -5
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +6 -6
- package/dist/order-C0KsOrOK.cjs +1 -0
- package/dist/order-D4daxyzU.js +325 -0
- package/dist/src/storefront/models/shop.d.ts +2 -0
- package/dist/{subscription-Bb6mktG2.cjs → subscription-4CHOOBkd.cjs} +1 -1
- package/dist/{subscription-CWaihzfa.js → subscription-D9tguRYG.js} +5 -5
- package/dist/{ticket-BL9adYRI.cjs → ticket-BKgdPBSh.cjs} +62 -62
- package/dist/{ticket-CLpJWP1h.js → ticket-BODLy8iD.js} +420 -414
- package/dist/{top-up-Dk-Y3esP.js → top-up-BxIXamXN.js} +5 -5
- package/dist/{top-up-Cg__N_vU.cjs → top-up-DR4KDupr.cjs} +1 -1
- package/dist/{ui-components-B8oZU0nb.js → ui-components-B2XdfTmJ.js} +4 -4
- package/dist/{ui-components-D0GuyFp-.cjs → ui-components-DnGzB9kA.cjs} +1 -1
- package/dist/ui.cjs.js +1 -1
- package/dist/ui.es.js +1 -1
- package/dist/{validation-BVWHfuZu.cjs → validation-B_jzusSg.cjs} +1 -1
- package/dist/{validation-jyr_dGjd.js → validation-BusGxggf.js} +5 -5
- package/package.json +1 -1
- package/dist/order-DKol_hUe.cjs +0 -1
- package/dist/order-qWzTRhXL.js +0 -318
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const b=require("./builder-nPHbngbk.cjs"),i=require("react/jsx-runtime"),P=require("react"),w=require("./ui-components-D0GuyFp-.cjs"),Vd=require("./builder-components-D785h2tu.cjs"),Wc=require("./ticket-BL9adYRI.cjs");require("react-dom");const Yc=require("./order-DKol_hUe.cjs"),$d=require("./subscription-Bb6mktG2.cjs");function zd(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const le=zd(P),qd=()=>typeof document<"u"?document.documentElement.hasAttribute("translated")||document.documentElement.querySelector(".translated-ltr, .translated-rtl")!==null||document.head.querySelector('meta[name="_translator"]')!==null:!1,Gc=({children:e,className:t,as:n="span",...r})=>{const[u,a]=P.useState(!1);return P.useEffect(()=>{typeof window<"u"&&a(qd())},[]),u?i.jsx(n,{className:t,...r,"data-stable-text":e,dangerouslySetInnerHTML:{__html:""}}):i.jsx(n,{className:t,...r,children:e})};async function Zd(e){const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.storeApi}/shops/${n}/general`+(e?`?password=${e}`:"");return(await b.request({method:"get",url:r,withToken:!1})).data}const Wd=async()=>{const e=b.useApiStore.getState().apiUrls,t=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain")||"flagship-theme.pages.dev":window.location.hostname,n=`${e.storeApi}/v2/shops/${t}/settings-theme`;return await b.request({url:n,withToken:!0,method:"get"})},Yd=async e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/balance/top-up/${n}`;return await b.request({url:r,method:"post",body:e,withToken:!1})},Gd=async(e,t)=>{const r=`${b.useApiStore.getState().apiUrls.cashappApi}/v1/${t}/cashapp/link`;return await b.request({url:r,method:"post",body:e,withToken:!1})},Tr=async e=>{const t=b.useApiStore.getState().apiUrls;if(!localStorage.getItem("token"))throw new Error("No access token");const r=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${t.customersApi}/v2/${r}/customers/${e}`;return await b.request({url:u,withToken:!0,method:"get",typeToken:"customer"})},Xd=()=>Tr("dash/info"),Kd=()=>Tr("dash/dashboard/home"),Qd=()=>Tr("rewards"),Jd=()=>Tr("balance"),e2=()=>Tr("balance/top-up/settings"),t2=()=>Tr("referral-system"),zs=e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.storeApi}/shops/${n}/${e}`;return b.request({url:r,withToken:!1,method:"get"})},n2=()=>zs("terms"),r2=()=>zs("refund-policy"),u2=()=>zs("privacy-policy"),ms=10,ta=async({url:e,PageNumber:t})=>{var o;const n=b.useApiStore.getState().apiUrls,r=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.customersApi}/v2/${r}/${e}?PageNumber=${t}&PageSize=${ms}`,a=await b.request({url:u,withToken:!0,method:"get",typeToken:"customer"}),s=Number((o=a.headers)==null?void 0:o["x-pagination-total"]);return{list:a.data,totalCount:s}},na=async(e,t="get",n)=>{const r=b.useApiStore.getState().apiUrls,u=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${r.slApi}/v1/orders/${u}/${e}`;return await b.request({url:a,method:t,withToken:!0,body:n,typeToken:"customer"})},a2=e=>na("","post",e),s2=({PageNumber:e})=>ta({url:"customers/orders",PageNumber:e}),i2=e=>na(e),o2=e=>na(e),c2=(e,t,n)=>{const r=b.useApiStore.getState().apiUrls,u=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${r.slApi}/v2/orders/${u}/${e}/${t}/replacement-requests`;return b.request({url:a,method:"post",withToken:!0,body:n,typeToken:"customer"})},l2=async e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/public/${n}/images`,u=new FormData;return u.append("file",e),b.request({url:r,method:"post",withToken:!1,body:u})},d2=(e,t,n)=>na(`${e}/${t}/replacement-requests/${n}/cancel`,"post"),f2=async e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/${n}/subscriptions`;return await b.request({url:r,method:"post",withToken:!1,body:e})},h2=async(e,t)=>{const n=b.useApiStore.getState().apiUrls,r=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.slApi}/v2/${r}/subscriptions/${e}/${t}`;return await b.request({url:u,method:"get",withToken:!1})},p2=async(e,t)=>{const n=b.useApiStore.getState().apiUrls,r=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.slApi}/v1/${r}/subscriptions/${e}/${t}/upgrades`;return await b.request({url:u,method:"get",withToken:!1})},m2=async(e,t,n)=>{const r=b.useApiStore.getState().apiUrls,u=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${r.slApi}/v1/${u}/subscriptions/${e}/${t}/cancel`;return await b.request({url:a,method:"post",withToken:!1,body:n})},g2=async(e,t)=>{const n=b.useApiStore.getState().apiUrls,r=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.slApi}/v2/${r}/subscriptions/${e}/change-gateway`;return await b.request({url:u,method:"post",withToken:!1,body:{gateway:t}})},b2=({PageNumber:e})=>ta({url:"customers/subscriptions",PageNumber:e}),_2=async({id:e,accessToken:t})=>await p2(e,t),x2=async(e,t)=>{const n=b.useApiStore.getState().apiUrls,r=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.slApi}/v2/${r}/subscriptions/${e}/order`;return await b.request({url:u,method:"post",withToken:!1,body:t})},C2=async(e,t)=>{const n=b.useApiStore.getState().apiUrls,r=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.slApi}/v1/public/${r}/tickets/${e}/${t}`;return await b.request({url:u,method:"get",withToken:!1})},E2=async(e,t,n,r,u)=>{const a=b.useApiStore.getState().apiUrls,s=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,o=`${a.slApi}/v1/public/${s}/tickets/${e}/${t}/answer`;return(await b.request({url:o,method:"post",body:{message:n,recaptcha:r,tsId:u},withToken:!1})).data},T2=({PageNumber:e})=>ta({url:"customers/tickets",PageNumber:e}),y2=({PageNumber:e})=>ta({url:"customers/balance/transactions",PageNumber:e}),k2=async(e,t,n)=>{const r=b.useApiStore.getState().apiUrls,u=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${r.slApi}/v1/reviews/${u}/${t}/${n}`;return await b.request({url:a,method:"post",withToken:!1,body:e})},A2=async e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/charges/${n}/${e}`;return await b.request({url:r,method:"get",withToken:!1})},S2=async e=>{const t=b.useApiStore.getState().apiUrls,n=e.map(s=>["names",s]),r=new URLSearchParams(n),u=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${t.slApi}/v2/gateways?shopDomain=${u}&${r.toString()}`;return await b.request({url:a,method:"get",withToken:!1})},xu=new Map,Xc=async e=>{const t=b.useApiStore.getState().apiUrls,r=Array.from(new Set(e)).sort().map(l=>["names",l]),u=new URLSearchParams(r),a=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,s=`${t.slApi}/v2/checkout?shopDomain=${a}&${u.toString()}`,o=`${s}`;if(xu.has(o))return xu.get(o);const c=b.request({url:s,method:"get",withToken:!1}).catch(l=>{throw xu.delete(o),l});return xu.set(o,c),c},Kc=async({email:e,recaptcha:t,tsId:n})=>{const r=b.useApiStore.getState().apiUrls,u=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${r.customersApi}/v2/${u}/auth/otp/request`;return(await b.request({url:a,body:{email:e,recaptcha:t,tsId:n},method:"post",withToken:!1})).data?{requested:!0,email:e}:{requested:!1,email:void 0}},Qc=async({email:e,otp:t,recaptcha:n,tsId:r})=>{const u=b.useApiStore.getState().apiUrls,a=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,s=`${u.customersApi}/v2/${a}/auth/otp/login`,{data:o}=await b.request({url:s,method:"post",body:{email:e,otp:t,recaptcha:n,tsId:r},withToken:!1});return b.useStorefrontStore.getState().setToken(o.data),localStorage.setItem("token",o.data),{token:o.data,requested:!1}},gs=async()=>{b.useStorefrontStore.getState().setToken(""),b.useCustomerDashboardStore.getState().setDashInfo(null),localStorage.removeItem("token")},I2=Object.freeze(Object.defineProperty({__proto__:null,loginCustomer:Qc,logoutCustomer:gs,requestOtp:Kc},Symbol.toStringTag,{value:"Module"})),N2=async e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v2/coupons/${n}/validate`;return await b.request({url:r,method:"post",body:e,withToken:!1})},v2=async e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.customersApi}/v2/${n}/customers/referral-system/signup`;return(await b.request({url:r,withToken:!0,method:"post",body:e,typeToken:"customer"})).data},w2=async()=>{const{data:e}=await t2();return e},D2=async e=>{const{data:t}=await v2(e);return t},L2=async e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/discord/${n}`;return await b.request({url:r,method:"post",body:e,withToken:!1})},P2=async e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/discord/${n}/${e.id}?customerEmail=${e.customerEmail}`;return await b.request({url:r,method:"get",withToken:!1})};async function R2(e){const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.customersApi}/v2/${n}/customers/rewards/${e.id}/claim`;return b.request({url:r,method:"post",withToken:!0,typeToken:"customer"})}const wa="Balance",Dn={Number:"NUMBER",Textarea:"LARGE_TEXT",Checkbox:"CHECK_BOX",Hidden:"HIDDEN"},O2={customerEmail:"",recaptcha:"",gateway:"",paymentMethod:"",parts:[],customFields:{},discordSocialConnectId:null,coupon:null,tsId:""},Bi=(e,t)=>{var l;const{productId:n,productVariantId:r,quantity:u,chargeType:a}=t,s=e.find(h=>h.id===n);if(!s)throw new Error("Product does not exist");const o=s.variants.find(h=>h.id===r);if(!o)throw new Error("Variant does not exist");if(a==="RECURRING"&&!o.subscriptionSettings)throw new Error("Variant does not have subscription settings");if(u!==void 0&&((l=o.quantity)!=null&&l.available)&&o.quantity.available<u)throw new Error("Not enough quantity available");const c=b.useCartStore.getState().cart;if(c.parts.length>0){const h=e.find(m=>m.id===c.parts[0].productId),f=h==null?void 0:h.variants.find(m=>m.id===c.parts[0].productVariantId);if(f&&o.price.currency!==f.price.currency)throw new Error("Product have different currency")}return o},M2=(e,t)=>{if(!e.volumeDiscounts||e.volumeDiscounts.length===0)return 0;const n=e.volumeDiscounts.filter(u=>t>=u.amount);return n.length===0?0:n.reduce((u,a)=>a.amount>u.amount?a:u).percentage},F2=(e,t)=>{let n=0,r=0;return e.forEach(u=>{var m,p;const a=t.find(g=>(g==null?void 0:g.id)===u.productId),s=a==null?void 0:a.variants.find(g=>g.id===u.productVariantId);if(!s)return;const{gateway:o}=b.useCartStore.getState().cart,c=(s==null?void 0:s.gateways)||[],l=c.some(g=>g.name===o&&g.overrodePrice)?(m=c.find(g=>g.name===o))==null?void 0:m.overrodePrice:null;let h=0,f=0;if(u.chargeType==="ONE_TIME"?(h=(l==null?void 0:l.amount)||(s==null?void 0:s.price.amount)||0,f=h*u.quantity):f=s!=null&&s.subscriptionSettings?s.subscriptionSettings.price.amount+(((p=s.subscriptionSettings.entryFee)==null?void 0:p.amount)||0):0,n+=f,u.chargeType==="ONE_TIME"){const g=M2(s,u.quantity),x=f*(1-g/100);r+=x}else r+=f}),{total:n,totalWithVolumeDiscounts:r}},B2=(e,t)=>({isRequired:t.some(r=>{var a;const u=e.find(s=>(s==null?void 0:s.id)===r.productId);return(a=u==null?void 0:u.variants.find(s=>s.id===r.productVariantId))==null?void 0:a.discordSettings.isRequired}),isEnabled:t.some(r=>{var a;const u=e.find(s=>(s==null?void 0:s.id)===r.productId);return(a=u==null?void 0:u.variants.find(s=>s.id===r.productVariantId))==null?void 0:a.discordSettings.isEnabled})}),ji=e=>new Set(e.gateways.map(t=>t.name)),Da={availableGateways:[],requiresSignInGateways:[]},Hi=(e,t)=>{if(t.length===0)return Da;const n=e[0];if(!n)return Da;const r=t.find(o=>o.id===n.productId),u=r==null?void 0:r.variants.find(o=>o.id===n.productVariantId);if(!u)return Da;const a=ji(u);for(const o of e){const c=t.find(f=>f.id===o.productId);if(!c)continue;const l=c.variants.find(f=>f.id===o.productVariantId);if(!l)continue;const h=ji(l);for(const f of a)h.has(f)||a.delete(f)}return!localStorage.getItem("token")&&a.has(wa)?(a.delete(wa),{availableGateways:[...a],requiresSignInGateways:[wa]}):{availableGateways:[...a],requiresSignInGateways:[]}},Ui=(e,t)=>{if(e.length===0)return[];const r=e.map(a=>{const s=t.find(c=>c.id===a.productId),o=s==null?void 0:s.variants.find(c=>c.id===a.productVariantId);return(o==null?void 0:o.customFields)??[]}).flat().reduce((a,s)=>{const o=a[s.name];return o?(s.required&&!o.required&&(a[s.name]={...s,value:s.defaultValue}),a):(a[s.name]={...s,value:s.defaultValue},a)},{});return Object.values(r).map(a=>({...a,value:""}))},j2=(e,t)=>{const n=t.find(u=>u.id===e.productId),r=n==null?void 0:n.variants.find(u=>u.id===e.productVariantId);return e.chargeType==="RECURRING"?!!(r!=null&&r.subscriptionSettings):!1},su=()=>{const{cart:e,products:t,coupon:n,pending:r,applyCouponPending:u,customerEmail:a,setCart:s,setProducts:o,setCoupon:c,setPending:l,setApplyCouponPending:h}=b.useCartStore(),f=async x=>{var F;h(!0);const{cart:C}=b.useCartStore.getState(),{gateway:_,parts:v}=C,{notifications:y,setNotifications:D}=b.useNotificationStore.getState();_||(h(!1),D([...y,{message:"There should be a gateway for the coupon",status:"error",id:b.v4()}]));const S=v.map(X=>X.productId);let I=null;try{const{data:X}=await N2({gateway:_,couponName:x,productIds:S});I=X.data,D([...y,{message:"Coupon is applied",status:"success",id:b.v4()}]),s(U=>({...U,coupon:x}))}catch(X){const U=X;D([...y,{message:`Coupon is not applied: ${U.message}`,status:"error",id:b.v4()}]),s(L=>({...L,coupon:null})),c(null),h(!1)}if(h(!1),(F=I==null?void 0:I.restrictToProductIds)!=null&&F.length&&!S.every(X=>{var U;return(U=I==null?void 0:I.restrictToProductIds)==null?void 0:U.includes(X)}))throw new Error("Coupon can't be applied to such products");return c(I),I},g={reset(){s({...O2})},addProducts:x=>{const C=b.useCartStore.getState().products,_=x.filter(v=>!C.some(y=>y.id===v.id));o([...C,..._])},addProductToCart:x=>{const C=b.useCartStore.getState().cart;try{Bi(t,x)}catch(v){throw new Error(v)}const _=C.parts.find(v=>v.productId===x.productId&&v.productVariantId===x.productVariantId&&v.chargeType===x.chargeType);if(_)return g.updateQuantityOfProduct({..._,quantity:(_.quantity||1)+(x.quantity||1),chargeType:x.chargeType});if(C.parts.length&&Hi([...C.parts,x],t).availableGateways.length===0)throw new Error("No common payment gateways available");s({...C,parts:[...C.parts,x]}),C.coupon&&f(C.coupon)},removeProduct({productId:x,productVariantId:C}){s(_=>({..._,parts:_.parts.filter(v=>v.productId!==x||v.productVariantId!==C)})),e.coupon&&f(e.coupon)},getPossibleGateways(){return Hi(e.parts,t)},removeCoupon(){c(null)},getDiscordSettings(){return B2(t,e.parts)},updateQuantityOfProduct(x){Bi(t,x),s(C=>({...C,parts:C.parts.map(_=>_.productId===x.productId&&_.productVariantId===x.productVariantId?{..._,quantity:x.quantity,chargeType:x.chargeType}:_)})),e.coupon&&f(e.coupon)},getTotalAndDiscount(){const{coupon:x}=b.useCartStore.getState(),{total:C,totalWithVolumeDiscounts:_}=F2(e.parts,t);let v;const y=_;return x&&x.discount?!x.isFixed&&x.discount===100?v=0:v=x.isFixed?Math.max(0,y-x.discount):y*(1-x.discount/100):_!==C&&(v=_),{total:C,totalWithVolumeDiscounts:_!==C?_:void 0,totalWithDiscount:v}},setGateway(x){s(_=>({..._,gateway:x}));const{isAntistock:C}=b.useGeneralStore.getState();e.coupon&&!C&&f(e.coupon)},setPaymentMethod(x){s(C=>({...C,paymentMethod:x}))},async submitCart(x){l(!0);const{cart:C}=b.useCartStore.getState(),{discordInfo:_}=b.useDiscordStore.getState();let v;if(C.parts&&a&&j2(C.parts[0],t))try{const{data:y}=await f2({gateway:C.gateway,coupon:C.coupon,partOrder:C.parts[0],referralCode:localStorage.getItem("referralCode"),discordSocialConnectId:_!=null&&_.authorized?_.id:null,customerEmail:a,recaptcha:x,customFields:{...C.customFields},tsId:b.useGetTsId()});v=y.data}catch(y){console.error(y)}else try{const{data:y}=await a2({gateway:C.gateway,parts:[...C.parts],coupon:C.coupon,customerEmail:C.customerEmail,referralCode:localStorage.getItem("referralCode"),recaptcha:x,customFields:{...C.customFields},tsId:b.useGetTsId(),discordSocialConnectId:_!=null&&_.authorized?_.id:null,usePriorityReplacement:C.usePriorityReplacement===!0});v=y.data}catch(y){const D=y,{notifications:S,setNotifications:I}=b.useNotificationStore.getState();I([...S,{message:`Failed to create order: ${D.message}`,status:"error",id:b.v4()}])}if(l(!1),v)return v;throw new Error("Failed to create order")},setDiscordSocialConnectId(x){s(C=>({...C,discordSocialConnectId:x}))},setCustomFields(x){s(C=>({...C,customFields:{...x}}))}};return P.useEffect(()=>{s(x=>({...x,customerEmail:a??""}))},[a,s]),{cart:e,products:t,coupon:n,pending:r,applyCouponPending:u,applyCoupon:f,...g}},Jn=()=>{const{notifications:e,setNotifications:t}=b.useNotificationStore();return n=>{navigator.clipboard.writeText(n),t([...e,{status:"success",message:"Successfully copied",id:b.v4()}])}};var bs={exports:{}},Cu={exports:{}},Me={};/** @license React v16.13.1
|
|
1
|
+
"use strict";const b=require("./builder-Iu70o8Zi.cjs"),i=require("react/jsx-runtime"),P=require("react"),w=require("./ui-components-DnGzB9kA.cjs"),Vd=require("./builder-components-3ULrMVTv.cjs"),Wc=require("./ticket-BKgdPBSh.cjs");require("react-dom");const Yc=require("./order-C0KsOrOK.cjs"),$d=require("./subscription-4CHOOBkd.cjs");function zd(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const le=zd(P),qd=()=>typeof document<"u"?document.documentElement.hasAttribute("translated")||document.documentElement.querySelector(".translated-ltr, .translated-rtl")!==null||document.head.querySelector('meta[name="_translator"]')!==null:!1,Gc=({children:e,className:t,as:n="span",...r})=>{const[u,a]=P.useState(!1);return P.useEffect(()=>{typeof window<"u"&&a(qd())},[]),u?i.jsx(n,{className:t,...r,"data-stable-text":e,dangerouslySetInnerHTML:{__html:""}}):i.jsx(n,{className:t,...r,children:e})};async function Zd(e){const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.storeApi}/shops/${n}/general`+(e?`?password=${e}`:"");return(await b.request({method:"get",url:r,withToken:!1})).data}const Wd=async()=>{const e=b.useApiStore.getState().apiUrls,t=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain")||"flagship-theme.pages.dev":window.location.hostname,n=`${e.storeApi}/v2/shops/${t}/settings-theme`;return await b.request({url:n,withToken:!0,method:"get"})},Yd=async e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/balance/top-up/${n}`;return await b.request({url:r,method:"post",body:e,withToken:!1})},Gd=async(e,t)=>{const r=`${b.useApiStore.getState().apiUrls.cashappApi}/v1/${t}/cashapp/link`;return await b.request({url:r,method:"post",body:e,withToken:!1})},Tr=async e=>{const t=b.useApiStore.getState().apiUrls;if(!localStorage.getItem("token"))throw new Error("No access token");const r=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${t.customersApi}/v2/${r}/customers/${e}`;return await b.request({url:u,withToken:!0,method:"get",typeToken:"customer"})},Xd=()=>Tr("dash/info"),Kd=()=>Tr("dash/dashboard/home"),Qd=()=>Tr("rewards"),Jd=()=>Tr("balance"),e2=()=>Tr("balance/top-up/settings"),t2=()=>Tr("referral-system"),zs=e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.storeApi}/shops/${n}/${e}`;return b.request({url:r,withToken:!1,method:"get"})},n2=()=>zs("terms"),r2=()=>zs("refund-policy"),u2=()=>zs("privacy-policy"),ms=10,ta=async({url:e,PageNumber:t})=>{var o;const n=b.useApiStore.getState().apiUrls,r=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.customersApi}/v2/${r}/${e}?PageNumber=${t}&PageSize=${ms}`,a=await b.request({url:u,withToken:!0,method:"get",typeToken:"customer"}),s=Number((o=a.headers)==null?void 0:o["x-pagination-total"]);return{list:a.data,totalCount:s}},na=async(e,t="get",n)=>{const r=b.useApiStore.getState().apiUrls,u=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${r.slApi}/v1/orders/${u}/${e}`;return await b.request({url:a,method:t,withToken:!0,body:n,typeToken:"customer"})},a2=e=>na("","post",e),s2=({PageNumber:e})=>ta({url:"customers/orders",PageNumber:e}),i2=e=>na(e),o2=e=>na(e),c2=(e,t,n)=>{const r=b.useApiStore.getState().apiUrls,u=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${r.slApi}/v2/orders/${u}/${e}/${t}/replacement-requests`;return b.request({url:a,method:"post",withToken:!0,body:n,typeToken:"customer"})},l2=async e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/public/${n}/images`,u=new FormData;return u.append("file",e),b.request({url:r,method:"post",withToken:!1,body:u})},d2=(e,t,n)=>na(`${e}/${t}/replacement-requests/${n}/cancel`,"post"),f2=async e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/${n}/subscriptions`;return await b.request({url:r,method:"post",withToken:!1,body:e})},h2=async(e,t)=>{const n=b.useApiStore.getState().apiUrls,r=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.slApi}/v2/${r}/subscriptions/${e}/${t}`;return await b.request({url:u,method:"get",withToken:!1})},p2=async(e,t)=>{const n=b.useApiStore.getState().apiUrls,r=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.slApi}/v1/${r}/subscriptions/${e}/${t}/upgrades`;return await b.request({url:u,method:"get",withToken:!1})},m2=async(e,t,n)=>{const r=b.useApiStore.getState().apiUrls,u=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${r.slApi}/v1/${u}/subscriptions/${e}/${t}/cancel`;return await b.request({url:a,method:"post",withToken:!1,body:n})},g2=async(e,t)=>{const n=b.useApiStore.getState().apiUrls,r=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.slApi}/v2/${r}/subscriptions/${e}/change-gateway`;return await b.request({url:u,method:"post",withToken:!1,body:{gateway:t}})},b2=({PageNumber:e})=>ta({url:"customers/subscriptions",PageNumber:e}),_2=async({id:e,accessToken:t})=>await p2(e,t),x2=async(e,t)=>{const n=b.useApiStore.getState().apiUrls,r=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.slApi}/v2/${r}/subscriptions/${e}/order`;return await b.request({url:u,method:"post",withToken:!1,body:t})},C2=async(e,t)=>{const n=b.useApiStore.getState().apiUrls,r=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.slApi}/v1/public/${r}/tickets/${e}/${t}`;return await b.request({url:u,method:"get",withToken:!1})},E2=async(e,t,n,r,u)=>{const a=b.useApiStore.getState().apiUrls,s=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,o=`${a.slApi}/v1/public/${s}/tickets/${e}/${t}/answer`;return(await b.request({url:o,method:"post",body:{message:n,recaptcha:r,tsId:u},withToken:!1})).data},T2=({PageNumber:e})=>ta({url:"customers/tickets",PageNumber:e}),y2=({PageNumber:e})=>ta({url:"customers/balance/transactions",PageNumber:e}),k2=async(e,t,n)=>{const r=b.useApiStore.getState().apiUrls,u=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${r.slApi}/v1/reviews/${u}/${t}/${n}`;return await b.request({url:a,method:"post",withToken:!1,body:e})},A2=async e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/charges/${n}/${e}`;return await b.request({url:r,method:"get",withToken:!1})},S2=async e=>{const t=b.useApiStore.getState().apiUrls,n=e.map(s=>["names",s]),r=new URLSearchParams(n),u=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${t.slApi}/v2/gateways?shopDomain=${u}&${r.toString()}`;return await b.request({url:a,method:"get",withToken:!1})},xu=new Map,Xc=async e=>{const t=b.useApiStore.getState().apiUrls,r=Array.from(new Set(e)).sort().map(l=>["names",l]),u=new URLSearchParams(r),a=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,s=`${t.slApi}/v2/checkout?shopDomain=${a}&${u.toString()}`,o=`${s}`;if(xu.has(o))return xu.get(o);const c=b.request({url:s,method:"get",withToken:!1}).catch(l=>{throw xu.delete(o),l});return xu.set(o,c),c},Kc=async({email:e,recaptcha:t,tsId:n})=>{const r=b.useApiStore.getState().apiUrls,u=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${r.customersApi}/v2/${u}/auth/otp/request`;return(await b.request({url:a,body:{email:e,recaptcha:t,tsId:n},method:"post",withToken:!1})).data?{requested:!0,email:e}:{requested:!1,email:void 0}},Qc=async({email:e,otp:t,recaptcha:n,tsId:r})=>{const u=b.useApiStore.getState().apiUrls,a=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,s=`${u.customersApi}/v2/${a}/auth/otp/login`,{data:o}=await b.request({url:s,method:"post",body:{email:e,otp:t,recaptcha:n,tsId:r},withToken:!1});return b.useStorefrontStore.getState().setToken(o.data),localStorage.setItem("token",o.data),{token:o.data,requested:!1}},gs=async()=>{b.useStorefrontStore.getState().setToken(""),b.useCustomerDashboardStore.getState().setDashInfo(null),localStorage.removeItem("token")},I2=Object.freeze(Object.defineProperty({__proto__:null,loginCustomer:Qc,logoutCustomer:gs,requestOtp:Kc},Symbol.toStringTag,{value:"Module"})),N2=async e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v2/coupons/${n}/validate`;return await b.request({url:r,method:"post",body:e,withToken:!1})},v2=async e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.customersApi}/v2/${n}/customers/referral-system/signup`;return(await b.request({url:r,withToken:!0,method:"post",body:e,typeToken:"customer"})).data},w2=async()=>{const{data:e}=await t2();return e},D2=async e=>{const{data:t}=await v2(e);return t},L2=async e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/discord/${n}`;return await b.request({url:r,method:"post",body:e,withToken:!1})},P2=async e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/discord/${n}/${e.id}?customerEmail=${e.customerEmail}`;return await b.request({url:r,method:"get",withToken:!1})};async function R2(e){const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.customersApi}/v2/${n}/customers/rewards/${e.id}/claim`;return b.request({url:r,method:"post",withToken:!0,typeToken:"customer"})}const wa="Balance",Dn={Number:"NUMBER",Textarea:"LARGE_TEXT",Checkbox:"CHECK_BOX",Hidden:"HIDDEN"},O2={customerEmail:"",recaptcha:"",gateway:"",paymentMethod:"",parts:[],customFields:{},discordSocialConnectId:null,coupon:null,tsId:""},Bi=(e,t)=>{var l;const{productId:n,productVariantId:r,quantity:u,chargeType:a}=t,s=e.find(h=>h.id===n);if(!s)throw new Error("Product does not exist");const o=s.variants.find(h=>h.id===r);if(!o)throw new Error("Variant does not exist");if(a==="RECURRING"&&!o.subscriptionSettings)throw new Error("Variant does not have subscription settings");if(u!==void 0&&((l=o.quantity)!=null&&l.available)&&o.quantity.available<u)throw new Error("Not enough quantity available");const c=b.useCartStore.getState().cart;if(c.parts.length>0){const h=e.find(m=>m.id===c.parts[0].productId),f=h==null?void 0:h.variants.find(m=>m.id===c.parts[0].productVariantId);if(f&&o.price.currency!==f.price.currency)throw new Error("Product have different currency")}return o},M2=(e,t)=>{if(!e.volumeDiscounts||e.volumeDiscounts.length===0)return 0;const n=e.volumeDiscounts.filter(u=>t>=u.amount);return n.length===0?0:n.reduce((u,a)=>a.amount>u.amount?a:u).percentage},F2=(e,t)=>{let n=0,r=0;return e.forEach(u=>{var m,p;const a=t.find(g=>(g==null?void 0:g.id)===u.productId),s=a==null?void 0:a.variants.find(g=>g.id===u.productVariantId);if(!s)return;const{gateway:o}=b.useCartStore.getState().cart,c=(s==null?void 0:s.gateways)||[],l=c.some(g=>g.name===o&&g.overrodePrice)?(m=c.find(g=>g.name===o))==null?void 0:m.overrodePrice:null;let h=0,f=0;if(u.chargeType==="ONE_TIME"?(h=(l==null?void 0:l.amount)||(s==null?void 0:s.price.amount)||0,f=h*u.quantity):f=s!=null&&s.subscriptionSettings?s.subscriptionSettings.price.amount+(((p=s.subscriptionSettings.entryFee)==null?void 0:p.amount)||0):0,n+=f,u.chargeType==="ONE_TIME"){const g=M2(s,u.quantity),x=f*(1-g/100);r+=x}else r+=f}),{total:n,totalWithVolumeDiscounts:r}},B2=(e,t)=>({isRequired:t.some(r=>{var a;const u=e.find(s=>(s==null?void 0:s.id)===r.productId);return(a=u==null?void 0:u.variants.find(s=>s.id===r.productVariantId))==null?void 0:a.discordSettings.isRequired}),isEnabled:t.some(r=>{var a;const u=e.find(s=>(s==null?void 0:s.id)===r.productId);return(a=u==null?void 0:u.variants.find(s=>s.id===r.productVariantId))==null?void 0:a.discordSettings.isEnabled})}),ji=e=>new Set(e.gateways.map(t=>t.name)),Da={availableGateways:[],requiresSignInGateways:[]},Hi=(e,t)=>{if(t.length===0)return Da;const n=e[0];if(!n)return Da;const r=t.find(o=>o.id===n.productId),u=r==null?void 0:r.variants.find(o=>o.id===n.productVariantId);if(!u)return Da;const a=ji(u);for(const o of e){const c=t.find(f=>f.id===o.productId);if(!c)continue;const l=c.variants.find(f=>f.id===o.productVariantId);if(!l)continue;const h=ji(l);for(const f of a)h.has(f)||a.delete(f)}return!localStorage.getItem("token")&&a.has(wa)?(a.delete(wa),{availableGateways:[...a],requiresSignInGateways:[wa]}):{availableGateways:[...a],requiresSignInGateways:[]}},Ui=(e,t)=>{if(e.length===0)return[];const r=e.map(a=>{const s=t.find(c=>c.id===a.productId),o=s==null?void 0:s.variants.find(c=>c.id===a.productVariantId);return(o==null?void 0:o.customFields)??[]}).flat().reduce((a,s)=>{const o=a[s.name];return o?(s.required&&!o.required&&(a[s.name]={...s,value:s.defaultValue}),a):(a[s.name]={...s,value:s.defaultValue},a)},{});return Object.values(r).map(a=>({...a,value:""}))},j2=(e,t)=>{const n=t.find(u=>u.id===e.productId),r=n==null?void 0:n.variants.find(u=>u.id===e.productVariantId);return e.chargeType==="RECURRING"?!!(r!=null&&r.subscriptionSettings):!1},su=()=>{const{cart:e,products:t,coupon:n,pending:r,applyCouponPending:u,customerEmail:a,setCart:s,setProducts:o,setCoupon:c,setPending:l,setApplyCouponPending:h}=b.useCartStore(),f=async x=>{var F;h(!0);const{cart:C}=b.useCartStore.getState(),{gateway:_,parts:v}=C,{notifications:y,setNotifications:D}=b.useNotificationStore.getState();_||(h(!1),D([...y,{message:"There should be a gateway for the coupon",status:"error",id:b.v4()}]));const S=v.map(X=>X.productId);let I=null;try{const{data:X}=await N2({gateway:_,couponName:x,productIds:S});I=X.data,D([...y,{message:"Coupon is applied",status:"success",id:b.v4()}]),s(U=>({...U,coupon:x}))}catch(X){const U=X;D([...y,{message:`Coupon is not applied: ${U.message}`,status:"error",id:b.v4()}]),s(L=>({...L,coupon:null})),c(null),h(!1)}if(h(!1),(F=I==null?void 0:I.restrictToProductIds)!=null&&F.length&&!S.every(X=>{var U;return(U=I==null?void 0:I.restrictToProductIds)==null?void 0:U.includes(X)}))throw new Error("Coupon can't be applied to such products");return c(I),I},g={reset(){s({...O2})},addProducts:x=>{const C=b.useCartStore.getState().products,_=x.filter(v=>!C.some(y=>y.id===v.id));o([...C,..._])},addProductToCart:x=>{const C=b.useCartStore.getState().cart;try{Bi(t,x)}catch(v){throw new Error(v)}const _=C.parts.find(v=>v.productId===x.productId&&v.productVariantId===x.productVariantId&&v.chargeType===x.chargeType);if(_)return g.updateQuantityOfProduct({..._,quantity:(_.quantity||1)+(x.quantity||1),chargeType:x.chargeType});if(C.parts.length&&Hi([...C.parts,x],t).availableGateways.length===0)throw new Error("No common payment gateways available");s({...C,parts:[...C.parts,x]}),C.coupon&&f(C.coupon)},removeProduct({productId:x,productVariantId:C}){s(_=>({..._,parts:_.parts.filter(v=>v.productId!==x||v.productVariantId!==C)})),e.coupon&&f(e.coupon)},getPossibleGateways(){return Hi(e.parts,t)},removeCoupon(){c(null)},getDiscordSettings(){return B2(t,e.parts)},updateQuantityOfProduct(x){Bi(t,x),s(C=>({...C,parts:C.parts.map(_=>_.productId===x.productId&&_.productVariantId===x.productVariantId?{..._,quantity:x.quantity,chargeType:x.chargeType}:_)})),e.coupon&&f(e.coupon)},getTotalAndDiscount(){const{coupon:x}=b.useCartStore.getState(),{total:C,totalWithVolumeDiscounts:_}=F2(e.parts,t);let v;const y=_;return x&&x.discount?!x.isFixed&&x.discount===100?v=0:v=x.isFixed?Math.max(0,y-x.discount):y*(1-x.discount/100):_!==C&&(v=_),{total:C,totalWithVolumeDiscounts:_!==C?_:void 0,totalWithDiscount:v}},setGateway(x){s(_=>({..._,gateway:x}));const{isAntistock:C}=b.useGeneralStore.getState();e.coupon&&!C&&f(e.coupon)},setPaymentMethod(x){s(C=>({...C,paymentMethod:x}))},async submitCart(x){l(!0);const{cart:C}=b.useCartStore.getState(),{discordInfo:_}=b.useDiscordStore.getState();let v;if(C.parts&&a&&j2(C.parts[0],t))try{const{data:y}=await f2({gateway:C.gateway,coupon:C.coupon,partOrder:C.parts[0],referralCode:localStorage.getItem("referralCode"),discordSocialConnectId:_!=null&&_.authorized?_.id:null,customerEmail:a,recaptcha:x,customFields:{...C.customFields},tsId:b.useGetTsId()});v=y.data}catch(y){console.error(y)}else try{const{data:y}=await a2({gateway:C.gateway,parts:[...C.parts],coupon:C.coupon,customerEmail:C.customerEmail,referralCode:localStorage.getItem("referralCode"),recaptcha:x,customFields:{...C.customFields},tsId:b.useGetTsId(),discordSocialConnectId:_!=null&&_.authorized?_.id:null,usePriorityReplacement:C.usePriorityReplacement===!0});v=y.data}catch(y){const D=y,{notifications:S,setNotifications:I}=b.useNotificationStore.getState();I([...S,{message:`Failed to create order: ${D.message}`,status:"error",id:b.v4()}])}if(l(!1),v)return v;throw new Error("Failed to create order")},setDiscordSocialConnectId(x){s(C=>({...C,discordSocialConnectId:x}))},setCustomFields(x){s(C=>({...C,customFields:{...x}}))}};return P.useEffect(()=>{s(x=>({...x,customerEmail:a??""}))},[a,s]),{cart:e,products:t,coupon:n,pending:r,applyCouponPending:u,applyCoupon:f,...g}},Jn=()=>{const{notifications:e,setNotifications:t}=b.useNotificationStore();return n=>{navigator.clipboard.writeText(n),t([...e,{status:"success",message:"Successfully copied",id:b.v4()}])}};var bs={exports:{}},Cu={exports:{}},Me={};/** @license React v16.13.1
|
|
2
2
|
* react-is.production.min.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -106,4 +106,4 @@ and limitations under the License.
|
|
|
106
106
|
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:m,table:s,tableCell:c,tableRow:o}};function s(p,g,x,C){return l(h(p,x,C),p.align)}function o(p,g,x,C){const _=f(p,x,C),v=l([_]);return v.slice(0,v.indexOf(`
|
|
107
107
|
`))}function c(p,g,x,C){const _=x.enter("tableCell"),v=x.enter("phrasing"),y=x.containerPhrasing(p,{...C,before:a,after:a});return v(),_(),y}function l(p,g){return tT(p,{align:g,alignDelimiters:r,padding:n,stringLength:u})}function h(p,g,x){const C=p.children;let _=-1;const v=[],y=g.enter("table");for(;++_<C.length;)v[_]=f(C[_],g,x);return y(),v}function f(p,g,x){const C=p.children;let _=-1;const v=[],y=g.enter("tableRow");for(;++_<C.length;)v[_]=c(C[_],p,g,x);return y(),v}function m(p,g,x){let C=b1.inlineCode(p,g,x);return x.stack.includes("tableCell")&&(C=C.replace(/\|/g,"\\$&")),C}}function VT(){return{exit:{taskListCheckValueChecked:kc,taskListCheckValueUnchecked:kc,paragraph:zT}}}function $T(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:qT}}}function kc(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function zT(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const u=t.children;let a=-1,s;for(;++a<u.length;){const o=u[a];if(o.type==="paragraph"){s=o;break}}s===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function qT(e,t,n,r){const u=e.children[0],a=typeof e.checked=="boolean"&&u&&u.type==="paragraph",s="["+(e.checked?"x":" ")+"] ",o=n.createTracker(r);a&&o.move(s);let c=b1.listItem(e,t,n,{...r,...o.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(h){return h+s}}function ZT(){return[kE(),qE(),GE(),OT(),VT()]}function WT(e){return{extensions:[AE(),ZE(e),XE(),UT(e),$T()]}}const YT={tokenize:ey,partial:!0},_1={tokenize:ty,partial:!0},x1={tokenize:ny,partial:!0},C1={tokenize:ry,partial:!0},GT={tokenize:uy,partial:!0},E1={name:"wwwAutolink",tokenize:QT,previous:y1},T1={name:"protocolAutolink",tokenize:JT,previous:k1},Tn={name:"emailAutolink",tokenize:KT,previous:A1},hn={};function XT(){return{text:hn}}let qn=48;for(;qn<123;)hn[qn]=Tn,qn++,qn===58?qn=65:qn===91&&(qn=97);hn[43]=Tn;hn[45]=Tn;hn[46]=Tn;hn[95]=Tn;hn[72]=[Tn,T1];hn[104]=[Tn,T1];hn[87]=[Tn,E1];hn[119]=[Tn,E1];function KT(e,t,n){const r=this;let u,a;return s;function s(f){return!Ms(f)||!A1.call(r,r.previous)||Ai(r.events)?n(f):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(f))}function o(f){return Ms(f)?(e.consume(f),o):f===64?(e.consume(f),c):n(f)}function c(f){return f===46?e.check(GT,h,l)(f):f===45||f===95||pt(f)?(a=!0,e.consume(f),c):h(f)}function l(f){return e.consume(f),u=!0,c}function h(f){return a&&u&&Et(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(f)):n(f)}}function QT(e,t,n){const r=this;return u;function u(s){return s!==87&&s!==119||!y1.call(r,r.previous)||Ai(r.events)?n(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(YT,e.attempt(_1,e.attempt(x1,a),n),n)(s))}function a(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(s)}}function JT(e,t,n){const r=this;let u="",a=!1;return s;function s(f){return(f===72||f===104)&&k1.call(r,r.previous)&&!Ai(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),u+=String.fromCodePoint(f),e.consume(f),o):n(f)}function o(f){if(Et(f)&&u.length<5)return u+=String.fromCodePoint(f),e.consume(f),o;if(f===58){const m=u.toLowerCase();if(m==="http"||m==="https")return e.consume(f),c}return n(f)}function c(f){return f===47?(e.consume(f),a?l:(a=!0,c)):n(f)}function l(f){return f===null||Yu(f)||He(f)||Qn(f)||xa(f)?n(f):e.attempt(_1,e.attempt(x1,h),n)(f)}function h(f){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(f)}}function ey(e,t,n){let r=0;return u;function u(s){return(s===87||s===119)&&r<3?(r++,e.consume(s),u):s===46&&r===3?(e.consume(s),a):n(s)}function a(s){return s===null?n(s):t(s)}}function ty(e,t,n){let r,u,a;return s;function s(l){return l===46||l===95?e.check(C1,c,o)(l):l===null||He(l)||Qn(l)||l!==45&&xa(l)?c(l):(a=!0,e.consume(l),s)}function o(l){return l===95?r=!0:(u=r,r=void 0),e.consume(l),s}function c(l){return u||r||!a?n(l):t(l)}}function ny(e,t){let n=0,r=0;return u;function u(s){return s===40?(n++,e.consume(s),u):s===41&&r<n?a(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?e.check(C1,t,a)(s):s===null||He(s)||Qn(s)?t(s):(e.consume(s),u)}function a(s){return s===41&&r++,e.consume(s),u}}function ry(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),u):o===60||o===null||He(o)||Qn(o)?t(o):n(o)}function u(o){return o===null||o===40||o===91||He(o)||Qn(o)?t(o):r(o)}function a(o){return Et(o)?s(o):n(o)}function s(o){return o===59?(e.consume(o),r):Et(o)?(e.consume(o),s):n(o)}}function uy(e,t,n){return r;function r(a){return e.consume(a),u}function u(a){return pt(a)?n(a):t(a)}}function y1(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||He(e)}function k1(e){return!Et(e)}function A1(e){return!(e===47||Ms(e))}function Ms(e){return e===43||e===45||e===46||e===95||pt(e)}function Ai(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const ay={tokenize:hy,partial:!0};function sy(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:ly,continuation:{tokenize:dy},exit:fy}},text:{91:{name:"gfmFootnoteCall",tokenize:cy},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:iy,resolveTo:oy}}}}function iy(e,t,n){const r=this;let u=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;u--;){const c=r.events[u][1];if(c.type==="labelImage"){s=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return o;function o(c){if(!s||!s._balanced)return n(c);const l=Kt(r.sliceSerialize({start:s.end,end:r.now()}));return l.codePointAt(0)!==94||!a.includes(l.slice(1))?n(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),t(c))}}function oy(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},u={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};u.end.column++,u.end.offset++,u.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},u.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},o=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",u,t],["exit",u,t],["enter",a,t],["enter",s,t],["exit",s,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...o),e}function cy(e,t,n){const r=this,u=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,s;return o;function o(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),c}function c(f){return f!==94?n(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",l)}function l(f){if(a>999||f===93&&!s||f===null||f===91||He(f))return n(f);if(f===93){e.exit("chunkString");const m=e.exit("gfmFootnoteCallString");return u.includes(Kt(r.sliceSerialize(m)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return He(f)||(s=!0),a++,e.consume(f),f===92?h:l}function h(f){return f===91||f===92||f===93?(e.consume(f),a++,l):l(f)}}function ly(e,t,n){const r=this,u=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,s=0,o;return c;function c(g){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),l}function l(g){return g===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",h):n(g)}function h(g){if(s>999||g===93&&!o||g===null||g===91||He(g))return n(g);if(g===93){e.exit("chunkString");const x=e.exit("gfmFootnoteDefinitionLabelString");return a=Kt(r.sliceSerialize(x)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),m}return He(g)||(o=!0),s++,e.consume(g),g===92?f:h}function f(g){return g===91||g===92||g===93?(e.consume(g),s++,h):h(g)}function m(g){return g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),u.includes(a)||u.push(a),we(e,p,"gfmFootnoteDefinitionWhitespace")):n(g)}function p(g){return t(g)}}function dy(e,t,n){return e.check(pu,t,e.attempt(ay,t,n))}function fy(e){e.exit("gfmFootnoteDefinition")}function hy(e,t,n){const r=this;return we(e,u,"gfmFootnoteDefinitionIndent",5);function u(a){const s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(a):n(a)}}function py(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:a,resolveAll:u};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function u(s,o){let c=-1;for(;++c<s.length;)if(s[c][0]==="enter"&&s[c][1].type==="strikethroughSequenceTemporary"&&s[c][1]._close){let l=c;for(;l--;)if(s[l][0]==="exit"&&s[l][1].type==="strikethroughSequenceTemporary"&&s[l][1]._open&&s[c][1].end.offset-s[c][1].start.offset===s[l][1].end.offset-s[l][1].start.offset){s[c][1].type="strikethroughSequence",s[l][1].type="strikethroughSequence";const h={type:"strikethrough",start:Object.assign({},s[l][1].start),end:Object.assign({},s[c][1].end)},f={type:"strikethroughText",start:Object.assign({},s[l][1].end),end:Object.assign({},s[c][1].start)},m=[["enter",h,o],["enter",s[l][1],o],["exit",s[l][1],o],["enter",f,o]],p=o.parser.constructs.insideSpan.null;p&&Bt(m,m.length,0,Ca(p,s.slice(l+1,c),o)),Bt(m,m.length,0,[["exit",f,o],["enter",s[c][1],o],["exit",s[c][1],o],["exit",h,o]]),Bt(s,l-1,c-l+3,m),c=l+m.length-2;break}}for(c=-1;++c<s.length;)s[c][1].type==="strikethroughSequenceTemporary"&&(s[c][1].type="data");return s}function a(s,o,c){const l=this.previous,h=this.events;let f=0;return m;function m(g){return l===126&&h[h.length-1][1].type!=="characterEscape"?c(g):(s.enter("strikethroughSequenceTemporary"),p(g))}function p(g){const x=xr(l);if(g===126)return f>1?c(g):(s.consume(g),f++,p);if(f<2&&!n)return c(g);const C=s.exit("strikethroughSequenceTemporary"),_=xr(g);return C._open=!_||_===2&&!!x,C._close=!x||x===2&&!!_,o(g)}}}class my{constructor(){this.map=[]}add(t,n,r){gy(this,t,n,r)}consume(t){if(this.map.sort(function(a,s){return a[0]-s[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let u=r.pop();for(;u;){for(const a of u)t.push(a);u=r.pop()}this.map.length=0}}function gy(e,t,n,r){let u=0;if(!(n===0&&r.length===0)){for(;u<e.map.length;){if(e.map[u][0]===t){e.map[u][1]+=n,e.map[u][2].push(...r);return}u+=1}e.map.push([t,n,r])}}function by(e,t){let n=!1;const r=[];for(;t<e.length;){const u=e[t];if(n){if(u[0]==="enter")u[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(u[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const a=r.length-1;r[a]=r[a]==="left"?"center":"right"}}else if(u[1].type==="tableDelimiterRow")break}else u[0]==="enter"&&u[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function _y(){return{flow:{null:{name:"table",tokenize:xy,resolveAll:Cy}}}}function xy(e,t,n){const r=this;let u=0,a=0,s;return o;function o(L){let H=r.events.length-1;for(;H>-1;){const se=r.events[H][1].type;if(se==="lineEnding"||se==="linePrefix")H--;else break}const B=H>-1?r.events[H][1].type:null,Q=B==="tableHead"||B==="tableRow"?I:c;return Q===I&&r.parser.lazy[r.now().line]?n(L):Q(L)}function c(L){return e.enter("tableHead"),e.enter("tableRow"),l(L)}function l(L){return L===124||(s=!0,a+=1),h(L)}function h(L){return L===null?n(L):ue(L)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),p):n(L):Ne(L)?we(e,h,"whitespace")(L):(a+=1,s&&(s=!1,u+=1),L===124?(e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),s=!0,h):(e.enter("data"),f(L)))}function f(L){return L===null||L===124||He(L)?(e.exit("data"),h(L)):(e.consume(L),L===92?m:f)}function m(L){return L===92||L===124?(e.consume(L),f):f(L)}function p(L){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(L):(e.enter("tableDelimiterRow"),s=!1,Ne(L)?we(e,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):g(L))}function g(L){return L===45||L===58?C(L):L===124?(s=!0,e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),x):S(L)}function x(L){return Ne(L)?we(e,C,"whitespace")(L):C(L)}function C(L){return L===58?(a+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(L),e.exit("tableDelimiterMarker"),_):L===45?(a+=1,_(L)):L===null||ue(L)?D(L):S(L)}function _(L){return L===45?(e.enter("tableDelimiterFiller"),v(L)):S(L)}function v(L){return L===45?(e.consume(L),v):L===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(L),e.exit("tableDelimiterMarker"),y):(e.exit("tableDelimiterFiller"),y(L))}function y(L){return Ne(L)?we(e,D,"whitespace")(L):D(L)}function D(L){return L===124?g(L):L===null||ue(L)?!s||u!==a?S(L):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(L)):S(L)}function S(L){return n(L)}function I(L){return e.enter("tableRow"),F(L)}function F(L){return L===124?(e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),F):L===null||ue(L)?(e.exit("tableRow"),t(L)):Ne(L)?we(e,F,"whitespace")(L):(e.enter("data"),X(L))}function X(L){return L===null||L===124||He(L)?(e.exit("data"),F(L)):(e.consume(L),L===92?U:X)}function U(L){return L===92||L===124?(e.consume(L),X):X(L)}}function Cy(e,t){let n=-1,r=!0,u=0,a=[0,0,0,0],s=[0,0,0,0],o=!1,c=0,l,h,f;const m=new my;for(;++n<e.length;){const p=e[n],g=p[1];p[0]==="enter"?g.type==="tableHead"?(o=!1,c!==0&&(Ac(m,t,c,l,h),h=void 0,c=0),l={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},m.add(n,0,[["enter",l,t]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(r=!0,f=void 0,a=[0,0,0,0],s=[0,n+1,0,0],o&&(o=!1,h={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},m.add(n,0,[["enter",h,t]])),u=g.type==="tableDelimiterRow"?2:h?3:1):u&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")?(r=!1,s[2]===0&&(a[1]!==0&&(s[0]=s[1],f=Ou(m,t,a,u,void 0,f),a=[0,0,0,0]),s[2]=n)):g.type==="tableCellDivider"&&(r?r=!1:(a[1]!==0&&(s[0]=s[1],f=Ou(m,t,a,u,void 0,f)),a=s,s=[a[1],n,0,0])):g.type==="tableHead"?(o=!0,c=n):g.type==="tableRow"||g.type==="tableDelimiterRow"?(c=n,a[1]!==0?(s[0]=s[1],f=Ou(m,t,a,u,n,f)):s[1]!==0&&(f=Ou(m,t,s,u,n,f)),u=0):u&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(s[3]=n)}for(c!==0&&Ac(m,t,c,l,h),m.consume(t.events),n=-1;++n<t.events.length;){const p=t.events[n];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=by(t.events,n))}return e}function Ou(e,t,n,r,u,a){const s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",o="tableContent";n[0]!==0&&(a.end=Object.assign({},lr(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const c=lr(t.events,n[1]);if(a={type:s,start:Object.assign({},c),end:Object.assign({},c)},e.add(n[1],0,[["enter",a,t]]),n[2]!==0){const l=lr(t.events,n[2]),h=lr(t.events,n[3]),f={type:o,start:Object.assign({},l),end:Object.assign({},h)};if(e.add(n[2],0,[["enter",f,t]]),r!==2){const m=t.events[n[2]],p=t.events[n[3]];if(m[1].end=Object.assign({},p[1].end),m[1].type="chunkText",m[1].contentType="text",n[3]>n[2]+1){const g=n[2]+1,x=n[3]-n[2]-1;e.add(g,x,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return u!==void 0&&(a.end=Object.assign({},lr(t.events,u)),e.add(u,0,[["exit",a,t]]),a=void 0),a}function Ac(e,t,n,r,u){const a=[],s=lr(t.events,n);u&&(u.end=Object.assign({},s),a.push(["exit",u,t])),r.end=Object.assign({},s),a.push(["exit",r,t]),e.add(n+1,0,a)}function lr(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const Ey={name:"tasklistCheck",tokenize:yy};function Ty(){return{text:{91:Ey}}}function yy(e,t,n){const r=this;return u;function u(c){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),a)}function a(c){return He(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),s):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),s):n(c)}function s(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(c)}function o(c){return ue(c)?t(c):Ne(c)?e.check({tokenize:ky},t,n)(c):n(c)}}function ky(e,t,n){return we(e,r,"whitespace");function r(u){return u===null?n(u):t(u)}}function Ay(e){return R0([XT(),sy(),py(e),_y(),Ty()])}const Sy={};function S1(e){const t=this,n=e||Sy,r=t.data(),u=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);u.push(Ay(n)),a.push(ZT()),s.push(WT(n))}const Sc=/[#.]/g;function Iy(e,t){const n=e||"",r={};let u=0,a,s;for(;u<n.length;){Sc.lastIndex=u;const o=Sc.exec(n),c=n.slice(u,o?o.index:n.length);c&&(a?a==="#"?r.id=c:Array.isArray(r.className)?r.className.push(c):r.className=[c]:s=c,u+=c.length),o&&(a=o[0],u++)}return{type:"element",tagName:s||t||"div",properties:r,children:[]}}function I1(e,t,n){const r=n?Dy(n):void 0;function u(a,s,...o){let c;if(a==null){c={type:"root",children:[]};const l=s;o.unshift(l)}else{c=Iy(a,t);const l=c.tagName.toLowerCase(),h=r?r.get(l):void 0;if(c.tagName=h||l,Ny(s))o.unshift(s);else for(const[f,m]of Object.entries(s))vy(e,c.properties,f,m)}for(const l of o)Fs(c.children,l);return c.type==="element"&&c.tagName==="template"&&(c.content={type:"root",children:c.children},c.children=[]),c}return u}function Ny(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,n=Object.keys(e);for(const r of n){const u=t[r];if(u&&typeof u=="object"){if(!Array.isArray(u))return!0;const a=u;for(const s of a)if(typeof s!="number"&&typeof s!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function vy(e,t,n,r){const u=li(e,n);let a;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;a=r}else typeof r=="boolean"?a=r:typeof r=="string"?u.spaceSeparated?a=Po(r):u.commaSeparated?a=No(r):u.commaOrSpaceSeparated?a=Po(No(r).join(" ")):a=Ic(u,u.property,r):Array.isArray(r)?a=[...r]:a=u.property==="style"?wy(r):String(r);if(Array.isArray(a)){const s=[];for(const o of a)s.push(Ic(u,u.property,o));a=s}u.property==="className"&&Array.isArray(t.className)&&(a=t.className.concat(a)),t[u.property]=a}}function Fs(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const n of t)Fs(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?Fs(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function Ic(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||nu(n)===nu(t)))return!0}return n}function wy(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}function Dy(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const Ly=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],Py=I1(ba,"div"),Ry=I1(Sr,"g",Ly);function Oy(e){const t=String(e),n=[];return{toOffset:u,toPoint:r};function r(a){if(typeof a=="number"&&a>-1&&a<=t.length){let s=0;for(;;){let o=n[s];if(o===void 0){const c=Nc(t,n[s-1]);o=c===-1?t.length+1:c+1,n[s]=o}if(o>a)return{line:s+1,column:a-(s>0?n[s-1]:0)+1,offset:a};s++}}}function u(a){if(a&&typeof a.line=="number"&&typeof a.column=="number"&&!Number.isNaN(a.line)&&!Number.isNaN(a.column)){for(;n.length<a.line;){const o=n[n.length-1],c=Nc(t,o),l=c===-1?t.length+1:c+1;if(o===l)break;n.push(l)}const s=(a.line>1?n[a.line-2]:0)+a.column-1;if(s<n[a.line-1])return s}}}function Nc(e,t){const n=e.indexOf("\r",t),r=e.indexOf(`
|
|
108
108
|
`,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}const Xn={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},N1={}.hasOwnProperty,My=Object.prototype;function Fy(e,t){const n=t||{};return Si({file:n.file||void 0,location:!1,schema:n.space==="svg"?Sr:ba,verbose:n.verbose||!1},e)}function Si(e,t){let n;switch(t.nodeName){case"#comment":{const r=t;return n={type:"comment",value:r.data},Vu(e,r,n),n}case"#document":case"#document-fragment":{const r=t,u="mode"in r?r.mode==="quirks"||r.mode==="limited-quirks":!1;if(n={type:"root",children:v1(e,t.childNodes),data:{quirksMode:u}},e.file&&e.location){const a=String(e.file),s=Oy(a),o=s.toPoint(0),c=s.toPoint(a.length);n.position={start:o,end:c}}return n}case"#documentType":{const r=t;return n={type:"doctype"},Vu(e,r,n),n}case"#text":{const r=t;return n={type:"text",value:r.value},Vu(e,r,n),n}default:return n=By(e,t),n}}function v1(e,t){let n=-1;const r=[];for(;++n<t.length;){const u=Si(e,t[n]);r.push(u)}return r}function By(e,t){const n=e.schema;e.schema=t.namespaceURI===Xn.svg?Sr:ba;let r=-1;const u={};for(;++r<t.attrs.length;){const o=t.attrs[r],c=(o.prefix?o.prefix+":":"")+o.name;N1.call(My,c)||(u[c]=o.value)}const s=(e.schema.space==="svg"?Ry:Py)(t.tagName,u,v1(e,t.childNodes));if(Vu(e,t,s),s.tagName==="template"){const o=t,c=o.sourceCodeLocation,l=c&&c.startTag&&dr(c.startTag),h=c&&c.endTag&&dr(c.endTag),f=Si(e,o.content);l&&h&&e.file&&(f.position={start:l.end,end:h.start}),s.content=f}return e.schema=n,s}function Vu(e,t,n){if("sourceCodeLocation"in t&&t.sourceCodeLocation&&e.file){const r=jy(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function jy(e,t,n){const r=dr(n);if(t.type==="element"){const u=t.children[t.children.length-1];if(r&&!n.endTag&&u&&u.position&&u.position.end&&(r.end=Object.assign({},u.position.end)),e.verbose){const a={};let s;if(n.attrs)for(s in n.attrs)N1.call(n.attrs,s)&&(a[li(e.schema,s).property]=dr(n.attrs[s]));n.startTag;const o=dr(n.startTag),c=n.endTag?dr(n.endTag):void 0,l={opening:o};c&&(l.closing=c),l.properties=a,t.data={position:l}}}return r}function dr(e){const t=vc({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=vc({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function vc(e){return e.line&&e.column?e:void 0}class gu{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}}gu.prototype.property={};gu.prototype.normal={};gu.prototype.space=null;function w1(e,t){const n={},r={};let u=-1;for(;++u<e.length;)Object.assign(n,e[u].property),Object.assign(r,e[u].normal);return new gu(n,r,t)}function Bs(e){return e.toLowerCase()}class Wt{constructor(t,n){this.property=t,this.attribute=n}}Wt.prototype.space=null;Wt.prototype.boolean=!1;Wt.prototype.booleanish=!1;Wt.prototype.overloadedBoolean=!1;Wt.prototype.number=!1;Wt.prototype.commaSeparated=!1;Wt.prototype.spaceSeparated=!1;Wt.prototype.commaOrSpaceSeparated=!1;Wt.prototype.mustUseProperty=!1;Wt.prototype.defined=!1;let Hy=0;const Ce=nr(),tt=nr(),D1=nr(),Z=nr(),ze=nr(),gr=nr(),Ot=nr();function nr(){return 2**++Hy}const js=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ce,booleanish:tt,commaOrSpaceSeparated:Ot,commaSeparated:gr,number:Z,overloadedBoolean:D1,spaceSeparated:ze},Symbol.toStringTag,{value:"Module"})),cs=Object.keys(js);class Ii extends Wt{constructor(t,n,r,u){let a=-1;if(super(t,n),wc(this,"space",u),typeof r=="number")for(;++a<cs.length;){const s=cs[a];wc(this,cs[a],(r&js[s])===js[s])}}}Ii.prototype.defined=!0;function wc(e,t,n){n&&(e[t]=n)}const Uy={}.hasOwnProperty;function Nr(e){const t={},n={};let r;for(r in e.properties)if(Uy.call(e.properties,r)){const u=e.properties[r],a=new Ii(r,e.transform(e.attributes||{},r),u,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Bs(r)]=r,n[Bs(a.attribute)]=r}return new gu(t,n,e.space)}const L1=Nr({space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()},properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),P1=Nr({space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function R1(e,t){return t in e?e[t]:t}function O1(e,t){return R1(e,t.toLowerCase())}const M1=Nr({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:O1,properties:{xmlns:null,xmlnsXLink:null}}),F1=Nr({transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:tt,ariaAutoComplete:null,ariaBusy:tt,ariaChecked:tt,ariaColCount:Z,ariaColIndex:Z,ariaColSpan:Z,ariaControls:ze,ariaCurrent:null,ariaDescribedBy:ze,ariaDetails:null,ariaDisabled:tt,ariaDropEffect:ze,ariaErrorMessage:null,ariaExpanded:tt,ariaFlowTo:ze,ariaGrabbed:tt,ariaHasPopup:null,ariaHidden:tt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ze,ariaLevel:Z,ariaLive:null,ariaModal:tt,ariaMultiLine:tt,ariaMultiSelectable:tt,ariaOrientation:null,ariaOwns:ze,ariaPlaceholder:null,ariaPosInSet:Z,ariaPressed:tt,ariaReadOnly:tt,ariaRelevant:null,ariaRequired:tt,ariaRoleDescription:ze,ariaRowCount:Z,ariaRowIndex:Z,ariaRowSpan:Z,ariaSelected:tt,ariaSetSize:Z,ariaSort:null,ariaValueMax:Z,ariaValueMin:Z,ariaValueNow:Z,ariaValueText:null,role:null}}),Vy=Nr({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:O1,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:gr,acceptCharset:ze,accessKey:ze,action:null,allow:null,allowFullScreen:Ce,allowPaymentRequest:Ce,allowUserMedia:Ce,alt:null,as:null,async:Ce,autoCapitalize:null,autoComplete:ze,autoFocus:Ce,autoPlay:Ce,blocking:ze,capture:null,charSet:null,checked:Ce,cite:null,className:ze,cols:Z,colSpan:null,content:null,contentEditable:tt,controls:Ce,controlsList:ze,coords:Z|gr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ce,defer:Ce,dir:null,dirName:null,disabled:Ce,download:D1,draggable:tt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ce,formTarget:null,headers:ze,height:Z,hidden:Ce,high:Z,href:null,hrefLang:null,htmlFor:ze,httpEquiv:ze,id:null,imageSizes:null,imageSrcSet:null,inert:Ce,inputMode:null,integrity:null,is:null,isMap:Ce,itemId:null,itemProp:ze,itemRef:ze,itemScope:Ce,itemType:ze,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ce,low:Z,manifest:null,max:null,maxLength:Z,media:null,method:null,min:null,minLength:Z,multiple:Ce,muted:Ce,name:null,nonce:null,noModule:Ce,noValidate:Ce,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Ce,optimum:Z,pattern:null,ping:ze,placeholder:null,playsInline:Ce,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ce,referrerPolicy:null,rel:ze,required:Ce,reversed:Ce,rows:Z,rowSpan:Z,sandbox:ze,scope:null,scoped:Ce,seamless:Ce,selected:Ce,shadowRootClonable:Ce,shadowRootDelegatesFocus:Ce,shadowRootMode:null,shape:null,size:Z,sizes:null,slot:null,span:Z,spellCheck:tt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Z,step:null,style:null,tabIndex:Z,target:null,title:null,translate:null,type:null,typeMustMatch:Ce,useMap:null,value:tt,width:Z,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ze,axis:null,background:null,bgColor:null,border:Z,borderColor:null,bottomMargin:Z,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ce,declare:Ce,event:null,face:null,frame:null,frameBorder:null,hSpace:Z,leftMargin:Z,link:null,longDesc:null,lowSrc:null,marginHeight:Z,marginWidth:Z,noResize:Ce,noHref:Ce,noShade:Ce,noWrap:Ce,object:null,profile:null,prompt:null,rev:null,rightMargin:Z,rules:null,scheme:null,scrolling:tt,standby:null,summary:null,text:null,topMargin:Z,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Z,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ce,disableRemotePlayback:Ce,prefix:null,property:null,results:Z,security:null,unselectable:null}}),$y=Nr({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:R1,properties:{about:Ot,accentHeight:Z,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Z,amplitude:Z,arabicForm:null,ascent:Z,attributeName:null,attributeType:null,azimuth:Z,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Z,by:null,calcMode:null,capHeight:Z,className:ze,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Z,diffuseConstant:Z,direction:null,display:null,dur:null,divisor:Z,dominantBaseline:null,download:Ce,dx:null,dy:null,edgeMode:null,editable:null,elevation:Z,enableBackground:null,end:null,event:null,exponent:Z,externalResourcesRequired:null,fill:null,fillOpacity:Z,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:gr,g2:gr,glyphName:gr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Z,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Z,horizOriginX:Z,horizOriginY:Z,id:null,ideographic:Z,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Z,k:Z,k1:Z,k2:Z,k3:Z,k4:Z,kernelMatrix:Ot,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Z,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Z,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Z,overlineThickness:Z,paintOrder:null,panose1:null,path:null,pathLength:Z,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ze,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Z,pointsAtY:Z,pointsAtZ:Z,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ot,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ot,rev:Ot,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ot,requiredFeatures:Ot,requiredFonts:Ot,requiredFormats:Ot,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Z,specularExponent:Z,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Z,strikethroughThickness:Z,string:null,stroke:null,strokeDashArray:Ot,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Z,strokeOpacity:Z,strokeWidth:null,style:null,surfaceScale:Z,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ot,tabIndex:Z,tableValues:null,target:null,targetX:Z,targetY:Z,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ot,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Z,underlineThickness:Z,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Z,values:null,vAlphabetic:Z,vMathematical:Z,vectorEffect:null,vHanging:Z,vIdeographic:Z,version:null,vertAdvY:Z,vertOriginX:Z,vertOriginY:Z,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Z,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),zy=/^data[-\w.:]+$/i,Dc=/-[a-z]/g,qy=/[A-Z]/g;function Zy(e,t){const n=Bs(t);let r=t,u=Wt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&zy.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(Dc,Yy);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!Dc.test(a)){let s=a.replace(qy,Wy);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}u=Ii}return new u(r,t)}function Wy(e){return"-"+e.toLowerCase()}function Yy(e){return e.charAt(1).toUpperCase()}const Gy=w1([P1,L1,M1,F1,Vy],"html"),B1=w1([P1,L1,M1,F1,$y],"svg"),Xy={},Ky={}.hasOwnProperty,j1=s1("type",{handlers:{root:Jy,element:uk,text:nk,comment:rk,doctype:tk}});function Qy(e,t){const r=(t||Xy).space;return j1(e,r==="svg"?B1:Gy)}function Jy(e,t){const n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=Ni(e.children,n,t),vr(e,n),n}function ek(e,t){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=Ni(e.children,n,t),vr(e,n),n}function tk(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return vr(e,t),t}function nk(e){const t={nodeName:"#text",value:e.value,parentNode:null};return vr(e,t),t}function rk(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return vr(e,t),t}function uk(e,t){const n=t;let r=n;e.type==="element"&&e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=B1);const u=[];let a;if(e.properties){for(a in e.properties)if(a!=="children"&&Ky.call(e.properties,a)){const c=ak(r,a,e.properties[a]);c&&u.push(c)}}const s=r.space,o={nodeName:e.tagName,tagName:e.tagName,attrs:u,namespaceURI:Xn[s],childNodes:[],parentNode:null};return o.childNodes=Ni(e.children,o,r),vr(e,o),e.tagName==="template"&&e.content&&(o.content=ek(e.content,r)),o}function ak(e,t,n){const r=Zy(e,t);if(n===!1||n===null||n===void 0||typeof n=="number"&&Number.isNaN(n)||!n&&r.boolean)return;Array.isArray(n)&&(n=r.commaSeparated?b0(n):S0(n));const u={name:r.attribute,value:n===!0?"":String(n)};if(r.space&&r.space!=="html"&&r.space!=="svg"){const a=u.name.indexOf(":");a<0?u.prefix="":(u.name=u.name.slice(a+1),u.prefix=r.attribute.slice(0,a)),u.namespace=Xn[r.space]}return u}function Ni(e,t,n){let r=-1;const u=[];if(e)for(;++r<e.length;){const a=j1(e[r],n);a.parentNode=t,u.push(a)}return u}function vr(e,t){const n=e.position;n&&n.start&&n.end&&(n.start.offset,n.end.offset,t.sourceCodeLocation={startLine:n.start.line,startCol:n.start.column,startOffset:n.start.offset,endLine:n.end.line,endCol:n.end.column,endOffset:n.end.offset})}const sk=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],ik=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),Ze="�";var T;(function(e){e[e.EOF=-1]="EOF",e[e.NULL=0]="NULL",e[e.TABULATION=9]="TABULATION",e[e.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",e[e.LINE_FEED=10]="LINE_FEED",e[e.FORM_FEED=12]="FORM_FEED",e[e.SPACE=32]="SPACE",e[e.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",e[e.QUOTATION_MARK=34]="QUOTATION_MARK",e[e.AMPERSAND=38]="AMPERSAND",e[e.APOSTROPHE=39]="APOSTROPHE",e[e.HYPHEN_MINUS=45]="HYPHEN_MINUS",e[e.SOLIDUS=47]="SOLIDUS",e[e.DIGIT_0=48]="DIGIT_0",e[e.DIGIT_9=57]="DIGIT_9",e[e.SEMICOLON=59]="SEMICOLON",e[e.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",e[e.EQUALS_SIGN=61]="EQUALS_SIGN",e[e.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",e[e.QUESTION_MARK=63]="QUESTION_MARK",e[e.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",e[e.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",e[e.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",e[e.GRAVE_ACCENT=96]="GRAVE_ACCENT",e[e.LATIN_SMALL_A=97]="LATIN_SMALL_A",e[e.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(T||(T={}));const Tt={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function H1(e){return e>=55296&&e<=57343}function ok(e){return e>=56320&&e<=57343}function ck(e,t){return(e-55296)*1024+9216+t}function U1(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function V1(e){return e>=64976&&e<=65007||ik.has(e)}var M;(function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeValue="missing-attribute-value",e.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",e.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",e.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",e.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",e.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",e.missingDoctypePublicIdentifier="missing-doctype-public-identifier",e.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",e.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",e.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",e.cdataInHtmlContent="cdata-in-html-content",e.incorrectlyOpenedComment="incorrectly-opened-comment",e.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",e.eofInDoctype="eof-in-doctype",e.nestedComment="nested-comment",e.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",e.eofInComment="eof-in-comment",e.incorrectlyClosedComment="incorrectly-closed-comment",e.eofInCdata="eof-in-cdata",e.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",e.nullCharacterReference="null-character-reference",e.surrogateCharacterReference="surrogate-character-reference",e.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",e.controlCharacterReference="control-character-reference",e.noncharacterCharacterReference="noncharacter-character-reference",e.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",e.missingDoctypeName="missing-doctype-name",e.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",e.duplicateAttribute="duplicate-attribute",e.nonConformingDoctype="non-conforming-doctype",e.missingDoctype="missing-doctype",e.misplacedDoctype="misplaced-doctype",e.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",e.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",e.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",e.openElementsLeftAfterEof="open-elements-left-after-eof",e.abandonedHeadElementChild="abandoned-head-element-child",e.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",e.nestedNoscriptInHead="nested-noscript-in-head",e.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(M||(M={}));const lk=65536;class dk{constructor(t){this.handler=t,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=lk,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(t,n){const{line:r,col:u,offset:a}=this,s=u+n,o=a+n;return{code:t,startLine:r,endLine:r,startCol:s,endCol:s,startOffset:o,endOffset:o}}_err(t){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(t,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(t){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(ok(n))return this.pos++,this._addGap(),ck(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,T.EOF;return this._err(M.surrogateInInputStream),t}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(t,n){this.html.length>0?this.html+=t:this.html=t,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(t){this.html=this.html.substring(0,this.pos+1)+t+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(t,n){if(this.pos+t.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(t,this.pos);for(let r=0;r<t.length;r++)if((this.html.charCodeAt(this.pos+r)|32)!==t.charCodeAt(r))return!1;return!0}peek(t){const n=this.pos+t;if(n>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,T.EOF;const r=this.html.charCodeAt(n);return r===T.CARRIAGE_RETURN?T.LINE_FEED:r}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,T.EOF;let t=this.html.charCodeAt(this.pos);return t===T.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,T.LINE_FEED):t===T.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,H1(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===T.LINE_FEED||t===T.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){U1(t)?this._err(M.controlCharacterInInputStream):V1(t)&&this._err(M.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var Se;(function(e){e[e.CHARACTER=0]="CHARACTER",e[e.NULL_CHARACTER=1]="NULL_CHARACTER",e[e.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",e[e.START_TAG=3]="START_TAG",e[e.END_TAG=4]="END_TAG",e[e.COMMENT=5]="COMMENT",e[e.DOCTYPE=6]="DOCTYPE",e[e.EOF=7]="EOF",e[e.HIBERNATION=8]="HIBERNATION"})(Se||(Se={}));function $1(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}const fk=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),hk=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function pk(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=hk.get(e))!==null&&t!==void 0?t:e}var lt;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(lt||(lt={}));const mk=32;var Mn;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Mn||(Mn={}));function Hs(e){return e>=lt.ZERO&&e<=lt.NINE}function gk(e){return e>=lt.UPPER_A&&e<=lt.UPPER_F||e>=lt.LOWER_A&&e<=lt.LOWER_F}function bk(e){return e>=lt.UPPER_A&&e<=lt.UPPER_Z||e>=lt.LOWER_A&&e<=lt.LOWER_Z||Hs(e)}function _k(e){return e===lt.EQUALS||bk(e)}var it;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(it||(it={}));var En;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(En||(En={}));class xk{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=it.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=En.Strict}startEntity(t){this.decodeMode=t,this.state=it.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case it.EntityStart:return t.charCodeAt(n)===lt.NUM?(this.state=it.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=it.NamedEntity,this.stateNamedEntity(t,n));case it.NumericStart:return this.stateNumericStart(t,n);case it.NumericDecimal:return this.stateNumericDecimal(t,n);case it.NumericHex:return this.stateNumericHex(t,n);case it.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|mk)===lt.LOWER_X?(this.state=it.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=it.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,r,u){if(n!==r){const a=r-n;this.result=this.result*Math.pow(u,a)+Number.parseInt(t.substr(n,a),u),this.consumed+=a}}stateNumericHex(t,n){const r=n;for(;n<t.length;){const u=t.charCodeAt(n);if(Hs(u)||gk(u))n+=1;else return this.addToNumericResult(t,r,n,16),this.emitNumericEntity(u,3)}return this.addToNumericResult(t,r,n,16),-1}stateNumericDecimal(t,n){const r=n;for(;n<t.length;){const u=t.charCodeAt(n);if(Hs(u))n+=1;else return this.addToNumericResult(t,r,n,10),this.emitNumericEntity(u,2)}return this.addToNumericResult(t,r,n,10),-1}emitNumericEntity(t,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===lt.SEMI)this.consumed+=1;else if(this.decodeMode===En.Strict)return 0;return this.emitCodePoint(pk(this.result),this.consumed),this.errors&&(t!==lt.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){const{decodeTree:r}=this;let u=r[this.treeIndex],a=(u&Mn.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const s=t.charCodeAt(n);if(this.treeIndex=Ck(r,u,this.treeIndex+Math.max(1,a),s),this.treeIndex<0)return this.result===0||this.decodeMode===En.Attribute&&(a===0||_k(s))?0:this.emitNotTerminatedNamedEntity();if(u=r[this.treeIndex],a=(u&Mn.VALUE_LENGTH)>>14,a!==0){if(s===lt.SEMI)return this.emitNamedEntityData(this.treeIndex,a,this.consumed+this.excess);this.decodeMode!==En.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:r}=this,u=(r[n]&Mn.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,u,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,r){const{decodeTree:u}=this;return this.emitCodePoint(n===1?u[t]&~Mn.VALUE_LENGTH:u[t+1],r),n===3&&this.emitCodePoint(u[t+2],r),r}end(){var t;switch(this.state){case it.NamedEntity:return this.result!==0&&(this.decodeMode!==En.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case it.NumericDecimal:return this.emitNumericEntity(0,2);case it.NumericHex:return this.emitNumericEntity(0,3);case it.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case it.EntityStart:return 0}}}function Ck(e,t,n,r){const u=(t&Mn.BRANCH_LENGTH)>>7,a=t&Mn.JUMP_TABLE;if(u===0)return a!==0&&r===a?n:-1;if(a){const c=r-a;return c<0||c>=u?-1:e[n+c]-1}let s=n,o=s+u-1;for(;s<=o;){const c=s+o>>>1,l=e[c];if(l<r)s=c+1;else if(l>r)o=c-1;else return e[c+u]}return-1}var V;(function(e){e.HTML="http://www.w3.org/1999/xhtml",e.MATHML="http://www.w3.org/1998/Math/MathML",e.SVG="http://www.w3.org/2000/svg",e.XLINK="http://www.w3.org/1999/xlink",e.XML="http://www.w3.org/XML/1998/namespace",e.XMLNS="http://www.w3.org/2000/xmlns/"})(V||(V={}));var Kn;(function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"})(Kn||(Kn={}));var zt;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(zt||(zt={}));var O;(function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SEARCH="search",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"})(O||(O={}));var d;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SEARCH=94]="SEARCH",e[e.SECTION=95]="SECTION",e[e.SELECT=96]="SELECT",e[e.SOURCE=97]="SOURCE",e[e.SMALL=98]="SMALL",e[e.SPAN=99]="SPAN",e[e.STRIKE=100]="STRIKE",e[e.STRONG=101]="STRONG",e[e.STYLE=102]="STYLE",e[e.SUB=103]="SUB",e[e.SUMMARY=104]="SUMMARY",e[e.SUP=105]="SUP",e[e.TABLE=106]="TABLE",e[e.TBODY=107]="TBODY",e[e.TEMPLATE=108]="TEMPLATE",e[e.TEXTAREA=109]="TEXTAREA",e[e.TFOOT=110]="TFOOT",e[e.TD=111]="TD",e[e.TH=112]="TH",e[e.THEAD=113]="THEAD",e[e.TITLE=114]="TITLE",e[e.TR=115]="TR",e[e.TRACK=116]="TRACK",e[e.TT=117]="TT",e[e.U=118]="U",e[e.UL=119]="UL",e[e.SVG=120]="SVG",e[e.VAR=121]="VAR",e[e.WBR=122]="WBR",e[e.XMP=123]="XMP"})(d||(d={}));const Ek=new Map([[O.A,d.A],[O.ADDRESS,d.ADDRESS],[O.ANNOTATION_XML,d.ANNOTATION_XML],[O.APPLET,d.APPLET],[O.AREA,d.AREA],[O.ARTICLE,d.ARTICLE],[O.ASIDE,d.ASIDE],[O.B,d.B],[O.BASE,d.BASE],[O.BASEFONT,d.BASEFONT],[O.BGSOUND,d.BGSOUND],[O.BIG,d.BIG],[O.BLOCKQUOTE,d.BLOCKQUOTE],[O.BODY,d.BODY],[O.BR,d.BR],[O.BUTTON,d.BUTTON],[O.CAPTION,d.CAPTION],[O.CENTER,d.CENTER],[O.CODE,d.CODE],[O.COL,d.COL],[O.COLGROUP,d.COLGROUP],[O.DD,d.DD],[O.DESC,d.DESC],[O.DETAILS,d.DETAILS],[O.DIALOG,d.DIALOG],[O.DIR,d.DIR],[O.DIV,d.DIV],[O.DL,d.DL],[O.DT,d.DT],[O.EM,d.EM],[O.EMBED,d.EMBED],[O.FIELDSET,d.FIELDSET],[O.FIGCAPTION,d.FIGCAPTION],[O.FIGURE,d.FIGURE],[O.FONT,d.FONT],[O.FOOTER,d.FOOTER],[O.FOREIGN_OBJECT,d.FOREIGN_OBJECT],[O.FORM,d.FORM],[O.FRAME,d.FRAME],[O.FRAMESET,d.FRAMESET],[O.H1,d.H1],[O.H2,d.H2],[O.H3,d.H3],[O.H4,d.H4],[O.H5,d.H5],[O.H6,d.H6],[O.HEAD,d.HEAD],[O.HEADER,d.HEADER],[O.HGROUP,d.HGROUP],[O.HR,d.HR],[O.HTML,d.HTML],[O.I,d.I],[O.IMG,d.IMG],[O.IMAGE,d.IMAGE],[O.INPUT,d.INPUT],[O.IFRAME,d.IFRAME],[O.KEYGEN,d.KEYGEN],[O.LABEL,d.LABEL],[O.LI,d.LI],[O.LINK,d.LINK],[O.LISTING,d.LISTING],[O.MAIN,d.MAIN],[O.MALIGNMARK,d.MALIGNMARK],[O.MARQUEE,d.MARQUEE],[O.MATH,d.MATH],[O.MENU,d.MENU],[O.META,d.META],[O.MGLYPH,d.MGLYPH],[O.MI,d.MI],[O.MO,d.MO],[O.MN,d.MN],[O.MS,d.MS],[O.MTEXT,d.MTEXT],[O.NAV,d.NAV],[O.NOBR,d.NOBR],[O.NOFRAMES,d.NOFRAMES],[O.NOEMBED,d.NOEMBED],[O.NOSCRIPT,d.NOSCRIPT],[O.OBJECT,d.OBJECT],[O.OL,d.OL],[O.OPTGROUP,d.OPTGROUP],[O.OPTION,d.OPTION],[O.P,d.P],[O.PARAM,d.PARAM],[O.PLAINTEXT,d.PLAINTEXT],[O.PRE,d.PRE],[O.RB,d.RB],[O.RP,d.RP],[O.RT,d.RT],[O.RTC,d.RTC],[O.RUBY,d.RUBY],[O.S,d.S],[O.SCRIPT,d.SCRIPT],[O.SEARCH,d.SEARCH],[O.SECTION,d.SECTION],[O.SELECT,d.SELECT],[O.SOURCE,d.SOURCE],[O.SMALL,d.SMALL],[O.SPAN,d.SPAN],[O.STRIKE,d.STRIKE],[O.STRONG,d.STRONG],[O.STYLE,d.STYLE],[O.SUB,d.SUB],[O.SUMMARY,d.SUMMARY],[O.SUP,d.SUP],[O.TABLE,d.TABLE],[O.TBODY,d.TBODY],[O.TEMPLATE,d.TEMPLATE],[O.TEXTAREA,d.TEXTAREA],[O.TFOOT,d.TFOOT],[O.TD,d.TD],[O.TH,d.TH],[O.THEAD,d.THEAD],[O.TITLE,d.TITLE],[O.TR,d.TR],[O.TRACK,d.TRACK],[O.TT,d.TT],[O.U,d.U],[O.UL,d.UL],[O.SVG,d.SVG],[O.VAR,d.VAR],[O.WBR,d.WBR],[O.XMP,d.XMP]]);function wr(e){var t;return(t=Ek.get(e))!==null&&t!==void 0?t:d.UNKNOWN}const z=d,Tk={[V.HTML]:new Set([z.ADDRESS,z.APPLET,z.AREA,z.ARTICLE,z.ASIDE,z.BASE,z.BASEFONT,z.BGSOUND,z.BLOCKQUOTE,z.BODY,z.BR,z.BUTTON,z.CAPTION,z.CENTER,z.COL,z.COLGROUP,z.DD,z.DETAILS,z.DIR,z.DIV,z.DL,z.DT,z.EMBED,z.FIELDSET,z.FIGCAPTION,z.FIGURE,z.FOOTER,z.FORM,z.FRAME,z.FRAMESET,z.H1,z.H2,z.H3,z.H4,z.H5,z.H6,z.HEAD,z.HEADER,z.HGROUP,z.HR,z.HTML,z.IFRAME,z.IMG,z.INPUT,z.LI,z.LINK,z.LISTING,z.MAIN,z.MARQUEE,z.MENU,z.META,z.NAV,z.NOEMBED,z.NOFRAMES,z.NOSCRIPT,z.OBJECT,z.OL,z.P,z.PARAM,z.PLAINTEXT,z.PRE,z.SCRIPT,z.SECTION,z.SELECT,z.SOURCE,z.STYLE,z.SUMMARY,z.TABLE,z.TBODY,z.TD,z.TEMPLATE,z.TEXTAREA,z.TFOOT,z.TH,z.THEAD,z.TITLE,z.TR,z.TRACK,z.UL,z.WBR,z.XMP]),[V.MATHML]:new Set([z.MI,z.MO,z.MN,z.MS,z.MTEXT,z.ANNOTATION_XML]),[V.SVG]:new Set([z.TITLE,z.FOREIGN_OBJECT,z.DESC]),[V.XLINK]:new Set,[V.XML]:new Set,[V.XMLNS]:new Set},Us=new Set([z.H1,z.H2,z.H3,z.H4,z.H5,z.H6]);O.STYLE,O.SCRIPT,O.XMP,O.IFRAME,O.NOEMBED,O.NOFRAMES,O.PLAINTEXT;var k;(function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(k||(k={}));const Qe={DATA:k.DATA,RCDATA:k.RCDATA,RAWTEXT:k.RAWTEXT,SCRIPT_DATA:k.SCRIPT_DATA,PLAINTEXT:k.PLAINTEXT,CDATA_SECTION:k.CDATA_SECTION};function yk(e){return e>=T.DIGIT_0&&e<=T.DIGIT_9}function Ur(e){return e>=T.LATIN_CAPITAL_A&&e<=T.LATIN_CAPITAL_Z}function kk(e){return e>=T.LATIN_SMALL_A&&e<=T.LATIN_SMALL_Z}function vn(e){return kk(e)||Ur(e)}function Lc(e){return vn(e)||yk(e)}function Mu(e){return e+32}function z1(e){return e===T.SPACE||e===T.LINE_FEED||e===T.TABULATION||e===T.FORM_FEED}function Pc(e){return z1(e)||e===T.SOLIDUS||e===T.GREATER_THAN_SIGN}function Ak(e){return e===T.NULL?M.nullCharacterReference:e>1114111?M.characterReferenceOutsideUnicodeRange:H1(e)?M.surrogateCharacterReference:V1(e)?M.noncharacterCharacterReference:U1(e)||e===T.CARRIAGE_RETURN?M.controlCharacterReference:null}class Sk{constructor(t,n){this.options=t,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=k.DATA,this.returnState=k.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new dk(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new xk(fk,(r,u)=>{this.preprocessor.pos=this.entityStartPos+u-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(M.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(M.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const u=Ak(r);u&&this._err(u,1)}}:void 0)}_err(t,n=0){var r,u;(u=(r=this.handler).onParseError)===null||u===void 0||u.call(r,this.preprocessor.getError(t,n))}getCurrentLocation(t){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-t,startOffset:this.preprocessor.offset-t,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const t=this._consume();this._ensureHibernation()||this._callState(t)}this.inLoop=!1}}pause(){this.paused=!0}resume(t){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||t==null||t())}write(t,n,r){this.active=!0,this.preprocessor.write(t,n),this._runParsingLoop(),this.paused||r==null||r()}insertHtmlAtCurrentPos(t){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(t),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(t){this.consumedAfterSnapshot+=t;for(let n=0;n<t;n++)this.preprocessor.advance()}_consumeSequenceIfMatch(t,n){return this.preprocessor.startsWith(t,n)?(this._advanceBy(t.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:Se.START_TAG,tagName:"",tagID:d.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:Se.END_TAG,tagName:"",tagID:d.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(t){this.currentToken={type:Se.COMMENT,data:"",location:this.getCurrentLocation(t)}}_createDoctypeToken(t){this.currentToken={type:Se.DOCTYPE,name:t,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(t,n){this.currentCharacterToken={type:t,chars:n,location:this.currentLocation}}_createAttr(t){this.currentAttr={name:t,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var t,n;const r=this.currentToken;if($1(r,this.currentAttr.name)===null){if(r.attrs.push(this.currentAttr),r.location&&this.currentLocation){const u=(t=(n=r.location).attrs)!==null&&t!==void 0?t:n.attrs=Object.create(null);u[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(M.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(t){this._emitCurrentCharacterToken(t.location),this.currentToken=null,t.location&&(t.location.endLine=this.preprocessor.line,t.location.endCol=this.preprocessor.col+1,t.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const t=this.currentToken;this.prepareToken(t),t.tagID=wr(t.tagName),t.type===Se.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this._err(M.endTagWithAttributes),t.selfClosing&&this._err(M.endTagWithTrailingSolidus),this.handler.onEndTag(t)),this.preprocessor.dropParsedChunk()}emitCurrentComment(t){this.prepareToken(t),this.handler.onComment(t),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(t){this.prepareToken(t),this.handler.onDoctype(t),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(t){if(this.currentCharacterToken){switch(t&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=t.startLine,this.currentCharacterToken.location.endCol=t.startCol,this.currentCharacterToken.location.endOffset=t.startOffset),this.currentCharacterToken.type){case Se.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case Se.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case Se.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const t=this.getCurrentLocation(0);t&&(t.endLine=t.startLine,t.endCol=t.startCol,t.endOffset=t.startOffset),this._emitCurrentCharacterToken(t),this.handler.onEof({type:Se.EOF,location:t}),this.active=!1}_appendCharToCurrentCharacterToken(t,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===t){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(t,n)}_emitCodePoint(t){const n=z1(t)?Se.WHITESPACE_CHARACTER:t===T.NULL?Se.NULL_CHARACTER:Se.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(Se.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=k.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?En.Attribute:En.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===k.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===k.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===k.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case k.DATA:{this._stateData(t);break}case k.RCDATA:{this._stateRcdata(t);break}case k.RAWTEXT:{this._stateRawtext(t);break}case k.SCRIPT_DATA:{this._stateScriptData(t);break}case k.PLAINTEXT:{this._statePlaintext(t);break}case k.TAG_OPEN:{this._stateTagOpen(t);break}case k.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case k.TAG_NAME:{this._stateTagName(t);break}case k.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case k.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case k.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case k.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case k.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case k.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case k.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case k.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case k.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case k.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case k.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case k.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case k.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case k.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case k.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case k.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case k.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case k.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case k.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case k.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case k.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case k.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case k.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case k.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case k.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case k.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case k.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case k.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case k.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case k.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case k.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case k.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case k.BOGUS_COMMENT:{this._stateBogusComment(t);break}case k.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case k.COMMENT_START:{this._stateCommentStart(t);break}case k.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case k.COMMENT:{this._stateComment(t);break}case k.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case k.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case k.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case k.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case k.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case k.COMMENT_END:{this._stateCommentEnd(t);break}case k.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case k.DOCTYPE:{this._stateDoctype(t);break}case k.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case k.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case k.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case k.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case k.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case k.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case k.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case k.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case k.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case k.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case k.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case k.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case k.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case k.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case k.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case k.CDATA_SECTION:{this._stateCdataSection(t);break}case k.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case k.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case k.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case k.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case T.LESS_THAN_SIGN:{this.state=k.TAG_OPEN;break}case T.AMPERSAND:{this._startCharacterReference();break}case T.NULL:{this._err(M.unexpectedNullCharacter),this._emitCodePoint(t);break}case T.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case T.AMPERSAND:{this._startCharacterReference();break}case T.LESS_THAN_SIGN:{this.state=k.RCDATA_LESS_THAN_SIGN;break}case T.NULL:{this._err(M.unexpectedNullCharacter),this._emitChars(Ze);break}case T.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case T.LESS_THAN_SIGN:{this.state=k.RAWTEXT_LESS_THAN_SIGN;break}case T.NULL:{this._err(M.unexpectedNullCharacter),this._emitChars(Ze);break}case T.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case T.LESS_THAN_SIGN:{this.state=k.SCRIPT_DATA_LESS_THAN_SIGN;break}case T.NULL:{this._err(M.unexpectedNullCharacter),this._emitChars(Ze);break}case T.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case T.NULL:{this._err(M.unexpectedNullCharacter),this._emitChars(Ze);break}case T.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(vn(t))this._createStartTagToken(),this.state=k.TAG_NAME,this._stateTagName(t);else switch(t){case T.EXCLAMATION_MARK:{this.state=k.MARKUP_DECLARATION_OPEN;break}case T.SOLIDUS:{this.state=k.END_TAG_OPEN;break}case T.QUESTION_MARK:{this._err(M.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=k.BOGUS_COMMENT,this._stateBogusComment(t);break}case T.EOF:{this._err(M.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(M.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=k.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(vn(t))this._createEndTagToken(),this.state=k.TAG_NAME,this._stateTagName(t);else switch(t){case T.GREATER_THAN_SIGN:{this._err(M.missingEndTagName),this.state=k.DATA;break}case T.EOF:{this._err(M.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(M.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=k.BOGUS_COMMENT,this._stateBogusComment(t)}}_stateTagName(t){const n=this.currentToken;switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:{this.state=k.BEFORE_ATTRIBUTE_NAME;break}case T.SOLIDUS:{this.state=k.SELF_CLOSING_START_TAG;break}case T.GREATER_THAN_SIGN:{this.state=k.DATA,this.emitCurrentTagToken();break}case T.NULL:{this._err(M.unexpectedNullCharacter),n.tagName+=Ze;break}case T.EOF:{this._err(M.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(Ur(t)?Mu(t):t)}}_stateRcdataLessThanSign(t){t===T.SOLIDUS?this.state=k.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=k.RCDATA,this._stateRcdata(t))}_stateRcdataEndTagOpen(t){vn(t)?(this.state=k.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(t)):(this._emitChars("</"),this.state=k.RCDATA,this._stateRcdata(t))}handleSpecialEndTag(t){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const n=this.currentToken;switch(n.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=k.BEFORE_ATTRIBUTE_NAME,!1;case T.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=k.SELF_CLOSING_START_TAG,!1;case T.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=k.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=k.RCDATA,this._stateRcdata(t))}_stateRawtextLessThanSign(t){t===T.SOLIDUS?this.state=k.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=k.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagOpen(t){vn(t)?(this.state=k.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(t)):(this._emitChars("</"),this.state=k.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=k.RAWTEXT,this._stateRawtext(t))}_stateScriptDataLessThanSign(t){switch(t){case T.SOLIDUS:{this.state=k.SCRIPT_DATA_END_TAG_OPEN;break}case T.EXCLAMATION_MARK:{this.state=k.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=k.SCRIPT_DATA,this._stateScriptData(t)}}_stateScriptDataEndTagOpen(t){vn(t)?(this.state=k.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(t)):(this._emitChars("</"),this.state=k.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=k.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStart(t){t===T.HYPHEN_MINUS?(this.state=k.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=k.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===T.HYPHEN_MINUS?(this.state=k.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=k.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscaped(t){switch(t){case T.HYPHEN_MINUS:{this.state=k.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case T.LESS_THAN_SIGN:{this.state=k.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case T.NULL:{this._err(M.unexpectedNullCharacter),this._emitChars(Ze);break}case T.EOF:{this._err(M.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataEscapedDash(t){switch(t){case T.HYPHEN_MINUS:{this.state=k.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case T.LESS_THAN_SIGN:{this.state=k.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case T.NULL:{this._err(M.unexpectedNullCharacter),this.state=k.SCRIPT_DATA_ESCAPED,this._emitChars(Ze);break}case T.EOF:{this._err(M.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=k.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case T.HYPHEN_MINUS:{this._emitChars("-");break}case T.LESS_THAN_SIGN:{this.state=k.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case T.GREATER_THAN_SIGN:{this.state=k.SCRIPT_DATA,this._emitChars(">");break}case T.NULL:{this._err(M.unexpectedNullCharacter),this.state=k.SCRIPT_DATA_ESCAPED,this._emitChars(Ze);break}case T.EOF:{this._err(M.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=k.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===T.SOLIDUS?this.state=k.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:vn(t)?(this._emitChars("<"),this.state=k.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=k.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){vn(t)?(this.state=k.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("</"),this.state=k.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=k.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscapeStart(t){if(this.preprocessor.startsWith(Tt.SCRIPT,!1)&&Pc(this.preprocessor.peek(Tt.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<Tt.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=k.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=k.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscaped(t){switch(t){case T.HYPHEN_MINUS:{this.state=k.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case T.LESS_THAN_SIGN:{this.state=k.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case T.NULL:{this._err(M.unexpectedNullCharacter),this._emitChars(Ze);break}case T.EOF:{this._err(M.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDash(t){switch(t){case T.HYPHEN_MINUS:{this.state=k.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case T.LESS_THAN_SIGN:{this.state=k.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case T.NULL:{this._err(M.unexpectedNullCharacter),this.state=k.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Ze);break}case T.EOF:{this._err(M.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=k.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDashDash(t){switch(t){case T.HYPHEN_MINUS:{this._emitChars("-");break}case T.LESS_THAN_SIGN:{this.state=k.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case T.GREATER_THAN_SIGN:{this.state=k.SCRIPT_DATA,this._emitChars(">");break}case T.NULL:{this._err(M.unexpectedNullCharacter),this.state=k.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Ze);break}case T.EOF:{this._err(M.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=k.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===T.SOLIDUS?(this.state=k.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=k.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(Tt.SCRIPT,!1)&&Pc(this.preprocessor.peek(Tt.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<Tt.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=k.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=k.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateBeforeAttributeName(t){switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.SOLIDUS:case T.GREATER_THAN_SIGN:case T.EOF:{this.state=k.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case T.EQUALS_SIGN:{this._err(M.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=k.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=k.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateAttributeName(t){switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:case T.SOLIDUS:case T.GREATER_THAN_SIGN:case T.EOF:{this._leaveAttrName(),this.state=k.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case T.EQUALS_SIGN:{this._leaveAttrName(),this.state=k.BEFORE_ATTRIBUTE_VALUE;break}case T.QUOTATION_MARK:case T.APOSTROPHE:case T.LESS_THAN_SIGN:{this._err(M.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case T.NULL:{this._err(M.unexpectedNullCharacter),this.currentAttr.name+=Ze;break}default:this.currentAttr.name+=String.fromCodePoint(Ur(t)?Mu(t):t)}}_stateAfterAttributeName(t){switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.SOLIDUS:{this.state=k.SELF_CLOSING_START_TAG;break}case T.EQUALS_SIGN:{this.state=k.BEFORE_ATTRIBUTE_VALUE;break}case T.GREATER_THAN_SIGN:{this.state=k.DATA,this.emitCurrentTagToken();break}case T.EOF:{this._err(M.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=k.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateBeforeAttributeValue(t){switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.QUOTATION_MARK:{this.state=k.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case T.APOSTROPHE:{this.state=k.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case T.GREATER_THAN_SIGN:{this._err(M.missingAttributeValue),this.state=k.DATA,this.emitCurrentTagToken();break}default:this.state=k.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case T.QUOTATION_MARK:{this.state=k.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case T.AMPERSAND:{this._startCharacterReference();break}case T.NULL:{this._err(M.unexpectedNullCharacter),this.currentAttr.value+=Ze;break}case T.EOF:{this._err(M.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case T.APOSTROPHE:{this.state=k.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case T.AMPERSAND:{this._startCharacterReference();break}case T.NULL:{this._err(M.unexpectedNullCharacter),this.currentAttr.value+=Ze;break}case T.EOF:{this._err(M.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueUnquoted(t){switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:{this._leaveAttrValue(),this.state=k.BEFORE_ATTRIBUTE_NAME;break}case T.AMPERSAND:{this._startCharacterReference();break}case T.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=k.DATA,this.emitCurrentTagToken();break}case T.NULL:{this._err(M.unexpectedNullCharacter),this.currentAttr.value+=Ze;break}case T.QUOTATION_MARK:case T.APOSTROPHE:case T.LESS_THAN_SIGN:case T.EQUALS_SIGN:case T.GRAVE_ACCENT:{this._err(M.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case T.EOF:{this._err(M.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAfterAttributeValueQuoted(t){switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:{this._leaveAttrValue(),this.state=k.BEFORE_ATTRIBUTE_NAME;break}case T.SOLIDUS:{this._leaveAttrValue(),this.state=k.SELF_CLOSING_START_TAG;break}case T.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=k.DATA,this.emitCurrentTagToken();break}case T.EOF:{this._err(M.eofInTag),this._emitEOFToken();break}default:this._err(M.missingWhitespaceBetweenAttributes),this.state=k.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case T.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=k.DATA,this.emitCurrentTagToken();break}case T.EOF:{this._err(M.eofInTag),this._emitEOFToken();break}default:this._err(M.unexpectedSolidusInTag),this.state=k.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){const n=this.currentToken;switch(t){case T.GREATER_THAN_SIGN:{this.state=k.DATA,this.emitCurrentComment(n);break}case T.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case T.NULL:{this._err(M.unexpectedNullCharacter),n.data+=Ze;break}default:n.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch(Tt.DASH_DASH,!0)?(this._createCommentToken(Tt.DASH_DASH.length+1),this.state=k.COMMENT_START):this._consumeSequenceIfMatch(Tt.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(Tt.DOCTYPE.length+1),this.state=k.DOCTYPE):this._consumeSequenceIfMatch(Tt.CDATA_START,!0)?this.inForeignNode?this.state=k.CDATA_SECTION:(this._err(M.cdataInHtmlContent),this._createCommentToken(Tt.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=k.BOGUS_COMMENT):this._ensureHibernation()||(this._err(M.incorrectlyOpenedComment),this._createCommentToken(2),this.state=k.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case T.HYPHEN_MINUS:{this.state=k.COMMENT_START_DASH;break}case T.GREATER_THAN_SIGN:{this._err(M.abruptClosingOfEmptyComment),this.state=k.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=k.COMMENT,this._stateComment(t)}}_stateCommentStartDash(t){const n=this.currentToken;switch(t){case T.HYPHEN_MINUS:{this.state=k.COMMENT_END;break}case T.GREATER_THAN_SIGN:{this._err(M.abruptClosingOfEmptyComment),this.state=k.DATA,this.emitCurrentComment(n);break}case T.EOF:{this._err(M.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=k.COMMENT,this._stateComment(t)}}_stateComment(t){const n=this.currentToken;switch(t){case T.HYPHEN_MINUS:{this.state=k.COMMENT_END_DASH;break}case T.LESS_THAN_SIGN:{n.data+="<",this.state=k.COMMENT_LESS_THAN_SIGN;break}case T.NULL:{this._err(M.unexpectedNullCharacter),n.data+=Ze;break}case T.EOF:{this._err(M.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(t)}}_stateCommentLessThanSign(t){const n=this.currentToken;switch(t){case T.EXCLAMATION_MARK:{n.data+="!",this.state=k.COMMENT_LESS_THAN_SIGN_BANG;break}case T.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=k.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===T.HYPHEN_MINUS?this.state=k.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=k.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===T.HYPHEN_MINUS?this.state=k.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=k.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==T.GREATER_THAN_SIGN&&t!==T.EOF&&this._err(M.nestedComment),this.state=k.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){const n=this.currentToken;switch(t){case T.HYPHEN_MINUS:{this.state=k.COMMENT_END;break}case T.EOF:{this._err(M.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=k.COMMENT,this._stateComment(t)}}_stateCommentEnd(t){const n=this.currentToken;switch(t){case T.GREATER_THAN_SIGN:{this.state=k.DATA,this.emitCurrentComment(n);break}case T.EXCLAMATION_MARK:{this.state=k.COMMENT_END_BANG;break}case T.HYPHEN_MINUS:{n.data+="-";break}case T.EOF:{this._err(M.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=k.COMMENT,this._stateComment(t)}}_stateCommentEndBang(t){const n=this.currentToken;switch(t){case T.HYPHEN_MINUS:{n.data+="--!",this.state=k.COMMENT_END_DASH;break}case T.GREATER_THAN_SIGN:{this._err(M.incorrectlyClosedComment),this.state=k.DATA,this.emitCurrentComment(n);break}case T.EOF:{this._err(M.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=k.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:{this.state=k.BEFORE_DOCTYPE_NAME;break}case T.GREATER_THAN_SIGN:{this.state=k.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case T.EOF:{this._err(M.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(M.missingWhitespaceBeforeDoctypeName),this.state=k.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(Ur(t))this._createDoctypeToken(String.fromCharCode(Mu(t))),this.state=k.DOCTYPE_NAME;else switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.NULL:{this._err(M.unexpectedNullCharacter),this._createDoctypeToken(Ze),this.state=k.DOCTYPE_NAME;break}case T.GREATER_THAN_SIGN:{this._err(M.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=k.DATA;break}case T.EOF:{this._err(M.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(t)),this.state=k.DOCTYPE_NAME}}_stateDoctypeName(t){const n=this.currentToken;switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:{this.state=k.AFTER_DOCTYPE_NAME;break}case T.GREATER_THAN_SIGN:{this.state=k.DATA,this.emitCurrentDoctype(n);break}case T.NULL:{this._err(M.unexpectedNullCharacter),n.name+=Ze;break}case T.EOF:{this._err(M.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(Ur(t)?Mu(t):t)}}_stateAfterDoctypeName(t){const n=this.currentToken;switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.GREATER_THAN_SIGN:{this.state=k.DATA,this.emitCurrentDoctype(n);break}case T.EOF:{this._err(M.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(Tt.PUBLIC,!1)?this.state=k.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(Tt.SYSTEM,!1)?this.state=k.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(M.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=k.BOGUS_DOCTYPE,this._stateBogusDoctype(t))}}_stateAfterDoctypePublicKeyword(t){const n=this.currentToken;switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:{this.state=k.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case T.QUOTATION_MARK:{this._err(M.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=k.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case T.APOSTROPHE:{this._err(M.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=k.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case T.GREATER_THAN_SIGN:{this._err(M.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=k.DATA,this.emitCurrentDoctype(n);break}case T.EOF:{this._err(M.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(M.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=k.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.QUOTATION_MARK:{n.publicId="",this.state=k.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case T.APOSTROPHE:{n.publicId="",this.state=k.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case T.GREATER_THAN_SIGN:{this._err(M.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=k.DATA,this.emitCurrentDoctype(n);break}case T.EOF:{this._err(M.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(M.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=k.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case T.QUOTATION_MARK:{this.state=k.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case T.NULL:{this._err(M.unexpectedNullCharacter),n.publicId+=Ze;break}case T.GREATER_THAN_SIGN:{this._err(M.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=k.DATA;break}case T.EOF:{this._err(M.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateDoctypePublicIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case T.APOSTROPHE:{this.state=k.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case T.NULL:{this._err(M.unexpectedNullCharacter),n.publicId+=Ze;break}case T.GREATER_THAN_SIGN:{this._err(M.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=k.DATA;break}case T.EOF:{this._err(M.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateAfterDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:{this.state=k.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case T.GREATER_THAN_SIGN:{this.state=k.DATA,this.emitCurrentDoctype(n);break}case T.QUOTATION_MARK:{this._err(M.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=k.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case T.APOSTROPHE:{this._err(M.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=k.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case T.EOF:{this._err(M.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(M.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=k.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBetweenDoctypePublicAndSystemIdentifiers(t){const n=this.currentToken;switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=k.DATA;break}case T.QUOTATION_MARK:{n.systemId="",this.state=k.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case T.APOSTROPHE:{n.systemId="",this.state=k.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case T.EOF:{this._err(M.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(M.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=k.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateAfterDoctypeSystemKeyword(t){const n=this.currentToken;switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:{this.state=k.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case T.QUOTATION_MARK:{this._err(M.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=k.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case T.APOSTROPHE:{this._err(M.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=k.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case T.GREATER_THAN_SIGN:{this._err(M.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=k.DATA,this.emitCurrentDoctype(n);break}case T.EOF:{this._err(M.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(M.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=k.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.QUOTATION_MARK:{n.systemId="",this.state=k.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case T.APOSTROPHE:{n.systemId="",this.state=k.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case T.GREATER_THAN_SIGN:{this._err(M.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=k.DATA,this.emitCurrentDoctype(n);break}case T.EOF:{this._err(M.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(M.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=k.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case T.QUOTATION_MARK:{this.state=k.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case T.NULL:{this._err(M.unexpectedNullCharacter),n.systemId+=Ze;break}case T.GREATER_THAN_SIGN:{this._err(M.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=k.DATA;break}case T.EOF:{this._err(M.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateDoctypeSystemIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case T.APOSTROPHE:{this.state=k.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case T.NULL:{this._err(M.unexpectedNullCharacter),n.systemId+=Ze;break}case T.GREATER_THAN_SIGN:{this._err(M.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=k.DATA;break}case T.EOF:{this._err(M.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateAfterDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case T.SPACE:case T.LINE_FEED:case T.TABULATION:case T.FORM_FEED:break;case T.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=k.DATA;break}case T.EOF:{this._err(M.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(M.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=k.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){const n=this.currentToken;switch(t){case T.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=k.DATA;break}case T.NULL:{this._err(M.unexpectedNullCharacter);break}case T.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(t){switch(t){case T.RIGHT_SQUARE_BRACKET:{this.state=k.CDATA_SECTION_BRACKET;break}case T.EOF:{this._err(M.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===T.RIGHT_SQUARE_BRACKET?this.state=k.CDATA_SECTION_END:(this._emitChars("]"),this.state=k.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case T.GREATER_THAN_SIGN:{this.state=k.DATA;break}case T.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=k.CDATA_SECTION,this._stateCdataSection(t)}}_stateCharacterReference(){let t=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(t<0)if(this.preprocessor.lastChunkWritten)t=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}t===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(T.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&Lc(this.preprocessor.peek(1))?k.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){Lc(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===T.SEMICOLON&&this._err(M.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}}const q1=new Set([d.DD,d.DT,d.LI,d.OPTGROUP,d.OPTION,d.P,d.RB,d.RP,d.RT,d.RTC]),Rc=new Set([...q1,d.CAPTION,d.COLGROUP,d.TBODY,d.TD,d.TFOOT,d.TH,d.THEAD,d.TR]),Ku=new Set([d.APPLET,d.CAPTION,d.HTML,d.MARQUEE,d.OBJECT,d.TABLE,d.TD,d.TEMPLATE,d.TH]),Ik=new Set([...Ku,d.OL,d.UL]),Nk=new Set([...Ku,d.BUTTON]),Oc=new Set([d.ANNOTATION_XML,d.MI,d.MN,d.MO,d.MS,d.MTEXT]),Mc=new Set([d.DESC,d.FOREIGN_OBJECT,d.TITLE]),vk=new Set([d.TR,d.TEMPLATE,d.HTML]),wk=new Set([d.TBODY,d.TFOOT,d.THEAD,d.TEMPLATE,d.HTML]),Dk=new Set([d.TABLE,d.TEMPLATE,d.HTML]),Lk=new Set([d.TD,d.TH]);class Pk{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(t,n,r){this.treeAdapter=n,this.handler=r,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=d.UNKNOWN,this.current=t}_indexOf(t){return this.items.lastIndexOf(t,this.stackTop)}_isInTemplate(){return this.currentTagId===d.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===V.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(t,n){this.stackTop++,this.items[this.stackTop]=t,this.current=t,this.tagIDs[this.stackTop]=n,this.currentTagId=n,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(t,n,!0)}pop(){const t=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!0)}replace(t,n){const r=this._indexOf(t);this.items[r]=n,r===this.stackTop&&(this.current=n)}insertAfter(t,n,r){const u=this._indexOf(t)+1;this.items.splice(u,0,n),this.tagIDs.splice(u,0,r),this.stackTop++,u===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,u===this.stackTop)}popUntilTagNamePopped(t){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(t,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==V.HTML);this.shortenToLength(Math.max(n,0))}shortenToLength(t){for(;this.stackTop>=t;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop<t)}}popUntilElementPopped(t){const n=this._indexOf(t);this.shortenToLength(Math.max(n,0))}popUntilPopped(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(Math.max(r,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(Us,V.HTML)}popUntilTableCellPopped(){this.popUntilPopped(Lk,V.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(t,n){for(let r=this.stackTop;r>=0;r--)if(t.has(this.tagIDs[r])&&this.treeAdapter.getNamespaceURI(this.items[r])===n)return r;return-1}clearBackTo(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(r+1)}clearBackToTableContext(){this.clearBackTo(Dk,V.HTML)}clearBackToTableBodyContext(){this.clearBackTo(wk,V.HTML)}clearBackToTableRowContext(){this.clearBackTo(vk,V.HTML)}remove(t){const n=this._indexOf(t);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===d.BODY?this.items[1]:null}contains(t){return this._indexOf(t)>-1}getCommonAncestor(t){const n=this._indexOf(t)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===d.HTML}hasInDynamicScope(t,n){for(let r=this.stackTop;r>=0;r--){const u=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case V.HTML:{if(u===t)return!0;if(n.has(u))return!1;break}case V.SVG:{if(Mc.has(u))return!1;break}case V.MATHML:{if(Oc.has(u))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,Ku)}hasInListItemScope(t){return this.hasInDynamicScope(t,Ik)}hasInButtonScope(t){return this.hasInDynamicScope(t,Nk)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case V.HTML:{if(Us.has(n))return!0;if(Ku.has(n))return!1;break}case V.SVG:{if(Mc.has(n))return!1;break}case V.MATHML:{if(Oc.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===V.HTML)switch(this.tagIDs[n]){case t:return!0;case d.TABLE:case d.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===V.HTML)switch(this.tagIDs[t]){case d.TBODY:case d.THEAD:case d.TFOOT:return!0;case d.TABLE:case d.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===V.HTML)switch(this.tagIDs[n]){case t:return!0;case d.OPTION:case d.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&q1.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&Rc.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&Rc.has(this.currentTagId);)this.pop()}}const ls=3;var sn;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(sn||(sn={}));const Fc={type:sn.Marker};class Rk{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const r=[],u=n.length,a=this.treeAdapter.getTagName(t),s=this.treeAdapter.getNamespaceURI(t);for(let o=0;o<this.entries.length;o++){const c=this.entries[o];if(c.type===sn.Marker)break;const{element:l}=c;if(this.treeAdapter.getTagName(l)===a&&this.treeAdapter.getNamespaceURI(l)===s){const h=this.treeAdapter.getAttrList(l);h.length===u&&r.push({idx:o,attrs:h})}}return r}_ensureNoahArkCondition(t){if(this.entries.length<ls)return;const n=this.treeAdapter.getAttrList(t),r=this._getNoahArkConditionCandidates(t,n);if(r.length<ls)return;const u=new Map(n.map(s=>[s.name,s.value]));let a=0;for(let s=0;s<r.length;s++){const o=r[s];o.attrs.every(c=>u.get(c.name)===c.value)&&(a+=1,a>=ls&&this.entries.splice(o.idx,1))}}insertMarker(){this.entries.unshift(Fc)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:sn.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:sn.Element,element:t,token:n})}removeEntry(t){const n=this.entries.indexOf(t);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const t=this.entries.indexOf(Fc);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(r=>r.type===sn.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===sn.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===sn.Element&&n.element===t)}}const wn={createDocument(){return{nodeName:"#document",mode:zt.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:"#comment",data:e,parentNode:null}},createTextNode(e){return{nodeName:"#text",value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){const r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){const u=e.childNodes.find(a=>a.nodeName==="#documentType");if(u)u.name=t,u.publicId=n,u.systemId=r;else{const a={nodeName:"#documentType",name:t,publicId:n,systemId:r,parentNode:null};wn.appendChild(e,a)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){const n=e.childNodes[e.childNodes.length-1];if(wn.isTextNode(n)){n.value+=t;return}}wn.appendChild(e,wn.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&wn.isTextNode(r)?r.value+=t:wn.insertBefore(e,wn.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(r=>r.name));for(let r=0;r<t.length;r++)n.has(t[r].name)||e.attrs.push(t[r])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName==="#text"},isCommentNode(e){return e.nodeName==="#comment"},isDocumentTypeNode(e){return e.nodeName==="#documentType"},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,"tagName")},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}},Z1="html",Ok="about:legacy-compat",Mk="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",W1=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],Fk=[...W1,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],Bk=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),Y1=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],jk=[...Y1,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function Bc(e,t){return t.some(n=>e.startsWith(n))}function Hk(e){return e.name===Z1&&e.publicId===null&&(e.systemId===null||e.systemId===Ok)}function Uk(e){if(e.name!==Z1)return zt.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===Mk)return zt.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),Bk.has(n))return zt.QUIRKS;let r=t===null?Fk:W1;if(Bc(n,r))return zt.QUIRKS;if(r=t===null?Y1:jk,Bc(n,r))return zt.LIMITED_QUIRKS}return zt.NO_QUIRKS}const jc={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},Vk="definitionurl",$k="definitionURL",zk=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(e=>[e.toLowerCase(),e])),qk=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:V.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:V.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:V.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:V.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:V.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:V.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:V.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:V.XML}],["xml:space",{prefix:"xml",name:"space",namespace:V.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:V.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:V.XMLNS}]]),Zk=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(e=>[e.toLowerCase(),e])),Wk=new Set([d.B,d.BIG,d.BLOCKQUOTE,d.BODY,d.BR,d.CENTER,d.CODE,d.DD,d.DIV,d.DL,d.DT,d.EM,d.EMBED,d.H1,d.H2,d.H3,d.H4,d.H5,d.H6,d.HEAD,d.HR,d.I,d.IMG,d.LI,d.LISTING,d.MENU,d.META,d.NOBR,d.OL,d.P,d.PRE,d.RUBY,d.S,d.SMALL,d.SPAN,d.STRONG,d.STRIKE,d.SUB,d.SUP,d.TABLE,d.TT,d.U,d.UL,d.VAR]);function Yk(e){const t=e.tagID;return t===d.FONT&&e.attrs.some(({name:r})=>r===Kn.COLOR||r===Kn.SIZE||r===Kn.FACE)||Wk.has(t)}function G1(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===Vk){e.attrs[t].name=$k;break}}function X1(e){for(let t=0;t<e.attrs.length;t++){const n=zk.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function vi(e){for(let t=0;t<e.attrs.length;t++){const n=qk.get(e.attrs[t].name);n&&(e.attrs[t].prefix=n.prefix,e.attrs[t].name=n.name,e.attrs[t].namespace=n.namespace)}}function Gk(e){const t=Zk.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=wr(e.tagName))}function Xk(e,t){return t===V.MATHML&&(e===d.MI||e===d.MO||e===d.MN||e===d.MS||e===d.MTEXT)}function Kk(e,t,n){if(t===V.MATHML&&e===d.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===Kn.ENCODING){const u=n[r].value.toLowerCase();return u===jc.TEXT_HTML||u===jc.APPLICATION_XML}}return t===V.SVG&&(e===d.FOREIGN_OBJECT||e===d.DESC||e===d.TITLE)}function Qk(e,t,n,r){return(!r||r===V.HTML)&&Kk(e,t,n)||(!r||r===V.MATHML)&&Xk(e,t)}const Jk="hidden",eA=8,tA=3;var N;(function(e){e[e.INITIAL=0]="INITIAL",e[e.BEFORE_HTML=1]="BEFORE_HTML",e[e.BEFORE_HEAD=2]="BEFORE_HEAD",e[e.IN_HEAD=3]="IN_HEAD",e[e.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",e[e.AFTER_HEAD=5]="AFTER_HEAD",e[e.IN_BODY=6]="IN_BODY",e[e.TEXT=7]="TEXT",e[e.IN_TABLE=8]="IN_TABLE",e[e.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",e[e.IN_CAPTION=10]="IN_CAPTION",e[e.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",e[e.IN_TABLE_BODY=12]="IN_TABLE_BODY",e[e.IN_ROW=13]="IN_ROW",e[e.IN_CELL=14]="IN_CELL",e[e.IN_SELECT=15]="IN_SELECT",e[e.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",e[e.IN_TEMPLATE=17]="IN_TEMPLATE",e[e.AFTER_BODY=18]="AFTER_BODY",e[e.IN_FRAMESET=19]="IN_FRAMESET",e[e.AFTER_FRAMESET=20]="AFTER_FRAMESET",e[e.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",e[e.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(N||(N={}));const nA={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},K1=new Set([d.TABLE,d.TBODY,d.TFOOT,d.THEAD,d.TR]),Hc={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:wn,onParseError:null};class Uc{constructor(t,n,r=null,u=null){this.fragmentContext=r,this.scriptHandler=u,this.currentToken=null,this.stopped=!1,this.insertionMode=N.INITIAL,this.originalInsertionMode=N.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...Hc,...t},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=n??this.treeAdapter.createDocument(),this.tokenizer=new Sk(this.options,this),this.activeFormattingElements=new Rk(this.treeAdapter),this.fragmentContextID=r?wr(this.treeAdapter.getTagName(r)):d.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new Pk(this.document,this.treeAdapter,this)}static parse(t,n){const r=new this(n);return r.tokenizer.write(t,!0),r.document}static getFragmentParser(t,n){const r={...Hc,...n};t??(t=r.treeAdapter.createElement(O.TEMPLATE,V.HTML,[]));const u=r.treeAdapter.createElement("documentmock",V.HTML,[]),a=new this(r,u,t);return a.fragmentContextID===d.TEMPLATE&&a.tmplInsertionModeStack.unshift(N.IN_TEMPLATE),a._initTokenizerForFragmentParsing(),a._insertFakeRootElement(),a._resetInsertionMode(),a._findFormInFragmentContext(),a}getFragment(){const t=this.treeAdapter.getFirstChild(this.document),n=this.treeAdapter.createDocumentFragment();return this._adoptNodes(t,n),n}_err(t,n,r){var u;if(!this.onParseError)return;const a=(u=t.location)!==null&&u!==void 0?u:nA,s={code:n,startLine:a.startLine,startCol:a.startCol,startOffset:a.startOffset,endLine:r?a.startLine:a.endLine,endCol:r?a.startCol:a.endCol,endOffset:r?a.startOffset:a.endOffset};this.onParseError(s)}onItemPush(t,n,r){var u,a;(a=(u=this.treeAdapter).onItemPush)===null||a===void 0||a.call(u,t),r&&this.openElements.stackTop>0&&this._setContextModes(t,n)}onItemPop(t,n){var r,u;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(u=(r=this.treeAdapter).onItemPop)===null||u===void 0||u.call(r,t,this.openElements.current),n){let a,s;this.openElements.stackTop===0&&this.fragmentContext?(a=this.fragmentContext,s=this.fragmentContextID):{current:a,currentTagId:s}=this.openElements,this._setContextModes(a,s)}}_setContextModes(t,n){const r=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===V.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,V.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=N.TEXT}switchToPlaintextParsing(){this.insertionMode=N.TEXT,this.originalInsertionMode=N.IN_BODY,this.tokenizer.state=Qe.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let t=this.fragmentContext;for(;t;){if(this.treeAdapter.getTagName(t)===O.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==V.HTML))switch(this.fragmentContextID){case d.TITLE:case d.TEXTAREA:{this.tokenizer.state=Qe.RCDATA;break}case d.STYLE:case d.XMP:case d.IFRAME:case d.NOEMBED:case d.NOFRAMES:case d.NOSCRIPT:{this.tokenizer.state=Qe.RAWTEXT;break}case d.SCRIPT:{this.tokenizer.state=Qe.SCRIPT_DATA;break}case d.PLAINTEXT:{this.tokenizer.state=Qe.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",r=t.publicId||"",u=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,u),t.location){const s=this.treeAdapter.getChildNodes(this.document).find(o=>this.treeAdapter.isDocumentTypeNode(o));s&&this.treeAdapter.setNodeSourceCodeLocation(s,t.location)}}_attachElementToTree(t,n){if(this.options.sourceCodeLocationInfo){const r=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(t,r)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const r=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(r??this.document,t)}}_appendElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location)}_insertElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location),this.openElements.push(r,t.tagID)}_insertFakeElement(t,n){const r=this.treeAdapter.createElement(t,V.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,V.HTML,t.attrs),r=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,r),this._attachElementToTree(n,t.location),this.openElements.push(n,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,null)}_insertFakeRootElement(){const t=this.treeAdapter.createElement(O.HTML,V.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,d.HTML)}_appendCommentNode(t,n){const r=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(n,r),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,t.location)}_insertCharacters(t){let n,r;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:r}=this._findFosterParentingLocation(),r?this.treeAdapter.insertTextBefore(n,t.chars,r):this.treeAdapter.insertText(n,t.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,t.chars)),!t.location)return;const u=this.treeAdapter.getChildNodes(n),a=r?u.lastIndexOf(r):u.length,s=u[a-1];if(this.treeAdapter.getNodeSourceCodeLocation(s)){const{endLine:c,endCol:l,endOffset:h}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(s,{endLine:c,endCol:l,endOffset:h})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(s,t.location)}_adoptNodes(t,n){for(let r=this.treeAdapter.getFirstChild(t);r;r=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(n,r)}_setEndLocation(t,n){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&n.location){const r=n.location,u=this.treeAdapter.getTagName(t),a=n.type===Se.END_TAG&&u===n.tagName?{endTag:{...r},endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,a)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let n,r;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,r=this.fragmentContextID):{current:n,currentTagId:r}=this.openElements,t.tagID===d.SVG&&this.treeAdapter.getTagName(n)===O.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===V.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===d.MGLYPH||t.tagID===d.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,V.HTML)}_processToken(t){switch(t.type){case Se.CHARACTER:{this.onCharacter(t);break}case Se.NULL_CHARACTER:{this.onNullCharacter(t);break}case Se.COMMENT:{this.onComment(t);break}case Se.DOCTYPE:{this.onDoctype(t);break}case Se.START_TAG:{this._processStartTag(t);break}case Se.END_TAG:{this.onEndTag(t);break}case Se.EOF:{this.onEof(t);break}case Se.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){const u=this.treeAdapter.getNamespaceURI(n),a=this.treeAdapter.getAttrList(n);return Qk(t,u,a,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(u=>u.type===sn.Marker||this.openElements.contains(u.element)),r=n===-1?t-1:n-1;for(let u=r;u>=0;u--){const a=this.activeFormattingElements.entries[u];this._insertElement(a.token,this.treeAdapter.getNamespaceURI(a.element)),a.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=N.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(d.P),this.openElements.popUntilTagNamePopped(d.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case d.TR:{this.insertionMode=N.IN_ROW;return}case d.TBODY:case d.THEAD:case d.TFOOT:{this.insertionMode=N.IN_TABLE_BODY;return}case d.CAPTION:{this.insertionMode=N.IN_CAPTION;return}case d.COLGROUP:{this.insertionMode=N.IN_COLUMN_GROUP;return}case d.TABLE:{this.insertionMode=N.IN_TABLE;return}case d.BODY:{this.insertionMode=N.IN_BODY;return}case d.FRAMESET:{this.insertionMode=N.IN_FRAMESET;return}case d.SELECT:{this._resetInsertionModeForSelect(t);return}case d.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case d.HTML:{this.insertionMode=this.headElement?N.AFTER_HEAD:N.BEFORE_HEAD;return}case d.TD:case d.TH:{if(t>0){this.insertionMode=N.IN_CELL;return}break}case d.HEAD:{if(t>0){this.insertionMode=N.IN_HEAD;return}break}}this.insertionMode=N.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===d.TEMPLATE)break;if(r===d.TABLE){this.insertionMode=N.IN_SELECT_IN_TABLE;return}}this.insertionMode=N.IN_SELECT}_isElementCausesFosterParenting(t){return K1.has(t)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let t=this.openElements.stackTop;t>=0;t--){const n=this.openElements.items[t];switch(this.openElements.tagIDs[t]){case d.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===V.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case d.TABLE:{const r=this.treeAdapter.getParentNode(n);return r?{parent:r,beforeElement:n}:{parent:this.openElements.items[t-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(t){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,t,n.beforeElement):this.treeAdapter.appendChild(n.parent,t)}_isSpecialElement(t,n){const r=this.treeAdapter.getNamespaceURI(t);return Tk[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){LS(this,t);return}switch(this.insertionMode){case N.INITIAL:{Fr(this,t);break}case N.BEFORE_HTML:{Zr(this,t);break}case N.BEFORE_HEAD:{Wr(this,t);break}case N.IN_HEAD:{Yr(this,t);break}case N.IN_HEAD_NO_SCRIPT:{Gr(this,t);break}case N.AFTER_HEAD:{Xr(this,t);break}case N.IN_BODY:case N.IN_CAPTION:case N.IN_CELL:case N.IN_TEMPLATE:{J1(this,t);break}case N.TEXT:case N.IN_SELECT:case N.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case N.IN_TABLE:case N.IN_TABLE_BODY:case N.IN_ROW:{ds(this,t);break}case N.IN_TABLE_TEXT:{ad(this,t);break}case N.IN_COLUMN_GROUP:{Qu(this,t);break}case N.AFTER_BODY:{Ju(this,t);break}case N.AFTER_AFTER_BODY:{$u(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){DS(this,t);return}switch(this.insertionMode){case N.INITIAL:{Fr(this,t);break}case N.BEFORE_HTML:{Zr(this,t);break}case N.BEFORE_HEAD:{Wr(this,t);break}case N.IN_HEAD:{Yr(this,t);break}case N.IN_HEAD_NO_SCRIPT:{Gr(this,t);break}case N.AFTER_HEAD:{Xr(this,t);break}case N.TEXT:{this._insertCharacters(t);break}case N.IN_TABLE:case N.IN_TABLE_BODY:case N.IN_ROW:{ds(this,t);break}case N.IN_COLUMN_GROUP:{Qu(this,t);break}case N.AFTER_BODY:{Ju(this,t);break}case N.AFTER_AFTER_BODY:{$u(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){Vs(this,t);return}switch(this.insertionMode){case N.INITIAL:case N.BEFORE_HTML:case N.BEFORE_HEAD:case N.IN_HEAD:case N.IN_HEAD_NO_SCRIPT:case N.AFTER_HEAD:case N.IN_BODY:case N.IN_TABLE:case N.IN_CAPTION:case N.IN_COLUMN_GROUP:case N.IN_TABLE_BODY:case N.IN_ROW:case N.IN_CELL:case N.IN_SELECT:case N.IN_SELECT_IN_TABLE:case N.IN_TEMPLATE:case N.IN_FRAMESET:case N.AFTER_FRAMESET:{Vs(this,t);break}case N.IN_TABLE_TEXT:{Br(this,t);break}case N.AFTER_BODY:{cA(this,t);break}case N.AFTER_AFTER_BODY:case N.AFTER_AFTER_FRAMESET:{lA(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case N.INITIAL:{dA(this,t);break}case N.BEFORE_HEAD:case N.IN_HEAD:case N.IN_HEAD_NO_SCRIPT:case N.AFTER_HEAD:{this._err(t,M.misplacedDoctype);break}case N.IN_TABLE_TEXT:{Br(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,M.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?PS(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case N.INITIAL:{Fr(this,t);break}case N.BEFORE_HTML:{fA(this,t);break}case N.BEFORE_HEAD:{pA(this,t);break}case N.IN_HEAD:{en(this,t);break}case N.IN_HEAD_NO_SCRIPT:{bA(this,t);break}case N.AFTER_HEAD:{xA(this,t);break}case N.IN_BODY:{gt(this,t);break}case N.IN_TABLE:{Er(this,t);break}case N.IN_TABLE_TEXT:{Br(this,t);break}case N.IN_CAPTION:{mS(this,t);break}case N.IN_COLUMN_GROUP:{Li(this,t);break}case N.IN_TABLE_BODY:{Ia(this,t);break}case N.IN_ROW:{Na(this,t);break}case N.IN_CELL:{_S(this,t);break}case N.IN_SELECT:{od(this,t);break}case N.IN_SELECT_IN_TABLE:{CS(this,t);break}case N.IN_TEMPLATE:{TS(this,t);break}case N.AFTER_BODY:{kS(this,t);break}case N.IN_FRAMESET:{AS(this,t);break}case N.AFTER_FRAMESET:{IS(this,t);break}case N.AFTER_AFTER_BODY:{vS(this,t);break}case N.AFTER_AFTER_FRAMESET:{wS(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?RS(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case N.INITIAL:{Fr(this,t);break}case N.BEFORE_HTML:{hA(this,t);break}case N.BEFORE_HEAD:{mA(this,t);break}case N.IN_HEAD:{gA(this,t);break}case N.IN_HEAD_NO_SCRIPT:{_A(this,t);break}case N.AFTER_HEAD:{CA(this,t);break}case N.IN_BODY:{Sa(this,t);break}case N.TEXT:{aS(this,t);break}case N.IN_TABLE:{au(this,t);break}case N.IN_TABLE_TEXT:{Br(this,t);break}case N.IN_CAPTION:{gS(this,t);break}case N.IN_COLUMN_GROUP:{bS(this,t);break}case N.IN_TABLE_BODY:{$s(this,t);break}case N.IN_ROW:{id(this,t);break}case N.IN_CELL:{xS(this,t);break}case N.IN_SELECT:{cd(this,t);break}case N.IN_SELECT_IN_TABLE:{ES(this,t);break}case N.IN_TEMPLATE:{yS(this,t);break}case N.AFTER_BODY:{dd(this,t);break}case N.IN_FRAMESET:{SS(this,t);break}case N.AFTER_FRAMESET:{NS(this,t);break}case N.AFTER_AFTER_BODY:{$u(this,t);break}}}onEof(t){switch(this.insertionMode){case N.INITIAL:{Fr(this,t);break}case N.BEFORE_HTML:{Zr(this,t);break}case N.BEFORE_HEAD:{Wr(this,t);break}case N.IN_HEAD:{Yr(this,t);break}case N.IN_HEAD_NO_SCRIPT:{Gr(this,t);break}case N.AFTER_HEAD:{Xr(this,t);break}case N.IN_BODY:case N.IN_TABLE:case N.IN_CAPTION:case N.IN_COLUMN_GROUP:case N.IN_TABLE_BODY:case N.IN_ROW:case N.IN_CELL:case N.IN_SELECT:case N.IN_SELECT_IN_TABLE:{rd(this,t);break}case N.TEXT:{sS(this,t);break}case N.IN_TABLE_TEXT:{Br(this,t);break}case N.IN_TEMPLATE:{ld(this,t);break}case N.AFTER_BODY:case N.IN_FRAMESET:case N.AFTER_FRAMESET:case N.AFTER_AFTER_BODY:case N.AFTER_AFTER_FRAMESET:{Di(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===T.LINE_FEED)){if(t.chars.length===1)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(t);return}switch(this.insertionMode){case N.IN_HEAD:case N.IN_HEAD_NO_SCRIPT:case N.AFTER_HEAD:case N.TEXT:case N.IN_COLUMN_GROUP:case N.IN_SELECT:case N.IN_SELECT_IN_TABLE:case N.IN_FRAMESET:case N.AFTER_FRAMESET:{this._insertCharacters(t);break}case N.IN_BODY:case N.IN_CAPTION:case N.IN_CELL:case N.IN_TEMPLATE:case N.AFTER_BODY:case N.AFTER_AFTER_BODY:case N.AFTER_AFTER_FRAMESET:{Q1(this,t);break}case N.IN_TABLE:case N.IN_TABLE_BODY:case N.IN_ROW:{ds(this,t);break}case N.IN_TABLE_TEXT:{ud(this,t);break}}}}function rA(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):nd(e,t),n}function uA(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){const u=e.openElements.items[r];if(u===t.element)break;e._isSpecialElement(u,e.openElements.tagIDs[r])&&(n=u)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function aA(e,t,n){let r=t,u=e.openElements.getCommonAncestor(t);for(let a=0,s=u;s!==n;a++,s=u){u=e.openElements.getCommonAncestor(s);const o=e.activeFormattingElements.getElementEntry(s),c=o&&a>=tA;!o||c?(c&&e.activeFormattingElements.removeEntry(o),e.openElements.remove(s)):(s=sA(e,o),r===t&&(e.activeFormattingElements.bookmark=o),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(s,r),r=s)}return r}function sA(e,t){const n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function iA(e,t,n){const r=e.treeAdapter.getTagName(t),u=wr(r);if(e._isElementCausesFosterParenting(u))e._fosterParentElement(n);else{const a=e.treeAdapter.getNamespaceURI(t);u===d.TEMPLATE&&a===V.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function oA(e,t,n){const r=e.treeAdapter.getNamespaceURI(n.element),{token:u}=n,a=e.treeAdapter.createElement(u.tagName,r,u.attrs);e._adoptNodes(t,a),e.treeAdapter.appendChild(t,a),e.activeFormattingElements.insertElementAfterBookmark(a,u),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,a,u.tagID)}function wi(e,t){for(let n=0;n<eA;n++){const r=rA(e,t);if(!r)break;const u=uA(e,r);if(!u)break;e.activeFormattingElements.bookmark=r;const a=aA(e,u,r.element),s=e.openElements.getCommonAncestor(r.element);e.treeAdapter.detachNode(a),s&&iA(e,s,a),oA(e,u,r)}}function Vs(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function cA(e,t){e._appendCommentNode(t,e.openElements.items[0])}function lA(e,t){e._appendCommentNode(t,e.document)}function Di(e,t){if(e.stopped=!0,t.location){const n=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const r=e.openElements.items[0],u=e.treeAdapter.getNodeSourceCodeLocation(r);if(u&&!u.endTag&&(e._setEndLocation(r,t),e.openElements.stackTop>=1)){const a=e.openElements.items[1],s=e.treeAdapter.getNodeSourceCodeLocation(a);s&&!s.endTag&&e._setEndLocation(a,t)}}}}function dA(e,t){e._setDocumentType(t);const n=t.forceQuirks?zt.QUIRKS:Uk(t);Hk(t)||e._err(t,M.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=N.BEFORE_HTML}function Fr(e,t){e._err(t,M.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,zt.QUIRKS),e.insertionMode=N.BEFORE_HTML,e._processToken(t)}function fA(e,t){t.tagID===d.HTML?(e._insertElement(t,V.HTML),e.insertionMode=N.BEFORE_HEAD):Zr(e,t)}function hA(e,t){const n=t.tagID;(n===d.HTML||n===d.HEAD||n===d.BODY||n===d.BR)&&Zr(e,t)}function Zr(e,t){e._insertFakeRootElement(),e.insertionMode=N.BEFORE_HEAD,e._processToken(t)}function pA(e,t){switch(t.tagID){case d.HTML:{gt(e,t);break}case d.HEAD:{e._insertElement(t,V.HTML),e.headElement=e.openElements.current,e.insertionMode=N.IN_HEAD;break}default:Wr(e,t)}}function mA(e,t){const n=t.tagID;n===d.HEAD||n===d.BODY||n===d.HTML||n===d.BR?Wr(e,t):e._err(t,M.endTagWithoutMatchingOpenElement)}function Wr(e,t){e._insertFakeElement(O.HEAD,d.HEAD),e.headElement=e.openElements.current,e.insertionMode=N.IN_HEAD,e._processToken(t)}function en(e,t){switch(t.tagID){case d.HTML:{gt(e,t);break}case d.BASE:case d.BASEFONT:case d.BGSOUND:case d.LINK:case d.META:{e._appendElement(t,V.HTML),t.ackSelfClosing=!0;break}case d.TITLE:{e._switchToTextParsing(t,Qe.RCDATA);break}case d.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,Qe.RAWTEXT):(e._insertElement(t,V.HTML),e.insertionMode=N.IN_HEAD_NO_SCRIPT);break}case d.NOFRAMES:case d.STYLE:{e._switchToTextParsing(t,Qe.RAWTEXT);break}case d.SCRIPT:{e._switchToTextParsing(t,Qe.SCRIPT_DATA);break}case d.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=N.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(N.IN_TEMPLATE);break}case d.HEAD:{e._err(t,M.misplacedStartTagForHeadElement);break}default:Yr(e,t)}}function gA(e,t){switch(t.tagID){case d.HEAD:{e.openElements.pop(),e.insertionMode=N.AFTER_HEAD;break}case d.BODY:case d.BR:case d.HTML:{Yr(e,t);break}case d.TEMPLATE:{rr(e,t);break}default:e._err(t,M.endTagWithoutMatchingOpenElement)}}function rr(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==d.TEMPLATE&&e._err(t,M.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(d.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,M.endTagWithoutMatchingOpenElement)}function Yr(e,t){e.openElements.pop(),e.insertionMode=N.AFTER_HEAD,e._processToken(t)}function bA(e,t){switch(t.tagID){case d.HTML:{gt(e,t);break}case d.BASEFONT:case d.BGSOUND:case d.HEAD:case d.LINK:case d.META:case d.NOFRAMES:case d.STYLE:{en(e,t);break}case d.NOSCRIPT:{e._err(t,M.nestedNoscriptInHead);break}default:Gr(e,t)}}function _A(e,t){switch(t.tagID){case d.NOSCRIPT:{e.openElements.pop(),e.insertionMode=N.IN_HEAD;break}case d.BR:{Gr(e,t);break}default:e._err(t,M.endTagWithoutMatchingOpenElement)}}function Gr(e,t){const n=t.type===Se.EOF?M.openElementsLeftAfterEof:M.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=N.IN_HEAD,e._processToken(t)}function xA(e,t){switch(t.tagID){case d.HTML:{gt(e,t);break}case d.BODY:{e._insertElement(t,V.HTML),e.framesetOk=!1,e.insertionMode=N.IN_BODY;break}case d.FRAMESET:{e._insertElement(t,V.HTML),e.insertionMode=N.IN_FRAMESET;break}case d.BASE:case d.BASEFONT:case d.BGSOUND:case d.LINK:case d.META:case d.NOFRAMES:case d.SCRIPT:case d.STYLE:case d.TEMPLATE:case d.TITLE:{e._err(t,M.abandonedHeadElementChild),e.openElements.push(e.headElement,d.HEAD),en(e,t),e.openElements.remove(e.headElement);break}case d.HEAD:{e._err(t,M.misplacedStartTagForHeadElement);break}default:Xr(e,t)}}function CA(e,t){switch(t.tagID){case d.BODY:case d.HTML:case d.BR:{Xr(e,t);break}case d.TEMPLATE:{rr(e,t);break}default:e._err(t,M.endTagWithoutMatchingOpenElement)}}function Xr(e,t){e._insertFakeElement(O.BODY,d.BODY),e.insertionMode=N.IN_BODY,Aa(e,t)}function Aa(e,t){switch(t.type){case Se.CHARACTER:{J1(e,t);break}case Se.WHITESPACE_CHARACTER:{Q1(e,t);break}case Se.COMMENT:{Vs(e,t);break}case Se.START_TAG:{gt(e,t);break}case Se.END_TAG:{Sa(e,t);break}case Se.EOF:{rd(e,t);break}}}function Q1(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function J1(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function EA(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function TA(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function yA(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,V.HTML),e.insertionMode=N.IN_FRAMESET)}function kA(e,t){e.openElements.hasInButtonScope(d.P)&&e._closePElement(),e._insertElement(t,V.HTML)}function AA(e,t){e.openElements.hasInButtonScope(d.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&Us.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,V.HTML)}function SA(e,t){e.openElements.hasInButtonScope(d.P)&&e._closePElement(),e._insertElement(t,V.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function IA(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(d.P)&&e._closePElement(),e._insertElement(t,V.HTML),n||(e.formElement=e.openElements.current))}function NA(e,t){e.framesetOk=!1;const n=t.tagID;for(let r=e.openElements.stackTop;r>=0;r--){const u=e.openElements.tagIDs[r];if(n===d.LI&&u===d.LI||(n===d.DD||n===d.DT)&&(u===d.DD||u===d.DT)){e.openElements.generateImpliedEndTagsWithExclusion(u),e.openElements.popUntilTagNamePopped(u);break}if(u!==d.ADDRESS&&u!==d.DIV&&u!==d.P&&e._isSpecialElement(e.openElements.items[r],u))break}e.openElements.hasInButtonScope(d.P)&&e._closePElement(),e._insertElement(t,V.HTML)}function vA(e,t){e.openElements.hasInButtonScope(d.P)&&e._closePElement(),e._insertElement(t,V.HTML),e.tokenizer.state=Qe.PLAINTEXT}function wA(e,t){e.openElements.hasInScope(d.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(d.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,V.HTML),e.framesetOk=!1}function DA(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(O.A);n&&(wi(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,V.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function LA(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,V.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function PA(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(d.NOBR)&&(wi(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,V.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function RA(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,V.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function OA(e,t){e.treeAdapter.getDocumentMode(e.document)!==zt.QUIRKS&&e.openElements.hasInButtonScope(d.P)&&e._closePElement(),e._insertElement(t,V.HTML),e.framesetOk=!1,e.insertionMode=N.IN_TABLE}function ed(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,V.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function td(e){const t=$1(e,Kn.TYPE);return t!=null&&t.toLowerCase()===Jk}function MA(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,V.HTML),td(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function FA(e,t){e._appendElement(t,V.HTML),t.ackSelfClosing=!0}function BA(e,t){e.openElements.hasInButtonScope(d.P)&&e._closePElement(),e._appendElement(t,V.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function jA(e,t){t.tagName=O.IMG,t.tagID=d.IMG,ed(e,t)}function HA(e,t){e._insertElement(t,V.HTML),e.skipNextNewLine=!0,e.tokenizer.state=Qe.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=N.TEXT}function UA(e,t){e.openElements.hasInButtonScope(d.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,Qe.RAWTEXT)}function VA(e,t){e.framesetOk=!1,e._switchToTextParsing(t,Qe.RAWTEXT)}function Vc(e,t){e._switchToTextParsing(t,Qe.RAWTEXT)}function $A(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,V.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===N.IN_TABLE||e.insertionMode===N.IN_CAPTION||e.insertionMode===N.IN_TABLE_BODY||e.insertionMode===N.IN_ROW||e.insertionMode===N.IN_CELL?N.IN_SELECT_IN_TABLE:N.IN_SELECT}function zA(e,t){e.openElements.currentTagId===d.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,V.HTML)}function qA(e,t){e.openElements.hasInScope(d.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,V.HTML)}function ZA(e,t){e.openElements.hasInScope(d.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(d.RTC),e._insertElement(t,V.HTML)}function WA(e,t){e._reconstructActiveFormattingElements(),G1(t),vi(t),t.selfClosing?e._appendElement(t,V.MATHML):e._insertElement(t,V.MATHML),t.ackSelfClosing=!0}function YA(e,t){e._reconstructActiveFormattingElements(),X1(t),vi(t),t.selfClosing?e._appendElement(t,V.SVG):e._insertElement(t,V.SVG),t.ackSelfClosing=!0}function $c(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,V.HTML)}function gt(e,t){switch(t.tagID){case d.I:case d.S:case d.B:case d.U:case d.EM:case d.TT:case d.BIG:case d.CODE:case d.FONT:case d.SMALL:case d.STRIKE:case d.STRONG:{LA(e,t);break}case d.A:{DA(e,t);break}case d.H1:case d.H2:case d.H3:case d.H4:case d.H5:case d.H6:{AA(e,t);break}case d.P:case d.DL:case d.OL:case d.UL:case d.DIV:case d.DIR:case d.NAV:case d.MAIN:case d.MENU:case d.ASIDE:case d.CENTER:case d.FIGURE:case d.FOOTER:case d.HEADER:case d.HGROUP:case d.DIALOG:case d.DETAILS:case d.ADDRESS:case d.ARTICLE:case d.SEARCH:case d.SECTION:case d.SUMMARY:case d.FIELDSET:case d.BLOCKQUOTE:case d.FIGCAPTION:{kA(e,t);break}case d.LI:case d.DD:case d.DT:{NA(e,t);break}case d.BR:case d.IMG:case d.WBR:case d.AREA:case d.EMBED:case d.KEYGEN:{ed(e,t);break}case d.HR:{BA(e,t);break}case d.RB:case d.RTC:{qA(e,t);break}case d.RT:case d.RP:{ZA(e,t);break}case d.PRE:case d.LISTING:{SA(e,t);break}case d.XMP:{UA(e,t);break}case d.SVG:{YA(e,t);break}case d.HTML:{EA(e,t);break}case d.BASE:case d.LINK:case d.META:case d.STYLE:case d.TITLE:case d.SCRIPT:case d.BGSOUND:case d.BASEFONT:case d.TEMPLATE:{en(e,t);break}case d.BODY:{TA(e,t);break}case d.FORM:{IA(e,t);break}case d.NOBR:{PA(e,t);break}case d.MATH:{WA(e,t);break}case d.TABLE:{OA(e,t);break}case d.INPUT:{MA(e,t);break}case d.PARAM:case d.TRACK:case d.SOURCE:{FA(e,t);break}case d.IMAGE:{jA(e,t);break}case d.BUTTON:{wA(e,t);break}case d.APPLET:case d.OBJECT:case d.MARQUEE:{RA(e,t);break}case d.IFRAME:{VA(e,t);break}case d.SELECT:{$A(e,t);break}case d.OPTION:case d.OPTGROUP:{zA(e,t);break}case d.NOEMBED:case d.NOFRAMES:{Vc(e,t);break}case d.FRAMESET:{yA(e,t);break}case d.TEXTAREA:{HA(e,t);break}case d.NOSCRIPT:{e.options.scriptingEnabled?Vc(e,t):$c(e,t);break}case d.PLAINTEXT:{vA(e,t);break}case d.COL:case d.TH:case d.TD:case d.TR:case d.HEAD:case d.FRAME:case d.TBODY:case d.TFOOT:case d.THEAD:case d.CAPTION:case d.COLGROUP:break;default:$c(e,t)}}function GA(e,t){if(e.openElements.hasInScope(d.BODY)&&(e.insertionMode=N.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function XA(e,t){e.openElements.hasInScope(d.BODY)&&(e.insertionMode=N.AFTER_BODY,dd(e,t))}function KA(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function QA(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(d.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(d.FORM):n&&e.openElements.remove(n))}function JA(e){e.openElements.hasInButtonScope(d.P)||e._insertFakeElement(O.P,d.P),e._closePElement()}function eS(e){e.openElements.hasInListItemScope(d.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(d.LI),e.openElements.popUntilTagNamePopped(d.LI))}function tS(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function nS(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function rS(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function uS(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(O.BR,d.BR),e.openElements.pop(),e.framesetOk=!1}function nd(e,t){const n=t.tagName,r=t.tagID;for(let u=e.openElements.stackTop;u>0;u--){const a=e.openElements.items[u],s=e.openElements.tagIDs[u];if(r===s&&(r!==d.UNKNOWN||e.treeAdapter.getTagName(a)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=u&&e.openElements.shortenToLength(u);break}if(e._isSpecialElement(a,s))break}}function Sa(e,t){switch(t.tagID){case d.A:case d.B:case d.I:case d.S:case d.U:case d.EM:case d.TT:case d.BIG:case d.CODE:case d.FONT:case d.NOBR:case d.SMALL:case d.STRIKE:case d.STRONG:{wi(e,t);break}case d.P:{JA(e);break}case d.DL:case d.UL:case d.OL:case d.DIR:case d.DIV:case d.NAV:case d.PRE:case d.MAIN:case d.MENU:case d.ASIDE:case d.BUTTON:case d.CENTER:case d.FIGURE:case d.FOOTER:case d.HEADER:case d.HGROUP:case d.DIALOG:case d.ADDRESS:case d.ARTICLE:case d.DETAILS:case d.SEARCH:case d.SECTION:case d.SUMMARY:case d.LISTING:case d.FIELDSET:case d.BLOCKQUOTE:case d.FIGCAPTION:{KA(e,t);break}case d.LI:{eS(e);break}case d.DD:case d.DT:{tS(e,t);break}case d.H1:case d.H2:case d.H3:case d.H4:case d.H5:case d.H6:{nS(e);break}case d.BR:{uS(e);break}case d.BODY:{GA(e,t);break}case d.HTML:{XA(e,t);break}case d.FORM:{QA(e);break}case d.APPLET:case d.OBJECT:case d.MARQUEE:{rS(e,t);break}case d.TEMPLATE:{rr(e,t);break}default:nd(e,t)}}function rd(e,t){e.tmplInsertionModeStack.length>0?ld(e,t):Di(e,t)}function aS(e,t){var n;t.tagID===d.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function sS(e,t){e._err(t,M.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function ds(e,t){if(e.openElements.currentTagId!==void 0&&K1.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=N.IN_TABLE_TEXT,t.type){case Se.CHARACTER:{ad(e,t);break}case Se.WHITESPACE_CHARACTER:{ud(e,t);break}}else bu(e,t)}function iS(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,V.HTML),e.insertionMode=N.IN_CAPTION}function oS(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,V.HTML),e.insertionMode=N.IN_COLUMN_GROUP}function cS(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(O.COLGROUP,d.COLGROUP),e.insertionMode=N.IN_COLUMN_GROUP,Li(e,t)}function lS(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,V.HTML),e.insertionMode=N.IN_TABLE_BODY}function dS(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(O.TBODY,d.TBODY),e.insertionMode=N.IN_TABLE_BODY,Ia(e,t)}function fS(e,t){e.openElements.hasInTableScope(d.TABLE)&&(e.openElements.popUntilTagNamePopped(d.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function hS(e,t){td(t)?e._appendElement(t,V.HTML):bu(e,t),t.ackSelfClosing=!0}function pS(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,V.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function Er(e,t){switch(t.tagID){case d.TD:case d.TH:case d.TR:{dS(e,t);break}case d.STYLE:case d.SCRIPT:case d.TEMPLATE:{en(e,t);break}case d.COL:{cS(e,t);break}case d.FORM:{pS(e,t);break}case d.TABLE:{fS(e,t);break}case d.TBODY:case d.TFOOT:case d.THEAD:{lS(e,t);break}case d.INPUT:{hS(e,t);break}case d.CAPTION:{iS(e,t);break}case d.COLGROUP:{oS(e,t);break}default:bu(e,t)}}function au(e,t){switch(t.tagID){case d.TABLE:{e.openElements.hasInTableScope(d.TABLE)&&(e.openElements.popUntilTagNamePopped(d.TABLE),e._resetInsertionMode());break}case d.TEMPLATE:{rr(e,t);break}case d.BODY:case d.CAPTION:case d.COL:case d.COLGROUP:case d.HTML:case d.TBODY:case d.TD:case d.TFOOT:case d.TH:case d.THEAD:case d.TR:break;default:bu(e,t)}}function bu(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,Aa(e,t),e.fosterParentingEnabled=n}function ud(e,t){e.pendingCharacterTokens.push(t)}function ad(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function Br(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)bu(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}const sd=new Set([d.CAPTION,d.COL,d.COLGROUP,d.TBODY,d.TD,d.TFOOT,d.TH,d.THEAD,d.TR]);function mS(e,t){const n=t.tagID;sd.has(n)?e.openElements.hasInTableScope(d.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(d.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=N.IN_TABLE,Er(e,t)):gt(e,t)}function gS(e,t){const n=t.tagID;switch(n){case d.CAPTION:case d.TABLE:{e.openElements.hasInTableScope(d.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(d.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=N.IN_TABLE,n===d.TABLE&&au(e,t));break}case d.BODY:case d.COL:case d.COLGROUP:case d.HTML:case d.TBODY:case d.TD:case d.TFOOT:case d.TH:case d.THEAD:case d.TR:break;default:Sa(e,t)}}function Li(e,t){switch(t.tagID){case d.HTML:{gt(e,t);break}case d.COL:{e._appendElement(t,V.HTML),t.ackSelfClosing=!0;break}case d.TEMPLATE:{en(e,t);break}default:Qu(e,t)}}function bS(e,t){switch(t.tagID){case d.COLGROUP:{e.openElements.currentTagId===d.COLGROUP&&(e.openElements.pop(),e.insertionMode=N.IN_TABLE);break}case d.TEMPLATE:{rr(e,t);break}case d.COL:break;default:Qu(e,t)}}function Qu(e,t){e.openElements.currentTagId===d.COLGROUP&&(e.openElements.pop(),e.insertionMode=N.IN_TABLE,e._processToken(t))}function Ia(e,t){switch(t.tagID){case d.TR:{e.openElements.clearBackToTableBodyContext(),e._insertElement(t,V.HTML),e.insertionMode=N.IN_ROW;break}case d.TH:case d.TD:{e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(O.TR,d.TR),e.insertionMode=N.IN_ROW,Na(e,t);break}case d.CAPTION:case d.COL:case d.COLGROUP:case d.TBODY:case d.TFOOT:case d.THEAD:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=N.IN_TABLE,Er(e,t));break}default:Er(e,t)}}function $s(e,t){const n=t.tagID;switch(t.tagID){case d.TBODY:case d.TFOOT:case d.THEAD:{e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=N.IN_TABLE);break}case d.TABLE:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=N.IN_TABLE,au(e,t));break}case d.BODY:case d.CAPTION:case d.COL:case d.COLGROUP:case d.HTML:case d.TD:case d.TH:case d.TR:break;default:au(e,t)}}function Na(e,t){switch(t.tagID){case d.TH:case d.TD:{e.openElements.clearBackToTableRowContext(),e._insertElement(t,V.HTML),e.insertionMode=N.IN_CELL,e.activeFormattingElements.insertMarker();break}case d.CAPTION:case d.COL:case d.COLGROUP:case d.TBODY:case d.TFOOT:case d.THEAD:case d.TR:{e.openElements.hasInTableScope(d.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=N.IN_TABLE_BODY,Ia(e,t));break}default:Er(e,t)}}function id(e,t){switch(t.tagID){case d.TR:{e.openElements.hasInTableScope(d.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=N.IN_TABLE_BODY);break}case d.TABLE:{e.openElements.hasInTableScope(d.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=N.IN_TABLE_BODY,$s(e,t));break}case d.TBODY:case d.TFOOT:case d.THEAD:{(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(d.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=N.IN_TABLE_BODY,$s(e,t));break}case d.BODY:case d.CAPTION:case d.COL:case d.COLGROUP:case d.HTML:case d.TD:case d.TH:break;default:au(e,t)}}function _S(e,t){const n=t.tagID;sd.has(n)?(e.openElements.hasInTableScope(d.TD)||e.openElements.hasInTableScope(d.TH))&&(e._closeTableCell(),Na(e,t)):gt(e,t)}function xS(e,t){const n=t.tagID;switch(n){case d.TD:case d.TH:{e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=N.IN_ROW);break}case d.TABLE:case d.TBODY:case d.TFOOT:case d.THEAD:case d.TR:{e.openElements.hasInTableScope(n)&&(e._closeTableCell(),id(e,t));break}case d.BODY:case d.CAPTION:case d.COL:case d.COLGROUP:case d.HTML:break;default:Sa(e,t)}}function od(e,t){switch(t.tagID){case d.HTML:{gt(e,t);break}case d.OPTION:{e.openElements.currentTagId===d.OPTION&&e.openElements.pop(),e._insertElement(t,V.HTML);break}case d.OPTGROUP:{e.openElements.currentTagId===d.OPTION&&e.openElements.pop(),e.openElements.currentTagId===d.OPTGROUP&&e.openElements.pop(),e._insertElement(t,V.HTML);break}case d.HR:{e.openElements.currentTagId===d.OPTION&&e.openElements.pop(),e.openElements.currentTagId===d.OPTGROUP&&e.openElements.pop(),e._appendElement(t,V.HTML),t.ackSelfClosing=!0;break}case d.INPUT:case d.KEYGEN:case d.TEXTAREA:case d.SELECT:{e.openElements.hasInSelectScope(d.SELECT)&&(e.openElements.popUntilTagNamePopped(d.SELECT),e._resetInsertionMode(),t.tagID!==d.SELECT&&e._processStartTag(t));break}case d.SCRIPT:case d.TEMPLATE:{en(e,t);break}}}function cd(e,t){switch(t.tagID){case d.OPTGROUP:{e.openElements.stackTop>0&&e.openElements.currentTagId===d.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===d.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===d.OPTGROUP&&e.openElements.pop();break}case d.OPTION:{e.openElements.currentTagId===d.OPTION&&e.openElements.pop();break}case d.SELECT:{e.openElements.hasInSelectScope(d.SELECT)&&(e.openElements.popUntilTagNamePopped(d.SELECT),e._resetInsertionMode());break}case d.TEMPLATE:{rr(e,t);break}}}function CS(e,t){const n=t.tagID;n===d.CAPTION||n===d.TABLE||n===d.TBODY||n===d.TFOOT||n===d.THEAD||n===d.TR||n===d.TD||n===d.TH?(e.openElements.popUntilTagNamePopped(d.SELECT),e._resetInsertionMode(),e._processStartTag(t)):od(e,t)}function ES(e,t){const n=t.tagID;n===d.CAPTION||n===d.TABLE||n===d.TBODY||n===d.TFOOT||n===d.THEAD||n===d.TR||n===d.TD||n===d.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(d.SELECT),e._resetInsertionMode(),e.onEndTag(t)):cd(e,t)}function TS(e,t){switch(t.tagID){case d.BASE:case d.BASEFONT:case d.BGSOUND:case d.LINK:case d.META:case d.NOFRAMES:case d.SCRIPT:case d.STYLE:case d.TEMPLATE:case d.TITLE:{en(e,t);break}case d.CAPTION:case d.COLGROUP:case d.TBODY:case d.TFOOT:case d.THEAD:{e.tmplInsertionModeStack[0]=N.IN_TABLE,e.insertionMode=N.IN_TABLE,Er(e,t);break}case d.COL:{e.tmplInsertionModeStack[0]=N.IN_COLUMN_GROUP,e.insertionMode=N.IN_COLUMN_GROUP,Li(e,t);break}case d.TR:{e.tmplInsertionModeStack[0]=N.IN_TABLE_BODY,e.insertionMode=N.IN_TABLE_BODY,Ia(e,t);break}case d.TD:case d.TH:{e.tmplInsertionModeStack[0]=N.IN_ROW,e.insertionMode=N.IN_ROW,Na(e,t);break}default:e.tmplInsertionModeStack[0]=N.IN_BODY,e.insertionMode=N.IN_BODY,gt(e,t)}}function yS(e,t){t.tagID===d.TEMPLATE&&rr(e,t)}function ld(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(d.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):Di(e,t)}function kS(e,t){t.tagID===d.HTML?gt(e,t):Ju(e,t)}function dd(e,t){var n;if(t.tagID===d.HTML){if(e.fragmentContext||(e.insertionMode=N.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===d.HTML){e._setEndLocation(e.openElements.items[0],t);const r=e.openElements.items[1];r&&!(!((n=e.treeAdapter.getNodeSourceCodeLocation(r))===null||n===void 0)&&n.endTag)&&e._setEndLocation(r,t)}}else Ju(e,t)}function Ju(e,t){e.insertionMode=N.IN_BODY,Aa(e,t)}function AS(e,t){switch(t.tagID){case d.HTML:{gt(e,t);break}case d.FRAMESET:{e._insertElement(t,V.HTML);break}case d.FRAME:{e._appendElement(t,V.HTML),t.ackSelfClosing=!0;break}case d.NOFRAMES:{en(e,t);break}}}function SS(e,t){t.tagID===d.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==d.FRAMESET&&(e.insertionMode=N.AFTER_FRAMESET))}function IS(e,t){switch(t.tagID){case d.HTML:{gt(e,t);break}case d.NOFRAMES:{en(e,t);break}}}function NS(e,t){t.tagID===d.HTML&&(e.insertionMode=N.AFTER_AFTER_FRAMESET)}function vS(e,t){t.tagID===d.HTML?gt(e,t):$u(e,t)}function $u(e,t){e.insertionMode=N.IN_BODY,Aa(e,t)}function wS(e,t){switch(t.tagID){case d.HTML:{gt(e,t);break}case d.NOFRAMES:{en(e,t);break}}}function DS(e,t){t.chars=Ze,e._insertCharacters(t)}function LS(e,t){e._insertCharacters(t),e.framesetOk=!1}function fd(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==V.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function PS(e,t){if(Yk(t))fd(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===V.MATHML?G1(t):r===V.SVG&&(Gk(t),X1(t)),vi(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function RS(e,t){if(t.tagID===d.P||t.tagID===d.BR){fd(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){const r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===V.HTML){e._endTagOutsideForeignContent(t);break}const u=e.treeAdapter.getTagName(r);if(u.toLowerCase()===t.tagName){t.tagName=u,e.openElements.shortenToLength(n);break}}}O.AREA,O.BASE,O.BASEFONT,O.BGSOUND,O.BR,O.COL,O.EMBED,O.FRAME,O.HR,O.IMG,O.INPUT,O.KEYGEN,O.LINK,O.META,O.PARAM,O.SOURCE,O.TRACK,O.WBR;const OS=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,MS=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),zc={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function hd(e,t){const n=ZS(e),r=s1("type",{handlers:{root:FS,element:BS,text:jS,comment:md,doctype:HS,raw:VS},unknown:$S}),u={parser:n?new Uc(zc):Uc.getFragmentParser(void 0,zc),handle(o){r(o,u)},stitches:!1,options:t||{}};r(e,u),Dr(u,fn());const a=n?u.parser.document:u.parser.getFragment(),s=Fy(a,{file:u.options.file});return u.stitches&&ka(s,"comment",function(o,c,l){const h=o;if(h.value.stitch&&l&&c!==void 0){const f=l.children;return f[c]=h.value.stitch,c}}),s.type==="root"&&s.children.length===1&&s.children[0].type===e.type?s.children[0]:s}function pd(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function FS(e,t){pd(e.children,t)}function BS(e,t){zS(e,t),pd(e.children,t),qS(e,t)}function jS(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);const n={type:Se.CHARACTER,chars:e.value,location:_u(e)};Dr(t,fn(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function HS(e,t){const n={type:Se.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:_u(e)};Dr(t,fn(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function US(e,t){t.stitches=!0;const n=WS(e);if("children"in e&&"children"in n){const r=hd({type:"root",children:e.children},t.options);n.children=r.children}md({type:"comment",value:{stitch:n}},t)}function md(e,t){const n=e.value,r={type:Se.COMMENT,data:n,location:_u(e)};Dr(t,fn(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function VS(e,t){if(t.parser.tokenizer.preprocessor.html="",t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,gd(t,fn(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(OS,"<$1$2"):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;const n=t.parser.tokenizer._consume();t.parser.tokenizer._callState(n)}}function $S(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))US(n,t);else{let r="";throw MS.has(n.type)&&(r=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+n.type+"` node"+r)}}function Dr(e,t){gd(e,t);const n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=Qe.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:"",value:""}}function gd(e,t){if(t&&t.offset!==void 0){const n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function zS(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===Qe.PLAINTEXT)return;Dr(t,fn(e));const r=t.parser.openElements.current;let u="namespaceURI"in r?r.namespaceURI:Xn.html;u===Xn.html&&n==="svg"&&(u=Xn.svg);const a=Qy({...e,children:[]},{space:u===Xn.svg?"svg":"html"}),s={type:Se.START_TAG,tagName:n,tagID:wr(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in a?a.attrs:[],location:_u(e)};t.parser.currentToken=s,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function qS(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&sk.includes(n)||t.parser.tokenizer.state===Qe.PLAINTEXT)return;Dr(t,_a(e));const r={type:Se.END_TAG,tagName:n,tagID:wr(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:_u(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===Qe.RCDATA||t.parser.tokenizer.state===Qe.RAWTEXT||t.parser.tokenizer.state===Qe.SCRIPT_DATA)&&(t.parser.tokenizer.state=Qe.DATA)}function ZS(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function _u(e){const t=fn(e)||{line:void 0,column:void 0,offset:void 0},n=_a(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function WS(e){return"children"in e?Cr({...e,children:[]}):Cr(e)}function bd(e){return function(t,n){return hd(t,{...e,file:n})}}const Pi=()=>{const{shopTerms:e}=b.useStorefrontStore(),{isAntistock:t}=b.useGeneralStore();return!(e!=null&&e.showTermsOfServiceOnProduct)||!(e!=null&&e.termsOfService)?null:i.jsxs("div",{className:Rr.container,children:[i.jsx("div",{className:Rr.icon,children:i.jsx(w.Icon,{name:"FileCloud",fill:"var(--text-secondary)"})}),t?i.jsx(la,{text:e.termsOfService}):i.jsx(Ti,{remarkPlugins:[S1],rehypePlugins:[bd],className:Rr.text,components:{a:({node:n,...r})=>i.jsx("a",{...r,target:"_blank",rel:"noopener noreferrer",className:Rr.link,id:"md"}),p:({node:n,...r})=>i.jsx("p",{...r,className:Rr.text,id:"md"})},children:e==null?void 0:e.termsOfService})]})},YS="_securedBySsl_1ng38_2",GS="_text_1ng38_9",fs={securedBySsl:YS,text:GS},Ri=({isAntistock:e})=>i.jsxs("div",{className:fs.securedBySsl,children:[i.jsx("div",{className:fs.iconWrapper,children:i.jsx(w.Icon,{name:"ShieldCheck",fill:"var(--text-secondary)"})}),i.jsx("p",{className:fs.text,id:"md",children:e?"Your data is secured by extended validation SSL certificates (256-bit encryption).":"Your data is secured by extended validation SSL certificates (256-bit encryption). This complies with the strongest payment security standard available today."})]}),XS="_container_152ix_1",KS="_header_152ix_7",QS="_backButton_152ix_13",JS="_title_152ix_22",eI="_cards_152ix_28",tI="_card_152ix_28",nI="_selected_152ix_46",rI="_prioritySelected_152ix_50",uI="_price_152ix_51",aI="_description_152ix_61",Ut={container:XS,header:KS,backButton:QS,title:JS,cards:eI,card:tI,selected:nI,prioritySelected:rI,price:uI,description:aI},qc=(e,t,n)=>e+n*t/100,sI=e=>{if(!e)return!0;try{const t=JSON.parse(e);if(t.blocks&&Array.isArray(t.blocks))return!t.blocks.some(n=>n.text?n.text.replace(/[\s\u00A0\u2000-\u200F\u2028-\u202F\u205F-\u206F\u3000\u3164]/g,"").length>0:!1)}catch{return e.replace(/[\s\u00A0\u2000-\u200F\u2028-\u202F\u205F-\u206F\u3000\u3164]/g,"").length===0}return!1},_d=({config:e,totalAmount:t,selected:n,onSelect:r,onBack:u,formatter:a})=>{if(!e)return null;const{priorityReplacement:s,standardReplacement:o}=e,c=!!(s!=null&&s.enabled),l=!!(o!=null&&o.enabled),f=[{key:"PRIORITY",title:(s==null?void 0:s.name)||"Priority Replacement",desc:(s==null?void 0:s.description)||"",price:qc((s==null?void 0:s.fixedFee)||0,(s==null?void 0:s.feePercentage)||0,t),isPriority:!0,visible:c&&(!l||l)},{key:"STANDARD",title:(o==null?void 0:o.name)||"Standard Replacement",desc:(o==null?void 0:o.description)||"",price:qc((o==null?void 0:o.fixedFee)||0,(o==null?void 0:o.feePercentage)||0,t),isPriority:!1,visible:c&&l?!0:l},{key:"NONE",title:"No Replacements",desc:i.jsxs(i.Fragment,{children:[i.jsx("p",{children:"• No guaranteed refunds or replacements."}),i.jsx("p",{children:"• No priority support."}),i.jsx("p",{children:"• No dedicated buyer resolution team."})]}),price:0,isPriority:!1,visible:c&&!l}].filter(m=>m.visible);return i.jsxs("div",{className:Ut.container,children:[i.jsxs("div",{className:Ut.header,children:[i.jsx("button",{type:"button",className:Ut.backButton,onClick:u,"aria-label":"Back to payment methods",children:"←"}),i.jsx("h4",{className:Ut.title,children:"Protect Your Checkout"})]}),i.jsx("div",{className:Ut.cards,children:f.map(m=>i.jsxs("div",{className:b.clx(Ut.card,{[Ut.selected]:n===m.key,[Ut.prioritySelected]:n==="PRIORITY"&&m.isPriority}),onClick:()=>r(m.key),role:"button",tabIndex:0,onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&r(m.key)},children:[i.jsx("div",{className:Ut.title,children:m.title}),i.jsx("div",{className:Ut.price,children:a.format(m.price)}),typeof m.desc=="string"?!sI(m.desc)&&i.jsx("div",{className:Ut.description,children:i.jsx(la,{text:m.desc})}):i.jsx("div",{className:Ut.description,children:m.desc})]},m.key))})]})},xd=({getPossibleGateways:e,setGateway:t,getDiscordSettings:n,cart:r,products:u,submitCart:a,reset:s,setCustomFieldsToCart:o,totalAndDiscount:c,setDiscordSocialConnectId:l,setPaymentMethod:h,isAntistock:f})=>{var Ve;const m=P.useMemo(()=>n(),[]),[p,g]=P.useState([]),{balance:x,setBalance:C}=b.useCustomerDashboardStore(),{token:_}=b.useStorefrontStore(),{general:v}=b.useGeneralStore(),{executeRecaptcha:y}=iu(),{discordInfo:D}=b.useDiscordStore(),{customerEmail:S,setCustomerEmail:I,setUsePriorityReplacement:F,setReplacementConfig:X}=b.useCartStore(),U=D!=null&&D.authorized?D.id:void 0,L=b.useNavigate(),H=P.useMemo(()=>e(),[r.parts]),[B,Q]=P.useState(null),[se,te]=P.useState(!1),[_e,Te]=P.useState(null),Ue=!!((Ve=B==null?void 0:B.priorityReplacement)!=null&&Ve.enabled),De=se&&Ue,[E,W]=P.useState(!1),{setIsOpen:ne}=b.useModalStore(),{notifications:A,setNotifications:J}=b.useNotificationStore();P.useEffect(()=>{const K=Ui(r.parts,u).map($=>$.type===Dn.Checkbox?{...$,value:String($.defaultValue)}:$);g([...K])},[]),P.useEffect(()=>{const R=Ui(r.parts,u);g(K=>{const $=new Map(K.map(Y=>[Y.name,Y]));return R.map(Y=>{const de=$.get(Y.name);return de&&de.value?{...Y,value:de.value}:Y.type===Dn.Checkbox?{...Y,value:String(Y.defaultValue)}:Y})})},[r.parts,u]),P.useEffect(()=>{_&&(async()=>{const K=await aa();C(K)})()},[_]);function re(R){return R&&/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(R)}const ee=()=>{const R=[];return p.forEach(K=>{var $;K.required&&!(($=K.value)!=null&&$.toString().trim())&&R.push({message:`Field "${K.name}" is required.`,status:"error",id:b.v4()})}),R.length>0?(J([...A,...R]),!1):!0},ie=async R=>{var de,pe,ve,be;if(R.stopPropagation(),r.gateway==="Balance"&&!_){ne(!0),W(!0);return}if(!ee())return;const K=!!(B&&((de=B.priorityReplacement)!=null&&de.enabled));if(K&&!De){te(!0),_e===null&&((pe=B==null?void 0:B.priorityReplacement)!=null&&pe.enabled)&&(Te("PRIORITY"),F(!0));return}K||(ve=B==null?void 0:B.standardReplacement)!=null&&ve.enabled&&!((be=B==null?void 0:B.priorityReplacement)!=null&&be.enabled)&&(_e===null&&Te("STANDARD"),F(!1));const $=Object.fromEntries(p.map(ae=>[ae.name,ae.value||""]));o({...$}),U&&m.isEnabled&&l(U);const Y=await y();if(Y){const ae=await a(Y),Pe=JSON.parse(localStorage.getItem("orders")||"{}");if(Object.keys(Pe).length>10){const ut=Date.now()-864e5;Object.keys(Pe).forEach(bt=>{Pe[bt].createdAt<=ut&&delete Pe[bt]})}"order"in ae?Pe[ae.order.id]={createdAt:Date.now(),fullAccessToken:ae.order.fullAccessToken}:Pe[ae.id]={createdAt:Date.now(),fullAccessToken:ae.fullAccessToken},localStorage.setItem("orders",JSON.stringify(Pe)),L(`/orders/${"order"in ae?ae.order.id:ae.id}/${"order"in ae?ae.order.fullAccessToken:ae.fullAccessToken}`),setTimeout(()=>s(),2e3)}};P.useEffect(()=>{const R=[...H.availableGateways,...H.requiresSignInGateways];if(!R.length)return;let K=!1;return(async()=>{try{const{data:$}=await Xc(R);if(K)return;let Y=null;Array.isArray($)||($&&$.replacement?Y=$.replacement:(($==null?void 0:$.priorityReplacement)!==void 0||($==null?void 0:$.standardReplacement)!==void 0)&&(Y={priorityReplacement:$.priorityReplacement,standardReplacement:$.standardReplacement})),Q(Y),X(Y)}catch{}})(),()=>{K=!0}},[H.availableGateways.join(","),H.requiresSignInGateways.join(",")]),P.useEffect(()=>{var $,Y;if(!B)return;const R=!!(($=B.priorityReplacement)!=null&&$.enabled),K=!!((Y=B.standardReplacement)!=null&&Y.enabled);!R&&K&&(Te("STANDARD"),F(!1),te(!1))},[B]);const oe=R=>{Te(R),F(R==="PRIORITY"?!0:R==="STANDARD"?!1:void 0)},ge=P.useMemo(()=>{const R=r.parts[0];if(!R)return"USD";const K=u.find(Y=>Y.id===R.productId),$=K==null?void 0:K.variants.find(Y=>Y.id===R.productVariantId);if($!=null&&$.gateways&&r.gateway){const Y=$.gateways.find(de=>de.name===r.gateway&&de.overrodePrice);if(Y!=null&&Y.overrodePrice)return Y.overrodePrice.currency}return($==null?void 0:$.price.currency)||"USD"},[r.parts,r.gateway,u]),ce=P.useMemo(()=>new Intl.NumberFormat("en-US",{style:"currency",currency:ge}),[ge]);return i.jsxs("div",{className:_t.checkoutOperational,style:f?{borderLeft:"1px solid var(--border-secondary)"}:void 0,children:[i.jsxs("div",{className:`${_t.innerContainer} ${f?_t.innerContainerAntistock:""}`,children:[f&&!De?i.jsx("h4",{style:{fontSize:"var(--input-label-size)",color:"var(--text-secondary)",paddingBottom:"12px",fontWeight:"400"},children:"Select Payment Method"}):null,r.parts.length>0&&!De&&i.jsx(oi,{possibleGateways:H,setGateway:t,setPaymentMethod:h,balance:x,totalAndDiscount:c,onSignInClick:()=>{W(!0),ne(!0)},isAntistock:f}),De?i.jsx("div",{style:{marginTop:"12px"},children:i.jsx(_d,{config:B,totalAmount:c.totalWithDiscount??c.total,selected:_e,onSelect:oe,onBack:()=>te(!1),formatter:ce})}):null,!De&&i.jsx("div",{className:b.clx(_t.paymentMethodsSection,{[_t.antistock]:f,[_t.paymentMethodsSectionAntistock]:f}),children:i.jsx(w.Input,{placeholder:"your@email.com",value:S||"",onChange:R=>I(R),disabled:!!_,label:"Email Address"})}),!De&&i.jsx(h0,{customFields:p,setCustomFields:g}),m.isEnabled&&!De&&i.jsxs("div",{className:_t.socialConnectSection,children:[i.jsx("p",{className:_t.socialConnectLabel,id:"md",children:"Social Connect"}),i.jsx("div",{className:_t.socialConnectContent,children:i.jsx(m0,{customerEmail:S||""})})]}),i.jsxs("div",{className:`${_t.continueButton} ${f?_t.continueButtonAntistock:""}`,children:[i.jsx(w.Button,{onClick:ie,disabled:!r.gateway||!re(S||"")||m.isRequired&&!(D!=null&&D.authorized),className:_t.button,children:"Continue to Checkout"}),De?i.jsxs("div",{style:{marginTop:"1rem",display:"flex",alignItems:"center",gap:"8px"},children:[i.jsx("div",{className:_t.iconWrapper,children:i.jsx(w.Icon,{name:"Shield",fill:"var(--text-secondary)"})}),i.jsxs("p",{style:{color:"var(--text-secondary)",fontSize:"14px"},children:["Protected by ",(v==null?void 0:v.info.name)||"Shop"," Buyer Protection"]})]}):i.jsxs(i.Fragment,{children:[i.jsx(Pi,{}),i.jsx(Ri,{isAntistock:f})]})]}),!De&&i.jsx(Hn,{className:`${_t.checkoutFooter} ${f?_t.checkoutFooterAntistock:""}`})]}),E&&i.jsx(w.Modal,{close:()=>W(!1),children:i.jsx(g0,{setIsOpen:W})})]})},iI="_bottomSheet_1a6cu_1",oI="_title_1a6cu_8",cI="_contentTitle_1a6cu_12",lI="_contentText_1a6cu_16",dI="_discordMessageTitle_1a6cu_20",fI="_content_1a6cu_12",hI="_section_1a6cu_27",pI="_copyButton_1a6cu_32",mI="_scrollableBox_1a6cu_37",gI="_scrollableBoxAntistock_1a6cu_47",bI="_discordMessage_1a6cu_20",_I="_link_1a6cu_61",xI="_buttonGroup_1a6cu_68",CI="_buttonWrapper_1a6cu_80",EI="_modal_1a6cu_84",TI="_modalAntistock_1a6cu_91",yI="_header_1a6cu_96",kI="_copyButtonAntistock_1a6cu_104",at={bottomSheet:iI,title:oI,contentTitle:cI,contentText:lI,discordMessageTitle:dI,content:fI,section:hI,copyButton:pI,scrollableBox:mI,scrollableBoxAntistock:gI,discordMessage:bI,link:_I,buttonGroup:xI,buttonWrapper:CI,modal:EI,modalAntistock:TI,header:yI,copyButtonAntistock:kI},Cd=({setIsOpen:e,deliveryConfiguration:t})=>{const n=Jn(),r=t.type===Oe.Discord,{setIsOpen:u}=b.useModalStore(),{isAntistock:a}=b.useGeneralStore(),s=t.type===Oe.Serial?t.deliveryItems.map(c=>c.serialKey).join(`
|
|
109
|
-
`):t.deliveryItems[0].textData,o=()=>{u(!1),a?e(!1):setTimeout(()=>{e(!1)},300)};return i.jsxs("div",{className:b.clx(at.modal,{[at.modalAntistock]:a}),onClick:c=>c.stopPropagation(),children:[i.jsxs("div",{className:at.header,children:[i.jsx("h3",{id:"h3",className:at.title,children:a?"View Content":"Thank you for the purchase!"}),i.jsx(w.Icon,{name:"X",hoverable:!0,onClick:o,fill:"var(--text-primary)"})]}),i.jsxs("div",{className:at.bottomSheet,children:[i.jsx("div",{className:at.content,children:r?i.jsx("div",{className:at.discordMessage,children:i.jsx("p",{className:at.discordMessageTitle,id:"md",children:"Discord role has been granted"})}):i.jsxs("div",{children:[i.jsxs("div",{className:at.section,children:[!a&&i.jsx("p",{className:at.contentTitle,id:"md",children:"Content"}),!a&&i.jsxs(w.Button,{className:at.copyButton,type:"Secondary",onClick:()=>n(s),children:[i.jsx(w.Icon,{name:"Copy"}),"Copy to Clipboard"]})]}),i.jsx("div",{className:b.clx(at.scrollableBox,{[at.scrollableBoxAntistock]:a}),children:i.jsx("p",{className:at.contentText,id:"md",children:a?i.jsx(la,{text:s}):i.jsx(Ti,{remarkPlugins:[S1],rehypePlugins:[bd],components:{a:({node:c,...l})=>i.jsx("a",{...l,target:"_blank",rel:"noopener noreferrer",className:at.link})},children:s})})})]})}),a&&i.jsxs(w.Button,{className:at.copyButtonAntistock,type:"Secondary",onClick:()=>n(s),style:{display:"flex",alignItems:"center",gap:"5px"},children:[i.jsx(w.Icon,{name:"Copy"}),"Copy All"]}),!a&&i.jsx("div",{className:at.buttonGroup,children:i.jsx("div",{className:at.buttonWrapper,children:i.jsx(w.Button,{type:"Secondary",onClick:o,children:"Close"})})})]})]})},AI="_mt1_1l62z_1",SI="_notifyBlock_1l62z_13",II="_notifyHeader_1l62z_19",NI="_notifyContent_1l62z_25",vI="_buttonBlock_1l62z_30",wI="_imageBlock_1l62z_34",DI="_imageContainer_1l62z_42",LI="_sectionBlock_1l62z_54",PI="_sectionTitle_1l62z_61",RI="_sectionSubtitle_1l62z_64",OI="_inputContainer_1l62z_69",Qt={mt1:AI,notifyBlock:SI,notifyHeader:II,notifyContent:NI,buttonBlock:vI,imageBlock:wI,imageContainer:DI,sectionBlock:LI,sectionTitle:PI,sectionSubtitle:RI,inputContainer:OI},MI=({props:e})=>{const t=Jn();return i.jsx("div",{className:Qt.mt1,children:i.jsxs("div",{className:Qt.inputContainer,children:[i.jsx(w.Input,{value:e.text,disabled:!0,onChange:()=>{}}),e.shownCopyButton&&i.jsx(w.Button,{type:"Secondary",onClick:()=>t(e.text),children:i.jsx(w.Icon,{name:"Copy"})})]})})},FI=({props:e})=>i.jsx(w.Button,{className:Qt.buttonBlock,onClick:()=>window.open(e.url,"_blank","noopener"),children:e.text}),BI=({props:e})=>i.jsx("div",{className:Qt.imageBlock,children:i.jsx("div",{className:Qt.imageContainer,children:i.jsx("img",{src:e.src,alt:""})})}),jI=({props:e})=>i.jsxs("div",{className:Qt.notifyBlock,children:[i.jsxs("div",{className:Qt.notifyHeader,children:[i.jsx(w.Icon,{name:"Info",width:24,height:24,fill:"var(--text-secondary)"}),i.jsx("p",{children:e.heading})]}),i.jsx("p",{className:Qt.notifyContent,children:e.content})]}),HI=({props:e})=>{var t;return i.jsxs("div",{className:Qt.sectionBlock,children:[i.jsx("p",{className:Qt.sectionTitle,children:e.title}),i.jsx("span",{className:Qt.sectionSubtitle,children:e.subTitle}),(t=e.children)==null?void 0:t.map((n,r)=>i.jsx(ea,{block:n},r))]})},ea=({block:e})=>{switch(e.type){case"Section":return i.jsx(HI,{...e});case"ReadOnlyTextInput":return i.jsx(MI,{...e});case"Notify":return i.jsx(jI,{...e});case"Button":return i.jsx(FI,{...e});case"Image":return i.jsx(BI,{...e});default:return null}},UI="_chargeStatusBlock_12swd_4",VI="_isAntistock_12swd_13",$I="_chargeStatusIcon_12swd_19",zI="_chargeStatusTitle_12swd_27",qI="_chargeStatusDescription_12swd_33",ZI="_pickUpButton_12swd_39",WI="_actionButtons_12swd_49",YI="_actionButton_12swd_49",It={chargeStatusBlock:UI,isAntistock:VI,chargeStatusIcon:$I,chargeStatusTitle:zI,chargeStatusDescription:qI,pickUpButton:ZI,actionButtons:WI,actionButton:YI},Gn={[ye.Paid]:"Payment Successful",[ye.Pending]:"Payment Pending",[ye.Expired]:"Payment Expired",[ye.Cancelled]:"Payment Cancelled",[ye.NotPaid]:"Payment Failed",[ye.Refunded]:"Payment Refunded"},Ed={[ye.Paid]:"Your payment has successfully been processed. Tap on the button below to be redirected back to our website.",[ye.Pending]:"Your payment is currently pending. We recommend checking back shortly for confirmation.",[ye.Expired]:"Your payment has expired due to the payment not being sent in time. If you already sent the payment, please contact us below.",[ye.Cancelled]:"You canceled the warrant. If there are any problems, please contact support",[ye.NotPaid]:"Your payment has expired due to the payment not being sent in time. If you already sent the payment, please contact us below.",[ye.Refunded]:"Your payment has been refunded. Please check your payment method for confirmation."},Td=()=>({[ye.Paid]:i.jsx("div",{className:`${It.chargeStatusIcon}`,children:i.jsx(w.Icon,{name:"Check",fill:"var(--text-success)"})}),[ye.Pending]:i.jsx("div",{className:It.chargeStatusIcon,children:i.jsx(w.Icon,{name:"Clock",fill:"var(--text-warning)"})}),[ye.Expired]:i.jsx("div",{className:It.chargeStatusIcon,children:i.jsx(w.Icon,{name:"XCircle",fill:"var(--text-action)"})}),[ye.Cancelled]:i.jsx("div",{className:It.chargeStatusIcon,children:i.jsx(w.Icon,{name:"XCircle",fill:"var(--text-action)"})}),[ye.NotPaid]:i.jsx("div",{className:It.chargeStatusIcon,children:i.jsx(w.Icon,{name:"XCircle",fill:"var(--text-action)"})}),[ye.Refunded]:i.jsx("div",{className:It.chargeStatusIcon,children:i.jsx(w.Icon,{name:"XCircle",fill:"var(--text-warning)"})})}),yd=({charge:e})=>{const t=e.status,n=b.useNavigate(),{shopDomain:r}=b.useStorefrontStore(),{isAntistock:u}=b.useGeneralStore(),a=P.useRef(),[s,o]=b.useSearchParams(),c=()=>{var h,f;if(!((h=e.order)!=null&&h.id))return;const l=s.get("redirectRoute");if((e==null?void 0:e.status)===ye.Paid&&e.redirectUrl&&!a.current){const p=JSON.parse(localStorage.getItem("orders")||"{}")[((f=e==null?void 0:e.order)==null?void 0:f.id)||""];p?window.open(p.fullAccessToken?`${e.redirectUrl}/${p.fullAccessToken}`:`${e.redirectUrl}`,"_self"):window.open(e.redirectUrl,"_self")}(e==null?void 0:e.status)===ye.Paid&&a.current&&n(a.current,{replace:!0}),l&&a&&(a.current=l,s.delete("redirectRoute"),o(s))};return i.jsxs("div",{className:b.clx(It.chargeStatusBlock,{[It.isAntistock]:u}),children:[Td()[t],i.jsx("h2",{className:It.chargeStatusTitle,children:Gn[t]}),i.jsx("p",{className:It.chargeStatusDescription,children:Ed[t]}),t===ye.Paid?i.jsx("div",{className:It.pickUpButton,style:u?{justifyContent:"flex-start"}:void 0,children:i.jsxs(w.Button,{onClick:c,style:{width:"100%",maxWidth:"250px",display:"flex",alignItems:"center",gap:"5px"},type:"Secondary",children:[i.jsx(w.Icon,{name:"ArrowLineUpRight"}),u?"View Order":"Pick up Order"]})}):i.jsxs("div",{className:It.actionButtons,children:[i.jsx("div",{className:It.actionButton,children:i.jsxs(w.Button,{type:"Secondary",onClick:()=>window.open(`https://${r}`),style:{width:"100%",display:"flex",alignItems:"center",gap:"5px"},children:[i.jsx(w.Icon,{name:"ArrowLineUpRight"}),"Visit Website"]})}),i.jsx("div",{className:It.actionButton,children:i.jsxs(w.Button,{type:"Secondary",style:{width:"100%",display:"flex",alignItems:"center",gap:"5px"},onClick:()=>{u?window.open(`https://${r}/support`):n("/contact")},children:[i.jsx(w.Icon,{name:"ChatsTeardrop"}),"Contact Support"]})})]})]})},GI="_bottomSheet_1x4sq_1",XI="_content_1x4sq_8",KI="_agreementList_1x4sq_11",QI="_agreementItem_1x4sq_16",JI="_warning_1x4sq_23",eN="_buttonGroup_1x4sq_31",tN="_buttonWrapper_1x4sq_41",nN="_fullWidthButton_1x4sq_44",rN="_modal_1x4sq_48",uN="_header_1x4sq_55",Vt={bottomSheet:GI,content:XI,agreementList:KI,agreementItem:QI,warning:JI,buttonGroup:eN,buttonWrapper:tN,fullWidthButton:nN,modal:rN,header:uN},kd=({setIsOpen:e,price:t})=>{const[n,r]=P.useState({agreeToSendAsFF:!1,agreeToSend:!1,agreeToNotAddNote:!1}),{setIsOpen:u}=b.useModalStore(),a=()=>{u(!1),setTimeout(()=>{e(!1)},300)};return i.jsxs("div",{className:Vt.modal,onClick:s=>s.stopPropagation(),children:[i.jsxs("div",{className:Vt.header,children:[i.jsx("h3",{id:"h3",children:"Note"}),i.jsx(w.Icon,{name:"X",hoverable:!0,onClick:a,fill:"var(--text-primary)"})]}),i.jsxs("div",{className:Vt.bottomSheet,children:[i.jsxs("div",{className:Vt.content,children:[i.jsxs("div",{className:Vt.agreementList,children:[i.jsxs("label",{className:Vt.agreementItem,children:[i.jsx(w.CheckboxSettings,{value:n.agreeToSendAsFF,onChange:s=>r({...n,agreeToSendAsFF:s})}),i.jsx("p",{children:"I agree to send the payment as friends & family"})]}),i.jsxs("label",{className:Vt.agreementItem,children:[i.jsx(w.CheckboxSettings,{value:n.agreeToSend,onChange:s=>r({...n,agreeToSend:s})}),i.jsxs("p",{children:["I agree to send the payment of ",b.formatPrice(t)," ",t.currency]})]}),i.jsxs("label",{className:Vt.agreementItem,children:[i.jsx(w.CheckboxSettings,{value:n.agreeToNotAddNote,onChange:s=>r({...n,agreeToNotAddNote:s})}),i.jsx("p",{children:"I agree to not add a note to this payment"})]})]}),i.jsx("div",{className:Vt.warning,children:i.jsxs("p",{children:["Please note that you are required to send the exact payment of ",b.formatPrice(t)," ",t.currency,". If you were to send any amount over or below, your funds will be lost."]})})]}),i.jsxs("div",{className:Vt.buttonGroup,children:[i.jsx("div",{className:Vt.buttonWrapper,children:i.jsx(w.Button,{type:"Secondary",children:i.jsx("span",{className:"text-[var(--text-secondary)]",children:"Cancel"})})}),i.jsx("div",{className:Vt.fullWidthButton,children:i.jsx(w.Button,{type:"Primary",disabled:!(n.agreeToSendAsFF&&n.agreeToNotAddNote&&n.agreeToSend),onClick:a,children:"Continue to Payment"})})]})]})]})},aN="_chargeItemsContainer_vynct_5",sN="_chargeItemsInner_vynct_18",iN="_productsContainer_vynct_25",oN="_antistockLayout_vynct_40",cN="_mainContentAntistock_vynct_53",lN="_desktopTrackPayment_vynct_64",dN="_desktopFooter_vynct_73",fN="_footerContainerAntistock_vynct_94",hN="_chargeHeader_vynct_107",pN="_chargeTitle_vynct_115",mN="_chargeDescription_vynct_121",gN="_copyButton_vynct_127",bN="_productsList_vynct_139",_N="_footerContainer_vynct_94",yt={chargeItemsContainer:aN,chargeItemsInner:sN,productsContainer:iN,antistockLayout:oN,mainContentAntistock:cN,desktopTrackPayment:lN,desktopFooter:dN,footerContainerAntistock:fN,chargeHeader:hN,chargeTitle:pN,chargeDescription:mN,copyButton:gN,productsList:bN,footerContainer:_N},Ad=({charge:e})=>{var s;const t=Jn(),{isAntistock:n}=b.useGeneralStore(),r=(e==null?void 0:e.price.currency)||"USD",u=new Intl.NumberFormat("en-US",{style:"currency",currency:r}),a=P.useMemo(()=>{var o;return((o=e==null?void 0:e.order)==null?void 0:o.partOrders.map(c=>{var l,h,f,m;return{id:(c==null?void 0:c.id)||0,image:c.productWithVariant.image,name:(()=>{var x,C;const p=((x=c.productWithVariant)==null?void 0:x.name)||"",g=((C=c.productWithVariant)==null?void 0:C.variantName)||"";return!p&&!g?"":!g||p===g?p:p?`${p} (${g})`:g})(),description:"",price:{quantity:c.quantity,amount:((l=c.productWithVariant)==null?void 0:l.price.amount)||0,currency:(h=c.productWithVariant)==null?void 0:h.price.currency},subscriptionSettings:(f=e.order)!=null&&f.subscriptionOrderId?(m=c.productWithVariant)==null?void 0:m.subscriptionSettings:null}}))||[]},[e]);return i.jsx("div",{className:yt.chargeItemsContainer,children:i.jsxs("div",{className:yt.chargeItemsInner,children:[i.jsx(ma,{expiresAt:e==null?void 0:e.expiresAt}),i.jsxs("div",{className:`${yt.productsContainer} ${n?yt.antistockLayout:""}`,children:[(e==null?void 0:e.name)&&i.jsxs("header",{className:yt.chargeHeader,children:[i.jsxs("div",{children:[i.jsx("h1",{className:yt.chargeTitle,id:"h5",children:e.name}),e.description&&i.jsx("p",{className:yt.chargeDescription,id:"md",children:e.description})]}),((s=e.order)==null?void 0:s.id)&&!n&&i.jsxs(w.Button,{type:"Secondary",className:yt.copyButton,onClick:()=>{var o;return t(((o=e.order)==null?void 0:o.id)||"")},children:[i.jsx(w.Icon,{name:"Copy"}),"Copy Order ID"]})]}),i.jsxs("div",{className:n?yt.mainContentAntistock:"",style:n?void 0:{flex:1},children:[!!a.length&&i.jsx("div",{className:yt.productsList,children:a.map(o=>i.jsx(ga,{product:o},o.id))}),i.jsx(kr,{formatter:u,coupon:null,total:(e==null?void 0:e.price.amount)||0,discount:0,totalWithDiscount:(e==null?void 0:e.price.amount)||0,isShowSubtotal:!1}),n&&e&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:yt.desktopTrackPayment,children:i.jsx(va,{timeline:e.timeline})}),i.jsx(Hn,{className:yt.desktopFooter})]})]}),!n&&i.jsx(Hn,{className:`${yt.footerContainer} ${n?yt.footerContainerAntistock:""}`})]})]})})},xN="_checkoutOrderMainData_hqf60_1",CN="_orderDetailRow_hqf60_6",EN="_chargeIdRow_hqf60_16",TN="_detailLabel_hqf60_25",yN="_detailValue_hqf60_29",kN="_chargeIdContainer_hqf60_33",AN="_chargeId_hqf60_16",SN="_copyIcon_hqf60_51",Je={checkoutOrderMainData:xN,orderDetailRow:CN,chargeIdRow:EN,detailLabel:TN,detailValue:yN,chargeIdContainer:kN,chargeId:AN,copyIcon:SN},Oi=({lastUpdate:e,invoiceId:t,email:n,paymentType:r,orderId:u})=>{const a=Jn(),[s,o]=P.useState(null),c=s==null?void 0:s.find(h=>h.name===r);P.useEffect(()=>{s||(async()=>{if(!r)return;const m=await ou([r]);o(m)})()},[r,s]);const l=h=>{const f=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],m=h.getDate().toString().padStart(2,"0"),p=f[h.getMonth()],g=h.getFullYear(),x=h.getHours(),C=h.getMinutes().toString().padStart(2,"0"),_=h.getSeconds().toString().padStart(2,"0"),v=x>=12?"PM":"AM",y=(x%12||12).toString().padStart(2,"0");return`${p} ${m}, ${g} at ${y}:${C}:${_} ${v}`};return i.jsxs("div",{className:Je.checkoutOrderMainData,children:[i.jsxs("div",{className:Je.orderDetailRow,children:[i.jsx("p",{className:Je.detailLabel,id:"md",children:"Last Updated"}),i.jsx("p",{className:Je.detailValue,id:"md",children:l(new Date(e))})]}),r&&i.jsxs("div",{className:Je.orderDetailRow,children:[i.jsx("p",{className:Je.detailLabel,id:"md",children:"Payment Type"}),i.jsx("p",{className:Je.detailValue,id:"md",children:c==null?void 0:c.displayName})]}),i.jsxs("div",{className:Je.orderDetailRow,children:[i.jsx("p",{className:Je.detailLabel,id:"md",children:"Email"}),i.jsx("p",{className:Je.detailValue,id:"md",children:n})]}),t&&i.jsxs("div",{className:Je.chargeIdRow,children:[i.jsx("p",{className:Je.detailLabel,id:"md",children:"Charge ID"}),i.jsxs("div",{className:Je.chargeIdContainer,children:[i.jsx("p",{className:Je.chargeId,id:"md",children:t}),i.jsx("div",{className:Je.copyIcon,onClick:()=>a(t),children:i.jsx(w.Icon,{name:"Copy"})})]})]}),u&&i.jsxs("div",{className:Je.chargeIdRow,children:[i.jsx("p",{className:Je.detailLabel,id:"md",children:"Order ID"}),i.jsxs("div",{className:Je.chargeIdContainer,children:[i.jsx("p",{className:Je.chargeId,id:"md",children:u}),i.jsx("div",{className:Je.copyIcon,onClick:()=>a(u),children:i.jsx(w.Icon,{name:"Copy"})})]})]})]})},IN="_bottomSheet_1yai1_1",NN="_formContainer_1yai1_8",vN="_error_1yai1_14",wN="_buttonGroup_1yai1_18",DN="_buttonWrapper_1yai1_28",LN="_fullWidthButton_1yai1_31",PN="_modal_1yai1_41",RN="_header_1yai1_48",Sn={bottomSheet:IN,formContainer:NN,error:vN,buttonGroup:wN,buttonWrapper:DN,fullWidthButton:LN,modal:PN,header:RN},Sd=({chargeId:e,setIsOpen:t})=>{const[n,r]=P.useState(""),[u,a]=P.useState(""),{setIsOpen:s}=b.useModalStore(),o=h=>{try{return new URL(h),!0}catch{return!1}},c=async h=>{if(h.preventDefault(),!n){a("The link field cannot be empty.");return}if(!o(n)){a("Please enter a valid URL");return}await Gd({url:n},e)&&(alert("CashApp successfully verified"),t(!1))},l=()=>{s(!1),setTimeout(()=>{t(!1)},300)};return i.jsxs("div",{className:Sn.modal,onClick:h=>h.stopPropagation(),children:[i.jsxs("div",{className:Sn.header,children:[i.jsx("h3",{id:"h3",children:"CashApp Verify"}),i.jsx(w.Icon,{name:"X",hoverable:!0,onClick:l,fill:"var(--text-primary)"})]}),i.jsx("form",{onSubmit:c,children:i.jsxs("div",{className:Sn.bottomSheet,children:[i.jsx("div",{className:Sn.formContainer,children:i.jsxs("div",{children:[i.jsx(w.Input,{value:n,onChange:h=>{r(h),a("")},label:"Enter Cashapp Link",placeholder:"https://cash.app/payments/0000"}),u&&i.jsx("p",{className:Sn.error,children:u})]})}),i.jsxs("div",{className:Sn.buttonGroup,children:[i.jsx("div",{className:Sn.buttonWrapper,children:i.jsx(w.Button,{type:"Secondary",onClick:l,children:"Cancel"})}),i.jsx("div",{className:Sn.fullWidthButton,children:i.jsx(w.Button,{type:"Primary",children:"Verify"})})]})]})})]})},ON="_trackPaymentContainer_fk3b6_1",MN="_trackPaymentBox_fk3b6_5",FN="_trackPaymentBoxActive_fk3b6_18",BN="_trackPaymentHeader_fk3b6_23",jN="_trackPaymentTitle_fk3b6_27",HN="_trackPaymentTimeline_fk3b6_33",UN="_trackPaymentItem_fk3b6_42",VN="_itemHeader_fk3b6_48",$N="_itemDate_fk3b6_55",zN="_itemMessage_fk3b6_59",qN="_trackPaymentToggle_fk3b6_64",ZN="_trackPaymentToggleContent_fk3b6_75",WN="_trackPaymentToggleText_fk3b6_81",YN="_antistock_fk3b6_88",xt={trackPaymentContainer:ON,trackPaymentBox:MN,trackPaymentBoxActive:FN,trackPaymentHeader:BN,trackPaymentTitle:jN,trackPaymentTimeline:HN,trackPaymentItem:UN,itemHeader:VN,itemDate:$N,itemMessage:zN,trackPaymentToggle:qN,trackPaymentToggleContent:ZN,trackPaymentToggleText:WN,antistock:YN},Zc=(e,t)=>{const n=e.getDate().toString().padStart(2,"0"),r=(e.getMonth()+1).toString().padStart(2,"0"),u=e.getFullYear(),a=e.getHours(),s=e.getMinutes().toString().padStart(2,"0"),o=e.getSeconds().toString().padStart(2,"0"),c=a>=12?"PM":"AM",l=(a%12||12).toString().padStart(2,"0");return t==="dd.MM.yyyy"?`${n}.${r}.${u}`:t==="hh:mm:ss aa"?`${l}:${s}:${o} ${c}`:""},GN={[ye.Paid]:{displayName:Gn[ye.Paid],displayMessage:"The invoice has been completed and the product has been delivered.",type:"success"},[ye.Pending]:{displayName:Gn[ye.Pending],displayMessage:"The invoice has been created and we are now waiting to receive the payment.",type:"warning"},[ye.Expired]:{displayName:Gn[ye.Expired],displayMessage:"Your payment has expired due to the payment not being sent in time.",type:"error"},[ye.Cancelled]:{displayName:Gn[ye.Cancelled],displayMessage:"The order has been canceled. The payment was not sent within the time limit.",type:"error"},[ye.NotPaid]:{displayName:"New",displayMessage:"The charge has been created and is awaiting payment.",type:"success"},[ye.Refunded]:{displayName:Gn[ye.Refunded],displayMessage:"Your order was refunded. Please check your payment method for confirmation.",type:"warning"}},XN=({date:e,chargeStatus:t})=>(console.log(t),i.jsxs("div",{className:xt.trackPaymentItem,children:[i.jsxs("div",{className:xt.itemHeader,children:[i.jsx("p",{className:xt.itemDate,id:"md-bold",children:Zc(new Date(e),"dd.MM.yyyy")}),i.jsx("p",{className:xt.itemTime,id:"md",children:Zc(new Date(e),"hh:mm:ss aa")})]}),i.jsx("p",{className:xt.itemMessage,id:"md",children:GN[t].displayMessage})]})),va=({timeline:e,className:t})=>{const[n,r]=P.useState(!1),{isAntistock:u}=b.useGeneralStore();return i.jsxs("div",{className:b.clx(xt.trackPaymentContainer,t,{[xt.antistock]:u}),children:[i.jsxs("div",{className:`${xt.trackPaymentBox} ${n?xt.trackPaymentBoxActive:""}`,style:u?{border:"1px solid var(--border-secondary)"}:void 0,children:[i.jsx("header",{className:xt.trackPaymentHeader,children:i.jsx("h2",{className:xt.trackPaymentTitle,id:"h4",children:"Track Payment"})}),i.jsx("div",{className:xt.trackPaymentTimeline,children:Object.keys(e).map(a=>i.jsx(XN,{date:e[a],chargeStatus:a},a))})]}),i.jsxs("div",{className:xt.trackPaymentToggle,onClick:()=>r(!n),style:u?{padding:"1.25rem",border:"1px solid var(--border-secondary)",borderRadius:"var(--border-radius)"}:void 0,children:[i.jsxs("div",{className:xt.trackPaymentToggleContent,children:[u?null:i.jsx(w.Icon,{name:"MagnifyingGlass",fill:"var(--text-secondary)"}),i.jsx("p",{className:xt.trackPaymentToggleText,id:"h5",children:"Track Payment"})]}),i.jsx(w.Icon,{name:"CaretRight",fill:"var(--text-primary)",width:16,height:16})]})]})},KN="_dateTime_1dnnn_11",QN="_tableItem_1dnnn_25",JN="_status_1dnnn_29",ev="_statusInProgress_1dnnn_38",tv="_statusText_1dnnn_42",nv="_statusIcon_1dnnn_46",rv="_statusInProgressText_1dnnn_52",uv="_statusInProgressIcon_1dnnn_57",av="_message_1dnnn_63",Ct={dateTime:KN,tableItem:QN,status:JN,statusInProgress:ev,statusText:tv,statusIcon:nv,statusInProgressText:rv,statusInProgressIcon:uv,message:av},Id=({item:e})=>{const[t,n]=b.extractDateAndTime(e.createdAt),r=b.useNavigate(),a=(s=>s.length>30?s.slice(0,27)+"...":s)(e.latestMessage);return i.jsxs(P.Fragment,{children:[i.jsx(ot,{className:Ct.tableItem,onClick:()=>r(`/ticket/${e.id}/${e.accessToken}`),children:i.jsxs("span",{id:"md",children:["#",e.id]})}),i.jsx(ot,{className:b.clx(Ct.message,Ct.tableItem),onClick:()=>r(`/ticket/${e.id}/${e.accessToken}`),children:i.jsx("span",{id:"md",children:a})}),i.jsx(ot,{className:Ct.tableItem,onClick:()=>r(`/ticket/${e.id}/${e.accessToken}`),children:i.jsxs("div",{children:[i.jsx("div",{id:"md",children:t}),i.jsx("div",{className:Ct.dateTime,id:"md",children:n})]})}),i.jsx(ot,{className:Ct.tableItem,onClick:()=>r(`/ticket/${e.id}/${e.accessToken}`),children:i.jsx(sv,{status:e.status})})]},e.id)},sv=({status:e})=>i.jsxs("div",{className:b.clx(Ct.status,{[Ct.statusClosed]:e==="CLOSED",[Ct.statusInProgress]:e!=="CLOSED"}),children:[i.jsx("div",{className:b.clx(Ct.statusIcon,{[Ct.statusInProgressIcon]:e!=="CLOSED"}),children:e==="CLOSED"?i.jsx(w.Icon,{name:"CheckCircle",className:Ct.statusIcon}):i.jsx(w.Icon,{name:"Clock",className:Ct.statusInProgressIcon})}),i.jsx("div",{className:b.clx(Ct.statusText,{[Ct.statusInProgressText]:e!=="CLOSED"}),id:"md",children:e==="CLOSED"?"Closed":"In Progress"})]}),iv="_tableContainer_1eytq_1",ov="_table_1eytq_1",cv="_productInfo_1eytq_19",lv="_productImage_1eytq_26",dv="_productName_1eytq_35",fv="_expirationDate_1eytq_46",hv="_overflowItem_1eytq_51",pv="_gatewayContainer_1eytq_57",mv="_gatewayImage_1eytq_62",gv="_dateTime_1eytq_67",bv="_tableLoader_1eytq_72",_v="_tableItem_1eytq_81",ft={tableContainer:iv,table:ov,productInfo:cv,productImage:lv,productName:dv,expirationDate:fv,overflowItem:hv,gatewayContainer:pv,gatewayImage:mv,dateTime:gv,tableLoader:bv,tableItem:_v},xv="_badge_1oac8_1",Cv="_active_1oac8_12",Ev="_awaitingPayment_1oac8_17",Tv="_cancelled_1oac8_22",yv="_changedGateway_1oac8_27",kv="_expired_1oac8_32",Av="_rial_1oac8_37",Sv="_pastDue_1oac8_42",Iv="_replaced_1oac8_47",Cn={badge:xv,active:Cv,awaitingPayment:Ev,cancelled:Tv,changedGateway:yv,expired:kv,rial:Av,pastDue:Sv,replaced:Iv},Nv=()=>({[xn.ACTIVE]:{icon:i.jsx(w.Icon,{name:"CheckCircle"}),title:"Active",className:Cn.active},[xn.AWAITING_PAYMENT]:{icon:i.jsx(w.Icon,{name:"Clock"}),title:"Awaiting Payment",className:Cn.awaitingPayment},[xn.CANCELLED]:{icon:i.jsx(w.Icon,{name:"XCircle"}),title:"Cancelled",className:Cn.cancelled},[xn.CHANGED_GATEWAY]:{icon:i.jsx(w.Icon,{name:"Warning"}),title:"Upgraded",className:Cn.changedGateway},[xn.EXPIRED]:{icon:i.jsx(w.Icon,{name:"XCircle"}),title:"Expired",className:Cn.expired},[xn.RIAL]:{icon:i.jsx(w.Icon,{name:"Clock"}),title:"Active",className:Cn.rial},[xn.PAST_DUE]:{icon:i.jsx(w.Icon,{name:"Clock"}),title:"Trial",className:Cn.pastDue},[xn.REPLACED]:{icon:i.jsx(w.Icon,{name:"Warning"}),title:"Replaced",className:Cn.replaced}}),Mi=({status:e})=>{const t=Nv()[e];return i.jsxs("div",{className:`${Cn.badge} ${t.className}`,children:[t.icon,i.jsx("p",{id:"md",children:t.title})]})},vv=(e,t)=>{const n=t.find(r=>r.name===e);return n?i.jsxs("div",{className:ft.gatewayContainer,children:[i.jsx("img",{alt:n.displayName,src:b.convertCfImageIdToUrl(n.logoCfImageId,"100"),className:ft.gatewayImage}),i.jsx("div",{children:n.displayName})]}):null},wv=({item:e,gatewaysDetail:t})=>{const[n,r]=b.extractDateAndTime(e.createdAt),[u]=b.extractDateAndTime(e.activeTo||""),a=Jn();return i.jsxs(P.Fragment,{children:[i.jsx(ot,{children:i.jsxs("div",{className:ft.productInfo,children:[i.jsx("div",{className:ft.productImage,children:i.jsx(w.Icon,{name:"Image",width:20,height:20,fill:"var(--text-secondary)"})}),i.jsxs("div",{children:[i.jsx(b.NavLink,{to:`/subscriptions/${e.id}/${e.accessToken}`,className:ft.productName,id:"md",children:e.productName}),i.jsx("p",{className:ft.expirationDate,children:e.activeTo&&`expires at ${u}`})]})]})}),i.jsx(ot,{className:ft.overflowItem,onClick:()=>a(e.id),children:e.id}),i.jsx(ot,{children:i.jsx(Mi,{status:e.status})}),i.jsx(ot,{children:b.formatPrice(e.price)}),i.jsx(ot,{children:vv(e.gatewayName,t)}),i.jsx(ot,{children:i.jsxs("div",{children:[i.jsx("div",{id:"md",children:n}),i.jsx("div",{className:ft.dateTime,id:"md",children:r})]})})]},e.id)},Nd=({subscriptions:e,gatewaysDetail:t,totalCount:n,page:r,setPage:u})=>{const s=!(!(e!=null&&e.length)||!t);return i.jsxs("div",{className:ft.tableContainer,children:[i.jsxs(pa,{className:ft.table,children:[i.jsx(Nt,{className:ft.tableItem,children:"Product name"}),i.jsx(Nt,{className:ft.tableItem,children:"ID"}),i.jsx(Nt,{className:ft.tableItem,children:"Status"}),i.jsx(Nt,{className:ft.tableItem,children:"Value"}),i.jsx(Nt,{className:ft.tableItem,children:"Payment"}),i.jsx(Nt,{className:ft.tableItem,children:"Date"}),s&&(e==null?void 0:e.map(o=>i.jsx(wv,{item:o,gatewaysDetail:t},o.id)))]}),!s&&i.jsx("div",{className:ft.tableLoader,children:i.jsx(w.Loader,{})}),s&&i.jsx(fu,{currentPage:r,totalCount:n,onPageChange:u})]})},Dv="_pageLoading_1rj3k_2",Lv="_title_1rj3k_11",Pv="_description_1rj3k_17",hs={pageLoading:Dv,title:Lv,description:Pv},Rv=({description:e,title:t})=>i.jsxs("div",{className:hs.pageLoading,children:[i.jsx("div",{children:i.jsx(w.Loader,{})}),i.jsx("h1",{className:hs.title,children:t}),i.jsx("p",{className:hs.description,children:e})]}),Ov="_container_1opbn_1",Mv="_productDetails_1opbn_8",Fv="_imageContainer_1opbn_14",Bv="_image_1opbn_14",jv="_textContainer_1opbn_32",Hv="_header_1opbn_40",Uv="_title_1opbn_46",Vv="_price_1opbn_53",$v="_badgeContainer_1opbn_57",zv="_description_1opbn_61",nn={container:Ov,productDetails:Mv,imageContainer:Fv,image:Bv,textContainer:jv,header:Hv,title:Uv,price:Vv,badgeContainer:$v,description:zv},vd=({subscription:e})=>i.jsxs("div",{className:nn.container,children:[i.jsxs("div",{className:nn.productDetails,children:[i.jsx("div",{className:nn.imageContainer,children:e!=null&&e.image?i.jsx("img",{className:nn.image,src:b.convertCfImageIdToUrl(e.image.cfId),alt:e==null?void 0:e.name}):i.jsx(w.Icon,{name:"Image"})}),i.jsxs("div",{className:nn.textContainer,children:[i.jsx("div",{className:nn.header,children:i.jsx("h2",{className:nn.title,children:e.name})}),i.jsxs("p",{className:nn.price,children:[b.formatPrice(e.price)," / ",e.recurringInterval]})]}),i.jsx("div",{className:nn.badgeContainer,children:i.jsx(Mi,{status:e.status})})]}),e.description&&i.jsx(Ti,{className:nn.description,children:e.description})]}),qv="_card_69liy_1",Zv="_price_69liy_10",Wv="_interval_69liy_17",Yv="_name_69liy_22",Gv="_description_69liy_28",Xv="_currentPlan_69liy_32",Kv="_selectButton_69liy_45",Qv="_progressSection_69liy_50",Jv="_progressLabel_69liy_54",ew="_bottomSheet_69liy_60",tw="_title_69liy_69",nw="_typeSelector_69liy_80",rw="_typeOption_69liy_90",uw="_active_69liy_100",aw="_saveTag_69liy_108",sw="_planSelector_69liy_117",iw="_modal_69liy_127",ow="_inactive_69liy_148",cw="_notMounted_69liy_151",lw="_closeButton_69liy_157",Xe={card:qv,price:Zv,interval:Wv,name:Yv,description:Gv,currentPlan:Xv,selectButton:Kv,progressSection:Qv,progressLabel:Jv,bottomSheet:ew,title:tw,typeSelector:nw,typeOption:rw,active:uw,saveTag:aw,planSelector:sw,modal:iw,inactive:ow,notMounted:cw,closeButton:lw},dw=({variant:e,onSelect:t,isCurrent:n})=>{const r=e.subscriptionSettings.recurringIntervalDays===30?"month":e.subscriptionSettings.recurringIntervalDays===365?"year":"period",u=e.subscriptionSettings.price.amount.toFixed(2),a=e.subscriptionSettings.recurringIntervalDays,s=10;return i.jsxs("div",{className:Xe.card,onClick:t,children:[i.jsxs("h2",{className:Xe.price,children:["$",u," ",i.jsxs("span",{className:Xe.interval,children:["/ ",r]})]}),i.jsx("h3",{className:Xe.name,children:e.name}),e.description&&i.jsx("p",{className:Xe.description,children:e.description}),n?i.jsxs("div",{className:Xe.currentPlan,children:[i.jsx(w.Icon,{name:"Check"}),"Your current Plan"]}):i.jsx(w.Button,{type:"Secondary",className:Xe.selectButton,children:"Select"}),n&&i.jsxs("div",{className:Xe.progressSection,children:[i.jsx(l0,{percent:s/a*100,disablePercentLabel:!0}),i.jsxs("p",{className:Xe.progressLabel,children:["Used: ",s," of ",a," days"]})]})]})},wd=({isOpen:e,setIsOpen:t,subscription:n})=>{const[r,u]=P.useState(null),[a,s]=P.useState(null),[o,c]=P.useState(null),{id:l,accessToken:h}=b.useParams(),[f,m]=P.useState(!1),[p,g]=P.useState(!1),{setIsOpen:x}=b.useModalStore();P.useEffect(()=>{e&&m(!0)},[e]);const C=()=>{t(!1)},[_,v]=P.useState(null);P.useEffect(()=>{l&&h&&(async()=>{if(l&&h){const{data:I}=await _2({id:l,accessToken:h});v(I)}})()},[l,h]),P.useEffect(()=>{var S;if(_!=null&&_.data.types[0]){const I=(S=_.data.types.flatMap(F=>F.productVariants).find(F=>F.data.id===(n==null?void 0:n.variantId)))==null?void 0:S.data;I&&(c(I),s(I))}},[_,n]),P.useEffect(()=>{_!=null&&_.data.types[0]&&u(_==null?void 0:_.data.types[0])},[_==null?void 0:_.data.types]);const y=S=>{u(S),s(null)},D=S=>{s(S),x(!0),g(!0)};return i.jsxs("div",{className:b.clx(Xe.modal,{[Xe.active]:e,[Xe.inactive]:!e&&f,[Xe.notMounted]:!f}),onClick:S=>S.stopPropagation(),children:[i.jsx(w.Icon,{name:"X",onClick:C,hoverable:!0,className:Xe.closeButton,fill:"var(--text-primary)"}),i.jsxs("div",{className:Xe.bottomSheet,children:[i.jsx("h3",{id:"h3",className:Xe.title,children:"Change Plan"}),i.jsx("p",{className:Xe.description,children:_==null?void 0:_.data.description}),i.jsx("div",{className:Xe.typeSelector,children:_==null?void 0:_.data.types.map(S=>i.jsxs("div",{className:b.clx(Xe.typeOption,{[Xe.active]:(r==null?void 0:r.id)===S.id}),onClick:()=>y(S),children:[S.name,S.name==="Yearly"&&i.jsx("span",{className:Xe.saveTag,children:"Save %"})]},S.id))}),r&&i.jsx("div",{className:Xe.planSelector,children:r.productVariants.map(S=>i.jsx(dw,{variant:S.data,isSelected:(a==null?void 0:a.id)===S.data.id,isCurrent:(o==null?void 0:o.id)===S.data.id,onSelect:()=>D(S.data)},S.data.id))})]}),p&&a&&n&&i.jsx(w.Modal,{close:()=>{g(!1)},children:i.jsx(Od,{setIsOpen:g,selectedVariant:a,subscription:n})})]})},fw="_container_nb625_1",hw="_title_nb625_11",pw="_subtitle_nb625_16",mw="_info_nb625_20",Fu={container:fw,title:hw,subtitle:pw,info:mw},Dd=()=>{const{subscription:e}=b.useSubscriptionStore(),[t,n]=b.extractDateAndTime((e==null?void 0:e.activeTo)||""),[r,u]=P.useState(!1),{setIsOpen:a}=b.useModalStore();return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:Fu.container,children:[i.jsxs("div",{className:Fu.info,children:[i.jsx("p",{className:Fu.title,children:"Expiration Date"}),i.jsxs("p",{className:Fu.subtitle,children:[t," at ",n]})]}),i.jsx(w.Button,{type:"Special",onClick:s=>{s.stopPropagation(),a(!0),u(!0)},children:"Extend"})]}),r&&i.jsx(w.Modal,{close:()=>u(!1),children:i.jsx(Hd,{setIsOpen:u})})]})},gw="_couponContainer_1sspa_1",bw="_iconWrapper_1sspa_10",_w="_details_1sspa_21",xw="_title_1sspa_25",Cw="_progress_1sspa_29",Ew="_foreverText_1sspa_34",or={couponContainer:gw,iconWrapper:bw,details:_w,title:xw,progress:Cw,foreverText:Ew},Ld=({coupon:e,currency:t})=>{const n=e.isFixed?b.formatPrice({amount:e.discount,currency:t}):`${e.discount}%`,r=e.initialCouponDurationForSubscriptions?b.percentageDifference(e.initialCouponDurationForSubscriptions,e.currentCouponDurationForSubscriptions||1):100;return i.jsxs("div",{className:or.couponContainer,children:[i.jsx("div",{className:or.iconWrapper,children:i.jsx(w.Icon,{name:"CheckCircle"})}),i.jsxs("div",{className:or.details,children:[i.jsxs("p",{className:or.title,children:[e.name,", ",n," discount"]}),i.jsx("div",{className:or.progress,children:i.jsx(l0,{color:"#C2C2C2",percent:r,disablePercentLabel:!0})}),i.jsx("p",{className:or.foreverText,children:"Forever discount code"})]})]})},Tw="_paymentMethodContainer_1g0da_4",yw="_paymentMethodTitle_1g0da_15",kw="_activeMethod_1g0da_20",Aw="_noMethod_1g0da_28",Sw="_activeMethodPaymentMethod_1g0da_37",Iw="_paymentMethodLogo_1g0da_47",Nw="_paymentMethodNumber_1g0da_57",vw="_method_1g0da_61",Rn={paymentMethodContainer:Tw,paymentMethodTitle:yw,activeMethod:kw,noMethod:Aw,activeMethodPaymentMethod:Sw,paymentMethodLogo:Iw,paymentMethodNumber:Nw,method:vw},ww="_paymentMethods_1gev0_1",Dw="_modal_1gev0_14",Lw="_header_1gev0_28",Pw="_content_1gev0_37",Zn={paymentMethods:ww,modal:Dw,header:Lw,content:Pw},Rw=e=>{const{setIsLoading:t,setIsOpen:n}=e,{subscription:r,setSubscription:u}=b.useSubscriptionStore();if(!r)return null;const{id:a}=b.useParams(),s=b.useNavigate(),{notifications:o,setNotifications:c}=b.useNotificationStore(),{setPaymentMethod:l,setGateway:h,cart:f}=su(),{setIsOpen:m}=b.useModalStore();async function p(){if(g(),t(!0),a&&r){const{data:x}=await g2(a,f.gateway);x.isReconnectPaymentNeeded?s(`/charges/${x.chargeId}`):(c([...o,{status:"success",id:b.v4(),message:"Your action has been successfully completed"}]),u({...r,gatewayName:f.gateway}))}else c([...o,{status:"error",id:b.v4(),message:"Your action has been failed. Try again!"}]);t(!1)}function g(){m(!1),setTimeout(()=>{n(!1)},300)}return i.jsxs("div",{className:Zn.modal,onClick:x=>{x.stopPropagation()},children:[i.jsxs("div",{className:Zn.header,children:[i.jsx("h3",{id:"h3",className:Zn.title,children:"Choose Payment Method"}),i.jsx(w.Icon,{name:"X",onClick:g,hoverable:!0,fill:"var(--text-primary)"})]}),i.jsxs("div",{className:Zn.content,children:[(r==null?void 0:r.availableGateways)&&i.jsx(oi,{possibleGateways:{availableGateways:r.availableGateways,requiresSignInGateways:r.availableGateways},setGateway:h,setPaymentMethod:l,totalAndDiscount:{total:(r==null?void 0:r.price.amount)||0,totalWithDiscount:r==null?void 0:r.price.amount},onSignInClick:()=>s("/customer-dash")}),i.jsxs("div",{className:Zn.paymentMethods,children:[i.jsx("div",{className:Zn.buttonWrapper,children:i.jsx(w.Button,{type:"Secondary",onClick:g,children:"Cancel"})}),i.jsx("div",{className:Zn.buttonWrapper,children:i.jsx(w.Button,{type:"Primary",disabled:!f.gateway,onClick:()=>p(),children:"Continue"})})]})]})]})},Ow="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20131.39%2086.9'%3e%3cdefs%3e%3cstyle%3e.a{opacity:0;}.b{fill:%23fff;}.c{fill:%23ff5f00;}.d{fill:%23eb001b;}.e{fill:%23f79e1b;}%3c/style%3e%3c/defs%3e%3ctitle%3eAsset%201%3c/title%3e%3cg%20class='a'%3e%3crect%20class='b'%20width='131.39'%20height='86.9'/%3e%3c/g%3e%3crect%20class='c'%20x='48.37'%20y='15.14'%20width='34.66'%20height='56.61'/%3e%3cpath%20class='d'%20d='M51.94,43.45a35.94,35.94,0,0,1,13.75-28.3,36,36,0,1,0,0,56.61A35.94,35.94,0,0,1,51.94,43.45Z'/%3e%3cpath%20class='e'%20d='M120.5,65.76V64.6H121v-.24h-1.19v.24h.47v1.16Zm2.31,0v-1.4h-.36l-.42,1-.42-1h-.36v1.4h.26V64.7l.39.91h.27l.39-.91v1.06Z'/%3e%3cpath%20class='e'%20d='M123.94,43.45a36,36,0,0,1-58.25,28.3,36,36,0,0,0,0-56.61,36,36,0,0,1,58.25,28.3Z'/%3e%3c/svg%3e",Pd=()=>{var g,x,C;const{subscription:e}=b.useSubscriptionStore(),{cart:t,setPaymentMethod:n}=su(),r=b.useNavigate(),[u,a]=P.useState(null),[s,o]=P.useState(!1),[c,l]=P.useState(!1),{setIsOpen:h}=b.useModalStore();if(!e)return null;const[f,m]=P.useState(e.gatewayName||t.gateway),p=t.paymentMethod;return P.useEffect(()=>{(async()=>{const v=await ou(e.availableGateways);a(v)})()},[]),P.useEffect(()=>{t.gateway!==f&&m(t.gateway)},[t.gateway]),i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:Rn.paymentMethodContainer,children:[i.jsxs("div",{children:[i.jsx("p",{className:Rn.paymentMethodTitle,children:"Active Payment Method"}),e.gatewayInfo&&Object.keys(e.gatewayInfo).length>0&&i.jsx(Mw,{gatewayInfo:e.gatewayInfo}),(!e.gatewayInfo||Object.keys(e.gatewayInfo).length===0)&&f==="Balance"&&i.jsx(si,{gateway:f,gatewayDisplayName:f,total:(e==null?void 0:e.price.amount)||0,onSignInClick:()=>r("/customer-dash")}),(!e.gatewayInfo||Object.keys(e.gatewayInfo).length===0)&&!f&&i.jsx("span",{className:Rn.noMethod,children:"Payment method is not set"}),(!e.gatewayInfo||Object.keys(e.gatewayInfo).length===0)&&f&&i.jsx("div",{className:Rn.activeMethod,children:u&&i.jsx(ii,{align:"row",gatewayLogoCfId:(g=u.find(_=>_.name===f))==null?void 0:g.logoCfImageId,gatewayDisplayName:(x=u.find(_=>_.name===f))==null?void 0:x.displayName,gateway:f,poweredByLogoCfId:(C=u.find(_=>_.name===f))==null?void 0:C.poweredByImageCfImageId,className:Rn.activeMethodPaymentMethod,selected:p===f,onSelect:_=>{n(_)}},f)})]}),i.jsx(w.Button,{type:"Special",onClick:_=>{_.stopPropagation(),h(!0),l(!0)},children:t.gateway?"Change":"Manage"})]}),c&&i.jsx(w.Modal,{close:()=>l(!1),children:i.jsx(Rw,{setIsLoading:o,setIsOpen:l})})]})},Mw=({gatewayInfo:e})=>{var t,n,r,u,a;return i.jsxs("div",{className:Rn.method,children:[i.jsxs("div",{className:Rn.paymentMethodLogo,children:[((t=e.card)==null?void 0:t.brand.toLowerCase())==="visa"&&i.jsx(Q6,{}),((n=e.card)==null?void 0:n.brand.toLowerCase())==="mastercard"&&i.jsx("img",{src:Ow,alt:"",width:22}),((r=e.card)==null?void 0:r.brand.toLowerCase())!=="visa"&&((u=e.card)==null?void 0:u.brand.toLowerCase())!=="mastercard"&&i.jsx(w.Icon,{name:"CreditCard",width:22})]}),i.jsxs("p",{className:Rn.paymentMethodNumber,children:["•••• •••• •••• ",(a=e.card)==null?void 0:a.last4]})]})},Fw="_subscriptionProductContainer_83ibx_4",Bw="_subscriptionProductImage_83ibx_15",jw="_subscriptionProductInfo_83ibx_32",Hw="_name_83ibx_37",Uw="_price_83ibx_40",jr={subscriptionProductContainer:Fw,subscriptionProductImage:Bw,subscriptionProductInfo:jw,name:Hw,price:Uw},Rd=({subscription:e,id:t,accessToken:n})=>{const[r,u]=P.useState(!1),{setIsOpen:a}=b.useModalStore();return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:jr.subscriptionProductContainer,onClick:s=>s.stopPropagation(),children:[i.jsx("div",{className:jr.subscriptionProductImage,children:e!=null&&e.image?i.jsx("img",{src:b.convertCfImageIdToUrl(e.image.cfId)}):i.jsx(w.Icon,{name:"Image"})}),i.jsxs("div",{className:jr.subscriptionProductInfo,children:[i.jsx("div",{className:"flex items-center gap-2",children:i.jsx("h2",{className:jr.name,children:e.name})}),i.jsxs("p",{className:jr.price,children:[b.formatPrice(e.price)," / ",e.recurringInterval]})]}),i.jsx(w.Button,{type:"Special",onClick:s=>{s.preventDefault(),u(!0),a(!0)},children:"Cancel"})]}),r&&i.jsx(w.Modal,{close:()=>u(!1),children:i.jsx(Ud,{accessToken:n,id:t,isOpen:r,setIsOpen:u})})]})},Vw="_content_5ctxw_1",$w="_selectedPlan_5ctxw_37",zw="_planName_5ctxw_44",qw="_description_5ctxw_48",Zw="_price_5ctxw_51",Ww="_buttonGroup_5ctxw_79",Yw="_buttonWrapper_5ctxw_84",Gw="_modal_5ctxw_88",Xw="_header_5ctxw_95",Xt={content:Vw,selectedPlan:$w,planName:zw,description:qw,price:Zw,buttonGroup:Ww,buttonWrapper:Yw,modal:Gw,header:Xw},Od=({setIsOpen:e,selectedVariant:t,subscription:n})=>{if(!t)return null;const{setIsOpen:r}=b.useModalStore(),u=()=>{a()},a=()=>{r(!1),setTimeout(()=>{e(!1)},300)},s=(t.subscriptionSettings.compareAtPrice||t.subscriptionSettings.price).amount,o=t.subscriptionSettings.compareAtPrice?t.subscriptionSettings.compareAtPrice.amount-t.subscriptionSettings.price.amount:t.subscriptionSettings.price.amount,c=s-o,l=new Intl.NumberFormat("en-US",{style:"currency",currency:n.price.currency});return i.jsxs("div",{className:Xt.modal,children:[i.jsxs("div",{className:Xt.header,children:[i.jsx("h3",{id:"h3",children:"Choose upgrade method"}),i.jsx(w.Icon,{name:"X",hoverable:!0,onClick:()=>a(),fill:"var(--text-primary)"})]}),i.jsxs("div",{className:Xt.bottomSheet,children:[i.jsxs("div",{className:Xt.content,children:[i.jsxs("div",{className:Xt.selectedPlan,children:[i.jsx("h2",{className:Xt.planName,children:t.name}),i.jsx("p",{className:Xt.description,children:t.description}),i.jsxs("p",{className:Xt.price,children:["$",t.subscriptionSettings.price.amount.toFixed(2)," /"," ",t.subscriptionSettings.recurringIntervalDays===30?"month":"year"]})]}),i.jsx(kr,{formatter:l,coupon:null,total:c,discount:o})]}),i.jsxs("div",{className:Xt.buttonGroup,children:[i.jsx("div",{className:Xt.buttonWrapper,children:i.jsx(w.Button,{type:"Secondary",onClick:()=>a(),children:"Stay with us"})}),i.jsx("div",{className:Xt.buttonWrapper,children:i.jsxs(w.Button,{type:"Primary",onClick:u,children:["Upgrade for $",c.toFixed(2)]})})]})]})]})},Kw="_orderStatusBlock_2wo4y_2",Qw="_orderStatusBlockAntistock_2wo4y_11",Jw="_iconWrapper_2wo4y_16",eD="_orderStatusTitle_2wo4y_26",tD="_orderStatusDescription_2wo4y_31",nD="_actionButtons_2wo4y_36",rD="_actionButton_2wo4y_36",uD="_button_2wo4y_47",rn={orderStatusBlock:Kw,orderStatusBlockAntistock:Qw,iconWrapper:Jw,orderStatusTitle:eD,orderStatusDescription:tD,actionButtons:nD,actionButton:rD,button:uD},aD={[Ie.New]:"New",[Ie.Pending]:"Order Pending",[Ie.Expired]:"Order Expired",[Ie.Cancelled]:"Order Canceled",[Ie.Failed]:"Order Failed",[Ie.FullDeliveryFailure]:"Delivery Failure",[Ie.PartiallyDelivered]:"Partial Delivery Failure",[Ie.Refunded]:"Order Refunded",[Ie.Completed]:"Order Completed"},sD={[Ie.New]:"Your order has been created and is awaiting payment.",[Ie.Pending]:"Your order is currently pending. We recommend checking back shortly for confirmation.",[Ie.Expired]:"Your order has expired due to the payment not being sent in time. If you already sent the payment, please contact us below.",[Ie.Cancelled]:"You canceled the warrant. If there are any problems, please contact support.",[Ie.Failed]:"Your order could not be processed due to a payment or system error. Please try again or contact support.",[Ie.FullDeliveryFailure]:"Your payment was successful but the product is currently out of stock. Please contact us below to get this sorted.",[Ie.PartiallyDelivered]:"Your payment was successful but some products were out of stock. Please contact us below to get this sorted.",[Ie.Refunded]:"Your order was refunded. Please check your payment method for confirmation.",[Ie.Completed]:"Your order has successfully been processed. View your products below or check your email for additional information."},Md=()=>({[Ie.Completed]:i.jsx(w.Icon,{name:"Check",fill:"var(--text-success)"}),[Ie.Pending]:i.jsx(w.Icon,{name:"Clock",fill:"var(--text-warning)"}),[Ie.New]:i.jsx(w.Icon,{name:"Clock",fill:"var(--text-warning)"}),[Ie.Expired]:i.jsx(w.Icon,{name:"XCircle",fill:"var(--text-action)"}),[Ie.Cancelled]:i.jsx(w.Icon,{name:"XCircle",fill:"var(--text-action)"}),[Ie.Failed]:i.jsx(w.Icon,{name:"XCircle",fill:"var(--text-action)"}),[Ie.FullDeliveryFailure]:i.jsx(w.Icon,{name:"Warning",fill:"var(--text-warning)"}),[Ie.PartiallyDelivered]:i.jsx(w.Icon,{name:"WarningDiamond",fill:"var(--text-warning)"}),[Ie.Refunded]:i.jsx(w.Icon,{name:"WarningDiamond",fill:"var(--text-warning)"})}),Fd=({orderStatus:e,className:t})=>{const{shopDomain:n}=b.useStorefrontStore(),{isAntistock:r}=b.useGeneralStore(),u=b.useNavigate();return i.jsxs("div",{className:b.clx(rn.orderStatusBlock,t,{[rn.orderStatusBlockAntistock]:r}),children:[i.jsx("div",{className:rn.iconWrapper,style:r?{background:"none"}:void 0,children:Md()[e]}),i.jsx("h2",{className:rn.orderStatusTitle,children:aD[e]}),i.jsx("p",{className:rn.orderStatusDescription,children:sD[e]}),i.jsxs("div",{className:rn.actionButtons,children:[i.jsx("div",{className:rn.actionButton,children:i.jsxs(w.Button,{type:"Secondary",className:rn.button,onClick:()=>window.open(`https://${n}`),style:{width:"100%",display:"flex",alignItems:"center",gap:"5px"},children:[i.jsx(w.Icon,{name:"ArrowLineUpRight"}),"Visit Website"]})}),i.jsx("div",{className:rn.actionButton,children:i.jsxs(w.Button,{type:"Secondary",className:rn.button,onClick:()=>{r?window.open(`https://${n}/support`):u("/contact")},style:{width:"100%",display:"flex",alignItems:"center",gap:"5px"},children:[i.jsx(w.Icon,{name:"ChatsTeardrop"}),"Contact Support"]})})]})]})},iD="_reviewMessage_1t8u4_1",oD="_leaveReviewContainer_1t8u4_11",cD="_leaveReviewTitle_1t8u4_20",ps={reviewMessage:iD,leaveReviewContainer:oD,leaveReviewTitle:cD},Bd=({review:e,orderId:t,className:n})=>{const[r,u]=P.useState((e==null?void 0:e.rating)||0),[a,s]=P.useState(!1),{setIsOpen:o}=b.useModalStore(),{notifications:c,setNotifications:l}=b.useNotificationStore(),h=async f=>{e&&"accessToken"in e&&(await k2({comment:f,rating:r,tsId:b.useGetTsId()},t,e.accessToken),l([...c,{status:"success",id:b.v4(),message:"Review left successfully"}]),s(!1))};return P.useEffect(()=>{e&&r&&"accessToken"in e&&!e.rating&&(o(!0),s(!0))},[r]),e?e.rating&&"accessToken"in e?i.jsxs("div",{className:ps.reviewMessage,children:["You left a ",e.rating," star rating"]}):i.jsxs("div",{className:b.clx(ps.leaveReviewContainer,n),children:[i.jsx("p",{className:ps.leaveReviewTitle,children:"Leave a review"}),i.jsx(w8,{rating:r,setRating:u,disabled:!!e.rating||!("accessToken"in e)}),a&&i.jsx(w.Modal,{close:()=>s(!1),children:i.jsx(jd,{setIsOpen:s,onSubmit:h})})]}):null},lD="_bottomSheet_1bcyj_1",dD="_content_1bcyj_7",fD="_title_1bcyj_18",hD="_buttonGroup_1bcyj_22",pD="_buttonWrapper_1bcyj_33",mD="_modal_1bcyj_37",gD="_header_1bcyj_44",In={bottomSheet:lD,content:dD,title:fD,buttonGroup:hD,buttonWrapper:pD,modal:mD,header:gD},jd=({setIsOpen:e,onSubmit:t})=>{const[n,r]=P.useState(""),{setIsOpen:u}=b.useModalStore(),a=()=>{u(!1),setTimeout(()=>{e(!1)},300)};return i.jsxs("div",{className:In.modal,onClick:s=>s.stopPropagation(),children:[i.jsxs("div",{className:In.header,children:[i.jsx("h3",{id:"h3",className:In.title,children:"Review Description"}),i.jsx(w.Icon,{name:"X",hoverable:!0,onClick:a,fill:"var(--text-primary)"})]}),i.jsxs("div",{className:In.bottomSheet,children:[i.jsx("div",{className:In.content,children:i.jsx(w.Textarea,{placeholder:"Great product and fast checkout...",value:n,onChange:s=>r(s),label:"Describe your review in detail below"})}),i.jsxs("div",{className:In.buttonGroup,children:[i.jsx("div",{className:In.buttonWrapper,children:i.jsx(w.Button,{type:"Secondary",onClick:a,children:"Cancel"})}),i.jsx("div",{className:In.buttonWrapper,children:i.jsx(w.Button,{type:"Primary",disabled:!n,onClick:()=>{a(),t(n)},children:"Submit"})})]})]})]})},bD="_container_1idhv_1",_D="_buttonGroup_1idhv_8",xD="_buttonWrapper_1idhv_15",CD="_header_1idhv_19",ED="_content_1idhv_28",Wn={container:bD,buttonGroup:_D,buttonWrapper:xD,header:CD,content:ED},TD="_modal_1rkmj_1",yD="_modalPayment_1rkmj_7",kD="_title_1rkmj_15",AD="_description_1rkmj_20",Bu={modal:TD,modalPayment:yD,title:kD,description:AD},Fi=()=>i.jsxs("div",{className:b.clx(Bu.modal,Bu.modalPayment),onClick:e=>e.stopPropagation(),children:[i.jsx(w.Loader,{style:{border:"4px solid var(--surface-action1)",borderLeftColor:"var(--surface-secondary)",width:"40px",height:"40px"}}),i.jsx("h2",{id:"h3",className:Bu.title,children:"Processing Payment"}),i.jsx("p",{className:Bu.description,children:"This payment is currently being processed. If you're here, it simply means that the payment was created but not complete."})]}),Hd=({setIsOpen:e})=>{const{subscription:t}=b.useSubscriptionStore(),{getTotalAndDiscount:n,cart:r,coupon:u}=su(),[a,s]=P.useState(1),o=b.useNavigate(),{setIsOpen:c}=b.useModalStore(),{setNotifications:l,notifications:h}=b.useNotificationStore(),[f,m]=P.useState(!1),p=P.useMemo(()=>n(),[u,r]),g=P.useMemo(()=>p.totalWithDiscount?p.total-p.totalWithDiscount:0,[p]);if(f)return i.jsx(Fi,{});const x=(t==null?void 0:t.price.currency)||"USD",C=new Intl.NumberFormat("en-US",{style:"currency",currency:x});async function _(){var y;m(!0);try{const{data:D}=await x2((t==null?void 0:t.id)||"",{});l([{id:b.v4(),message:"Order created successfully",status:"success"}]),o(`/orders/${(y=D.data)==null?void 0:y.id}/${D.data.fullAccessToken}`)}catch(D){const S=D;l([...h,{id:b.v4(),message:`Order creation failed: ${S.message}`,status:"error"}]),v()}finally{m(!1)}}function v(){c(!1),setTimeout(()=>{e(!1)},300)}return i.jsxs("div",{className:Wn.container,onClick:y=>y.stopPropagation(),children:[i.jsxs("div",{className:Wn.header,children:[i.jsx("h3",{id:"h3",className:Wn.title,children:"Extend Subscription"}),i.jsx(w.Icon,{name:"X",onClick:v,hoverable:!0,fill:"var(--text-primary)"})]}),i.jsxs("div",{className:Wn.content,children:[i.jsx(V8,{step:a,totalSteps:12,onStepChange:s,label:"How long would you like to extend your subscription for?"}),i.jsx(kr,{formatter:C,coupon:u,total:p.total,discount:g,totalWithDiscount:p.totalWithDiscount}),i.jsxs("div",{className:Wn.buttonGroup,children:[i.jsx("div",{className:Wn.buttonWrapper,children:i.jsx(w.Button,{type:"Secondary",onClick:v,children:"Cancel"})}),i.jsx("div",{className:Wn.buttonWrapper,children:i.jsx(w.Button,{type:"Primary",onClick:_,children:"Extend"})})]})]})]})},SD="_bottomSheet_uw5jb_1",ID="_content_uw5jb_7",ND="_radioGroup_uw5jb_11",vD="_confirmation_uw5jb_26",wD="_iconWrapper_uw5jb_33",DD="_title_uw5jb_42",LD="_message_uw5jb_48",PD="_buttonGroup_uw5jb_54",RD="_buttonWrapper_uw5jb_64",OD="_modal_uw5jb_68",MD="_header_uw5jb_77",rt={bottomSheet:SD,content:ID,radioGroup:ND,confirmation:vD,iconWrapper:wD,title:DD,message:LD,buttonGroup:PD,buttonWrapper:RD,modal:OD,header:MD},FD={0:"Are you sure?",1:"Just making sure",2:"We're sorry to see you go"},Ud=({isOpen:e,setIsOpen:t,id:n,accessToken:r})=>{const[u,a]=P.useState(0),[s,o]=P.useState(!1),[c,l]=P.useState(""),[h,f]=P.useState(""),{setIsOpen:m}=b.useModalStore(),p=async()=>{if(!c)return;o(!0);const x=await m2(n,r,{reason:c==="Other reason"?h:c});o(!1),x&&a(2)};P.useEffect(()=>{e||(a(0),l(""),f(""))},[e]);const g=()=>{m(!1),setTimeout(()=>{t(!1)},300)};return i.jsxs("div",{className:rt.modal,onClick:x=>x.stopPropagation(),children:[i.jsxs("div",{className:rt.header,children:[i.jsx("h3",{id:"h3",children:FD[u]||""}),i.jsx(w.Icon,{name:"X",onClick:g,hoverable:!0,fill:"var(--text-primary)"})]}),i.jsxs("div",{className:rt.content,children:[u===0&&i.jsxs("div",{className:rt.bottomSheet,children:[i.jsx("p",{children:"Before you cancel your subscription can you tell us why?"}),i.jsxs("div",{className:rt.radioGroup,children:[i.jsx(w.Radio,{defaultValue:c,onChange:x=>l(x),options:[{value:"Found another company",label:"Found another company"},{value:"Expensive",label:"Expensive"},{value:"Technical problems",label:"Technical problems"},{value:"Support problems",label:"Support problems"},{value:"Other reason",label:"Other reason"}],flexDirection:"column"}),c==="Other reason"&&i.jsx(w.Textarea,{value:h,onChange:x=>f(x),placeholder:"Describe the reason..."})]}),i.jsxs("div",{className:rt.buttonGroup,children:[i.jsx("div",{className:rt.buttonWrapper,children:i.jsx(w.Button,{type:"Secondary",onClick:g,children:"Stay with us"})}),i.jsx("div",{className:rt.buttonWrapper,children:i.jsx(w.Button,{type:"Primary",onClick:()=>c&&a(1),disabled:!c,children:"Continue"})})]})]}),u===1&&i.jsxs("div",{className:rt.bottomSheet,children:[i.jsx("p",{children:"You'll lose access to all of the features and content available within this subscription."}),i.jsxs("div",{className:rt.buttonGroup,children:[i.jsx("div",{className:rt.buttonWrapper,children:i.jsx(w.Button,{type:"Secondary",onClick:g,children:"Stay with us"})}),i.jsx("div",{className:rt.buttonWrapper,children:i.jsx(w.Button,{type:"Primary",onClick:p,disabled:s,children:"Cancel it anyway"})})]})]}),u===2&&i.jsxs("div",{className:rt.bottomSheet,children:[i.jsxs("div",{className:`${rt.confirmation}`,children:[i.jsx("div",{className:rt.iconWrapper,children:i.jsx(w.Icon,{name:"Check",fill:"var(--text-success)"})}),i.jsx("p",{className:rt.title,children:"Subscription Cancelled"}),i.jsx("p",{className:rt.message,children:"You'll lose access to all of the features and content available within this subscription."})]}),i.jsx("div",{className:rt.buttonGroup,children:i.jsx("div",{className:rt.buttonWrapper,children:i.jsx(w.Button,{type:"Secondary",onClick:g,children:"Close"})})})]})]})]})},BD=Object.freeze(Object.defineProperty({__proto__:null,ActivePaymentMethod:Pd,ActiveSubscriptionProduct:Rd,Auth:ui,AuthLogin:t0,AuthModal:g0,AuthRequestOtp:e0,CHARGE_STATUS_DESCRIPTION:Ed,CHARGE_STATUS_DISPLAY_NAME:Gn,CancelSubscription:Ud,CashAppVerify:Sd,ChangeSubscriptionPlan:wd,ChargeBlocksRenderer:ea,ChargeItems:Ad,ChargeStatusBlock:yd,CheckoutBalancePaymentMethod:si,CheckoutFooter:Hn,CheckoutHeader:ma,CheckoutItems:f0,CheckoutOperational:xd,CheckoutOrderMainData:Oi,CheckoutPaymentMethod:ii,CheckoutPrices:kr,CheckoutProduct:ga,ChoosePlanUpgradeMethod:Od,ConnectDiscord:m0,CustomField:p0,CustomFields:h0,CustomerDashboard:Im,LeaveAReview:Bd,NoItemsBlock:ha,OpenDelivery:Cd,OrderStatusBlock:Fd,OrdersTable:s0,PageLoading:Rv,PageTitle:fa,Pagination:i0,PaginationWithRange:fu,PayPalFFNote:kd,PaymentMethods:oi,ProcessingPaymentModal:Fi,ProtectYourCheckout:_d,ReferralBlock:n0,ReferralBlockInfo:u0,ReferralBlockSteps:r0,SecuredBySsl:Ri,Sidebar:Ol,SkeletonReferralBlock:a0,StatItem:At,StatusIndicator:c0,StatusVariant:Bn,SubmitReview:jd,SubscriptionCoupon:Ld,SubscriptionExpiration:Hd,SubscriptionExpirationDate:Dd,SubscriptionProduct:vd,SubscriptionStatusBadge:Mi,SubscriptionsTable:Nd,Table:pa,TableItem:ot,TableItemTitle:Nt,TermsOfService:Pi,TicketRow:Id,TrackPayment:va,getChargeStatusIcon:Td,getOrderStatusIcon:Md,getPaginationText:o0},Symbol.toStringTag,{value:"Module"})),jD="_chargePageContainer_1azbl_1",HD="_chargeItems_1azbl_14",UD="_mainContent_1azbl_25",VD="_contentWrapper_1azbl_44",$D="_antistockContent_1azbl_53",zD="_statusBlock_1azbl_58",qD="_statusBlockAntistock_1azbl_63",ZD="_notPaidSection_1azbl_68",WD="_antistockPayNow_1azbl_82",YD="_antistockFooter_1azbl_86",GD="_antistockTrackPayment_1azbl_96",XD="_footer_1azbl_106",KD="_loaderContainer_1azbl_128",Pt={chargePageContainer:jD,chargeItems:HD,mainContent:UD,contentWrapper:VD,antistockContent:$D,statusBlock:zD,statusBlockAntistock:qD,notPaidSection:ZD,antistockPayNow:WD,antistockFooter:YD,antistockTrackPayment:GD,footer:XD,loaderContainer:KD},QD=()=>{const{id:e}=b.useParams(),[t,n]=b.useSearchParams(),[r,u]=P.useState(!1),[a,s]=P.useState(),[o,c]=P.useState(!0),l=b.useNavigate(),h=P.useRef(),f=P.useRef(!1),{setIsOpen:m}=b.useModalStore(),{isAntistock:p}=b.useGeneralStore();return P.useEffect(()=>{const g=async(C,_=!1)=>{_||u(!0);const{data:v}=await A2(C);u(!1),s(v)},x=setInterval(()=>{e&&g(e,!0)},5e3);return e&&g(e),()=>{clearInterval(x)}},[]),P.useEffect(()=>{const g=setTimeout(()=>{var C;console.log("charge timeout",a);const x=t.get("redirectRoute");if((a==null?void 0:a.status)===ye.Paid&&a.redirectUrl&&!h.current){const v=JSON.parse(localStorage.getItem("orders")||"{}")[((C=a==null?void 0:a.order)==null?void 0:C.id)||""];v?window.open(v.fullAccessToken?`${a.redirectUrl}/${v.fullAccessToken}`:`${a.redirectUrl}`,"_self"):window.open(a.redirectUrl,"_self")}(a==null?void 0:a.status)===ye.Paid&&h.current&&(console.log("redirectRouteRef.current",h.current),l(h.current,{replace:!0})),x&&h&&(h.current=x,t.delete("redirectRoute"),n(t))},1e3);return()=>clearTimeout(g)},[a]),P.useEffect(()=>{((a==null?void 0:a.gateway)==="PayPalFF"||(a==null?void 0:a.gateway)==="Сashapp")&&m(!0)},[a]),P.useEffect(()=>{var g;if(a!=null&&a.displayPaymentInfo&&a.displayPaymentInfo.length===1&&a.status===ye.NotPaid&&!f.current){const x=a.displayPaymentInfo[0];x.type==="Button"&&((g=x.props)!=null&&g.url)&&(window.open(x.props.url,"_blank"),f.current=!0)}},[a==null?void 0:a.displayPaymentInfo,a==null?void 0:a.status]),r?i.jsx("div",{className:Pt.loaderContainer,children:i.jsx(w.Loader,{})}):i.jsxs("div",{className:Pt.chargePageContainer,children:[i.jsx("div",{className:Pt.chargeItems,children:i.jsx(Ad,{charge:a})}),i.jsx("div",{className:Pt.mainContent,style:p?{borderLeft:"1px solid var(--border-secondary)"}:void 0,children:i.jsxs("div",{className:b.clx(Pt.contentWrapper,{[Pt.antistockContent]:p}),children:[a&&(a==null?void 0:a.status)!==ye.NotPaid&&i.jsx(yd,{charge:a}),a&&i.jsxs("div",{className:b.clx(Pt.statusBlock,{[Pt.statusBlockAntistock]:p}),children:[i.jsx(Oi,{lastUpdate:a.expiresAt,email:a.customerForCharge.email,invoiceId:a.id,paymentType:a.gateway}),p&&(a==null?void 0:a.status)===ye.NotPaid&&i.jsx("div",{className:Pt.antistockPayNow,children:a==null?void 0:a.displayPaymentInfo.map((g,x)=>i.jsx(ea,{block:g},x))}),p&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:Pt.antistockTrackPayment,children:i.jsx(va,{timeline:a.timeline})}),i.jsx(Hn,{className:Pt.antistockFooter})]})]}),!p&&(a==null?void 0:a.status)===ye.NotPaid&&i.jsx("div",{className:Pt.notPaidSection,children:a==null?void 0:a.displayPaymentInfo.map((g,x)=>i.jsx(ea,{block:g},x))}),!p&&i.jsx(Hn,{className:Pt.footer})]})}),(a==null?void 0:a.gateway)==="PayPalFF"&&o&&i.jsx(w.Modal,{close:()=>c(!1),children:i.jsx(kd,{price:a.price,setIsOpen:c})}),(a==null?void 0:a.gateway)==="Сashapp"&&o&&i.jsx(w.Modal,{close:()=>u(!1),children:i.jsx(Sd,{setIsOpen:c,chargeId:a.id})})]})},JD=Object.freeze(Object.defineProperty({__proto__:null,ChargePage:QD},Symbol.toStringTag,{value:"Module"}));exports.ActivePaymentMethod=Pd;exports.ActiveSubscriptionProduct=Rd;exports.BalanceModal=$l;exports.ChangeSubscriptionPlan=wd;exports.ChargeStatus=ye;exports.CheckoutFooter=Hn;exports.CheckoutHeader=ma;exports.CheckoutItems=f0;exports.CheckoutOperational=xd;exports.CheckoutOrderMainData=Oi;exports.CheckoutPrices=kr;exports.CheckoutProduct=ga;exports.LeaveAReview=Bd;exports.MarkdownText=la;exports.NoItemsBlock=ha;exports.OrderStatus=Ie;exports.OrderStatusBlock=Fd;exports.OrdersTable=s0;exports.PageTitle=fa;exports.PaginationWithRange=fu;exports.ReCaptchaProvider=Gs;exports.StableText=Gc;exports.SubscriptionCoupon=Ld;exports.SubscriptionExpirationDate=Dd;exports.SubscriptionProduct=vd;exports.SubscriptionsTable=Nd;exports.Table=pa;exports.TableItemTitle=Nt;exports.TicketRow=Id;exports.TrackPayment=va;exports.auth=I2;exports.fetchAuthorizedOrder=o2;exports.fetchGeneral=Zd;exports.fetchOrder=i2;exports.fetchOrders=s2;exports.fetchPrivacyPolicy=u2;exports.fetchRefundPolicy=r2;exports.fetchSubscription=h2;exports.fetchSubscriptions=b2;exports.fetchTerms=n2;exports.fetchThemeAndSettings=Wd;exports.fetchTicket=C2;exports.fetchTickets=T2;exports.getBalance=aa;exports.getBalanceSettings=ol;exports.getGatewaysDetail=ou;exports.index=BD;exports.index$1=JD;exports.parseDraftJsText=il;exports.recapcha=gf;exports.sendTicketMessage=E2;exports.useCart=su;exports.useCopy=Jn;exports.useGeneralInfo=nl;exports.useMarkdownIt=Rl;exports.useReCaptcha=iu;
|
|
109
|
+
`):t.deliveryItems[0].textData,o=()=>{u(!1),a?e(!1):setTimeout(()=>{e(!1)},300)};return i.jsxs("div",{className:b.clx(at.modal,{[at.modalAntistock]:a}),onClick:c=>c.stopPropagation(),children:[i.jsxs("div",{className:at.header,children:[i.jsx("h3",{id:"h3",className:at.title,children:a?"View Content":"Thank you for the purchase!"}),i.jsx(w.Icon,{name:"X",hoverable:!0,onClick:o,fill:"var(--text-primary)"})]}),i.jsxs("div",{className:at.bottomSheet,children:[i.jsx("div",{className:at.content,children:r?i.jsx("div",{className:at.discordMessage,children:i.jsx("p",{className:at.discordMessageTitle,id:"md",children:"Discord role has been granted"})}):i.jsxs("div",{children:[i.jsxs("div",{className:at.section,children:[!a&&i.jsx("p",{className:at.contentTitle,id:"md",children:"Content"}),!a&&i.jsxs(w.Button,{className:at.copyButton,type:"Secondary",onClick:()=>n(s),children:[i.jsx(w.Icon,{name:"Copy"}),"Copy to Clipboard"]})]}),i.jsx("div",{className:b.clx(at.scrollableBox,{[at.scrollableBoxAntistock]:a}),children:i.jsx("p",{className:at.contentText,id:"md",children:a?i.jsx(la,{text:s}):i.jsx(Ti,{remarkPlugins:[S1],rehypePlugins:[bd],components:{a:({node:c,...l})=>i.jsx("a",{...l,target:"_blank",rel:"noopener noreferrer",className:at.link})},children:s})})})]})}),a&&i.jsxs(w.Button,{className:at.copyButtonAntistock,type:"Secondary",onClick:()=>n(s),style:{display:"flex",alignItems:"center",gap:"5px"},children:[i.jsx(w.Icon,{name:"Copy"}),"Copy All"]}),!a&&i.jsx("div",{className:at.buttonGroup,children:i.jsx("div",{className:at.buttonWrapper,children:i.jsx(w.Button,{type:"Secondary",onClick:o,children:"Close"})})})]})]})},AI="_mt1_1l62z_1",SI="_notifyBlock_1l62z_13",II="_notifyHeader_1l62z_19",NI="_notifyContent_1l62z_25",vI="_buttonBlock_1l62z_30",wI="_imageBlock_1l62z_34",DI="_imageContainer_1l62z_42",LI="_sectionBlock_1l62z_54",PI="_sectionTitle_1l62z_61",RI="_sectionSubtitle_1l62z_64",OI="_inputContainer_1l62z_69",Qt={mt1:AI,notifyBlock:SI,notifyHeader:II,notifyContent:NI,buttonBlock:vI,imageBlock:wI,imageContainer:DI,sectionBlock:LI,sectionTitle:PI,sectionSubtitle:RI,inputContainer:OI},MI=({props:e})=>{const t=Jn();return i.jsx("div",{className:Qt.mt1,children:i.jsxs("div",{className:Qt.inputContainer,children:[i.jsx(w.Input,{value:e.text,disabled:!0,onChange:()=>{}}),e.shownCopyButton&&i.jsx(w.Button,{type:"Secondary",onClick:()=>t(e.text),children:i.jsx(w.Icon,{name:"Copy"})})]})})},FI=({props:e})=>i.jsx(w.Button,{className:Qt.buttonBlock,onClick:()=>window.open(e.url,"_blank","noopener"),children:e.text}),BI=({props:e})=>i.jsx("div",{className:Qt.imageBlock,children:i.jsx("div",{className:Qt.imageContainer,children:i.jsx("img",{src:e.src,alt:""})})}),jI=({props:e})=>i.jsxs("div",{className:Qt.notifyBlock,children:[i.jsxs("div",{className:Qt.notifyHeader,children:[i.jsx(w.Icon,{name:"Info",width:24,height:24,fill:"var(--text-secondary)"}),i.jsx("p",{children:e.heading})]}),i.jsx("p",{className:Qt.notifyContent,children:e.content})]}),HI=({props:e})=>{var t;return i.jsxs("div",{className:Qt.sectionBlock,children:[i.jsx("p",{className:Qt.sectionTitle,children:e.title}),i.jsx("span",{className:Qt.sectionSubtitle,children:e.subTitle}),(t=e.children)==null?void 0:t.map((n,r)=>i.jsx(ea,{block:n},r))]})},ea=({block:e})=>{switch(e.type){case"Section":return i.jsx(HI,{...e});case"ReadOnlyTextInput":return i.jsx(MI,{...e});case"Notify":return i.jsx(jI,{...e});case"Button":return i.jsx(FI,{...e});case"Image":return i.jsx(BI,{...e});default:return null}},UI="_chargeStatusBlock_12swd_4",VI="_isAntistock_12swd_13",$I="_chargeStatusIcon_12swd_19",zI="_chargeStatusTitle_12swd_27",qI="_chargeStatusDescription_12swd_33",ZI="_pickUpButton_12swd_39",WI="_actionButtons_12swd_49",YI="_actionButton_12swd_49",It={chargeStatusBlock:UI,isAntistock:VI,chargeStatusIcon:$I,chargeStatusTitle:zI,chargeStatusDescription:qI,pickUpButton:ZI,actionButtons:WI,actionButton:YI},Gn={[ye.Paid]:"Payment Successful",[ye.Pending]:"Payment Pending",[ye.Expired]:"Payment Expired",[ye.Cancelled]:"Payment Cancelled",[ye.NotPaid]:"Payment Failed",[ye.Refunded]:"Payment Refunded"},Ed={[ye.Paid]:"Your payment has successfully been processed. Tap on the button below to be redirected back to our website.",[ye.Pending]:"Your payment is currently pending. We recommend checking back shortly for confirmation.",[ye.Expired]:"Your payment has expired due to the payment not being sent in time. If you already sent the payment, please contact us below.",[ye.Cancelled]:"You canceled the warrant. If there are any problems, please contact support",[ye.NotPaid]:"Your payment has expired due to the payment not being sent in time. If you already sent the payment, please contact us below.",[ye.Refunded]:"Your payment has been refunded. Please check your payment method for confirmation."},Td=()=>({[ye.Paid]:i.jsx("div",{className:`${It.chargeStatusIcon}`,children:i.jsx(w.Icon,{name:"Check",fill:"var(--text-success)"})}),[ye.Pending]:i.jsx("div",{className:It.chargeStatusIcon,children:i.jsx(w.Icon,{name:"Clock",fill:"var(--text-warning)"})}),[ye.Expired]:i.jsx("div",{className:It.chargeStatusIcon,children:i.jsx(w.Icon,{name:"XCircle",fill:"var(--text-action)"})}),[ye.Cancelled]:i.jsx("div",{className:It.chargeStatusIcon,children:i.jsx(w.Icon,{name:"XCircle",fill:"var(--text-action)"})}),[ye.NotPaid]:i.jsx("div",{className:It.chargeStatusIcon,children:i.jsx(w.Icon,{name:"XCircle",fill:"var(--text-action)"})}),[ye.Refunded]:i.jsx("div",{className:It.chargeStatusIcon,children:i.jsx(w.Icon,{name:"XCircle",fill:"var(--text-warning)"})})}),yd=({charge:e})=>{var p,g;const t=e.status,n=b.useNavigate(),{shopDomain:r}=b.useStorefrontStore(),{isAntistock:u,general:a}=b.useGeneralStore(),s=P.useRef(),o=!!((p=a==null?void 0:a.info)!=null&&p.disableSupport),c=(g=a==null?void 0:a.info)==null?void 0:g.thirdPartySupportUrl,l=!(o&&!c),[h,f]=b.useSearchParams(),m=()=>{var C,_;if(!((C=e.order)!=null&&C.id))return;const x=h.get("redirectRoute");if((e==null?void 0:e.status)===ye.Paid&&e.redirectUrl&&!s.current){const y=JSON.parse(localStorage.getItem("orders")||"{}")[((_=e==null?void 0:e.order)==null?void 0:_.id)||""];y?window.open(y.fullAccessToken?`${e.redirectUrl}/${y.fullAccessToken}`:`${e.redirectUrl}`,"_self"):window.open(e.redirectUrl,"_self")}(e==null?void 0:e.status)===ye.Paid&&s.current&&n(s.current,{replace:!0}),x&&s&&(s.current=x,h.delete("redirectRoute"),f(h))};return i.jsxs("div",{className:b.clx(It.chargeStatusBlock,{[It.isAntistock]:u}),children:[Td()[t],i.jsx("h2",{className:It.chargeStatusTitle,children:Gn[t]}),i.jsx("p",{className:It.chargeStatusDescription,children:Ed[t]}),t===ye.Paid?i.jsx("div",{className:It.pickUpButton,style:u?{justifyContent:"flex-start"}:void 0,children:i.jsxs(w.Button,{onClick:m,style:{width:"100%",maxWidth:"250px",display:"flex",alignItems:"center",gap:"5px"},type:"Secondary",children:[i.jsx(w.Icon,{name:"ArrowLineUpRight"}),u?"View Order":"Pick up Order"]})}):i.jsxs("div",{className:It.actionButtons,children:[i.jsx("div",{className:It.actionButton,children:i.jsxs(w.Button,{type:"Secondary",onClick:()=>window.open(`https://${r}`),style:{width:"100%",display:"flex",alignItems:"center",gap:"5px"},children:[i.jsx(w.Icon,{name:"ArrowLineUpRight"}),"Visit Website"]})}),l&&i.jsx("div",{className:It.actionButton,children:i.jsxs(w.Button,{type:"Secondary",style:{width:"100%",display:"flex",alignItems:"center",gap:"5px"},onClick:()=>{o&&c?window.open(c):u?window.open(`https://${r}/support`):n("/contact")},children:[i.jsx(w.Icon,{name:"ChatsTeardrop"}),"Contact Support"]})})]})]})},GI="_bottomSheet_1x4sq_1",XI="_content_1x4sq_8",KI="_agreementList_1x4sq_11",QI="_agreementItem_1x4sq_16",JI="_warning_1x4sq_23",eN="_buttonGroup_1x4sq_31",tN="_buttonWrapper_1x4sq_41",nN="_fullWidthButton_1x4sq_44",rN="_modal_1x4sq_48",uN="_header_1x4sq_55",Vt={bottomSheet:GI,content:XI,agreementList:KI,agreementItem:QI,warning:JI,buttonGroup:eN,buttonWrapper:tN,fullWidthButton:nN,modal:rN,header:uN},kd=({setIsOpen:e,price:t})=>{const[n,r]=P.useState({agreeToSendAsFF:!1,agreeToSend:!1,agreeToNotAddNote:!1}),{setIsOpen:u}=b.useModalStore(),a=()=>{u(!1),setTimeout(()=>{e(!1)},300)};return i.jsxs("div",{className:Vt.modal,onClick:s=>s.stopPropagation(),children:[i.jsxs("div",{className:Vt.header,children:[i.jsx("h3",{id:"h3",children:"Note"}),i.jsx(w.Icon,{name:"X",hoverable:!0,onClick:a,fill:"var(--text-primary)"})]}),i.jsxs("div",{className:Vt.bottomSheet,children:[i.jsxs("div",{className:Vt.content,children:[i.jsxs("div",{className:Vt.agreementList,children:[i.jsxs("label",{className:Vt.agreementItem,children:[i.jsx(w.CheckboxSettings,{value:n.agreeToSendAsFF,onChange:s=>r({...n,agreeToSendAsFF:s})}),i.jsx("p",{children:"I agree to send the payment as friends & family"})]}),i.jsxs("label",{className:Vt.agreementItem,children:[i.jsx(w.CheckboxSettings,{value:n.agreeToSend,onChange:s=>r({...n,agreeToSend:s})}),i.jsxs("p",{children:["I agree to send the payment of ",b.formatPrice(t)," ",t.currency]})]}),i.jsxs("label",{className:Vt.agreementItem,children:[i.jsx(w.CheckboxSettings,{value:n.agreeToNotAddNote,onChange:s=>r({...n,agreeToNotAddNote:s})}),i.jsx("p",{children:"I agree to not add a note to this payment"})]})]}),i.jsx("div",{className:Vt.warning,children:i.jsxs("p",{children:["Please note that you are required to send the exact payment of ",b.formatPrice(t)," ",t.currency,". If you were to send any amount over or below, your funds will be lost."]})})]}),i.jsxs("div",{className:Vt.buttonGroup,children:[i.jsx("div",{className:Vt.buttonWrapper,children:i.jsx(w.Button,{type:"Secondary",children:i.jsx("span",{className:"text-[var(--text-secondary)]",children:"Cancel"})})}),i.jsx("div",{className:Vt.fullWidthButton,children:i.jsx(w.Button,{type:"Primary",disabled:!(n.agreeToSendAsFF&&n.agreeToNotAddNote&&n.agreeToSend),onClick:a,children:"Continue to Payment"})})]})]})]})},aN="_chargeItemsContainer_vynct_5",sN="_chargeItemsInner_vynct_18",iN="_productsContainer_vynct_25",oN="_antistockLayout_vynct_40",cN="_mainContentAntistock_vynct_53",lN="_desktopTrackPayment_vynct_64",dN="_desktopFooter_vynct_73",fN="_footerContainerAntistock_vynct_94",hN="_chargeHeader_vynct_107",pN="_chargeTitle_vynct_115",mN="_chargeDescription_vynct_121",gN="_copyButton_vynct_127",bN="_productsList_vynct_139",_N="_footerContainer_vynct_94",yt={chargeItemsContainer:aN,chargeItemsInner:sN,productsContainer:iN,antistockLayout:oN,mainContentAntistock:cN,desktopTrackPayment:lN,desktopFooter:dN,footerContainerAntistock:fN,chargeHeader:hN,chargeTitle:pN,chargeDescription:mN,copyButton:gN,productsList:bN,footerContainer:_N},Ad=({charge:e})=>{var s;const t=Jn(),{isAntistock:n}=b.useGeneralStore(),r=(e==null?void 0:e.price.currency)||"USD",u=new Intl.NumberFormat("en-US",{style:"currency",currency:r}),a=P.useMemo(()=>{var o;return((o=e==null?void 0:e.order)==null?void 0:o.partOrders.map(c=>{var l,h,f,m;return{id:(c==null?void 0:c.id)||0,image:c.productWithVariant.image,name:(()=>{var x,C;const p=((x=c.productWithVariant)==null?void 0:x.name)||"",g=((C=c.productWithVariant)==null?void 0:C.variantName)||"";return!p&&!g?"":!g||p===g?p:p?`${p} (${g})`:g})(),description:"",price:{quantity:c.quantity,amount:((l=c.productWithVariant)==null?void 0:l.price.amount)||0,currency:(h=c.productWithVariant)==null?void 0:h.price.currency},subscriptionSettings:(f=e.order)!=null&&f.subscriptionOrderId?(m=c.productWithVariant)==null?void 0:m.subscriptionSettings:null}}))||[]},[e]);return i.jsx("div",{className:yt.chargeItemsContainer,children:i.jsxs("div",{className:yt.chargeItemsInner,children:[i.jsx(ma,{expiresAt:e==null?void 0:e.expiresAt}),i.jsxs("div",{className:`${yt.productsContainer} ${n?yt.antistockLayout:""}`,children:[(e==null?void 0:e.name)&&i.jsxs("header",{className:yt.chargeHeader,children:[i.jsxs("div",{children:[i.jsx("h1",{className:yt.chargeTitle,id:"h5",children:e.name}),e.description&&i.jsx("p",{className:yt.chargeDescription,id:"md",children:e.description})]}),((s=e.order)==null?void 0:s.id)&&!n&&i.jsxs(w.Button,{type:"Secondary",className:yt.copyButton,onClick:()=>{var o;return t(((o=e.order)==null?void 0:o.id)||"")},children:[i.jsx(w.Icon,{name:"Copy"}),"Copy Order ID"]})]}),i.jsxs("div",{className:n?yt.mainContentAntistock:"",style:n?void 0:{flex:1},children:[!!a.length&&i.jsx("div",{className:yt.productsList,children:a.map(o=>i.jsx(ga,{product:o},o.id))}),i.jsx(kr,{formatter:u,coupon:null,total:(e==null?void 0:e.price.amount)||0,discount:0,totalWithDiscount:(e==null?void 0:e.price.amount)||0,isShowSubtotal:!1}),n&&e&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:yt.desktopTrackPayment,children:i.jsx(va,{timeline:e.timeline})}),i.jsx(Hn,{className:yt.desktopFooter})]})]}),!n&&i.jsx(Hn,{className:`${yt.footerContainer} ${n?yt.footerContainerAntistock:""}`})]})]})})},xN="_checkoutOrderMainData_hqf60_1",CN="_orderDetailRow_hqf60_6",EN="_chargeIdRow_hqf60_16",TN="_detailLabel_hqf60_25",yN="_detailValue_hqf60_29",kN="_chargeIdContainer_hqf60_33",AN="_chargeId_hqf60_16",SN="_copyIcon_hqf60_51",Je={checkoutOrderMainData:xN,orderDetailRow:CN,chargeIdRow:EN,detailLabel:TN,detailValue:yN,chargeIdContainer:kN,chargeId:AN,copyIcon:SN},Oi=({lastUpdate:e,invoiceId:t,email:n,paymentType:r,orderId:u})=>{const a=Jn(),[s,o]=P.useState(null),c=s==null?void 0:s.find(h=>h.name===r);P.useEffect(()=>{s||(async()=>{if(!r)return;const m=await ou([r]);o(m)})()},[r,s]);const l=h=>{const f=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],m=h.getDate().toString().padStart(2,"0"),p=f[h.getMonth()],g=h.getFullYear(),x=h.getHours(),C=h.getMinutes().toString().padStart(2,"0"),_=h.getSeconds().toString().padStart(2,"0"),v=x>=12?"PM":"AM",y=(x%12||12).toString().padStart(2,"0");return`${p} ${m}, ${g} at ${y}:${C}:${_} ${v}`};return i.jsxs("div",{className:Je.checkoutOrderMainData,children:[i.jsxs("div",{className:Je.orderDetailRow,children:[i.jsx("p",{className:Je.detailLabel,id:"md",children:"Last Updated"}),i.jsx("p",{className:Je.detailValue,id:"md",children:l(new Date(e))})]}),r&&i.jsxs("div",{className:Je.orderDetailRow,children:[i.jsx("p",{className:Je.detailLabel,id:"md",children:"Payment Type"}),i.jsx("p",{className:Je.detailValue,id:"md",children:c==null?void 0:c.displayName})]}),i.jsxs("div",{className:Je.orderDetailRow,children:[i.jsx("p",{className:Je.detailLabel,id:"md",children:"Email"}),i.jsx("p",{className:Je.detailValue,id:"md",children:n})]}),t&&i.jsxs("div",{className:Je.chargeIdRow,children:[i.jsx("p",{className:Je.detailLabel,id:"md",children:"Charge ID"}),i.jsxs("div",{className:Je.chargeIdContainer,children:[i.jsx("p",{className:Je.chargeId,id:"md",children:t}),i.jsx("div",{className:Je.copyIcon,onClick:()=>a(t),children:i.jsx(w.Icon,{name:"Copy"})})]})]}),u&&i.jsxs("div",{className:Je.chargeIdRow,children:[i.jsx("p",{className:Je.detailLabel,id:"md",children:"Order ID"}),i.jsxs("div",{className:Je.chargeIdContainer,children:[i.jsx("p",{className:Je.chargeId,id:"md",children:u}),i.jsx("div",{className:Je.copyIcon,onClick:()=>a(u),children:i.jsx(w.Icon,{name:"Copy"})})]})]})]})},IN="_bottomSheet_1yai1_1",NN="_formContainer_1yai1_8",vN="_error_1yai1_14",wN="_buttonGroup_1yai1_18",DN="_buttonWrapper_1yai1_28",LN="_fullWidthButton_1yai1_31",PN="_modal_1yai1_41",RN="_header_1yai1_48",Sn={bottomSheet:IN,formContainer:NN,error:vN,buttonGroup:wN,buttonWrapper:DN,fullWidthButton:LN,modal:PN,header:RN},Sd=({chargeId:e,setIsOpen:t})=>{const[n,r]=P.useState(""),[u,a]=P.useState(""),{setIsOpen:s}=b.useModalStore(),o=h=>{try{return new URL(h),!0}catch{return!1}},c=async h=>{if(h.preventDefault(),!n){a("The link field cannot be empty.");return}if(!o(n)){a("Please enter a valid URL");return}await Gd({url:n},e)&&(alert("CashApp successfully verified"),t(!1))},l=()=>{s(!1),setTimeout(()=>{t(!1)},300)};return i.jsxs("div",{className:Sn.modal,onClick:h=>h.stopPropagation(),children:[i.jsxs("div",{className:Sn.header,children:[i.jsx("h3",{id:"h3",children:"CashApp Verify"}),i.jsx(w.Icon,{name:"X",hoverable:!0,onClick:l,fill:"var(--text-primary)"})]}),i.jsx("form",{onSubmit:c,children:i.jsxs("div",{className:Sn.bottomSheet,children:[i.jsx("div",{className:Sn.formContainer,children:i.jsxs("div",{children:[i.jsx(w.Input,{value:n,onChange:h=>{r(h),a("")},label:"Enter Cashapp Link",placeholder:"https://cash.app/payments/0000"}),u&&i.jsx("p",{className:Sn.error,children:u})]})}),i.jsxs("div",{className:Sn.buttonGroup,children:[i.jsx("div",{className:Sn.buttonWrapper,children:i.jsx(w.Button,{type:"Secondary",onClick:l,children:"Cancel"})}),i.jsx("div",{className:Sn.fullWidthButton,children:i.jsx(w.Button,{type:"Primary",children:"Verify"})})]})]})})]})},ON="_trackPaymentContainer_fk3b6_1",MN="_trackPaymentBox_fk3b6_5",FN="_trackPaymentBoxActive_fk3b6_18",BN="_trackPaymentHeader_fk3b6_23",jN="_trackPaymentTitle_fk3b6_27",HN="_trackPaymentTimeline_fk3b6_33",UN="_trackPaymentItem_fk3b6_42",VN="_itemHeader_fk3b6_48",$N="_itemDate_fk3b6_55",zN="_itemMessage_fk3b6_59",qN="_trackPaymentToggle_fk3b6_64",ZN="_trackPaymentToggleContent_fk3b6_75",WN="_trackPaymentToggleText_fk3b6_81",YN="_antistock_fk3b6_88",xt={trackPaymentContainer:ON,trackPaymentBox:MN,trackPaymentBoxActive:FN,trackPaymentHeader:BN,trackPaymentTitle:jN,trackPaymentTimeline:HN,trackPaymentItem:UN,itemHeader:VN,itemDate:$N,itemMessage:zN,trackPaymentToggle:qN,trackPaymentToggleContent:ZN,trackPaymentToggleText:WN,antistock:YN},Zc=(e,t)=>{const n=e.getDate().toString().padStart(2,"0"),r=(e.getMonth()+1).toString().padStart(2,"0"),u=e.getFullYear(),a=e.getHours(),s=e.getMinutes().toString().padStart(2,"0"),o=e.getSeconds().toString().padStart(2,"0"),c=a>=12?"PM":"AM",l=(a%12||12).toString().padStart(2,"0");return t==="dd.MM.yyyy"?`${n}.${r}.${u}`:t==="hh:mm:ss aa"?`${l}:${s}:${o} ${c}`:""},GN={[ye.Paid]:{displayName:Gn[ye.Paid],displayMessage:"The invoice has been completed and the product has been delivered.",type:"success"},[ye.Pending]:{displayName:Gn[ye.Pending],displayMessage:"The invoice has been created and we are now waiting to receive the payment.",type:"warning"},[ye.Expired]:{displayName:Gn[ye.Expired],displayMessage:"Your payment has expired due to the payment not being sent in time.",type:"error"},[ye.Cancelled]:{displayName:Gn[ye.Cancelled],displayMessage:"The order has been canceled. The payment was not sent within the time limit.",type:"error"},[ye.NotPaid]:{displayName:"New",displayMessage:"The charge has been created and is awaiting payment.",type:"success"},[ye.Refunded]:{displayName:Gn[ye.Refunded],displayMessage:"Your order was refunded. Please check your payment method for confirmation.",type:"warning"}},XN=({date:e,chargeStatus:t})=>(console.log(t),i.jsxs("div",{className:xt.trackPaymentItem,children:[i.jsxs("div",{className:xt.itemHeader,children:[i.jsx("p",{className:xt.itemDate,id:"md-bold",children:Zc(new Date(e),"dd.MM.yyyy")}),i.jsx("p",{className:xt.itemTime,id:"md",children:Zc(new Date(e),"hh:mm:ss aa")})]}),i.jsx("p",{className:xt.itemMessage,id:"md",children:GN[t].displayMessage})]})),va=({timeline:e,className:t})=>{const[n,r]=P.useState(!1),{isAntistock:u}=b.useGeneralStore();return i.jsxs("div",{className:b.clx(xt.trackPaymentContainer,t,{[xt.antistock]:u}),children:[i.jsxs("div",{className:`${xt.trackPaymentBox} ${n?xt.trackPaymentBoxActive:""}`,style:u?{border:"1px solid var(--border-secondary)"}:void 0,children:[i.jsx("header",{className:xt.trackPaymentHeader,children:i.jsx("h2",{className:xt.trackPaymentTitle,id:"h4",children:"Track Payment"})}),i.jsx("div",{className:xt.trackPaymentTimeline,children:Object.keys(e).map(a=>i.jsx(XN,{date:e[a],chargeStatus:a},a))})]}),i.jsxs("div",{className:xt.trackPaymentToggle,onClick:()=>r(!n),style:u?{padding:"1.25rem",border:"1px solid var(--border-secondary)",borderRadius:"var(--border-radius)"}:void 0,children:[i.jsxs("div",{className:xt.trackPaymentToggleContent,children:[u?null:i.jsx(w.Icon,{name:"MagnifyingGlass",fill:"var(--text-secondary)"}),i.jsx("p",{className:xt.trackPaymentToggleText,id:"h5",children:"Track Payment"})]}),i.jsx(w.Icon,{name:"CaretRight",fill:"var(--text-primary)",width:16,height:16})]})]})},KN="_dateTime_1dnnn_11",QN="_tableItem_1dnnn_25",JN="_status_1dnnn_29",ev="_statusInProgress_1dnnn_38",tv="_statusText_1dnnn_42",nv="_statusIcon_1dnnn_46",rv="_statusInProgressText_1dnnn_52",uv="_statusInProgressIcon_1dnnn_57",av="_message_1dnnn_63",Ct={dateTime:KN,tableItem:QN,status:JN,statusInProgress:ev,statusText:tv,statusIcon:nv,statusInProgressText:rv,statusInProgressIcon:uv,message:av},Id=({item:e})=>{const[t,n]=b.extractDateAndTime(e.createdAt),r=b.useNavigate(),a=(s=>s.length>30?s.slice(0,27)+"...":s)(e.latestMessage);return i.jsxs(P.Fragment,{children:[i.jsx(ot,{className:Ct.tableItem,onClick:()=>r(`/ticket/${e.id}/${e.accessToken}`),children:i.jsxs("span",{id:"md",children:["#",e.id]})}),i.jsx(ot,{className:b.clx(Ct.message,Ct.tableItem),onClick:()=>r(`/ticket/${e.id}/${e.accessToken}`),children:i.jsx("span",{id:"md",children:a})}),i.jsx(ot,{className:Ct.tableItem,onClick:()=>r(`/ticket/${e.id}/${e.accessToken}`),children:i.jsxs("div",{children:[i.jsx("div",{id:"md",children:t}),i.jsx("div",{className:Ct.dateTime,id:"md",children:n})]})}),i.jsx(ot,{className:Ct.tableItem,onClick:()=>r(`/ticket/${e.id}/${e.accessToken}`),children:i.jsx(sv,{status:e.status})})]},e.id)},sv=({status:e})=>i.jsxs("div",{className:b.clx(Ct.status,{[Ct.statusClosed]:e==="CLOSED",[Ct.statusInProgress]:e!=="CLOSED"}),children:[i.jsx("div",{className:b.clx(Ct.statusIcon,{[Ct.statusInProgressIcon]:e!=="CLOSED"}),children:e==="CLOSED"?i.jsx(w.Icon,{name:"CheckCircle",className:Ct.statusIcon}):i.jsx(w.Icon,{name:"Clock",className:Ct.statusInProgressIcon})}),i.jsx("div",{className:b.clx(Ct.statusText,{[Ct.statusInProgressText]:e!=="CLOSED"}),id:"md",children:e==="CLOSED"?"Closed":"In Progress"})]}),iv="_tableContainer_1eytq_1",ov="_table_1eytq_1",cv="_productInfo_1eytq_19",lv="_productImage_1eytq_26",dv="_productName_1eytq_35",fv="_expirationDate_1eytq_46",hv="_overflowItem_1eytq_51",pv="_gatewayContainer_1eytq_57",mv="_gatewayImage_1eytq_62",gv="_dateTime_1eytq_67",bv="_tableLoader_1eytq_72",_v="_tableItem_1eytq_81",ft={tableContainer:iv,table:ov,productInfo:cv,productImage:lv,productName:dv,expirationDate:fv,overflowItem:hv,gatewayContainer:pv,gatewayImage:mv,dateTime:gv,tableLoader:bv,tableItem:_v},xv="_badge_1oac8_1",Cv="_active_1oac8_12",Ev="_awaitingPayment_1oac8_17",Tv="_cancelled_1oac8_22",yv="_changedGateway_1oac8_27",kv="_expired_1oac8_32",Av="_rial_1oac8_37",Sv="_pastDue_1oac8_42",Iv="_replaced_1oac8_47",Cn={badge:xv,active:Cv,awaitingPayment:Ev,cancelled:Tv,changedGateway:yv,expired:kv,rial:Av,pastDue:Sv,replaced:Iv},Nv=()=>({[xn.ACTIVE]:{icon:i.jsx(w.Icon,{name:"CheckCircle"}),title:"Active",className:Cn.active},[xn.AWAITING_PAYMENT]:{icon:i.jsx(w.Icon,{name:"Clock"}),title:"Awaiting Payment",className:Cn.awaitingPayment},[xn.CANCELLED]:{icon:i.jsx(w.Icon,{name:"XCircle"}),title:"Cancelled",className:Cn.cancelled},[xn.CHANGED_GATEWAY]:{icon:i.jsx(w.Icon,{name:"Warning"}),title:"Upgraded",className:Cn.changedGateway},[xn.EXPIRED]:{icon:i.jsx(w.Icon,{name:"XCircle"}),title:"Expired",className:Cn.expired},[xn.RIAL]:{icon:i.jsx(w.Icon,{name:"Clock"}),title:"Active",className:Cn.rial},[xn.PAST_DUE]:{icon:i.jsx(w.Icon,{name:"Clock"}),title:"Trial",className:Cn.pastDue},[xn.REPLACED]:{icon:i.jsx(w.Icon,{name:"Warning"}),title:"Replaced",className:Cn.replaced}}),Mi=({status:e})=>{const t=Nv()[e];return i.jsxs("div",{className:`${Cn.badge} ${t.className}`,children:[t.icon,i.jsx("p",{id:"md",children:t.title})]})},vv=(e,t)=>{const n=t.find(r=>r.name===e);return n?i.jsxs("div",{className:ft.gatewayContainer,children:[i.jsx("img",{alt:n.displayName,src:b.convertCfImageIdToUrl(n.logoCfImageId,"100"),className:ft.gatewayImage}),i.jsx("div",{children:n.displayName})]}):null},wv=({item:e,gatewaysDetail:t})=>{const[n,r]=b.extractDateAndTime(e.createdAt),[u]=b.extractDateAndTime(e.activeTo||""),a=Jn();return i.jsxs(P.Fragment,{children:[i.jsx(ot,{children:i.jsxs("div",{className:ft.productInfo,children:[i.jsx("div",{className:ft.productImage,children:i.jsx(w.Icon,{name:"Image",width:20,height:20,fill:"var(--text-secondary)"})}),i.jsxs("div",{children:[i.jsx(b.NavLink,{to:`/subscriptions/${e.id}/${e.accessToken}`,className:ft.productName,id:"md",children:e.productName}),i.jsx("p",{className:ft.expirationDate,children:e.activeTo&&`expires at ${u}`})]})]})}),i.jsx(ot,{className:ft.overflowItem,onClick:()=>a(e.id),children:e.id}),i.jsx(ot,{children:i.jsx(Mi,{status:e.status})}),i.jsx(ot,{children:b.formatPrice(e.price)}),i.jsx(ot,{children:vv(e.gatewayName,t)}),i.jsx(ot,{children:i.jsxs("div",{children:[i.jsx("div",{id:"md",children:n}),i.jsx("div",{className:ft.dateTime,id:"md",children:r})]})})]},e.id)},Nd=({subscriptions:e,gatewaysDetail:t,totalCount:n,page:r,setPage:u})=>{const s=!(!(e!=null&&e.length)||!t);return i.jsxs("div",{className:ft.tableContainer,children:[i.jsxs(pa,{className:ft.table,children:[i.jsx(Nt,{className:ft.tableItem,children:"Product name"}),i.jsx(Nt,{className:ft.tableItem,children:"ID"}),i.jsx(Nt,{className:ft.tableItem,children:"Status"}),i.jsx(Nt,{className:ft.tableItem,children:"Value"}),i.jsx(Nt,{className:ft.tableItem,children:"Payment"}),i.jsx(Nt,{className:ft.tableItem,children:"Date"}),s&&(e==null?void 0:e.map(o=>i.jsx(wv,{item:o,gatewaysDetail:t},o.id)))]}),!s&&i.jsx("div",{className:ft.tableLoader,children:i.jsx(w.Loader,{})}),s&&i.jsx(fu,{currentPage:r,totalCount:n,onPageChange:u})]})},Dv="_pageLoading_1rj3k_2",Lv="_title_1rj3k_11",Pv="_description_1rj3k_17",hs={pageLoading:Dv,title:Lv,description:Pv},Rv=({description:e,title:t})=>i.jsxs("div",{className:hs.pageLoading,children:[i.jsx("div",{children:i.jsx(w.Loader,{})}),i.jsx("h1",{className:hs.title,children:t}),i.jsx("p",{className:hs.description,children:e})]}),Ov="_container_1opbn_1",Mv="_productDetails_1opbn_8",Fv="_imageContainer_1opbn_14",Bv="_image_1opbn_14",jv="_textContainer_1opbn_32",Hv="_header_1opbn_40",Uv="_title_1opbn_46",Vv="_price_1opbn_53",$v="_badgeContainer_1opbn_57",zv="_description_1opbn_61",nn={container:Ov,productDetails:Mv,imageContainer:Fv,image:Bv,textContainer:jv,header:Hv,title:Uv,price:Vv,badgeContainer:$v,description:zv},vd=({subscription:e})=>i.jsxs("div",{className:nn.container,children:[i.jsxs("div",{className:nn.productDetails,children:[i.jsx("div",{className:nn.imageContainer,children:e!=null&&e.image?i.jsx("img",{className:nn.image,src:b.convertCfImageIdToUrl(e.image.cfId),alt:e==null?void 0:e.name}):i.jsx(w.Icon,{name:"Image"})}),i.jsxs("div",{className:nn.textContainer,children:[i.jsx("div",{className:nn.header,children:i.jsx("h2",{className:nn.title,children:e.name})}),i.jsxs("p",{className:nn.price,children:[b.formatPrice(e.price)," / ",e.recurringInterval]})]}),i.jsx("div",{className:nn.badgeContainer,children:i.jsx(Mi,{status:e.status})})]}),e.description&&i.jsx(Ti,{className:nn.description,children:e.description})]}),qv="_card_69liy_1",Zv="_price_69liy_10",Wv="_interval_69liy_17",Yv="_name_69liy_22",Gv="_description_69liy_28",Xv="_currentPlan_69liy_32",Kv="_selectButton_69liy_45",Qv="_progressSection_69liy_50",Jv="_progressLabel_69liy_54",ew="_bottomSheet_69liy_60",tw="_title_69liy_69",nw="_typeSelector_69liy_80",rw="_typeOption_69liy_90",uw="_active_69liy_100",aw="_saveTag_69liy_108",sw="_planSelector_69liy_117",iw="_modal_69liy_127",ow="_inactive_69liy_148",cw="_notMounted_69liy_151",lw="_closeButton_69liy_157",Xe={card:qv,price:Zv,interval:Wv,name:Yv,description:Gv,currentPlan:Xv,selectButton:Kv,progressSection:Qv,progressLabel:Jv,bottomSheet:ew,title:tw,typeSelector:nw,typeOption:rw,active:uw,saveTag:aw,planSelector:sw,modal:iw,inactive:ow,notMounted:cw,closeButton:lw},dw=({variant:e,onSelect:t,isCurrent:n})=>{const r=e.subscriptionSettings.recurringIntervalDays===30?"month":e.subscriptionSettings.recurringIntervalDays===365?"year":"period",u=e.subscriptionSettings.price.amount.toFixed(2),a=e.subscriptionSettings.recurringIntervalDays,s=10;return i.jsxs("div",{className:Xe.card,onClick:t,children:[i.jsxs("h2",{className:Xe.price,children:["$",u," ",i.jsxs("span",{className:Xe.interval,children:["/ ",r]})]}),i.jsx("h3",{className:Xe.name,children:e.name}),e.description&&i.jsx("p",{className:Xe.description,children:e.description}),n?i.jsxs("div",{className:Xe.currentPlan,children:[i.jsx(w.Icon,{name:"Check"}),"Your current Plan"]}):i.jsx(w.Button,{type:"Secondary",className:Xe.selectButton,children:"Select"}),n&&i.jsxs("div",{className:Xe.progressSection,children:[i.jsx(l0,{percent:s/a*100,disablePercentLabel:!0}),i.jsxs("p",{className:Xe.progressLabel,children:["Used: ",s," of ",a," days"]})]})]})},wd=({isOpen:e,setIsOpen:t,subscription:n})=>{const[r,u]=P.useState(null),[a,s]=P.useState(null),[o,c]=P.useState(null),{id:l,accessToken:h}=b.useParams(),[f,m]=P.useState(!1),[p,g]=P.useState(!1),{setIsOpen:x}=b.useModalStore();P.useEffect(()=>{e&&m(!0)},[e]);const C=()=>{t(!1)},[_,v]=P.useState(null);P.useEffect(()=>{l&&h&&(async()=>{if(l&&h){const{data:I}=await _2({id:l,accessToken:h});v(I)}})()},[l,h]),P.useEffect(()=>{var S;if(_!=null&&_.data.types[0]){const I=(S=_.data.types.flatMap(F=>F.productVariants).find(F=>F.data.id===(n==null?void 0:n.variantId)))==null?void 0:S.data;I&&(c(I),s(I))}},[_,n]),P.useEffect(()=>{_!=null&&_.data.types[0]&&u(_==null?void 0:_.data.types[0])},[_==null?void 0:_.data.types]);const y=S=>{u(S),s(null)},D=S=>{s(S),x(!0),g(!0)};return i.jsxs("div",{className:b.clx(Xe.modal,{[Xe.active]:e,[Xe.inactive]:!e&&f,[Xe.notMounted]:!f}),onClick:S=>S.stopPropagation(),children:[i.jsx(w.Icon,{name:"X",onClick:C,hoverable:!0,className:Xe.closeButton,fill:"var(--text-primary)"}),i.jsxs("div",{className:Xe.bottomSheet,children:[i.jsx("h3",{id:"h3",className:Xe.title,children:"Change Plan"}),i.jsx("p",{className:Xe.description,children:_==null?void 0:_.data.description}),i.jsx("div",{className:Xe.typeSelector,children:_==null?void 0:_.data.types.map(S=>i.jsxs("div",{className:b.clx(Xe.typeOption,{[Xe.active]:(r==null?void 0:r.id)===S.id}),onClick:()=>y(S),children:[S.name,S.name==="Yearly"&&i.jsx("span",{className:Xe.saveTag,children:"Save %"})]},S.id))}),r&&i.jsx("div",{className:Xe.planSelector,children:r.productVariants.map(S=>i.jsx(dw,{variant:S.data,isSelected:(a==null?void 0:a.id)===S.data.id,isCurrent:(o==null?void 0:o.id)===S.data.id,onSelect:()=>D(S.data)},S.data.id))})]}),p&&a&&n&&i.jsx(w.Modal,{close:()=>{g(!1)},children:i.jsx(Od,{setIsOpen:g,selectedVariant:a,subscription:n})})]})},fw="_container_nb625_1",hw="_title_nb625_11",pw="_subtitle_nb625_16",mw="_info_nb625_20",Fu={container:fw,title:hw,subtitle:pw,info:mw},Dd=()=>{const{subscription:e}=b.useSubscriptionStore(),[t,n]=b.extractDateAndTime((e==null?void 0:e.activeTo)||""),[r,u]=P.useState(!1),{setIsOpen:a}=b.useModalStore();return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:Fu.container,children:[i.jsxs("div",{className:Fu.info,children:[i.jsx("p",{className:Fu.title,children:"Expiration Date"}),i.jsxs("p",{className:Fu.subtitle,children:[t," at ",n]})]}),i.jsx(w.Button,{type:"Special",onClick:s=>{s.stopPropagation(),a(!0),u(!0)},children:"Extend"})]}),r&&i.jsx(w.Modal,{close:()=>u(!1),children:i.jsx(Hd,{setIsOpen:u})})]})},gw="_couponContainer_1sspa_1",bw="_iconWrapper_1sspa_10",_w="_details_1sspa_21",xw="_title_1sspa_25",Cw="_progress_1sspa_29",Ew="_foreverText_1sspa_34",or={couponContainer:gw,iconWrapper:bw,details:_w,title:xw,progress:Cw,foreverText:Ew},Ld=({coupon:e,currency:t})=>{const n=e.isFixed?b.formatPrice({amount:e.discount,currency:t}):`${e.discount}%`,r=e.initialCouponDurationForSubscriptions?b.percentageDifference(e.initialCouponDurationForSubscriptions,e.currentCouponDurationForSubscriptions||1):100;return i.jsxs("div",{className:or.couponContainer,children:[i.jsx("div",{className:or.iconWrapper,children:i.jsx(w.Icon,{name:"CheckCircle"})}),i.jsxs("div",{className:or.details,children:[i.jsxs("p",{className:or.title,children:[e.name,", ",n," discount"]}),i.jsx("div",{className:or.progress,children:i.jsx(l0,{color:"#C2C2C2",percent:r,disablePercentLabel:!0})}),i.jsx("p",{className:or.foreverText,children:"Forever discount code"})]})]})},Tw="_paymentMethodContainer_1g0da_4",yw="_paymentMethodTitle_1g0da_15",kw="_activeMethod_1g0da_20",Aw="_noMethod_1g0da_28",Sw="_activeMethodPaymentMethod_1g0da_37",Iw="_paymentMethodLogo_1g0da_47",Nw="_paymentMethodNumber_1g0da_57",vw="_method_1g0da_61",Rn={paymentMethodContainer:Tw,paymentMethodTitle:yw,activeMethod:kw,noMethod:Aw,activeMethodPaymentMethod:Sw,paymentMethodLogo:Iw,paymentMethodNumber:Nw,method:vw},ww="_paymentMethods_1gev0_1",Dw="_modal_1gev0_14",Lw="_header_1gev0_28",Pw="_content_1gev0_37",Zn={paymentMethods:ww,modal:Dw,header:Lw,content:Pw},Rw=e=>{const{setIsLoading:t,setIsOpen:n}=e,{subscription:r,setSubscription:u}=b.useSubscriptionStore();if(!r)return null;const{id:a}=b.useParams(),s=b.useNavigate(),{notifications:o,setNotifications:c}=b.useNotificationStore(),{setPaymentMethod:l,setGateway:h,cart:f}=su(),{setIsOpen:m}=b.useModalStore();async function p(){if(g(),t(!0),a&&r){const{data:x}=await g2(a,f.gateway);x.isReconnectPaymentNeeded?s(`/charges/${x.chargeId}`):(c([...o,{status:"success",id:b.v4(),message:"Your action has been successfully completed"}]),u({...r,gatewayName:f.gateway}))}else c([...o,{status:"error",id:b.v4(),message:"Your action has been failed. Try again!"}]);t(!1)}function g(){m(!1),setTimeout(()=>{n(!1)},300)}return i.jsxs("div",{className:Zn.modal,onClick:x=>{x.stopPropagation()},children:[i.jsxs("div",{className:Zn.header,children:[i.jsx("h3",{id:"h3",className:Zn.title,children:"Choose Payment Method"}),i.jsx(w.Icon,{name:"X",onClick:g,hoverable:!0,fill:"var(--text-primary)"})]}),i.jsxs("div",{className:Zn.content,children:[(r==null?void 0:r.availableGateways)&&i.jsx(oi,{possibleGateways:{availableGateways:r.availableGateways,requiresSignInGateways:r.availableGateways},setGateway:h,setPaymentMethod:l,totalAndDiscount:{total:(r==null?void 0:r.price.amount)||0,totalWithDiscount:r==null?void 0:r.price.amount},onSignInClick:()=>s("/customer-dash")}),i.jsxs("div",{className:Zn.paymentMethods,children:[i.jsx("div",{className:Zn.buttonWrapper,children:i.jsx(w.Button,{type:"Secondary",onClick:g,children:"Cancel"})}),i.jsx("div",{className:Zn.buttonWrapper,children:i.jsx(w.Button,{type:"Primary",disabled:!f.gateway,onClick:()=>p(),children:"Continue"})})]})]})]})},Ow="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20131.39%2086.9'%3e%3cdefs%3e%3cstyle%3e.a{opacity:0;}.b{fill:%23fff;}.c{fill:%23ff5f00;}.d{fill:%23eb001b;}.e{fill:%23f79e1b;}%3c/style%3e%3c/defs%3e%3ctitle%3eAsset%201%3c/title%3e%3cg%20class='a'%3e%3crect%20class='b'%20width='131.39'%20height='86.9'/%3e%3c/g%3e%3crect%20class='c'%20x='48.37'%20y='15.14'%20width='34.66'%20height='56.61'/%3e%3cpath%20class='d'%20d='M51.94,43.45a35.94,35.94,0,0,1,13.75-28.3,36,36,0,1,0,0,56.61A35.94,35.94,0,0,1,51.94,43.45Z'/%3e%3cpath%20class='e'%20d='M120.5,65.76V64.6H121v-.24h-1.19v.24h.47v1.16Zm2.31,0v-1.4h-.36l-.42,1-.42-1h-.36v1.4h.26V64.7l.39.91h.27l.39-.91v1.06Z'/%3e%3cpath%20class='e'%20d='M123.94,43.45a36,36,0,0,1-58.25,28.3,36,36,0,0,0,0-56.61,36,36,0,0,1,58.25,28.3Z'/%3e%3c/svg%3e",Pd=()=>{var g,x,C;const{subscription:e}=b.useSubscriptionStore(),{cart:t,setPaymentMethod:n}=su(),r=b.useNavigate(),[u,a]=P.useState(null),[s,o]=P.useState(!1),[c,l]=P.useState(!1),{setIsOpen:h}=b.useModalStore();if(!e)return null;const[f,m]=P.useState(e.gatewayName||t.gateway),p=t.paymentMethod;return P.useEffect(()=>{(async()=>{const v=await ou(e.availableGateways);a(v)})()},[]),P.useEffect(()=>{t.gateway!==f&&m(t.gateway)},[t.gateway]),i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:Rn.paymentMethodContainer,children:[i.jsxs("div",{children:[i.jsx("p",{className:Rn.paymentMethodTitle,children:"Active Payment Method"}),e.gatewayInfo&&Object.keys(e.gatewayInfo).length>0&&i.jsx(Mw,{gatewayInfo:e.gatewayInfo}),(!e.gatewayInfo||Object.keys(e.gatewayInfo).length===0)&&f==="Balance"&&i.jsx(si,{gateway:f,gatewayDisplayName:f,total:(e==null?void 0:e.price.amount)||0,onSignInClick:()=>r("/customer-dash")}),(!e.gatewayInfo||Object.keys(e.gatewayInfo).length===0)&&!f&&i.jsx("span",{className:Rn.noMethod,children:"Payment method is not set"}),(!e.gatewayInfo||Object.keys(e.gatewayInfo).length===0)&&f&&i.jsx("div",{className:Rn.activeMethod,children:u&&i.jsx(ii,{align:"row",gatewayLogoCfId:(g=u.find(_=>_.name===f))==null?void 0:g.logoCfImageId,gatewayDisplayName:(x=u.find(_=>_.name===f))==null?void 0:x.displayName,gateway:f,poweredByLogoCfId:(C=u.find(_=>_.name===f))==null?void 0:C.poweredByImageCfImageId,className:Rn.activeMethodPaymentMethod,selected:p===f,onSelect:_=>{n(_)}},f)})]}),i.jsx(w.Button,{type:"Special",onClick:_=>{_.stopPropagation(),h(!0),l(!0)},children:t.gateway?"Change":"Manage"})]}),c&&i.jsx(w.Modal,{close:()=>l(!1),children:i.jsx(Rw,{setIsLoading:o,setIsOpen:l})})]})},Mw=({gatewayInfo:e})=>{var t,n,r,u,a;return i.jsxs("div",{className:Rn.method,children:[i.jsxs("div",{className:Rn.paymentMethodLogo,children:[((t=e.card)==null?void 0:t.brand.toLowerCase())==="visa"&&i.jsx(Q6,{}),((n=e.card)==null?void 0:n.brand.toLowerCase())==="mastercard"&&i.jsx("img",{src:Ow,alt:"",width:22}),((r=e.card)==null?void 0:r.brand.toLowerCase())!=="visa"&&((u=e.card)==null?void 0:u.brand.toLowerCase())!=="mastercard"&&i.jsx(w.Icon,{name:"CreditCard",width:22})]}),i.jsxs("p",{className:Rn.paymentMethodNumber,children:["•••• •••• •••• ",(a=e.card)==null?void 0:a.last4]})]})},Fw="_subscriptionProductContainer_83ibx_4",Bw="_subscriptionProductImage_83ibx_15",jw="_subscriptionProductInfo_83ibx_32",Hw="_name_83ibx_37",Uw="_price_83ibx_40",jr={subscriptionProductContainer:Fw,subscriptionProductImage:Bw,subscriptionProductInfo:jw,name:Hw,price:Uw},Rd=({subscription:e,id:t,accessToken:n})=>{const[r,u]=P.useState(!1),{setIsOpen:a}=b.useModalStore();return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:jr.subscriptionProductContainer,onClick:s=>s.stopPropagation(),children:[i.jsx("div",{className:jr.subscriptionProductImage,children:e!=null&&e.image?i.jsx("img",{src:b.convertCfImageIdToUrl(e.image.cfId)}):i.jsx(w.Icon,{name:"Image"})}),i.jsxs("div",{className:jr.subscriptionProductInfo,children:[i.jsx("div",{className:"flex items-center gap-2",children:i.jsx("h2",{className:jr.name,children:e.name})}),i.jsxs("p",{className:jr.price,children:[b.formatPrice(e.price)," / ",e.recurringInterval]})]}),i.jsx(w.Button,{type:"Special",onClick:s=>{s.preventDefault(),u(!0),a(!0)},children:"Cancel"})]}),r&&i.jsx(w.Modal,{close:()=>u(!1),children:i.jsx(Ud,{accessToken:n,id:t,isOpen:r,setIsOpen:u})})]})},Vw="_content_5ctxw_1",$w="_selectedPlan_5ctxw_37",zw="_planName_5ctxw_44",qw="_description_5ctxw_48",Zw="_price_5ctxw_51",Ww="_buttonGroup_5ctxw_79",Yw="_buttonWrapper_5ctxw_84",Gw="_modal_5ctxw_88",Xw="_header_5ctxw_95",Xt={content:Vw,selectedPlan:$w,planName:zw,description:qw,price:Zw,buttonGroup:Ww,buttonWrapper:Yw,modal:Gw,header:Xw},Od=({setIsOpen:e,selectedVariant:t,subscription:n})=>{if(!t)return null;const{setIsOpen:r}=b.useModalStore(),u=()=>{a()},a=()=>{r(!1),setTimeout(()=>{e(!1)},300)},s=(t.subscriptionSettings.compareAtPrice||t.subscriptionSettings.price).amount,o=t.subscriptionSettings.compareAtPrice?t.subscriptionSettings.compareAtPrice.amount-t.subscriptionSettings.price.amount:t.subscriptionSettings.price.amount,c=s-o,l=new Intl.NumberFormat("en-US",{style:"currency",currency:n.price.currency});return i.jsxs("div",{className:Xt.modal,children:[i.jsxs("div",{className:Xt.header,children:[i.jsx("h3",{id:"h3",children:"Choose upgrade method"}),i.jsx(w.Icon,{name:"X",hoverable:!0,onClick:()=>a(),fill:"var(--text-primary)"})]}),i.jsxs("div",{className:Xt.bottomSheet,children:[i.jsxs("div",{className:Xt.content,children:[i.jsxs("div",{className:Xt.selectedPlan,children:[i.jsx("h2",{className:Xt.planName,children:t.name}),i.jsx("p",{className:Xt.description,children:t.description}),i.jsxs("p",{className:Xt.price,children:["$",t.subscriptionSettings.price.amount.toFixed(2)," /"," ",t.subscriptionSettings.recurringIntervalDays===30?"month":"year"]})]}),i.jsx(kr,{formatter:l,coupon:null,total:c,discount:o})]}),i.jsxs("div",{className:Xt.buttonGroup,children:[i.jsx("div",{className:Xt.buttonWrapper,children:i.jsx(w.Button,{type:"Secondary",onClick:()=>a(),children:"Stay with us"})}),i.jsx("div",{className:Xt.buttonWrapper,children:i.jsxs(w.Button,{type:"Primary",onClick:u,children:["Upgrade for $",c.toFixed(2)]})})]})]})]})},Kw="_orderStatusBlock_2wo4y_2",Qw="_orderStatusBlockAntistock_2wo4y_11",Jw="_iconWrapper_2wo4y_16",eD="_orderStatusTitle_2wo4y_26",tD="_orderStatusDescription_2wo4y_31",nD="_actionButtons_2wo4y_36",rD="_actionButton_2wo4y_36",uD="_button_2wo4y_47",rn={orderStatusBlock:Kw,orderStatusBlockAntistock:Qw,iconWrapper:Jw,orderStatusTitle:eD,orderStatusDescription:tD,actionButtons:nD,actionButton:rD,button:uD},aD={[Ie.New]:"New",[Ie.Pending]:"Order Pending",[Ie.Expired]:"Order Expired",[Ie.Cancelled]:"Order Canceled",[Ie.Failed]:"Order Failed",[Ie.FullDeliveryFailure]:"Delivery Failure",[Ie.PartiallyDelivered]:"Partial Delivery Failure",[Ie.Refunded]:"Order Refunded",[Ie.Completed]:"Order Completed"},sD={[Ie.New]:"Your order has been created and is awaiting payment.",[Ie.Pending]:"Your order is currently pending. We recommend checking back shortly for confirmation.",[Ie.Expired]:"Your order has expired due to the payment not being sent in time. If you already sent the payment, please contact us below.",[Ie.Cancelled]:"You canceled the warrant. If there are any problems, please contact support.",[Ie.Failed]:"Your order could not be processed due to a payment or system error. Please try again or contact support.",[Ie.FullDeliveryFailure]:"Your payment was successful but the product is currently out of stock. Please contact us below to get this sorted.",[Ie.PartiallyDelivered]:"Your payment was successful but some products were out of stock. Please contact us below to get this sorted.",[Ie.Refunded]:"Your order was refunded. Please check your payment method for confirmation.",[Ie.Completed]:"Your order has successfully been processed. View your products below or check your email for additional information."},Md=()=>({[Ie.Completed]:i.jsx(w.Icon,{name:"Check",fill:"var(--text-success)"}),[Ie.Pending]:i.jsx(w.Icon,{name:"Clock",fill:"var(--text-warning)"}),[Ie.New]:i.jsx(w.Icon,{name:"Clock",fill:"var(--text-warning)"}),[Ie.Expired]:i.jsx(w.Icon,{name:"XCircle",fill:"var(--text-action)"}),[Ie.Cancelled]:i.jsx(w.Icon,{name:"XCircle",fill:"var(--text-action)"}),[Ie.Failed]:i.jsx(w.Icon,{name:"XCircle",fill:"var(--text-action)"}),[Ie.FullDeliveryFailure]:i.jsx(w.Icon,{name:"Warning",fill:"var(--text-warning)"}),[Ie.PartiallyDelivered]:i.jsx(w.Icon,{name:"WarningDiamond",fill:"var(--text-warning)"}),[Ie.Refunded]:i.jsx(w.Icon,{name:"WarningDiamond",fill:"var(--text-warning)"})}),Fd=({orderStatus:e,className:t})=>{var l,h;const{shopDomain:n}=b.useStorefrontStore(),{isAntistock:r,general:u}=b.useGeneralStore(),a=b.useNavigate(),s=!!((l=u==null?void 0:u.info)!=null&&l.disableSupport),o=(h=u==null?void 0:u.info)==null?void 0:h.thirdPartySupportUrl,c=!(s&&!o);return i.jsxs("div",{className:b.clx(rn.orderStatusBlock,t,{[rn.orderStatusBlockAntistock]:r}),children:[i.jsx("div",{className:rn.iconWrapper,style:r?{background:"none"}:void 0,children:Md()[e]}),i.jsx("h2",{className:rn.orderStatusTitle,children:aD[e]}),i.jsx("p",{className:rn.orderStatusDescription,children:sD[e]}),i.jsxs("div",{className:rn.actionButtons,children:[i.jsx("div",{className:rn.actionButton,children:i.jsxs(w.Button,{type:"Secondary",className:rn.button,onClick:()=>window.open(`https://${n}`),style:{width:"100%",display:"flex",alignItems:"center",gap:"5px"},children:[i.jsx(w.Icon,{name:"ArrowLineUpRight"}),"Visit Website"]})}),c&&i.jsx("div",{className:rn.actionButton,children:i.jsxs(w.Button,{type:"Secondary",className:rn.button,onClick:()=>{s&&o?window.open(o):r?window.open(`https://${n}/support`):a("/contact")},style:{width:"100%",display:"flex",alignItems:"center",gap:"5px"},children:[i.jsx(w.Icon,{name:"ChatsTeardrop"}),"Contact Support"]})})]})]})},iD="_reviewMessage_1t8u4_1",oD="_leaveReviewContainer_1t8u4_11",cD="_leaveReviewTitle_1t8u4_20",ps={reviewMessage:iD,leaveReviewContainer:oD,leaveReviewTitle:cD},Bd=({review:e,orderId:t,className:n})=>{const[r,u]=P.useState((e==null?void 0:e.rating)||0),[a,s]=P.useState(!1),{setIsOpen:o}=b.useModalStore(),{notifications:c,setNotifications:l}=b.useNotificationStore(),h=async f=>{e&&"accessToken"in e&&(await k2({comment:f,rating:r,tsId:b.useGetTsId()},t,e.accessToken),l([...c,{status:"success",id:b.v4(),message:"Review left successfully"}]),s(!1))};return P.useEffect(()=>{e&&r&&"accessToken"in e&&!e.rating&&(o(!0),s(!0))},[r]),e?e.rating&&"accessToken"in e?i.jsxs("div",{className:ps.reviewMessage,children:["You left a ",e.rating," star rating"]}):i.jsxs("div",{className:b.clx(ps.leaveReviewContainer,n),children:[i.jsx("p",{className:ps.leaveReviewTitle,children:"Leave a review"}),i.jsx(w8,{rating:r,setRating:u,disabled:!!e.rating||!("accessToken"in e)}),a&&i.jsx(w.Modal,{close:()=>s(!1),children:i.jsx(jd,{setIsOpen:s,onSubmit:h})})]}):null},lD="_bottomSheet_1bcyj_1",dD="_content_1bcyj_7",fD="_title_1bcyj_18",hD="_buttonGroup_1bcyj_22",pD="_buttonWrapper_1bcyj_33",mD="_modal_1bcyj_37",gD="_header_1bcyj_44",In={bottomSheet:lD,content:dD,title:fD,buttonGroup:hD,buttonWrapper:pD,modal:mD,header:gD},jd=({setIsOpen:e,onSubmit:t})=>{const[n,r]=P.useState(""),{setIsOpen:u}=b.useModalStore(),a=()=>{u(!1),setTimeout(()=>{e(!1)},300)};return i.jsxs("div",{className:In.modal,onClick:s=>s.stopPropagation(),children:[i.jsxs("div",{className:In.header,children:[i.jsx("h3",{id:"h3",className:In.title,children:"Review Description"}),i.jsx(w.Icon,{name:"X",hoverable:!0,onClick:a,fill:"var(--text-primary)"})]}),i.jsxs("div",{className:In.bottomSheet,children:[i.jsx("div",{className:In.content,children:i.jsx(w.Textarea,{placeholder:"Great product and fast checkout...",value:n,onChange:s=>r(s),label:"Describe your review in detail below"})}),i.jsxs("div",{className:In.buttonGroup,children:[i.jsx("div",{className:In.buttonWrapper,children:i.jsx(w.Button,{type:"Secondary",onClick:a,children:"Cancel"})}),i.jsx("div",{className:In.buttonWrapper,children:i.jsx(w.Button,{type:"Primary",disabled:!n,onClick:()=>{a(),t(n)},children:"Submit"})})]})]})]})},bD="_container_1idhv_1",_D="_buttonGroup_1idhv_8",xD="_buttonWrapper_1idhv_15",CD="_header_1idhv_19",ED="_content_1idhv_28",Wn={container:bD,buttonGroup:_D,buttonWrapper:xD,header:CD,content:ED},TD="_modal_1rkmj_1",yD="_modalPayment_1rkmj_7",kD="_title_1rkmj_15",AD="_description_1rkmj_20",Bu={modal:TD,modalPayment:yD,title:kD,description:AD},Fi=()=>i.jsxs("div",{className:b.clx(Bu.modal,Bu.modalPayment),onClick:e=>e.stopPropagation(),children:[i.jsx(w.Loader,{style:{border:"4px solid var(--surface-action1)",borderLeftColor:"var(--surface-secondary)",width:"40px",height:"40px"}}),i.jsx("h2",{id:"h3",className:Bu.title,children:"Processing Payment"}),i.jsx("p",{className:Bu.description,children:"This payment is currently being processed. If you're here, it simply means that the payment was created but not complete."})]}),Hd=({setIsOpen:e})=>{const{subscription:t}=b.useSubscriptionStore(),{getTotalAndDiscount:n,cart:r,coupon:u}=su(),[a,s]=P.useState(1),o=b.useNavigate(),{setIsOpen:c}=b.useModalStore(),{setNotifications:l,notifications:h}=b.useNotificationStore(),[f,m]=P.useState(!1),p=P.useMemo(()=>n(),[u,r]),g=P.useMemo(()=>p.totalWithDiscount?p.total-p.totalWithDiscount:0,[p]);if(f)return i.jsx(Fi,{});const x=(t==null?void 0:t.price.currency)||"USD",C=new Intl.NumberFormat("en-US",{style:"currency",currency:x});async function _(){var y;m(!0);try{const{data:D}=await x2((t==null?void 0:t.id)||"",{});l([{id:b.v4(),message:"Order created successfully",status:"success"}]),o(`/orders/${(y=D.data)==null?void 0:y.id}/${D.data.fullAccessToken}`)}catch(D){const S=D;l([...h,{id:b.v4(),message:`Order creation failed: ${S.message}`,status:"error"}]),v()}finally{m(!1)}}function v(){c(!1),setTimeout(()=>{e(!1)},300)}return i.jsxs("div",{className:Wn.container,onClick:y=>y.stopPropagation(),children:[i.jsxs("div",{className:Wn.header,children:[i.jsx("h3",{id:"h3",className:Wn.title,children:"Extend Subscription"}),i.jsx(w.Icon,{name:"X",onClick:v,hoverable:!0,fill:"var(--text-primary)"})]}),i.jsxs("div",{className:Wn.content,children:[i.jsx(V8,{step:a,totalSteps:12,onStepChange:s,label:"How long would you like to extend your subscription for?"}),i.jsx(kr,{formatter:C,coupon:u,total:p.total,discount:g,totalWithDiscount:p.totalWithDiscount}),i.jsxs("div",{className:Wn.buttonGroup,children:[i.jsx("div",{className:Wn.buttonWrapper,children:i.jsx(w.Button,{type:"Secondary",onClick:v,children:"Cancel"})}),i.jsx("div",{className:Wn.buttonWrapper,children:i.jsx(w.Button,{type:"Primary",onClick:_,children:"Extend"})})]})]})]})},SD="_bottomSheet_uw5jb_1",ID="_content_uw5jb_7",ND="_radioGroup_uw5jb_11",vD="_confirmation_uw5jb_26",wD="_iconWrapper_uw5jb_33",DD="_title_uw5jb_42",LD="_message_uw5jb_48",PD="_buttonGroup_uw5jb_54",RD="_buttonWrapper_uw5jb_64",OD="_modal_uw5jb_68",MD="_header_uw5jb_77",rt={bottomSheet:SD,content:ID,radioGroup:ND,confirmation:vD,iconWrapper:wD,title:DD,message:LD,buttonGroup:PD,buttonWrapper:RD,modal:OD,header:MD},FD={0:"Are you sure?",1:"Just making sure",2:"We're sorry to see you go"},Ud=({isOpen:e,setIsOpen:t,id:n,accessToken:r})=>{const[u,a]=P.useState(0),[s,o]=P.useState(!1),[c,l]=P.useState(""),[h,f]=P.useState(""),{setIsOpen:m}=b.useModalStore(),p=async()=>{if(!c)return;o(!0);const x=await m2(n,r,{reason:c==="Other reason"?h:c});o(!1),x&&a(2)};P.useEffect(()=>{e||(a(0),l(""),f(""))},[e]);const g=()=>{m(!1),setTimeout(()=>{t(!1)},300)};return i.jsxs("div",{className:rt.modal,onClick:x=>x.stopPropagation(),children:[i.jsxs("div",{className:rt.header,children:[i.jsx("h3",{id:"h3",children:FD[u]||""}),i.jsx(w.Icon,{name:"X",onClick:g,hoverable:!0,fill:"var(--text-primary)"})]}),i.jsxs("div",{className:rt.content,children:[u===0&&i.jsxs("div",{className:rt.bottomSheet,children:[i.jsx("p",{children:"Before you cancel your subscription can you tell us why?"}),i.jsxs("div",{className:rt.radioGroup,children:[i.jsx(w.Radio,{defaultValue:c,onChange:x=>l(x),options:[{value:"Found another company",label:"Found another company"},{value:"Expensive",label:"Expensive"},{value:"Technical problems",label:"Technical problems"},{value:"Support problems",label:"Support problems"},{value:"Other reason",label:"Other reason"}],flexDirection:"column"}),c==="Other reason"&&i.jsx(w.Textarea,{value:h,onChange:x=>f(x),placeholder:"Describe the reason..."})]}),i.jsxs("div",{className:rt.buttonGroup,children:[i.jsx("div",{className:rt.buttonWrapper,children:i.jsx(w.Button,{type:"Secondary",onClick:g,children:"Stay with us"})}),i.jsx("div",{className:rt.buttonWrapper,children:i.jsx(w.Button,{type:"Primary",onClick:()=>c&&a(1),disabled:!c,children:"Continue"})})]})]}),u===1&&i.jsxs("div",{className:rt.bottomSheet,children:[i.jsx("p",{children:"You'll lose access to all of the features and content available within this subscription."}),i.jsxs("div",{className:rt.buttonGroup,children:[i.jsx("div",{className:rt.buttonWrapper,children:i.jsx(w.Button,{type:"Secondary",onClick:g,children:"Stay with us"})}),i.jsx("div",{className:rt.buttonWrapper,children:i.jsx(w.Button,{type:"Primary",onClick:p,disabled:s,children:"Cancel it anyway"})})]})]}),u===2&&i.jsxs("div",{className:rt.bottomSheet,children:[i.jsxs("div",{className:`${rt.confirmation}`,children:[i.jsx("div",{className:rt.iconWrapper,children:i.jsx(w.Icon,{name:"Check",fill:"var(--text-success)"})}),i.jsx("p",{className:rt.title,children:"Subscription Cancelled"}),i.jsx("p",{className:rt.message,children:"You'll lose access to all of the features and content available within this subscription."})]}),i.jsx("div",{className:rt.buttonGroup,children:i.jsx("div",{className:rt.buttonWrapper,children:i.jsx(w.Button,{type:"Secondary",onClick:g,children:"Close"})})})]})]})]})},BD=Object.freeze(Object.defineProperty({__proto__:null,ActivePaymentMethod:Pd,ActiveSubscriptionProduct:Rd,Auth:ui,AuthLogin:t0,AuthModal:g0,AuthRequestOtp:e0,CHARGE_STATUS_DESCRIPTION:Ed,CHARGE_STATUS_DISPLAY_NAME:Gn,CancelSubscription:Ud,CashAppVerify:Sd,ChangeSubscriptionPlan:wd,ChargeBlocksRenderer:ea,ChargeItems:Ad,ChargeStatusBlock:yd,CheckoutBalancePaymentMethod:si,CheckoutFooter:Hn,CheckoutHeader:ma,CheckoutItems:f0,CheckoutOperational:xd,CheckoutOrderMainData:Oi,CheckoutPaymentMethod:ii,CheckoutPrices:kr,CheckoutProduct:ga,ChoosePlanUpgradeMethod:Od,ConnectDiscord:m0,CustomField:p0,CustomFields:h0,CustomerDashboard:Im,LeaveAReview:Bd,NoItemsBlock:ha,OpenDelivery:Cd,OrderStatusBlock:Fd,OrdersTable:s0,PageLoading:Rv,PageTitle:fa,Pagination:i0,PaginationWithRange:fu,PayPalFFNote:kd,PaymentMethods:oi,ProcessingPaymentModal:Fi,ProtectYourCheckout:_d,ReferralBlock:n0,ReferralBlockInfo:u0,ReferralBlockSteps:r0,SecuredBySsl:Ri,Sidebar:Ol,SkeletonReferralBlock:a0,StatItem:At,StatusIndicator:c0,StatusVariant:Bn,SubmitReview:jd,SubscriptionCoupon:Ld,SubscriptionExpiration:Hd,SubscriptionExpirationDate:Dd,SubscriptionProduct:vd,SubscriptionStatusBadge:Mi,SubscriptionsTable:Nd,Table:pa,TableItem:ot,TableItemTitle:Nt,TermsOfService:Pi,TicketRow:Id,TrackPayment:va,getChargeStatusIcon:Td,getOrderStatusIcon:Md,getPaginationText:o0},Symbol.toStringTag,{value:"Module"})),jD="_chargePageContainer_1azbl_1",HD="_chargeItems_1azbl_14",UD="_mainContent_1azbl_25",VD="_contentWrapper_1azbl_44",$D="_antistockContent_1azbl_53",zD="_statusBlock_1azbl_58",qD="_statusBlockAntistock_1azbl_63",ZD="_notPaidSection_1azbl_68",WD="_antistockPayNow_1azbl_82",YD="_antistockFooter_1azbl_86",GD="_antistockTrackPayment_1azbl_96",XD="_footer_1azbl_106",KD="_loaderContainer_1azbl_128",Pt={chargePageContainer:jD,chargeItems:HD,mainContent:UD,contentWrapper:VD,antistockContent:$D,statusBlock:zD,statusBlockAntistock:qD,notPaidSection:ZD,antistockPayNow:WD,antistockFooter:YD,antistockTrackPayment:GD,footer:XD,loaderContainer:KD},QD=()=>{const{id:e}=b.useParams(),[t,n]=b.useSearchParams(),[r,u]=P.useState(!1),[a,s]=P.useState(),[o,c]=P.useState(!0),l=b.useNavigate(),h=P.useRef(),f=P.useRef(!1),{setIsOpen:m}=b.useModalStore(),{isAntistock:p}=b.useGeneralStore();return P.useEffect(()=>{const g=async(C,_=!1)=>{_||u(!0);const{data:v}=await A2(C);u(!1),s(v)},x=setInterval(()=>{e&&g(e,!0)},5e3);return e&&g(e),()=>{clearInterval(x)}},[]),P.useEffect(()=>{const g=setTimeout(()=>{var C;console.log("charge timeout",a);const x=t.get("redirectRoute");if((a==null?void 0:a.status)===ye.Paid&&a.redirectUrl&&!h.current){const v=JSON.parse(localStorage.getItem("orders")||"{}")[((C=a==null?void 0:a.order)==null?void 0:C.id)||""];v?window.open(v.fullAccessToken?`${a.redirectUrl}/${v.fullAccessToken}`:`${a.redirectUrl}`,"_self"):window.open(a.redirectUrl,"_self")}(a==null?void 0:a.status)===ye.Paid&&h.current&&(console.log("redirectRouteRef.current",h.current),l(h.current,{replace:!0})),x&&h&&(h.current=x,t.delete("redirectRoute"),n(t))},1e3);return()=>clearTimeout(g)},[a]),P.useEffect(()=>{((a==null?void 0:a.gateway)==="PayPalFF"||(a==null?void 0:a.gateway)==="Сashapp")&&m(!0)},[a]),P.useEffect(()=>{var g;if(a!=null&&a.displayPaymentInfo&&a.displayPaymentInfo.length===1&&a.status===ye.NotPaid&&!f.current){const x=a.displayPaymentInfo[0];x.type==="Button"&&((g=x.props)!=null&&g.url)&&(window.open(x.props.url,"_blank"),f.current=!0)}},[a==null?void 0:a.displayPaymentInfo,a==null?void 0:a.status]),r?i.jsx("div",{className:Pt.loaderContainer,children:i.jsx(w.Loader,{})}):i.jsxs("div",{className:Pt.chargePageContainer,children:[i.jsx("div",{className:Pt.chargeItems,children:i.jsx(Ad,{charge:a})}),i.jsx("div",{className:Pt.mainContent,style:p?{borderLeft:"1px solid var(--border-secondary)"}:void 0,children:i.jsxs("div",{className:b.clx(Pt.contentWrapper,{[Pt.antistockContent]:p}),children:[a&&(a==null?void 0:a.status)!==ye.NotPaid&&i.jsx(yd,{charge:a}),a&&i.jsxs("div",{className:b.clx(Pt.statusBlock,{[Pt.statusBlockAntistock]:p}),children:[i.jsx(Oi,{lastUpdate:a.expiresAt,email:a.customerForCharge.email,invoiceId:a.id,paymentType:a.gateway}),p&&(a==null?void 0:a.status)===ye.NotPaid&&i.jsx("div",{className:Pt.antistockPayNow,children:a==null?void 0:a.displayPaymentInfo.map((g,x)=>i.jsx(ea,{block:g},x))}),p&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:Pt.antistockTrackPayment,children:i.jsx(va,{timeline:a.timeline})}),i.jsx(Hn,{className:Pt.antistockFooter})]})]}),!p&&(a==null?void 0:a.status)===ye.NotPaid&&i.jsx("div",{className:Pt.notPaidSection,children:a==null?void 0:a.displayPaymentInfo.map((g,x)=>i.jsx(ea,{block:g},x))}),!p&&i.jsx(Hn,{className:Pt.footer})]})}),(a==null?void 0:a.gateway)==="PayPalFF"&&o&&i.jsx(w.Modal,{close:()=>c(!1),children:i.jsx(kd,{price:a.price,setIsOpen:c})}),(a==null?void 0:a.gateway)==="Сashapp"&&o&&i.jsx(w.Modal,{close:()=>u(!1),children:i.jsx(Sd,{setIsOpen:c,chargeId:a.id})})]})},JD=Object.freeze(Object.defineProperty({__proto__:null,ChargePage:QD},Symbol.toStringTag,{value:"Module"}));exports.ActivePaymentMethod=Pd;exports.ActiveSubscriptionProduct=Rd;exports.BalanceModal=$l;exports.ChangeSubscriptionPlan=wd;exports.ChargeStatus=ye;exports.CheckoutFooter=Hn;exports.CheckoutHeader=ma;exports.CheckoutItems=f0;exports.CheckoutOperational=xd;exports.CheckoutOrderMainData=Oi;exports.CheckoutPrices=kr;exports.CheckoutProduct=ga;exports.LeaveAReview=Bd;exports.MarkdownText=la;exports.NoItemsBlock=ha;exports.OrderStatus=Ie;exports.OrderStatusBlock=Fd;exports.OrdersTable=s0;exports.PageTitle=fa;exports.PaginationWithRange=fu;exports.ReCaptchaProvider=Gs;exports.StableText=Gc;exports.SubscriptionCoupon=Ld;exports.SubscriptionExpirationDate=Dd;exports.SubscriptionProduct=vd;exports.SubscriptionsTable=Nd;exports.Table=pa;exports.TableItemTitle=Nt;exports.TicketRow=Id;exports.TrackPayment=va;exports.auth=I2;exports.fetchAuthorizedOrder=o2;exports.fetchGeneral=Zd;exports.fetchOrder=i2;exports.fetchOrders=s2;exports.fetchPrivacyPolicy=u2;exports.fetchRefundPolicy=r2;exports.fetchSubscription=h2;exports.fetchSubscriptions=b2;exports.fetchTerms=n2;exports.fetchThemeAndSettings=Wd;exports.fetchTicket=C2;exports.fetchTickets=T2;exports.getBalance=aa;exports.getBalanceSettings=ol;exports.getGatewaysDetail=ou;exports.index=BD;exports.index$1=JD;exports.parseDraftJsText=il;exports.recapcha=gf;exports.sendTicketMessage=E2;exports.useCart=su;exports.useCopy=Jn;exports.useGeneralInfo=nl;exports.useMarkdownIt=Rl;exports.useReCaptcha=iu;
|