studiograph 1.3.48-next.261 → 1.3.48-next.262
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/agent/prompts/system.md +2 -2
- package/dist/agent/skills/artifact-canvas/skill.md +25 -37
- package/dist/agent/skills/paged-documents/skill.md +53 -103
- package/dist/agent/tools/artifact-tools.js +1 -1
- package/dist/agent/tools/artifact-tools.js.map +1 -1
- package/dist/core/artifact-columns-css.d.ts +38 -0
- package/dist/core/artifact-columns-css.js +157 -0
- package/dist/core/artifact-columns-css.js.map +1 -0
- package/dist/core/artifact-frame-document.d.ts +57 -15
- package/dist/core/artifact-frame-document.js +351 -346
- package/dist/core/artifact-frame-document.js.map +1 -1
- package/dist/mcp/tools.js +8 -8
- package/dist/mcp/tools.js.map +1 -1
- package/dist/server/routes/artifact-export-api.js +2 -3
- package/dist/server/routes/artifact-export-api.js.map +1 -1
- package/dist/services/artifact-library-sources.d.ts +1 -6
- package/dist/services/artifact-library-sources.js +1 -9
- package/dist/services/artifact-library-sources.js.map +1 -1
- package/dist/services/artifact-render-export.d.ts +3 -3
- package/dist/services/artifact-render-export.js +57 -50
- package/dist/services/artifact-render-export.js.map +1 -1
- package/dist/web/_app/immutable/chunks/2jM_FrdF.js +1 -0
- package/dist/web/_app/immutable/chunks/{DtXJCaQc2.js → 3Jf1z4Hy2.js} +1 -1
- package/dist/web/_app/immutable/chunks/3e54b3S0.js +1 -0
- package/dist/web/_app/immutable/chunks/7pkBLE0o.js +23 -0
- package/dist/web/_app/immutable/chunks/{B9VQbssY.js → B1pVemww.js} +1 -1
- package/dist/web/_app/immutable/chunks/{DMFH9Cnt2.js → B4K-yj0D2.js} +1 -1
- package/dist/web/_app/immutable/chunks/B7P31uII.js +1 -0
- package/dist/web/_app/immutable/chunks/B7QhSEou.js +1 -0
- package/dist/web/_app/immutable/chunks/{F5xZdLlB.js → B7WN6QF2.js} +1 -1
- package/dist/web/_app/immutable/chunks/{Cg7m1gqN.js → BBiZOxjN.js} +1 -1
- package/dist/web/_app/immutable/chunks/BH8Lm2ff.js +1 -0
- package/dist/web/_app/immutable/chunks/BLw5bIbe.js +1 -0
- package/dist/web/_app/immutable/chunks/{Oglnp7sm.js → BNq2--8a.js} +1 -1
- package/dist/web/_app/immutable/chunks/BaEbafZv.js +1 -0
- package/dist/web/_app/immutable/chunks/{sUAtda6y2.js → BeMEksa_2.js} +1 -1
- package/dist/web/_app/immutable/chunks/BksI9pEP.js +2 -0
- package/dist/web/_app/immutable/chunks/{CLninaDG2.js → Bncd_2iV2.js} +2 -2
- package/dist/web/_app/immutable/chunks/Bo6vsMxZ.js +1 -0
- package/dist/web/_app/immutable/chunks/{D0_Iu3Uj.js → BwZmyfEX.js} +1 -1
- package/dist/web/_app/immutable/chunks/{7l950wkn.js → CB2VdVc2.js} +1 -1
- package/dist/web/_app/immutable/chunks/CGG26Xmx.js +1 -0
- package/dist/web/_app/immutable/chunks/{K5YHt1WL2.js → CRANgTjw2.js} +1 -1
- package/dist/web/_app/immutable/chunks/{CuatNdzp.js → CSkL5wO6.js} +1 -1
- package/dist/web/_app/immutable/chunks/C_vyTCDY.js +1 -0
- package/dist/web/_app/immutable/chunks/{CQW66fYJ.js → Ca57r8F-.js} +1 -1
- package/dist/web/_app/immutable/chunks/CbnTIbQI2.js +915 -0
- package/dist/web/_app/immutable/chunks/{CR1JY_cb.js → CdvkVymz2.js} +1 -1
- package/dist/web/_app/immutable/chunks/{atFSAfcd2.js → Cf7pPlrJ2.js} +2 -2
- package/dist/web/_app/immutable/chunks/{CKwV6HKc.js → Cg5kjIaW.js} +1 -1
- package/dist/web/_app/immutable/chunks/{BvyVm7-j.js → CmPtL-Rn.js} +1 -1
- package/dist/web/_app/immutable/chunks/{B3u4QMoU.js → CnpFxw1N2.js} +1 -1
- package/dist/web/_app/immutable/chunks/D2G8GgRX.js +1 -0
- package/dist/web/_app/immutable/chunks/D3ZdQV1G2.js +66 -0
- package/dist/web/_app/immutable/chunks/{snCOoD78.js → D74E7DtA.js} +1 -1
- package/dist/web/_app/immutable/chunks/{B4PrlkmE.js → D8nBN3-t.js} +1 -1
- package/dist/web/_app/immutable/chunks/{Bpmx7Umc.js → DE5MFphK.js} +1 -1
- package/dist/web/_app/immutable/chunks/DGayKSDC.js +1 -0
- package/dist/web/_app/immutable/chunks/{BU5TCj7m.js → DHtwYMGu2.js} +1 -1
- package/dist/web/_app/immutable/chunks/DIro3eQz.js +1 -0
- package/dist/web/_app/immutable/chunks/{DgP0Pxes.js → DJ61sY6B.js} +1 -1
- package/dist/web/_app/immutable/chunks/{-MYqXlc3.js → DLFxzom2.js} +1 -1
- package/dist/web/_app/immutable/chunks/{BIeOkmiV.js → DOTPES0g.js} +1 -1
- package/dist/web/_app/immutable/chunks/DWbRq2tL.js +1 -0
- package/dist/web/_app/immutable/chunks/{BBrP9GiZ.js → D_iZ9buk.js} +1 -1
- package/dist/web/_app/immutable/chunks/Dm-W1U3E.js +1 -0
- package/dist/web/_app/immutable/chunks/{DhD1HF7R.js → DnUROuxo.js} +1 -1
- package/dist/web/_app/immutable/chunks/{B5UH1FNe.js → DqGcR20a.js} +3 -3
- package/dist/web/_app/immutable/chunks/{DaB0hU8_.js → DqGo4lyB2.js} +1 -1
- package/dist/web/_app/immutable/chunks/{ChS3kWO-.js → DrD4p8T22.js} +1 -1
- package/dist/web/_app/immutable/chunks/{-Tbr-96c2.js → DtsNBsm82.js} +1 -1
- package/dist/web/_app/immutable/chunks/{B06uE1qJ.js → DwvPlTQh.js} +1 -1
- package/dist/web/_app/immutable/chunks/{CZBW5wi82.js → DxPoYrW02.js} +1 -1
- package/dist/web/_app/immutable/chunks/DxQ5eC8d.js +1 -0
- package/dist/web/_app/immutable/chunks/{2z2ekE6D2.js → DzBvLWrB2.js} +2 -2
- package/dist/web/_app/immutable/chunks/{CcgYvk_3.js → G9YEWi42.js} +1 -1
- package/dist/web/_app/immutable/chunks/{CQl_RUVN2.js → HMuf07932.js} +1 -1
- package/dist/web/_app/immutable/chunks/{CG8YKaqc.js → HdbzGSgU.js} +1 -1
- package/dist/web/_app/immutable/chunks/{Cxdio_Al.js → Mozc9LAu.js} +3 -3
- package/dist/web/_app/immutable/chunks/{D-vvXTU3.js → Ryiz4ZhP.js} +2 -2
- package/dist/web/_app/immutable/chunks/{1QRy7-wo.js → gIVpw0C1.js} +1 -1
- package/dist/web/_app/immutable/chunks/{Cx5IiiDO2.js → gwOFYscJ2.js} +1 -1
- package/dist/web/_app/immutable/chunks/nacCpTNj.js +83 -0
- package/dist/web/_app/immutable/chunks/{PwUOTfSv.js → rSrKfaH92.js} +1 -1
- package/dist/web/_app/immutable/chunks/{CkivrILi.js → tvHn3XYh.js} +1 -1
- package/dist/web/_app/immutable/chunks/{pPsy4008.js → w53PifJt.js} +1 -1
- package/dist/web/_app/immutable/entry/app.D9mnvkg5.js +2 -0
- package/dist/web/_app/immutable/entry/start.B1L019Jv.js +1 -0
- package/dist/web/_app/immutable/nodes/{0.v0W5DL7W.js → 0.GCsQhZXx.js} +2 -2
- package/dist/web/_app/immutable/nodes/{1.81Rb3Ith.js → 1.Bai1Q_j6.js} +1 -1
- package/dist/web/_app/immutable/nodes/{10.CAlZNFOq.js → 10.Y-zXN2Lv.js} +1 -1
- package/dist/web/_app/immutable/nodes/{11.CCfUginI.js → 11.BGLbrt6p.js} +1 -1
- package/dist/web/_app/immutable/nodes/{12.BJLboAyk.js → 12.kkg6EDtl.js} +1 -1
- package/dist/web/_app/immutable/nodes/{13.Cz4UTl2G.js → 13.DVLmp3Ll.js} +1 -1
- package/dist/web/_app/immutable/nodes/15.B6Aw4lhr.js +1 -0
- package/dist/web/_app/immutable/nodes/{16.BjohAUt9.js → 16.BvduImqP.js} +1 -1
- package/dist/web/_app/immutable/nodes/{18.DsOT0tDo.js → 18.pwlJhpUE.js} +1 -1
- package/dist/web/_app/immutable/nodes/{19.BiJWLOUT.js → 19.CC1kL3Df.js} +1 -1
- package/dist/web/_app/immutable/nodes/2.CvV_5gfw.js +124 -0
- package/dist/web/_app/immutable/nodes/{3.BIT9mm9r.js → 3.DBPrinvQ.js} +1 -1
- package/dist/web/_app/immutable/nodes/{4.Cn7r0Poe.js → 4.A-1yULWB.js} +3 -3
- package/dist/web/_app/immutable/nodes/{5.CkJNdCZG.js → 5.CN9jkFSb.js} +1 -1
- package/dist/web/_app/immutable/nodes/{6.1rbIRQgQ.js → 6.B2TGmdUT.js} +1 -1
- package/dist/web/_app/immutable/nodes/{7.w17Zl36i.js → 7.DQFIEPX4.js} +1 -1
- package/dist/web/_app/immutable/nodes/{8.DqTsYuU-.js → 8.CsTDHJ_M.js} +1 -1
- package/dist/web/_app/immutable/nodes/{9.BJhYZPfc.js → 9.B9zlBMg4.js} +1 -1
- package/dist/web/_app/version.json +1 -1
- package/dist/web/index.html +17 -17
- package/package.json +1 -2
- package/dist/core/artifact-bundle.d.ts +0 -69
- package/dist/core/artifact-bundle.js +0 -305
- package/dist/core/artifact-bundle.js.map +0 -1
- package/dist/core/artifact-export.d.ts +0 -83
- package/dist/core/artifact-export.js +0 -1567
- package/dist/core/artifact-export.js.map +0 -1
- package/dist/core/artifact-frame-selectors.d.ts +0 -42
- package/dist/core/artifact-frame-selectors.js +0 -65
- package/dist/core/artifact-frame-selectors.js.map +0 -1
- package/dist/core/artifact-paged-css.d.ts +0 -64
- package/dist/core/artifact-paged-css.js +0 -253
- package/dist/core/artifact-paged-css.js.map +0 -1
- package/dist/core/field-library.d.ts +0 -62
- package/dist/core/field-library.js +0 -129
- package/dist/core/field-library.js.map +0 -1
- package/dist/mcp/comment-virtual-entity.d.ts +0 -36
- package/dist/mcp/comment-virtual-entity.js +0 -71
- package/dist/mcp/comment-virtual-entity.js.map +0 -1
- package/dist/server/routes/field-library-api.d.ts +0 -28
- package/dist/server/routes/field-library-api.js +0 -126
- package/dist/server/routes/field-library-api.js.map +0 -1
- package/dist/server/routes/import-batch.d.ts +0 -24
- package/dist/server/routes/import-batch.js +0 -33
- package/dist/server/routes/import-batch.js.map +0 -1
- package/dist/services/artifact-inspect-metadata.d.ts +0 -21
- package/dist/services/artifact-inspect-metadata.js +0 -66
- package/dist/services/artifact-inspect-metadata.js.map +0 -1
- package/dist/services/asset-upload-service.d.ts +0 -56
- package/dist/services/asset-upload-service.js +0 -200
- package/dist/services/asset-upload-service.js.map +0 -1
- package/dist/services/bookmark-import-service.d.ts +0 -49
- package/dist/services/bookmark-import-service.js +0 -250
- package/dist/services/bookmark-import-service.js.map +0 -1
- package/dist/web/_app/immutable/chunks/1_BWKAKA2.js +0 -23
- package/dist/web/_app/immutable/chunks/9Sn2PwSn2.js +0 -1025
- package/dist/web/_app/immutable/chunks/B2cjR0rG.js +0 -83
- package/dist/web/_app/immutable/chunks/BIwe25Lk.js +0 -1
- package/dist/web/_app/immutable/chunks/BnYohOts2.js +0 -1
- package/dist/web/_app/immutable/chunks/BxeOdaUQ.js +0 -1
- package/dist/web/_app/immutable/chunks/C6d9nn3k.js +0 -1
- package/dist/web/_app/immutable/chunks/C85NG5lS.js +0 -1
- package/dist/web/_app/immutable/chunks/CB-t1Bv-.js +0 -1
- package/dist/web/_app/immutable/chunks/CJbr-v9X.js +0 -1
- package/dist/web/_app/immutable/chunks/CKGHeJzq.js +0 -1
- package/dist/web/_app/immutable/chunks/CXPMb3zd.js +0 -1
- package/dist/web/_app/immutable/chunks/CgCz4Fj6.js +0 -1
- package/dist/web/_app/immutable/chunks/CuYL65Bn.js +0 -2
- package/dist/web/_app/immutable/chunks/D4vfNy_f.js +0 -1
- package/dist/web/_app/immutable/chunks/DBGaXAP8.js +0 -1
- package/dist/web/_app/immutable/chunks/DG7uGoZb2.js +0 -58
- package/dist/web/_app/immutable/chunks/DTOO9nUj.js +0 -1
- package/dist/web/_app/immutable/chunks/Dav8Lgyy2.js +0 -5
- package/dist/web/_app/immutable/chunks/DiiXREv7.js +0 -1
- package/dist/web/_app/immutable/chunks/DjXtgWTP.js +0 -1
- package/dist/web/_app/immutable/chunks/oIZupUnz.js +0 -1
- package/dist/web/_app/immutable/entry/app.1tcNTKI-.js +0 -2
- package/dist/web/_app/immutable/entry/start.BJMsySI1.js +0 -1
- package/dist/web/_app/immutable/nodes/15.D2mNE6C-.js +0 -1
- package/dist/web/_app/immutable/nodes/2.Cd72nG2V.js +0 -124
- /package/dist/web/_app/immutable/chunks/{B9KfEsQw2.js → B9KfEsQw.js} +0 -0
- /package/dist/web/_app/immutable/chunks/{BO6-nRV9.js → BO6-nRV92.js} +0 -0
- /package/dist/web/_app/immutable/chunks/{CcWaWbrI2.js → CcWaWbrI.js} +0 -0
- /package/dist/web/_app/immutable/chunks/{CsIWxmio2.js → CsIWxmio.js} +0 -0
- /package/dist/web/_app/immutable/chunks/{DQMWa2t7.js → DQMWa2t72.js} +0 -0
- /package/dist/web/_app/immutable/chunks/{MAYbL-xn2.js → MAYbL-xn.js} +0 -0
- /package/dist/web/_app/immutable/chunks/{MtN4vJa02.js → MtN4vJa0.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as e,Dt as t,Et as n,Ft as r,G as i,Gt as a,H as o,Ht as s,I as c,It as l,K as u,Mt as d,O as f,P as p,Pt as m,R as h,S as g,T as _,U as v,V as y,Vt as b,W as x,X as S,Z as C,a as w,at as ee,c as T,ct as E,d as te,g as D,ht as O,j as ne,k,kt as re,mt as A,o as j,ot as M,pt as N,s as P,st as F,u as ie,v as ae,vt as I,wt as L,x as oe,xt as R,yt as z,z as B}from"./FISIvbqq.js";import"./B4PrlkmE.js";import"./xihTtKlq.js";import{B as V,Dt as se,H,Nt as U,Ot as ce,dt as le,ht as ue,kt as W,mt as de,pt as fe,ut as G,vt as pe,z as me}from"./w5tsuIav.js";import{t as he}from"./CgOgBK5j.js";import"./CWIHttTH.js";import{t as ge}from"./DIsSxB_C.js";import{A as _e,D as ve,E as ye,M as be,T as xe,a as Se,i as Ce,j as we,k as Te,r as Ee,t as De}from"./DwuBUEvU.js";import{a as K,i as q,t as J}from"./GC5Izn9E2.js";import{f as Oe,n as ke,t as Ae}from"./DqKYbIld2.js";import{S as je,T as Me,h as Ne,i as Pe,l as Fe,m as Ie,p as Le,r as Re}from"./BZDKT2Qw2.js";import{n as ze,r as Be,t as Ve}from"./DAsarOLg2.js";import{t as He}from"./DPLkAijI2.js";import{t as Ue}from"./CQW66fYJ.js";import{n as We,t as Ge}from"./BqButnP4.js";var Y=de({component:`toggle-group`,parts:[`root`,`item`]}),X=new ce(`ToggleGroup.Root`),Z=class{opts;rovingFocusGroup;attachment;constructor(e){this.opts=e,this.attachment=pe(this.opts.ref),this.rovingFocusGroup=new H({candidateAttr:Y.item,rootNode:e.ref,loop:e.loop,orientation:e.orientation})}#e=L(()=>({id:this.opts.id.current,[Y.root]:``,role:`group`,"data-orientation":this.opts.orientation.current,"data-disabled":G(this.opts.disabled.current),...this.attachment}));get props(){return C(this.#e)}set props(e){z(this.#e,e)}},Ke=class extends Z{opts;isMulti=!1;#e=L(()=>this.opts.value.current!==``);get anyPressed(){return C(this.#e)}set anyPressed(e){z(this.#e,e)}constructor(e){super(e),this.opts=e}includesItem(e){return this.opts.value.current===e}toggleItem(e,t){this.includesItem(e)?this.opts.value.current=``:(this.opts.value.current=e,this.rovingFocusGroup.setCurrentTabStopId(t))}},qe=class extends Z{opts;isMulti=!0;#e=L(()=>this.opts.value.current.length>0);get anyPressed(){return C(this.#e)}set anyPressed(e){z(this.#e,e)}constructor(e){super(e),this.opts=e}includesItem(e){return this.opts.value.current.includes(e)}toggleItem(e,t){this.includesItem(e)?this.opts.value.current=this.opts.value.current.filter(t=>t!==e):(this.opts.value.current=[...this.opts.value.current,e],this.rovingFocusGroup.setCurrentTabStopId(t))}},Je=class{static create(e){let{type:t,...n}=e,r=t===`single`?new Ke(n):new qe(n);return X.set(r)}},Ye=class e{static create(t){return new e(t,X.get())}opts;root;attachment;#e=L(()=>this.opts.disabled.current||this.root.opts.disabled.current);#t=L(()=>this.root.includesItem(this.opts.value.current));get isPressed(){return C(this.#t)}set isPressed(e){z(this.#t,e)}#n=L(()=>this.root.isMulti?void 0:ue(this.isPressed,!1));#r=L(()=>this.root.isMulti?le(this.isPressed):void 0);constructor(e,t){this.opts=e,this.root=t,this.attachment=pe(this.opts.ref),E(()=>{this.root.opts.rovingFocus.current?z(this.#a,this.root.rovingFocusGroup.getTabIndex(this.opts.ref.current),!0):z(this.#a,0)}),this.onclick=this.onclick.bind(this),this.onkeydown=this.onkeydown.bind(this)}#i(){C(this.#e)||this.root.toggleItem(this.opts.value.current,this.opts.id.current)}onclick(e){C(this.#e)||this.root.toggleItem(this.opts.value.current,this.opts.id.current)}onkeydown(e){if(!C(this.#e)){if(e.key===`Enter`||e.key===` `){e.preventDefault(),this.#i();return}this.root.opts.rovingFocus.current&&this.root.rovingFocusGroup.handleKeydown(this.opts.ref.current,e)}}#a=R(0);#o=L(()=>({pressed:this.isPressed}));get snippetProps(){return C(this.#o)}set snippetProps(e){z(this.#o,e)}#s=L(()=>({id:this.opts.id.current,role:this.root.isMulti?void 0:`radio`,tabindex:C(this.#a),"data-orientation":this.root.opts.orientation.current,"data-disabled":G(C(this.#e)),"data-state":Q(this.isPressed),"data-value":this.opts.value.current,"aria-pressed":C(this.#r),"aria-checked":C(this.#n),disabled:fe(C(this.#e)),[Y.item]:``,onclick:this.onclick,onkeydown:this.onkeydown,...this.attachment}));get props(){return C(this.#s)}set props(e){z(this.#s,e)}};function Q(e){return e?`on`:`off`}var Xe=e(`<div><!></div>`);function Ze(e,t){let n=o();r(t,!0);let i=j(t,`id`,19,()=>me(n)),c=j(t,`ref`,15,null),l=j(t,`value`,15),u=j(t,`onValueChange`,3,V),d=j(t,`disabled`,3,!1),f=j(t,`loop`,3,!0),g=j(t,`orientation`,3,`horizontal`),_=j(t,`rovingFocus`,3,!0),v=P(t,[`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`value`,`onValueChange`,`type`,`disabled`,`loop`,`orientation`,`rovingFocus`,`child`,`children`]);function y(){l()===void 0&&l(t.type===`single`?``:[])}y(),se.pre(()=>l(),()=>{y()});let b=Je.create({id:U(()=>i()),value:U(()=>l(),e=>{l(e),u()(e)}),disabled:U(()=>d()),loop:U(()=>f()),orientation:U(()=>g()),rovingFocus:U(()=>_()),type:t.type,ref:U(()=>c(),e=>c(e))}),x=L(()=>W(v,b.props));var S=B(),w=A(S),ee=e=>{var n=B();k(A(n),()=>t.child,()=>({props:C(x)})),h(e,n)},T=e=>{var n=Xe();D(n,()=>({...C(x)})),k(N(n),()=>t.children??a),s(n),h(e,n)};p(w,e=>{t.child?e(ee):e(T,-1)}),h(e,S),m()}var Qe=e(`<button><!></button>`);function $e(e,t){let n=o();r(t,!0);let i=j(t,`ref`,15,null),c=j(t,`disabled`,3,!1),l=j(t,`id`,19,()=>me(n)),u=j(t,`type`,3,`button`),d=P(t,[`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`ref`,`value`,`disabled`,`id`,`type`]),f=Ye.create({id:U(()=>l()),value:U(()=>t.value),disabled:U(()=>c()??!1),ref:U(()=>i(),e=>i(e))}),g=L(()=>W(d,f.props,{type:u()}));var _=B(),v=A(_),y=e=>{var n=B(),r=A(n);{let e=L(()=>({props:C(g),...f.snippetProps}));k(r,()=>t.child,()=>C(e))}h(e,n)},b=e=>{var n=Qe();D(n,()=>({...C(g)})),k(N(n),()=>t.children??a,()=>f.snippetProps),s(n),h(e,n)};p(v,e=>{t.child?e(y):e(b,-1)}),h(e,_),m()}var et=y(`<title> </title>`),$=y(`<svg><!><path d="M6 18 7.41 19.41 15 11.83 15 30 17 30 17 11.83 24.59 19.41 26 18 16 8 6 18z"></path><path d="M6,8V4H26V8h2V4a2,2,0,0,0-2-2H6A2,2,0,0,0,4,4V8Z"></path></svg>`);function tt(e,t){let n=w(t,[`children`,`$$slots`,`$$events`,`$$legacy`]),i=w(n,[`size`,`title`]);r(t,!1);let a=I(),o=I(),l=j(t,`size`,8,16),u=j(t,`title`,8,void 0);ee(()=>(S(n),S(u())),()=>{z(a,n[`aria-label`]||n[`aria-labelledby`]||u())}),ee(()=>(C(a),S(n)),()=>{z(o,{"aria-hidden":C(a)?void 0:!0,role:C(a)?`img`:void 0,focusable:Number(n.tabindex)===0?!0:void 0})}),M(),ie();var d=$();D(d,()=>({xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 32`,fill:`currentColor`,preserveAspectRatio:`xMidYMid meet`,width:l(),height:l(),...C(o),...i}));var f=N(d),g=e=>{var t=et(),n=N(t,!0);s(t),F(()=>c(n,u())),h(e,t)};p(f,e=>{u()&&e(g)}),b(2),s(d),h(e,d),m()}function nt(){return typeof navigator<`u`&&/Mac|iPhone|iPad|iPod/i.test(navigator.platform??``)}function rt(){return nt()?`⌘`:`Ctrl+`}var it=q({base:`hover:bg-muted hover:text-muted-foreground data-[state=on]:bg-accent data-[state=on]:text-accent-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,variants:{variant:{default:`bg-transparent`,outline:`border-input hover:bg-accent hover:text-accent-foreground border bg-transparent shadow-xs`},size:{default:`h-9 min-w-9 px-2`,sm:`h-8 min-w-8 px-1.5`,lg:`h-10 min-w-10 px-2.5`}},defaultVariants:{variant:`default`,size:`default`}});function at(e){l(`toggleGroup`,e)}function ot(){return d(`toggleGroup`)}function st(e,t){r(t,!0);let n=j(t,`ref`,15,null),i=j(t,`value`,15),a=j(t,`size`,3,`default`),o=j(t,`spacing`,3,0),s=j(t,`variant`,3,`default`),c=P(t,[`$$slots`,`$$events`,`$$legacy`,`ref`,`value`,`class`,`size`,`spacing`,`variant`]);at({get variant(){return s()},get size(){return a()},get spacing(){return o()}});var l=B(),u=A(l);{let e=L(()=>`--gap: ${o()}`),r=L(()=>K(`group/toggle-group flex w-fit items-center gap-[--spacing(var(--gap))] rounded-md data-[spacing=default]:data-[variant=outline]:shadow-xs`,t.class));f(u,()=>Ze,(t,l)=>{l(t,T({"data-slot":`toggle-group`,get"data-variant"(){return s()},get"data-size"(){return a()},get"data-spacing"(){return o()},get style(){return C(e)},get class(){return C(r)}},()=>c,{get value(){return i()},set value(e){i(e)},get ref(){return n()},set ref(e){n(e)}}))})}h(e,l),m()}function ct(e,t){r(t,!0);let n=j(t,`ref`,15,null),i=P(t,[`$$slots`,`$$events`,`$$legacy`,`ref`,`value`,`class`,`size`,`variant`]),a=ot();var o=B(),s=A(o);{let e=L(()=>a.variant||t.variant),r=L(()=>a.size||t.size),o=L(()=>K(it({variant:a.variant||t.variant,size:a.size||t.size}),`w-auto min-w-0 shrink-0 px-3 focus:z-10 focus-visible:z-10 data-[spacing=0]:rounded-none data-[spacing=0]:shadow-none data-[spacing=0]:first:rounded-l-md data-[spacing=0]:last:rounded-r-md data-[spacing=0]:data-[variant=outline]:border-l-0 data-[spacing=0]:data-[variant=outline]:first:border-l`,t.class));f(s,()=>$e,(s,c)=>{c(s,T({"data-slot":`toggle-group-item`,get"data-variant"(){return C(e)},get"data-size"(){return C(r)},get"data-spacing"(){return a.spacing},get class(){return C(o)},get value(){return t.value}},()=>i,{get ref(){return n()},set ref(e){n(e)}}))})}h(e,o),m()}var lt=e(`<!> <!>`,1),ut=e(`<!> <span class="picker-folder-label svelte-yml3mb"> </span> <!>`,1),dt=e(`<div class="picker-divider svelte-yml3mb" role="separator"></div>`),ft=e(`<div class="picker-search svelte-yml3mb"><!></div>`),pt=e(`<div class="picker-state svelte-yml3mb" role="alert"><p> </p> <!></div>`),mt=e(`<div class="picker-state svelte-yml3mb" role="status" aria-live="polite"><!> <span class="sr-only svelte-yml3mb">Loading images…</span></div>`),ht=e(`<p class="picker-empty-message svelte-yml3mb"> </p> <!>`,1),gt=e(`<p class="picker-empty-message svelte-yml3mb"> </p> <!>`,1),_t=e(`<div class="picker-state svelte-yml3mb"><!></div>`),vt=e(`<div class="picker-spacer svelte-yml3mb" aria-hidden="true"></div>`),yt=e(`<img alt="" loading="lazy" draggable="false" class="svelte-yml3mb"/>`),bt=e(`<span class="picker-tile-glyph svelte-yml3mb" aria-hidden="true"><!></span>`),xt=e(`<button type="button"><span class="picker-tile-media svelte-yml3mb"><!> <span class="picker-tile-check svelte-yml3mb" aria-hidden="true"><!></span></span> <span class="picker-tile-name svelte-yml3mb"> </span></button>`),St=e(`<div class="picker-spacer svelte-yml3mb" aria-hidden="true"></div>`),Ct=e(`<div class="picker-grid svelte-yml3mb"><!> <!> <!></div>`),wt=e(`<!> <p class="svelte-yml3mb">Uploading…</p>`,1),Tt=e(`<!> <p class="svelte-yml3mb"> </p>`,1),Et=e(`<div class="picker-drop-overlay svelte-yml3mb"><!></div>`),Dt=e(`<div class="picker-library svelte-yml3mb"><!> <div class="picker-scroll svelte-yml3mb"><!></div></div> <!>`,1),Ot=e(`<!> <p class="picker-upload-hint svelte-yml3mb">Uploading…</p>`,1),kt=e(`<!> <p class="svelte-yml3mb">Drag images here, or <button type="button" class="picker-upload-browse svelte-yml3mb">browse files</button></p> <p class="picker-upload-dest svelte-yml3mb"> </p>`,1),At=e(`<div><!></div>`),jt=e(`<div class="picker-shell svelte-yml3mb"><!> <div class="picker-context svelte-yml3mb"><!> <!></div> <!> <input type="file" multiple="" style="display:none"/></div>`),Mt=e(`<!> <!>`,1),Nt=e(`<!> <!> <!>`,1);function Pt(e,a){r(a,!0);let o=()=>t(Ye,`$virtualizer`,l),[l,d]=n();Re.load();let y=L(()=>Pe(Re.current().formats)),x=j(a,`open`,15),S=j(a,`media`,3,`image`),w=L(()=>!!a.onPick),ee=L(()=>S()===`all`?[`image`,`document`]:[`image`]),T=R(`library`),D=`library`;E(()=>{C(T)===`library`||C(T)===`upload`?D=C(T):z(T,D,!0)}),E(()=>{x()&&z(T,`library`)}),E(()=>{x()&&a.entity&&C(U)&&C(le).length===0&&z(T,`upload`)});let k=R(``),M=R(``);E(()=>{let e=C(k);if(e===C(M))return;let t=setTimeout(()=>{requestAnimationFrame(()=>{z(M,e,!0)})},200);return()=>clearTimeout(t)});let P=L(()=>C(k)!==C(M));function ie(){z(k,``),z(M,``)}let I=R(!1),V=R(!1),se=R(void 0),H=R(``),U=L(()=>ze.loaded),ce=L(()=>ze.error),le=L(()=>ze.assets.filter(e=>C(ee).includes(e.mediaType))),ue=L(()=>Me(C(le),`created`,!1)),W=L(()=>Ie(C(ue),{search:C(M),folders:C(H)?[C(H)]:[],media:[]})),de=L(()=>Ie(C(ue),{search:``,folders:C(H)?[C(H)]:[],media:[]}).length),fe=L(()=>C(U)&&C(de)===0);E(()=>{C(fe)&&C(k)&&ie()});let G=L(()=>{let e=ze.folders.map(e=>({value:e.repo,label:e.workspaceWide?`Studio`:Ne(e),ws:!!e.workspaceWide}));return e.sort((e,t)=>e.ws===t.ws?e.label.localeCompare(t.label,void 0,{sensitivity:`base`}):e.ws?-1:1),[{value:``,label:`All folders`},...e.map(({value:e,label:t})=>({value:e,label:t}))]}),pe=L(()=>C(H)?C(G).find(e=>e.value===C(H))?.label??C(H):`All folders`),me=L(()=>a.entity?C(G).find(e=>e.value===a.entity.repo)?.label??a.entity.repo:``);E(()=>{x()&&z(H,a.entity?.repo??``,!0)});let K=R(null),q=R(null),Y=R(5),X=R(140),Z=R(152),Ke=R(0);function qe(){if(C(K)){let e=C(K).offsetWidth-C(K).clientWidth;e!==C(Ke)&&z(Ke,e)}if(!C(q))return;let e=getComputedStyle(C(q)),t=e.gridTemplateColumns.split(` `).filter(Boolean);t.length>0&&t.length!==C(Y)&&z(Y,t.length,!0);let n=parseFloat(t[0]||`0`);if(n>0){let t=n+28;Math.abs(t-C(X))>=.5&&z(X,t);let r=t+parseFloat(e.rowGap||`0`);Math.abs(r-C(Z))>=.5&&z(Z,r)}}E(()=>{if(!C(q))return;qe();let e=new ResizeObserver(()=>qe());return e.observe(C(q)),()=>e.disconnect()});let Je=L(()=>Math.ceil(C(W).length/C(Y))),Ye=Ue({count:0,getScrollElement:()=>null,estimateSize:()=>C(Z),overscan:2});E(()=>{let e=C(Je),t=C(Z);re(Ye).setOptions({count:e,getScrollElement:()=>C(K),estimateSize:()=>t,overscan:2})});let Q=L(()=>o().getVirtualItems()),Xe=L(()=>C(Q).length>0?C(Q)[0].index:0),Ze=L(()=>C(Q).length>0?Math.max(0,C(Je)-C(Q)[C(Q).length-1].index-1):0),Qe=L(()=>{if(C(Q).length===0)return{start:0,items:C(W).slice(0,C(Y)*4)};let e=C(Q)[0].index*C(Y),t=Math.min(C(W).length,(C(Q)[C(Q).length-1].index+1)*C(Y));return{start:e,items:C(W).slice(e,t)}}),$e=L(()=>C(Qe).start),et=L(()=>C(Qe).items);E(()=>{x()&&Ve()});let $=Ge(()=>C(W),Fe);function nt(e,t){$.toggleAt(e,{shiftKey:t.shiftKey})}function rt(){let e=$.getSelected();if(e.length!==0){if(a.onPick)a.onPick(e);else for(let t of e)a.onInsert?.(t.embed);Ft()}}async function it(e){let t=e?[...e].filter(e=>e.type.startsWith(`image/`)):[];if(!(!a.entity||t.length===0)){z(I,!0);try{for(let e of t){let t=await Oe(a.entity.repo,a.entity.type,a.entity.id,e);a.onInsert?.(``)}Ft()}catch(e){he.error(e?.message??`Image upload failed`)}finally{z(I,!1)}}}function at(e){e.preventDefault(),z(V,!1),it(e.dataTransfer?.files??null)}function ot(e){let t=e.target;it(t.files),t.value=``}function Pt(e){!a.entity||C(I)||e.dataTransfer?.types?.includes(`Files`)&&(e.preventDefault(),e.dataTransfer.dropEffect=`copy`,C(T)===`library`&&z(V,!0))}function Ft(){x(!1),z(k,``),z(V,!1),$.clear()}var It=B();f(A(It),()=>be,(e,t)=>{t(e,{get open(){return x()},set open(e){x(e)},children:(e,t)=>{var n=B();f(A(n),()=>we,(e,t)=>{t(e,{size:`lg`,children:(e,t)=>{var n=Nt(),r=A(n);f(r,()=>_e,(e,t)=>{t(e,{class:`close-only-header`,children:(e,t)=>{var n=B();f(A(n),()=>xe,(e,t)=>{t(e,{})}),h(e,n)},$$slots:{default:!0}})});var o=O(r,2);f(o,()=>ve,(e,t)=>{t(e,{class:`dialog-body-lg picker-body`,children:(e,t)=>{var n=jt(),r=N(n);f(r,()=>Te,(e,t)=>{t(e,{children:(e,t)=>{b();var n=v();F(()=>c(n,C(w)?`Choose asset`:`Insert images`)),h(e,n)},$$slots:{default:!0}})});var o=O(r,2),l=N(o),d=e=>{var t=B();f(A(t),()=>st,(e,t)=>{t(e,{type:`single`,spacing:0,class:`sg-segmented picker-tabs`,"aria-label":`Image source`,get value(){return C(T)},set value(e){z(T,e,!0)},children:(e,t)=>{var n=lt(),r=A(n);f(r,()=>ct,(e,t)=>{t(e,{value:`library`,children:(e,t)=>{b(),h(e,v(`Library`))},$$slots:{default:!0}})}),f(O(r,2),()=>ct,(e,t)=>{t(e,{value:`upload`,children:(e,t)=>{b(),h(e,v(`Upload`))},$$slots:{default:!0}})}),h(e,n)},$$slots:{default:!0}})}),h(e,t)};p(l,e=>{a.entity&&e(d)});var m=O(l,2),x=e=>{We(e,{get items(){return C(G)},get value(){return C(H)},onSelect:e=>{z(H,e,!0)},title:`Filter by folder`,align:`end`,triggerClass:`picker-folder-trigger`,triggerAriaLabel:`Filter by folder`,menuClass:`picker-folder-menu`,trigger:e=>{var t=ut(),n=A(t);Ce(n,{size:16});var r=O(n,2),i=N(r,!0);s(r),_(r,e=>He?.(e)),Ee(O(r,2),{size:16}),F(()=>c(i,C(pe))),h(e,t)},$$slots:{trigger:!0}})};p(m,e=>{C(T)===`library`&&e(x)}),s(o);var S=O(o,2),ee=e=>{var t=Dt(),n=A(t),r=N(n),a=e=>{h(e,dt())},o=e=>{var t=ft();De(N(t),{ariaLabel:`Search the image library`,get pending(){return C(P)},onclear:ie,get value(){return C(k)},set value(e){z(k,e,!0)}}),s(t),h(e,t)};p(r,e=>{C(fe)?e(a):e(o,-1)});var l=O(r,2),d=N(l),f=e=>{var t=pt(),n=N(t),r=N(n,!0);s(n),J(O(n,2),{variant:`outline`,onclick:()=>Be(),children:(e,t)=>{b(),h(e,v(`Retry`))},$$slots:{default:!0}}),s(t),F(()=>c(r,C(ce))),h(e,t)},m=e=>{var t=mt();ge(N(t),{size:20}),b(2),s(t),h(e,t)},y=e=>{var t=_t(),n=N(t),r=e=>{var t=ht(),n=A(t),r=N(n);s(n),J(O(n,2),{variant:`outline`,onclick:ie,children:(e,t)=>{b(),h(e,v(`Clear search`))},$$slots:{default:!0}}),F(()=>c(r,`No images match “${C(k)??``}”.`)),h(e,t)},i=e=>{var t=gt(),n=A(t),r=N(n);s(n),J(O(n,2),{variant:`outline`,onclick:()=>{z(H,``)},children:(e,t)=>{b(),h(e,v(`Browse all folders`))},$$slots:{default:!0}}),F(()=>c(r,`No images in “${C(pe)??``}”.`)),h(e,t)};p(n,e=>{C(M)?e(r):e(i,-1)}),s(t),h(e,t)},x=e=>{var t=Ct();let n;var r=N(t),a=e=>{var t=vt();let n;F(()=>n=oe(t,``,n,{"grid-column":`1 / -1`,"grid-row":`span ${C(Xe)??``}`})),h(e,t)};p(r,e=>{C(Xe)>0&&e(a)});var o=O(r,2);ne(o,19,()=>C(et),e=>Fe(e),(e,t,n)=>{let r=L(()=>Le(C(t).filename)),a=L(()=>C($e)+C(n)),o=L(()=>$.isSelected(C(t)));var l=xt();let u;var d=N(l),f=N(d),m=e=>{var n=yt();F(()=>ae(n,`src`,C(t).url)),h(e,n)},v=e=>{var n=bt(),r=N(n),i=e=>{Ae(e,{size:24})},a=L(()=>je(C(t))),o=e=>{ke(e,{size:24})};p(r,e=>{C(a)?e(i):e(o,-1)}),s(n),h(e,n)};p(f,e=>{C(t).mediaType===`image`?e(m):e(v,-1)});var y=O(f,2);Se(N(y),{get checked(){return C(o)},tabindex:-1}),s(y),s(d);var b=O(d,2),x=N(b,!0);s(b),_(b,e=>He?.(e)),s(l),F(()=>{u=g(l,1,`picker-tile svelte-yml3mb`,null,u,{selected:C(o)}),ae(l,`aria-pressed`,C(o)),ae(l,`aria-label`,C(o)?`Deselect ${C(r)}`:`Select ${C(r)}`),c(x,C(r))}),i(`click`,l,e=>nt(C(a),e)),h(e,l)});var l=O(o,2),u=e=>{var t=St();let n;F(()=>n=oe(t,``,n,{"grid-column":`1 / -1`,"grid-row":`span ${C(Ze)??``}`})),h(e,t)};p(l,e=>{C(Ze)>0&&e(u)}),s(t),te(t,e=>z(q,e),()=>C(q)),F(()=>n=oe(t,``,n,{"--cell-row-h":C(X)?`${C(X)}px`:null,"--scrollbar-w":`${C(Ke)}px`})),h(e,t)};p(d,e=>{C(ce)&&!C(U)?e(f):C(U)?C(W).length===0?e(y,2):e(x,-1):e(m,1)}),s(l),te(l,e=>z(K,e),()=>C(K)),s(n);var S=O(n,2),w=e=>{var t=Et(),n=N(t),r=e=>{var t=wt();ge(A(t),{size:20}),b(2),h(e,t)},i=e=>{var t=Tt(),n=A(t);tt(n,{size:20});var r=O(n,2),i=N(r);s(r),F(()=>c(i,`Drop to upload to “${C(me)??``}”`)),h(e,t)};p(n,e=>{C(I)?e(r):e(i,-1)}),s(t),u(`dragover`,t,e=>{e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=`copy`)}),u(`dragleave`,t,e=>{let t=e.relatedTarget;t&&e.currentTarget?.contains(t)||z(V,!1)}),u(`drop`,t,at),h(e,t)};p(S,e=>{(C(V)||C(I)&&C(T)===`library`)&&e(w)}),h(e,t)},E=e=>{var t=At(),n=N(t),r=e=>{var t=Ot();ge(A(t),{size:20}),b(2),h(e,t)},a=e=>{var t=kt(),n=A(t);tt(n,{size:20});var r=O(n,2),a=O(N(r));s(r);var o=O(r,2),l=N(o);s(o),F(()=>c(l,`(Uploads to “${C(me)??``}”)`)),i(`click`,a,()=>C(se)?.click()),h(e,t)};p(n,e=>{C(I)?e(r):e(a,-1)}),s(t),F(()=>g(t,1,`picker-upload-tab ${C(V)?`drag-over`:``}`,`svelte-yml3mb`)),u(`dragover`,t,e=>{e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=`copy`),z(V,!0)}),u(`dragleave`,t,e=>{let t=e.relatedTarget;t&&e.currentTarget?.contains(t)||z(V,!1)}),u(`drop`,t,at),h(e,t)};p(S,e=>{C(T)===`library`?e(ee):e(E,-1)});var D=O(S,2);te(D,e=>z(se,e),()=>C(se)),s(n),F(()=>ae(D,`accept`,C(y))),u(`dragover`,n,Pt),i(`change`,D,ot),h(e,n)},$$slots:{default:!0}})}),f(O(o,2),()=>ye,(e,t)=>{t(e,{children:(e,t)=>{var n=Mt(),r=A(n);J(r,{variant:`ghost`,onclick:Ft,children:(e,t)=>{b(),h(e,v(`Cancel`))},$$slots:{default:!0}});var i=O(r,2);{let e=L(()=>!$.hasSelection);J(i,{variant:`accent`,get disabled(){return C(e)},onclick:rt,children:(e,t)=>{var n=B(),r=A(n),i=e=>{var t=v();F(()=>c(t,$.hasSelection?`Add (${$.keys.size})`:`Add`)),h(e,t)},a=e=>{var t=v();F(()=>c(t,$.hasSelection?`Insert (${$.keys.size})`:`Insert`)),h(e,t)};p(r,e=>{C(w)?e(i):e(a,-1)}),h(e,n)},$$slots:{default:!0}})}h(e,n)},$$slots:{default:!0}})}),h(e,n)},$$slots:{default:!0}})}),h(e,n)},$$slots:{default:!0}})}),h(e,It),m(),d()}x([`click`,`change`]);export{tt as a,rt as i,ct as n,st as r,Pt as t};
|
|
1
|
+
import{B as e,Dt as t,Et as n,Ft as r,G as i,Gt as a,H as o,Ht as s,I as c,It as l,K as u,Mt as d,O as f,P as p,Pt as m,R as h,S as g,T as _,U as v,V as y,Vt as b,W as x,X as S,Z as C,a as w,at as ee,c as T,ct as E,d as te,g as D,ht as O,j as ne,k,kt as re,mt as A,o as j,ot as M,pt as N,s as P,st as F,u as ie,v as ae,vt as I,wt as L,x as oe,xt as R,yt as z,z as B}from"./FISIvbqq.js";import"./D8nBN3-t.js";import"./xihTtKlq.js";import{B as V,Dt as se,H,Nt as U,Ot as ce,dt as le,ht as ue,kt as W,mt as de,pt as fe,ut as G,vt as pe,z as me}from"./w5tsuIav.js";import{t as he}from"./CgOgBK5j.js";import"./CWIHttTH.js";import{t as ge}from"./DIsSxB_C.js";import{A as _e,D as ve,E as ye,M as be,T as xe,a as Se,i as Ce,j as we,k as Te,r as Ee,t as De}from"./DwuBUEvU.js";import{a as K,i as q,t as J}from"./GC5Izn9E2.js";import{f as Oe,n as ke,t as Ae}from"./DqKYbIld2.js";import{S as je,T as Me,h as Ne,i as Pe,l as Fe,m as Ie,p as Le,r as Re}from"./BZDKT2Qw2.js";import{n as ze,r as Be,t as Ve}from"./DAsarOLg2.js";import{t as He}from"./DPLkAijI2.js";import{t as Ue}from"./Ca57r8F-.js";import{n as We,t as Ge}from"./BqButnP4.js";var Y=de({component:`toggle-group`,parts:[`root`,`item`]}),X=new ce(`ToggleGroup.Root`),Z=class{opts;rovingFocusGroup;attachment;constructor(e){this.opts=e,this.attachment=pe(this.opts.ref),this.rovingFocusGroup=new H({candidateAttr:Y.item,rootNode:e.ref,loop:e.loop,orientation:e.orientation})}#e=L(()=>({id:this.opts.id.current,[Y.root]:``,role:`group`,"data-orientation":this.opts.orientation.current,"data-disabled":G(this.opts.disabled.current),...this.attachment}));get props(){return C(this.#e)}set props(e){z(this.#e,e)}},Ke=class extends Z{opts;isMulti=!1;#e=L(()=>this.opts.value.current!==``);get anyPressed(){return C(this.#e)}set anyPressed(e){z(this.#e,e)}constructor(e){super(e),this.opts=e}includesItem(e){return this.opts.value.current===e}toggleItem(e,t){this.includesItem(e)?this.opts.value.current=``:(this.opts.value.current=e,this.rovingFocusGroup.setCurrentTabStopId(t))}},qe=class extends Z{opts;isMulti=!0;#e=L(()=>this.opts.value.current.length>0);get anyPressed(){return C(this.#e)}set anyPressed(e){z(this.#e,e)}constructor(e){super(e),this.opts=e}includesItem(e){return this.opts.value.current.includes(e)}toggleItem(e,t){this.includesItem(e)?this.opts.value.current=this.opts.value.current.filter(t=>t!==e):(this.opts.value.current=[...this.opts.value.current,e],this.rovingFocusGroup.setCurrentTabStopId(t))}},Je=class{static create(e){let{type:t,...n}=e,r=t===`single`?new Ke(n):new qe(n);return X.set(r)}},Ye=class e{static create(t){return new e(t,X.get())}opts;root;attachment;#e=L(()=>this.opts.disabled.current||this.root.opts.disabled.current);#t=L(()=>this.root.includesItem(this.opts.value.current));get isPressed(){return C(this.#t)}set isPressed(e){z(this.#t,e)}#n=L(()=>this.root.isMulti?void 0:ue(this.isPressed,!1));#r=L(()=>this.root.isMulti?le(this.isPressed):void 0);constructor(e,t){this.opts=e,this.root=t,this.attachment=pe(this.opts.ref),E(()=>{this.root.opts.rovingFocus.current?z(this.#a,this.root.rovingFocusGroup.getTabIndex(this.opts.ref.current),!0):z(this.#a,0)}),this.onclick=this.onclick.bind(this),this.onkeydown=this.onkeydown.bind(this)}#i(){C(this.#e)||this.root.toggleItem(this.opts.value.current,this.opts.id.current)}onclick(e){C(this.#e)||this.root.toggleItem(this.opts.value.current,this.opts.id.current)}onkeydown(e){if(!C(this.#e)){if(e.key===`Enter`||e.key===` `){e.preventDefault(),this.#i();return}this.root.opts.rovingFocus.current&&this.root.rovingFocusGroup.handleKeydown(this.opts.ref.current,e)}}#a=R(0);#o=L(()=>({pressed:this.isPressed}));get snippetProps(){return C(this.#o)}set snippetProps(e){z(this.#o,e)}#s=L(()=>({id:this.opts.id.current,role:this.root.isMulti?void 0:`radio`,tabindex:C(this.#a),"data-orientation":this.root.opts.orientation.current,"data-disabled":G(C(this.#e)),"data-state":Q(this.isPressed),"data-value":this.opts.value.current,"aria-pressed":C(this.#r),"aria-checked":C(this.#n),disabled:fe(C(this.#e)),[Y.item]:``,onclick:this.onclick,onkeydown:this.onkeydown,...this.attachment}));get props(){return C(this.#s)}set props(e){z(this.#s,e)}};function Q(e){return e?`on`:`off`}var Xe=e(`<div><!></div>`);function Ze(e,t){let n=o();r(t,!0);let i=j(t,`id`,19,()=>me(n)),c=j(t,`ref`,15,null),l=j(t,`value`,15),u=j(t,`onValueChange`,3,V),d=j(t,`disabled`,3,!1),f=j(t,`loop`,3,!0),g=j(t,`orientation`,3,`horizontal`),_=j(t,`rovingFocus`,3,!0),v=P(t,[`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`value`,`onValueChange`,`type`,`disabled`,`loop`,`orientation`,`rovingFocus`,`child`,`children`]);function y(){l()===void 0&&l(t.type===`single`?``:[])}y(),se.pre(()=>l(),()=>{y()});let b=Je.create({id:U(()=>i()),value:U(()=>l(),e=>{l(e),u()(e)}),disabled:U(()=>d()),loop:U(()=>f()),orientation:U(()=>g()),rovingFocus:U(()=>_()),type:t.type,ref:U(()=>c(),e=>c(e))}),x=L(()=>W(v,b.props));var S=B(),w=A(S),ee=e=>{var n=B();k(A(n),()=>t.child,()=>({props:C(x)})),h(e,n)},T=e=>{var n=Xe();D(n,()=>({...C(x)})),k(N(n),()=>t.children??a),s(n),h(e,n)};p(w,e=>{t.child?e(ee):e(T,-1)}),h(e,S),m()}var Qe=e(`<button><!></button>`);function $e(e,t){let n=o();r(t,!0);let i=j(t,`ref`,15,null),c=j(t,`disabled`,3,!1),l=j(t,`id`,19,()=>me(n)),u=j(t,`type`,3,`button`),d=P(t,[`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`ref`,`value`,`disabled`,`id`,`type`]),f=Ye.create({id:U(()=>l()),value:U(()=>t.value),disabled:U(()=>c()??!1),ref:U(()=>i(),e=>i(e))}),g=L(()=>W(d,f.props,{type:u()}));var _=B(),v=A(_),y=e=>{var n=B(),r=A(n);{let e=L(()=>({props:C(g),...f.snippetProps}));k(r,()=>t.child,()=>C(e))}h(e,n)},b=e=>{var n=Qe();D(n,()=>({...C(g)})),k(N(n),()=>t.children??a,()=>f.snippetProps),s(n),h(e,n)};p(v,e=>{t.child?e(y):e(b,-1)}),h(e,_),m()}var et=y(`<title> </title>`),$=y(`<svg><!><path d="M6 18 7.41 19.41 15 11.83 15 30 17 30 17 11.83 24.59 19.41 26 18 16 8 6 18z"></path><path d="M6,8V4H26V8h2V4a2,2,0,0,0-2-2H6A2,2,0,0,0,4,4V8Z"></path></svg>`);function tt(e,t){let n=w(t,[`children`,`$$slots`,`$$events`,`$$legacy`]),i=w(n,[`size`,`title`]);r(t,!1);let a=I(),o=I(),l=j(t,`size`,8,16),u=j(t,`title`,8,void 0);ee(()=>(S(n),S(u())),()=>{z(a,n[`aria-label`]||n[`aria-labelledby`]||u())}),ee(()=>(C(a),S(n)),()=>{z(o,{"aria-hidden":C(a)?void 0:!0,role:C(a)?`img`:void 0,focusable:Number(n.tabindex)===0?!0:void 0})}),M(),ie();var d=$();D(d,()=>({xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 32`,fill:`currentColor`,preserveAspectRatio:`xMidYMid meet`,width:l(),height:l(),...C(o),...i}));var f=N(d),g=e=>{var t=et(),n=N(t,!0);s(t),F(()=>c(n,u())),h(e,t)};p(f,e=>{u()&&e(g)}),b(2),s(d),h(e,d),m()}function nt(){return typeof navigator<`u`&&/Mac|iPhone|iPad|iPod/i.test(navigator.platform??``)}function rt(){return nt()?`⌘`:`Ctrl+`}var it=q({base:`hover:bg-muted hover:text-muted-foreground data-[state=on]:bg-accent data-[state=on]:text-accent-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,variants:{variant:{default:`bg-transparent`,outline:`border-input hover:bg-accent hover:text-accent-foreground border bg-transparent shadow-xs`},size:{default:`h-9 min-w-9 px-2`,sm:`h-8 min-w-8 px-1.5`,lg:`h-10 min-w-10 px-2.5`}},defaultVariants:{variant:`default`,size:`default`}});function at(e){l(`toggleGroup`,e)}function ot(){return d(`toggleGroup`)}function st(e,t){r(t,!0);let n=j(t,`ref`,15,null),i=j(t,`value`,15),a=j(t,`size`,3,`default`),o=j(t,`spacing`,3,0),s=j(t,`variant`,3,`default`),c=P(t,[`$$slots`,`$$events`,`$$legacy`,`ref`,`value`,`class`,`size`,`spacing`,`variant`]);at({get variant(){return s()},get size(){return a()},get spacing(){return o()}});var l=B(),u=A(l);{let e=L(()=>`--gap: ${o()}`),r=L(()=>K(`group/toggle-group flex w-fit items-center gap-[--spacing(var(--gap))] rounded-md data-[spacing=default]:data-[variant=outline]:shadow-xs`,t.class));f(u,()=>Ze,(t,l)=>{l(t,T({"data-slot":`toggle-group`,get"data-variant"(){return s()},get"data-size"(){return a()},get"data-spacing"(){return o()},get style(){return C(e)},get class(){return C(r)}},()=>c,{get value(){return i()},set value(e){i(e)},get ref(){return n()},set ref(e){n(e)}}))})}h(e,l),m()}function ct(e,t){r(t,!0);let n=j(t,`ref`,15,null),i=P(t,[`$$slots`,`$$events`,`$$legacy`,`ref`,`value`,`class`,`size`,`variant`]),a=ot();var o=B(),s=A(o);{let e=L(()=>a.variant||t.variant),r=L(()=>a.size||t.size),o=L(()=>K(it({variant:a.variant||t.variant,size:a.size||t.size}),`w-auto min-w-0 shrink-0 px-3 focus:z-10 focus-visible:z-10 data-[spacing=0]:rounded-none data-[spacing=0]:shadow-none data-[spacing=0]:first:rounded-l-md data-[spacing=0]:last:rounded-r-md data-[spacing=0]:data-[variant=outline]:border-l-0 data-[spacing=0]:data-[variant=outline]:first:border-l`,t.class));f(s,()=>$e,(s,c)=>{c(s,T({"data-slot":`toggle-group-item`,get"data-variant"(){return C(e)},get"data-size"(){return C(r)},get"data-spacing"(){return a.spacing},get class(){return C(o)},get value(){return t.value}},()=>i,{get ref(){return n()},set ref(e){n(e)}}))})}h(e,o),m()}var lt=e(`<!> <!>`,1),ut=e(`<!> <span class="picker-folder-label svelte-yml3mb"> </span> <!>`,1),dt=e(`<div class="picker-divider svelte-yml3mb" role="separator"></div>`),ft=e(`<div class="picker-search svelte-yml3mb"><!></div>`),pt=e(`<div class="picker-state svelte-yml3mb" role="alert"><p> </p> <!></div>`),mt=e(`<div class="picker-state svelte-yml3mb" role="status" aria-live="polite"><!> <span class="sr-only svelte-yml3mb">Loading images…</span></div>`),ht=e(`<p class="picker-empty-message svelte-yml3mb"> </p> <!>`,1),gt=e(`<p class="picker-empty-message svelte-yml3mb"> </p> <!>`,1),_t=e(`<div class="picker-state svelte-yml3mb"><!></div>`),vt=e(`<div class="picker-spacer svelte-yml3mb" aria-hidden="true"></div>`),yt=e(`<img alt="" loading="lazy" draggable="false" class="svelte-yml3mb"/>`),bt=e(`<span class="picker-tile-glyph svelte-yml3mb" aria-hidden="true"><!></span>`),xt=e(`<button type="button"><span class="picker-tile-media svelte-yml3mb"><!> <span class="picker-tile-check svelte-yml3mb" aria-hidden="true"><!></span></span> <span class="picker-tile-name svelte-yml3mb"> </span></button>`),St=e(`<div class="picker-spacer svelte-yml3mb" aria-hidden="true"></div>`),Ct=e(`<div class="picker-grid svelte-yml3mb"><!> <!> <!></div>`),wt=e(`<!> <p class="svelte-yml3mb">Uploading…</p>`,1),Tt=e(`<!> <p class="svelte-yml3mb"> </p>`,1),Et=e(`<div class="picker-drop-overlay svelte-yml3mb"><!></div>`),Dt=e(`<div class="picker-library svelte-yml3mb"><!> <div class="picker-scroll svelte-yml3mb"><!></div></div> <!>`,1),Ot=e(`<!> <p class="picker-upload-hint svelte-yml3mb">Uploading…</p>`,1),kt=e(`<!> <p class="svelte-yml3mb">Drag images here, or <button type="button" class="picker-upload-browse svelte-yml3mb">browse files</button></p> <p class="picker-upload-dest svelte-yml3mb"> </p>`,1),At=e(`<div><!></div>`),jt=e(`<div class="picker-shell svelte-yml3mb"><!> <div class="picker-context svelte-yml3mb"><!> <!></div> <!> <input type="file" multiple="" style="display:none"/></div>`),Mt=e(`<!> <!>`,1),Nt=e(`<!> <!> <!>`,1);function Pt(e,a){r(a,!0);let o=()=>t(Ye,`$virtualizer`,l),[l,d]=n();Re.load();let y=L(()=>Pe(Re.current().formats)),x=j(a,`open`,15),S=j(a,`media`,3,`image`),w=L(()=>!!a.onPick),ee=L(()=>S()===`all`?[`image`,`document`]:[`image`]),T=R(`library`),D=`library`;E(()=>{C(T)===`library`||C(T)===`upload`?D=C(T):z(T,D,!0)}),E(()=>{x()&&z(T,`library`)}),E(()=>{x()&&a.entity&&C(U)&&C(le).length===0&&z(T,`upload`)});let k=R(``),M=R(``);E(()=>{let e=C(k);if(e===C(M))return;let t=setTimeout(()=>{requestAnimationFrame(()=>{z(M,e,!0)})},200);return()=>clearTimeout(t)});let P=L(()=>C(k)!==C(M));function ie(){z(k,``),z(M,``)}let I=R(!1),V=R(!1),se=R(void 0),H=R(``),U=L(()=>ze.loaded),ce=L(()=>ze.error),le=L(()=>ze.assets.filter(e=>C(ee).includes(e.mediaType))),ue=L(()=>Me(C(le),`created`,!1)),W=L(()=>Ie(C(ue),{search:C(M),folders:C(H)?[C(H)]:[],media:[]})),de=L(()=>Ie(C(ue),{search:``,folders:C(H)?[C(H)]:[],media:[]}).length),fe=L(()=>C(U)&&C(de)===0);E(()=>{C(fe)&&C(k)&&ie()});let G=L(()=>{let e=ze.folders.map(e=>({value:e.repo,label:e.workspaceWide?`Studio`:Ne(e),ws:!!e.workspaceWide}));return e.sort((e,t)=>e.ws===t.ws?e.label.localeCompare(t.label,void 0,{sensitivity:`base`}):e.ws?-1:1),[{value:``,label:`All folders`},...e.map(({value:e,label:t})=>({value:e,label:t}))]}),pe=L(()=>C(H)?C(G).find(e=>e.value===C(H))?.label??C(H):`All folders`),me=L(()=>a.entity?C(G).find(e=>e.value===a.entity.repo)?.label??a.entity.repo:``);E(()=>{x()&&z(H,a.entity?.repo??``,!0)});let K=R(null),q=R(null),Y=R(5),X=R(140),Z=R(152),Ke=R(0);function qe(){if(C(K)){let e=C(K).offsetWidth-C(K).clientWidth;e!==C(Ke)&&z(Ke,e)}if(!C(q))return;let e=getComputedStyle(C(q)),t=e.gridTemplateColumns.split(` `).filter(Boolean);t.length>0&&t.length!==C(Y)&&z(Y,t.length,!0);let n=parseFloat(t[0]||`0`);if(n>0){let t=n+28;Math.abs(t-C(X))>=.5&&z(X,t);let r=t+parseFloat(e.rowGap||`0`);Math.abs(r-C(Z))>=.5&&z(Z,r)}}E(()=>{if(!C(q))return;qe();let e=new ResizeObserver(()=>qe());return e.observe(C(q)),()=>e.disconnect()});let Je=L(()=>Math.ceil(C(W).length/C(Y))),Ye=Ue({count:0,getScrollElement:()=>null,estimateSize:()=>C(Z),overscan:2});E(()=>{let e=C(Je),t=C(Z);re(Ye).setOptions({count:e,getScrollElement:()=>C(K),estimateSize:()=>t,overscan:2})});let Q=L(()=>o().getVirtualItems()),Xe=L(()=>C(Q).length>0?C(Q)[0].index:0),Ze=L(()=>C(Q).length>0?Math.max(0,C(Je)-C(Q)[C(Q).length-1].index-1):0),Qe=L(()=>{if(C(Q).length===0)return{start:0,items:C(W).slice(0,C(Y)*4)};let e=C(Q)[0].index*C(Y),t=Math.min(C(W).length,(C(Q)[C(Q).length-1].index+1)*C(Y));return{start:e,items:C(W).slice(e,t)}}),$e=L(()=>C(Qe).start),et=L(()=>C(Qe).items);E(()=>{x()&&Ve()});let $=Ge(()=>C(W),Fe);function nt(e,t){$.toggleAt(e,{shiftKey:t.shiftKey})}function rt(){let e=$.getSelected();if(e.length!==0){if(a.onPick)a.onPick(e);else for(let t of e)a.onInsert?.(t.embed);Ft()}}async function it(e){let t=e?[...e].filter(e=>e.type.startsWith(`image/`)):[];if(!(!a.entity||t.length===0)){z(I,!0);try{for(let e of t){let t=await Oe(a.entity.repo,a.entity.type,a.entity.id,e);a.onInsert?.(``)}Ft()}catch(e){he.error(e?.message??`Image upload failed`)}finally{z(I,!1)}}}function at(e){e.preventDefault(),z(V,!1),it(e.dataTransfer?.files??null)}function ot(e){let t=e.target;it(t.files),t.value=``}function Pt(e){!a.entity||C(I)||e.dataTransfer?.types?.includes(`Files`)&&(e.preventDefault(),e.dataTransfer.dropEffect=`copy`,C(T)===`library`&&z(V,!0))}function Ft(){x(!1),z(k,``),z(V,!1),$.clear()}var It=B();f(A(It),()=>be,(e,t)=>{t(e,{get open(){return x()},set open(e){x(e)},children:(e,t)=>{var n=B();f(A(n),()=>we,(e,t)=>{t(e,{size:`lg`,children:(e,t)=>{var n=Nt(),r=A(n);f(r,()=>_e,(e,t)=>{t(e,{class:`close-only-header`,children:(e,t)=>{var n=B();f(A(n),()=>xe,(e,t)=>{t(e,{})}),h(e,n)},$$slots:{default:!0}})});var o=O(r,2);f(o,()=>ve,(e,t)=>{t(e,{class:`dialog-body-lg picker-body`,children:(e,t)=>{var n=jt(),r=N(n);f(r,()=>Te,(e,t)=>{t(e,{children:(e,t)=>{b();var n=v();F(()=>c(n,C(w)?`Choose asset`:`Insert images`)),h(e,n)},$$slots:{default:!0}})});var o=O(r,2),l=N(o),d=e=>{var t=B();f(A(t),()=>st,(e,t)=>{t(e,{type:`single`,spacing:0,class:`sg-segmented picker-tabs`,"aria-label":`Image source`,get value(){return C(T)},set value(e){z(T,e,!0)},children:(e,t)=>{var n=lt(),r=A(n);f(r,()=>ct,(e,t)=>{t(e,{value:`library`,children:(e,t)=>{b(),h(e,v(`Library`))},$$slots:{default:!0}})}),f(O(r,2),()=>ct,(e,t)=>{t(e,{value:`upload`,children:(e,t)=>{b(),h(e,v(`Upload`))},$$slots:{default:!0}})}),h(e,n)},$$slots:{default:!0}})}),h(e,t)};p(l,e=>{a.entity&&e(d)});var m=O(l,2),x=e=>{We(e,{get items(){return C(G)},get value(){return C(H)},onSelect:e=>{z(H,e,!0)},title:`Filter by folder`,align:`end`,triggerClass:`picker-folder-trigger`,triggerAriaLabel:`Filter by folder`,menuClass:`picker-folder-menu`,trigger:e=>{var t=ut(),n=A(t);Ce(n,{size:16});var r=O(n,2),i=N(r,!0);s(r),_(r,e=>He?.(e)),Ee(O(r,2),{size:16}),F(()=>c(i,C(pe))),h(e,t)},$$slots:{trigger:!0}})};p(m,e=>{C(T)===`library`&&e(x)}),s(o);var S=O(o,2),ee=e=>{var t=Dt(),n=A(t),r=N(n),a=e=>{h(e,dt())},o=e=>{var t=ft();De(N(t),{ariaLabel:`Search the image library`,get pending(){return C(P)},onclear:ie,get value(){return C(k)},set value(e){z(k,e,!0)}}),s(t),h(e,t)};p(r,e=>{C(fe)?e(a):e(o,-1)});var l=O(r,2),d=N(l),f=e=>{var t=pt(),n=N(t),r=N(n,!0);s(n),J(O(n,2),{variant:`outline`,onclick:()=>Be(),children:(e,t)=>{b(),h(e,v(`Retry`))},$$slots:{default:!0}}),s(t),F(()=>c(r,C(ce))),h(e,t)},m=e=>{var t=mt();ge(N(t),{size:20}),b(2),s(t),h(e,t)},y=e=>{var t=_t(),n=N(t),r=e=>{var t=ht(),n=A(t),r=N(n);s(n),J(O(n,2),{variant:`outline`,onclick:ie,children:(e,t)=>{b(),h(e,v(`Clear search`))},$$slots:{default:!0}}),F(()=>c(r,`No images match “${C(k)??``}”.`)),h(e,t)},i=e=>{var t=gt(),n=A(t),r=N(n);s(n),J(O(n,2),{variant:`outline`,onclick:()=>{z(H,``)},children:(e,t)=>{b(),h(e,v(`Browse all folders`))},$$slots:{default:!0}}),F(()=>c(r,`No images in “${C(pe)??``}”.`)),h(e,t)};p(n,e=>{C(M)?e(r):e(i,-1)}),s(t),h(e,t)},x=e=>{var t=Ct();let n;var r=N(t),a=e=>{var t=vt();let n;F(()=>n=oe(t,``,n,{"grid-column":`1 / -1`,"grid-row":`span ${C(Xe)??``}`})),h(e,t)};p(r,e=>{C(Xe)>0&&e(a)});var o=O(r,2);ne(o,19,()=>C(et),e=>Fe(e),(e,t,n)=>{let r=L(()=>Le(C(t).filename)),a=L(()=>C($e)+C(n)),o=L(()=>$.isSelected(C(t)));var l=xt();let u;var d=N(l),f=N(d),m=e=>{var n=yt();F(()=>ae(n,`src`,C(t).url)),h(e,n)},v=e=>{var n=bt(),r=N(n),i=e=>{Ae(e,{size:24})},a=L(()=>je(C(t))),o=e=>{ke(e,{size:24})};p(r,e=>{C(a)?e(i):e(o,-1)}),s(n),h(e,n)};p(f,e=>{C(t).mediaType===`image`?e(m):e(v,-1)});var y=O(f,2);Se(N(y),{get checked(){return C(o)},tabindex:-1}),s(y),s(d);var b=O(d,2),x=N(b,!0);s(b),_(b,e=>He?.(e)),s(l),F(()=>{u=g(l,1,`picker-tile svelte-yml3mb`,null,u,{selected:C(o)}),ae(l,`aria-pressed`,C(o)),ae(l,`aria-label`,C(o)?`Deselect ${C(r)}`:`Select ${C(r)}`),c(x,C(r))}),i(`click`,l,e=>nt(C(a),e)),h(e,l)});var l=O(o,2),u=e=>{var t=St();let n;F(()=>n=oe(t,``,n,{"grid-column":`1 / -1`,"grid-row":`span ${C(Ze)??``}`})),h(e,t)};p(l,e=>{C(Ze)>0&&e(u)}),s(t),te(t,e=>z(q,e),()=>C(q)),F(()=>n=oe(t,``,n,{"--cell-row-h":C(X)?`${C(X)}px`:null,"--scrollbar-w":`${C(Ke)}px`})),h(e,t)};p(d,e=>{C(ce)&&!C(U)?e(f):C(U)?C(W).length===0?e(y,2):e(x,-1):e(m,1)}),s(l),te(l,e=>z(K,e),()=>C(K)),s(n);var S=O(n,2),w=e=>{var t=Et(),n=N(t),r=e=>{var t=wt();ge(A(t),{size:20}),b(2),h(e,t)},i=e=>{var t=Tt(),n=A(t);tt(n,{size:20});var r=O(n,2),i=N(r);s(r),F(()=>c(i,`Drop to upload to “${C(me)??``}”`)),h(e,t)};p(n,e=>{C(I)?e(r):e(i,-1)}),s(t),u(`dragover`,t,e=>{e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=`copy`)}),u(`dragleave`,t,e=>{let t=e.relatedTarget;t&&e.currentTarget?.contains(t)||z(V,!1)}),u(`drop`,t,at),h(e,t)};p(S,e=>{(C(V)||C(I)&&C(T)===`library`)&&e(w)}),h(e,t)},E=e=>{var t=At(),n=N(t),r=e=>{var t=Ot();ge(A(t),{size:20}),b(2),h(e,t)},a=e=>{var t=kt(),n=A(t);tt(n,{size:20});var r=O(n,2),a=O(N(r));s(r);var o=O(r,2),l=N(o);s(o),F(()=>c(l,`(Uploads to “${C(me)??``}”)`)),i(`click`,a,()=>C(se)?.click()),h(e,t)};p(n,e=>{C(I)?e(r):e(a,-1)}),s(t),F(()=>g(t,1,`picker-upload-tab ${C(V)?`drag-over`:``}`,`svelte-yml3mb`)),u(`dragover`,t,e=>{e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=`copy`),z(V,!0)}),u(`dragleave`,t,e=>{let t=e.relatedTarget;t&&e.currentTarget?.contains(t)||z(V,!1)}),u(`drop`,t,at),h(e,t)};p(S,e=>{C(T)===`library`?e(ee):e(E,-1)});var D=O(S,2);te(D,e=>z(se,e),()=>C(se)),s(n),F(()=>ae(D,`accept`,C(y))),u(`dragover`,n,Pt),i(`change`,D,ot),h(e,n)},$$slots:{default:!0}})}),f(O(o,2),()=>ye,(e,t)=>{t(e,{children:(e,t)=>{var n=Mt(),r=A(n);J(r,{variant:`ghost`,onclick:Ft,children:(e,t)=>{b(),h(e,v(`Cancel`))},$$slots:{default:!0}});var i=O(r,2);{let e=L(()=>!$.hasSelection);J(i,{variant:`accent`,get disabled(){return C(e)},onclick:rt,children:(e,t)=>{var n=B(),r=A(n),i=e=>{var t=v();F(()=>c(t,$.hasSelection?`Add (${$.keys.size})`:`Add`)),h(e,t)},a=e=>{var t=v();F(()=>c(t,$.hasSelection?`Insert (${$.keys.size})`:`Insert`)),h(e,t)};p(r,e=>{C(w)?e(i):e(a,-1)}),h(e,n)},$$slots:{default:!0}})}h(e,n)},$$slots:{default:!0}})}),h(e,n)},$$slots:{default:!0}})}),h(e,n)},$$slots:{default:!0}})}),h(e,It),m(),d()}x([`click`,`change`]);export{tt as a,rt as i,ct as n,st as r,Pt as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{dt as e}from"./CsIWxmio.js";import{o as t,s as n,t as r}from"./nacCpTNj.js";e.add(r,n),e.add(t);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$ as e,B as t,Ft as n,G as r,Ht as i,I as a,K as o,P as s,Pt as c,R as l,S as u,T as d,U as f,V as p,Vt as m,W as h,X as g,Z as _,a as v,at as y,ct as b,d as x,g as S,gt as C,ht as w,j as T,k as E,mt as ee,n as D,o as O,ot as te,pt as k,r as ne,st as A,u as j,v as M,vt as N,wt as P,x as F,xt as I,yt as L,z as re}from"./FISIvbqq.js";import{r as R}from"./D8nBN3-t.js";import"./xihTtKlq.js";import"./D2G8GgRX.js";import{$ as ie}from"./nqo2e2Yv.js";import{i as ae}from"./CWZSexLW.js";import"./CWIHttTH.js";import{t as oe}from"./F92HmKX8.js";import{i as se}from"./BeMEksa_2.js";import{r as ce}from"./DPLkAijI2.js";import{n as le}from"./Ca57r8F-.js";import{r as ue}from"./DiMsLIh3.js";import{s as de}from"./joKsoiFC.js";import{o as fe}from"./B1pVemww.js";import{n as pe,r as me}from"./BqButnP4.js";import{i as he,n as ge,r as _e}from"./C8ZiSqQm.js";import{t as ve}from"./Cg5kjIaW.js";import{t as ye}from"./uHaS74te.js";import{t as be}from"./CqyFdLMa.js";import{r as xe}from"./Bncd_2iV2.js";import{r as Se,t as Ce}from"./DQMWa2t72.js";var we={project:{start:`start_date`,end:`date`},task:{start:`start_date`,end:`date`},deliverable:{start:`start_date`,end:`date`},deal:{start:`start_date`,end:`date`},event:{start:`start_date`,end:`date`}},Te={weeks:24,months:5,quarters:1.6},Ee=[`project`,`deliverable`,`task`,`deal`,`event`],De={project:`Projects`,deliverable:`Deliverables`,task:`Tasks`,deal:`Deals`,event:`Events`},Oe={project:`project`,deliverable:`deliverable`,task:`task`,deal:`deal`,event:`event`},z=we,B={project:new Set([`complete`,`archived`]),task:new Set([`done`,`cancelled`]),deliverable:new Set([`delivered`,`accepted`,`rejected`]),deal:new Set([`won`,`lost`])},V=new Set([`archived`]),H={deal:`stage`};function ke(e){return H[e]??`status`}function Ae(e){let t=z[e];return t?{startField:t.start,endField:t.end}:{}}function je(e){return Oe[e]??null}function Me(e,t){let n=e.fields[t];if(typeof n!=`string`)return null;let r=/^(\d{4})-(\d{2})-(\d{2})/.exec(n);return r?new Date(Date.UTC(+r[1],r[2]-1,+r[3])):null}function Ne(e){let t=z[e.entityType];if(!t)return null;let n=Me(e,t.start),r=Me(e,t.end);if(!n&&!r)return null;if(n&&r)return n.getTime()>r.getTime()?{start:r,end:n}:{start:n,end:r};let i=n??r;return{start:i,end:i,singleEndpoint:n?`start`:`end`}}function U(e){let t=B[e.entityType]??V,n=e.fields[ke(e.entityType)];return typeof n==`string`&&t.has(n)}function Pe(e,t){t.today;let n=[];for(let r of e){let e=je(r.entityType);if(!e)continue;let i=Ne(r);if(!i)continue;let a=U(r);t.hideCompleted&&a||n.push({entity:r,start:i.start,end:i.end,isCompleted:a,sectionKey:e,color:ue(r.entityType),singleEndpoint:i.singleEndpoint})}return n}function Fe(e){let t=0;for(let n of e)je(n.entityType)&&(Ne(n)||t++);return t}function Ie(e,t){let n=G(Le(t),-30),r=G(Le(t),90);for(let t of e)t.start.getTime()<n.getTime()&&(n=G(Le(t.start),-7)),t.end.getTime()>r.getTime()&&(r=Le(G(t.end,1)));return{start:n,end:r,days:W(n,r)}}function W(e,t){return Math.round((t.getTime()-e.getTime())/864e5)}function Le(e){return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()))}function G(e,t){let n=new Date(e.getTime());return n.setUTCDate(n.getUTCDate()+t),n}function K(e,t,n,r,i,a){let o=W(t.start,r)*n,s=W(r,i)*n;s>0&&e.push({x:o,width:s,label:a})}function Re(e,t){let n=new Date(Date.UTC(e.start.getUTCFullYear(),0,1));for(;n<e.end;){let e=new Date(Date.UTC(n.getUTCFullYear()+1,0,1));t(n,e),n.setTime(e.getTime())}}function ze(e,t){let n=Math.floor(e.start.getUTCMonth()/3)*3,r=new Date(Date.UTC(e.start.getUTCFullYear(),n,1));for(;r<e.end;){let e=new Date(Date.UTC(r.getUTCFullYear(),r.getUTCMonth()+3,1));t(r,e),r.setTime(e.getTime())}}function q(e,t){let n=new Date(Date.UTC(e.start.getUTCFullYear(),e.start.getUTCMonth(),1));for(;n<e.end;){let e=new Date(Date.UTC(n.getUTCFullYear(),n.getUTCMonth()+1,1));t(n,e),n.setTime(e.getTime())}}function J(e,t){let n=new Date(e.start.getTime()),r=(n.getUTCDay()+6)%7;for(n.setUTCDate(n.getUTCDate()-r);n<e.end;){let e=G(n,7);t(n,e),n.setTime(e.getTime())}}function Be(e,t,n){let r=n??Te[t],i=[],a=[];return t===`weeks`?(q(e,(t,n)=>{K(i,e,r,t,n,t.toLocaleDateString(`en-US`,{month:`long`,year:`numeric`,timeZone:`UTC`}))}),J(e,(t,n)=>{K(a,e,r,t,n,t.toLocaleDateString(`en-US`,{month:`short`,day:`numeric`,timeZone:`UTC`}))})):t===`months`?(Re(e,(t,n)=>{K(i,e,r,t,n,String(t.getUTCFullYear()))}),q(e,(t,n)=>{K(a,e,r,t,n,t.toLocaleDateString(`en-US`,{month:`short`,timeZone:`UTC`}))})):(ze(e,(t,n)=>{K(i,e,r,t,n,`Q${Math.floor(t.getUTCMonth()/3)+1} ${t.getUTCFullYear()}`)}),q(e,(t,n)=>{K(a,e,r,t,n,t.toLocaleDateString(`en-US`,{month:`short`,timeZone:`UTC`}))})),{primary:i,secondary:a}}var Y=p(`<title> </title>`),Ve=p(`<svg><!><path d="M14 21.414 9 16.413 10.413 15 14 18.586 21.585 11 23 12.415 14 21.414z"></path><path d="M16,2A14,14,0,1,0,30,16,14,14,0,0,0,16,2Zm0,26A12,12,0,1,1,28,16,12,12,0,0,1,16,28Z"></path></svg>`);function He(e,t){let r=v(t,[`children`,`$$slots`,`$$events`,`$$legacy`]),o=v(r,[`size`,`title`]);n(t,!1);let u=N(),d=N(),f=O(t,`size`,8,16),p=O(t,`title`,8,void 0);y(()=>(g(r),g(p())),()=>{L(u,r[`aria-label`]||r[`aria-labelledby`]||p())}),y(()=>(_(u),g(r)),()=>{L(d,{"aria-hidden":_(u)?void 0:!0,role:_(u)?`img`:void 0,focusable:Number(r.tabindex)===0?!0:void 0})}),te(),j();var h=Ve();S(h,()=>({xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 32`,fill:`currentColor`,preserveAspectRatio:`xMidYMid meet`,width:f(),height:f(),..._(d),...o}));var b=k(h),x=e=>{var t=Y(),n=k(t,!0);i(t),A(()=>a(n,p())),l(e,t)};s(b,e=>{p()&&e(x)}),m(2),i(h),l(e,h),c()}var X=t(`<button type="button"><!></button>`);function Ue(e,t){n(t,!0);let a=O(t,`hideCompleted`,15);var o=X();let d;var f=k(o),p=e=>{oe(e,{size:16})},m=e=>{He(e,{size:16})};s(f,e=>{a()?e(m,-1):e(p)}),i(o),A(()=>{d=u(o,1,`toolbar-icon-btn`,null,d,{active:!a()}),M(o,`title`,a()?`Show completed`:`Hide completed`),M(o,`aria-pressed`,!a())}),r(`click`,o,()=>a(!a())),l(e,o),c()}h([`click`]);var We=t(`<div class="toolbar-group"><!></div>`),Ge=t(`<div class="toolbar-group"><!></div>`),Ke=t(`<div class="timeline-empty svelte-13deb53"><p class="empty-title svelte-13deb53">Map your entries across time</p> <p class="empty-hint svelte-13deb53">Give a project, task, deliverable, or event a start and due date and it'll appear here.</p></div>`),qe=t(`<div class="grid-line svelte-13deb53" aria-hidden="true"></div>`),Je=t(`<div class="tick-cell tick-primary svelte-13deb53"><span class="tick-label svelte-13deb53"> </span></div>`),Ye=t(`<div class="tick-cell tick-secondary svelte-13deb53"><span class="tick-label svelte-13deb53"> </span></div>`),Xe=t(`<div class="section-row svelte-13deb53" role="button" tabindex="0"><div class="section-header svelte-13deb53"><span><!></span> <span class="section-label svelte-13deb53"> </span></div></div>`),Ze=t(`<span> </span>`),Qe=t(`<div><button type="button"><span class="resize-handle resize-handle-left svelte-13deb53" aria-hidden="true"></span> <span class="resize-handle resize-handle-right svelte-13deb53" aria-hidden="true"></span> <!></button> <button type="button"><!> <span class="arrow-label svelte-13deb53"> </span></button> <button type="button"><span class="arrow-label svelte-13deb53"> </span> <!></button></div>`),$e=t(`<!> <!>`,1),et=t(`<div class="timeline-scroll svelte-13deb53"><div class="timeline-canvas svelte-13deb53"><!> <div class="timeline-header svelte-13deb53"><div class="header-tier header-primary svelte-13deb53"></div> <div class="header-tier header-secondary svelte-13deb53"></div></div> <div class="timeline-body"></div> <div class="today-line svelte-13deb53" aria-hidden="true"></div></div></div>`),tt=t(`<div class="timeline-view svelte-13deb53"><div class="timeline-toolbar view-toolbar svelte-13deb53"><div class="toolbar-left toolbar-row svelte-13deb53"><!> <div class="toolbar-group"><button type="button"><!></button> <!> <!></div> <!> <div class="toolbar-group"><button type="button" class="toolbar-text-btn today-btn" title="Jump to today">Today</button></div></div> <div class="toolbar-flex-spacer svelte-13deb53"></div> <div class="toolbar-right toolbar-group svelte-13deb53"><!></div></div> <!> <!></div>`);function nt(t,p){n(p,!0);let h=O(p,`lockedType`,3,null),g=O(p,`lockedFolder`,3,null),v=O(p,`lockedFolderPath`,3,null),y=O(p,`storageId`,3,null),S=O(p,`sharedConfig`,3,null),te=O(p,`sharedConfigId`,3,null),j=O(p,`entities`,3,null),N=P(()=>y()?`sg-timelineview-${y()}`:null),oe=y()?`sg-timelineview-${y()}`:null,ue=(()=>{if(!oe||typeof localStorage>`u`)return[];try{let e=localStorage.getItem(oe),t=e?JSON.parse(e):null;return Array.isArray(t?.collapsed)?t.collapsed:[]}catch{return[]}})(),we=I(C(new Set(ue)));b(()=>{if(_(N))try{localStorage.setItem(_(N),JSON.stringify({collapsed:[..._(we)]}))}catch{}});let Oe=S()??null,z=Oe===null?null:te(),B=I(C(Oe?.zoom??`months`)),V=I(C(Oe?.groupBy??`type`)),H=I(C(Oe?.hideCompleted??!0));function ke(){return{zoom:_(B),groupBy:_(V),hideCompleted:_(H)}}let je=I(C(z===null?null:JSON.stringify(ke())));b(()=>{let e=S(),t=te();e==null||t===z||(L(B,e.zoom??`months`,!0),L(V,e.groupBy??`type`,!0),L(H,e.hideCompleted??!0,!0),L(je,JSON.stringify(ke()),!0),z=t)}),b(()=>{let e=ke();if(e.zoom,e.groupBy,e.hideCompleted,z===null)return;let t=JSON.stringify(e);t!==_(je)&&(L(je,t,!0),p.onConfigChange?.(e))});let Me=Le(new Date),Ne=P(()=>{let e=j()??[];return h()?e.filter(e=>e.entityType===h()):e}),U=P(()=>Pe(_(Ne),{hideCompleted:_(H),today:Me})),K=P(()=>Fe(_(Ne)));function Re(e,t){let n=e.start.getTime(),r=t.start.getTime();return n===r?e.entity.title.localeCompare(t.entity.title):n-r}let ze=P(()=>{if(_(V)===`none`){let e=[..._(U)].sort(Re);return e.length===0?[]:[{key:`__all__`,label:``,entries:e,isUngrouped:!0}]}let e=new Map;for(let t of _(U)){let n=e.get(t.sectionKey);n||(n=[],e.set(t.sectionKey,n)),n.push(t)}let t=[];for(let n of Ee){let r=e.get(n);!r||r.length===0||(r.sort(Re),t.push({key:n,label:De[n],entries:r}))}return t}),q=P(()=>Ie(_(U),Me)),J=P(()=>{let e=Te[_(B)];return!_(it)||_(rt)<=0||_(q).days<=0?e:Math.max(e,_(rt)/_(q).days)}),Y=P(()=>_(q).days*_(J)),Ve=P(()=>Be(_(q),_(B),_(J))),He=P(()=>W(_(q).start,Me)*_(J));b(()=>{me.count=_(U).length}),D(()=>{me.count=null,cancelAnimationFrame(lt)});let X=I(null),nt=I(0),rt=I(0),it=I(!1),at=!1,ot=C({});function st(e){let t=()=>{e.classList.toggle(`is-overflowing`,e.scrollWidth>e.clientWidth)};t();let n=new ResizeObserver(t);return n.observe(e),{destroy(){n.disconnect()}}}function ct(e,t){let n=new ResizeObserver(()=>{ot[t]=e.offsetWidth});return n.observe(e),ot[t]=e.offsetWidth,{destroy(){n.disconnect(),delete ot[t]}}}let lt=0;function ut(){_(X)&&(L(nt,_(X).scrollLeft,!0),cancelAnimationFrame(lt),lt=requestAnimationFrame(()=>{_(X)&&Se(y(),_(X))}))}b(()=>{if(!_(X))return;L(rt,_(X).clientWidth,!0),L(it,!0);let e=new ResizeObserver(()=>{_(X)&&L(rt,_(X).clientWidth,!0)});return e.observe(_(X)),()=>e.disconnect()});function dt(e,t=`smooth`){if(!_(X))return;let n=Math.max(0,_(Y)-_(X).clientWidth);_(X).scrollTo({left:Math.min(n,Math.max(0,e)),behavior:t})}function ft(e=`auto`){_(X)&&dt(_(He)-_(X).clientWidth/2,e)}function pt(e){_(X)&&dt(e-_(X).clientWidth/4,`smooth`)}ne(()=>(e().then(()=>{if(at)return;at=!0;let e=Ce(y());if(e&&_(X)){let t=Math.max(0,_(Y)-_(X).clientWidth),n=Math.max(0,_(X).scrollHeight-_(X).clientHeight);_(X).scrollLeft=Math.min(e.x,t),_(X).scrollTop=Math.min(e.y,n)}else ft()}),window.addEventListener(`keydown`,xt),()=>window.removeEventListener(`keydown`,xt)));let mt=I(C(_(J)));b(()=>{if(!_(X)){L(mt,_(J),!0);return}if(_(mt)===_(J))return;let t=_(mt);L(mt,_(J),!0);let n=(_(X).scrollLeft+_(X).clientWidth/2)*(_(J)/t);e().then(()=>{_(X)&&(_(X).scrollLeft=Math.max(0,Math.min(_(Y)-_(X).clientWidth,n-_(X).clientWidth/2)))})});let Z=I(null),Q=I(C({})),ht=!1;function $(e){return`${e.getUTCFullYear()}-${String(e.getUTCMonth()+1).padStart(2,`0`)}-${String(e.getUTCDate()).padStart(2,`0`)}`}function gt(e){return _(Z)?.entityId===e.entity.id&&_(Z).committed?_(Z).currentStart:_(Q)[e.entity.id]?.start??e.start}function _t(e){return _(Z)?.entityId===e.entity.id&&_(Z).committed?_(Z).currentEnd:_(Q)[e.entity.id]?.end??e.end}function vt(e,t){return t<24?e<t/2?`resize-start`:`resize-end`:e<8?`resize-start`:e>t-8?`resize-end`:`move`}function yt(e,t,n){if(e.button!==0)return;ht=!1;let{startField:r,endField:i}=Ae(t.entity.entityType);if(!i)return;let a=e.currentTarget,o=a.getBoundingClientRect(),s=vt(e.clientX-o.left,n),c=gt(t),l=_t(t);L(Z,{entityId:t.entity.id,mode:s,committed:!1,pointerId:e.pointerId,pointerStartX:e.clientX,initialStart:c,initialEnd:l,currentStart:c,currentEnd:l,startField:r,endField:i,captureEl:a},!0),a.setPointerCapture(e.pointerId)}function bt(){if(_(Z)){_(Z).committed&&(ht=!0);try{_(Z).captureEl.releasePointerCapture(_(Z).pointerId)}catch{}document.body.style.cursor=``,L(Z,null)}}function xt(e){e.key!==`Escape`||!_(Z)||(e.preventDefault(),bt())}function St(e){if(!_(Z)||_(Z).pointerId!==e.pointerId)return;let t=e.clientX-_(Z).pointerStartX;if(!_(Z).committed){if(Math.abs(t)<4)return;_(Z).committed=!0,ge(),document.body.style.cursor=_(Z).mode===`move`?`pointer`:`ew-resize`}let n=Math.round(t/_(J));if(_(Z).mode===`move`)_(Z).currentStart=G(_(Z).initialStart,n),_(Z).currentEnd=G(_(Z).initialEnd,n);else if(_(Z).mode===`resize-start`){let e=G(_(Z).initialStart,n);e.getTime()>_(Z).initialEnd.getTime()&&(e=_(Z).initialEnd),_(Z).currentStart=e}else{let e=G(_(Z).initialEnd,n);e.getTime()<_(Z).initialStart.getTime()&&(e=_(Z).initialStart),_(Z).currentEnd=e}}function Ct(e){!_(Z)||_(Z).pointerId!==e.pointerId||(document.body.style.cursor=``,_(Z).committed&&(ht=!0,(_(Z).currentStart.getTime()!==_(Z).initialStart.getTime()||_(Z).currentEnd.getTime()!==_(Z).initialEnd.getTime())&&Tt(_(Z))),L(Z,null))}function wt(e){!_(Z)||_(Z).pointerId!==e.pointerId||(document.body.style.cursor=``,L(Z,null))}async function Tt(e){let t=_(U).find(t=>t.entity.id===e.entityId);if(!t)return;let n=t.entity,r={};if(t.singleEndpoint===`start`?e.mode===`move`&&e.startField?r[e.startField]=$(e.currentStart):e.mode===`resize-end`?r[e.endField]=$(e.currentEnd):e.mode===`resize-start`&&(e.startField&&(r[e.startField]=$(e.currentStart)),r[e.endField]=$(e.currentEnd)):t.singleEndpoint===`end`?e.mode===`move`?r[e.endField]=$(e.currentEnd):e.mode===`resize-start`&&e.startField?r[e.startField]=$(e.currentStart):e.mode===`resize-end`&&(e.startField&&(r[e.startField]=$(e.currentStart)),r[e.endField]=$(e.currentEnd)):((e.mode===`move`||e.mode===`resize-start`)&&e.startField&&(r[e.startField]=$(e.currentStart)),(e.mode===`move`||e.mode===`resize-end`)&&(r[e.endField]=$(e.currentEnd))),Object.keys(r).length!==0){L(Q,{..._(Q),[n.id]:{start:e.currentStart,end:e.currentEnd}},!0);try{await ie(n.repo,n.entityType,n.id,{data:r}),await ae.refreshEntities(n.repo);let e={..._(Q)};delete e[n.id],L(Q,e,!0)}catch(e){console.error(`[timeline] failed to persist date change`,e);let t={..._(Q)};delete t[n.id],L(Q,t,!0)}}}function Et(e){if(ht){ht=!1;return}R(`/${e.repo}/${e.entityType}/${e.id}`)}function Dt(e,t){e.stopPropagation(),pt(t)}function Ot(e){let t=new Set(_(we));t.has(e)?t.delete(e):t.add(e),L(we,t,!0)}function kt(){ft(`smooth`)}function At(e){return e.toLocaleDateString(`en-US`,{month:`short`,day:`numeric`,year:`numeric`,timeZone:`UTC`})}function jt(e,t){let n=se(e,void 0).find(e=>e.key===t);return n?.label?n.label:t.replace(/[-_]/g,` `).replace(/^./,e=>e.toUpperCase())}function Mt(e){let t=e.entity.entityType,{startField:n,endField:r}=Ae(t),i=[],a=[],o=gt(e),s=_t(e);return e.singleEndpoint===`start`&&n?(i.push({label:jt(t,n),value:At(o)}),a.push(n),{extraLines:i,suppressMetaKeys:a}):e.singleEndpoint===`end`&&r?(i.push({label:jt(t,r),value:At(s)}),a.push(r),{extraLines:i,suppressMetaKeys:a}):(n&&(i.push({label:jt(t,n),value:At(o)}),a.push(n)),r&&(i.push({label:jt(t,r),value:At(s)}),a.push(r)),{extraLines:i,suppressMetaKeys:a})}let Nt={weeks:`Weeks`,months:`Months`,quarters:`Quarters`};var Pt=tt(),Ft=k(Pt),It=k(Ft),Lt=k(It),Rt=e=>{var t=We();ve(k(t),{get repoName(){return g()},get currentPath(){return v()}}),i(t),l(e,t)};s(Lt,e=>{g()&&v()&&e(Rt)});var zt=w(Lt,2),Bt=k(zt);let Vt;xe(k(Bt),{size:16}),i(Bt);var Ht=w(Bt,2);{let e=e=>{le(e,{size:16})},t=P(()=>`Zoom: ${Nt[_(B)]}`),n=P(()=>[`weeks`,`months`,`quarters`].map(e=>({value:e,label:Nt[e]})));pe(Ht,{triggerClass:`toolbar-icon-btn`,get triggerTitle(){return _(t)},title:`Zoom`,align:`start`,get value(){return _(B)},get items(){return _(n)},onSelect:e=>L(B,e,!0),trigger:e,$$slots:{trigger:!0}})}Ue(w(Ht,2),{get hideCompleted(){return _(H)},set hideCompleted(e){L(H,e,!0)}}),i(zt);var Ut=w(zt,2),Wt=e=>{var t=Ge();E(k(t),()=>p.toolbarLeft),i(t),l(e,t)};s(Ut,e=>{p.toolbarLeft&&e(Wt)});var Gt=w(Ut,2),Kt=k(Gt);i(Gt),i(It);var qt=w(It,4),Jt=k(qt),Yt=e=>{var t=re();E(ee(t),()=>p.toolbarRight),l(e,t)};s(Jt,e=>{p.toolbarRight&&e(Yt)}),i(qt),i(Ft);var Xt=w(Ft,2),Zt=e=>{ye(e,{children:(e,t)=>{m();var n=f();A(()=>a(n,`${_(K)??``} ${_(K)===1?`entry isn't`:`entries aren't`} on the timeline yet — add a start and due date to place ${_(K)===1?`it`:`them`}.`)),l(e,n)},$$slots:{default:!0}})};s(Xt,e=>{_(K)>0&&_(U).length>0&&e(Zt)});var Qt=w(Xt,2),$t=e=>{l(e,Ke())},en=e=>{var t=et(),n=k(t),c=k(n);T(c,17,()=>_(Ve).primary,e=>e.x,(e,t,n,r)=>{var i=qe();A(()=>F(i,`left: ${_(t).x??``}px;`)),l(e,i)});var f=w(c,2),p=k(f);T(p,21,()=>_(Ve).primary,e=>e.x,(e,t,n,r)=>{var o=Je(),s=k(o),c=k(s,!0);i(s),i(o),A(()=>{F(o,`left: ${_(t).x??``}px; width: ${_(t).width??``}px;`),a(c,_(t).label)}),l(e,o)}),i(p);var m=w(p,2);T(m,21,()=>_(Ve).secondary,e=>e.x,(e,t,n,r)=>{var o=Ye(),s=k(o),c=k(s,!0);i(s),i(o),A(()=>{F(o,`left: ${_(t).x??``}px; width: ${_(t).width??``}px;`),a(c,_(t).label)}),l(e,o)}),i(m),i(f);var h=w(f,2);T(h,21,()=>_(ze),e=>e.key,(e,t)=>{let n=P(()=>_(we).has(_(t).key));var c=$e(),f=ee(c),p=e=>{var o=Xe(),s=k(o),c=k(s);let d;ce(k(c),{size:14}),i(c);var f=w(c,2),p=k(f,!0);i(f),i(s),i(o),A(()=>{d=u(c,1,`section-chevron svelte-13deb53`,null,d,{open:!_(n)}),a(p,_(t).label)}),r(`click`,o,()=>Ot(_(t).key)),r(`keydown`,o,e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),Ot(_(t).key))}),l(e,o)};s(f,e=>{_(t).isUngrouped||e(p)});var m=w(f,2),h=e=>{var n=re();T(ee(n),17,()=>_(t).entries,e=>e.entity.id,(e,t)=>{let n=P(()=>gt(_(t))),c=P(()=>_t(_(t))),f=P(()=>W(_(q).start,_(n))*_(J)),p=P(()=>Math.max(0,W(_(n),_(c)))),m=P(()=>(_(p)+1)*_(J)),h=P(()=>_(Z)?.entityId===_(t).entity.id&&_(Z).committed),v=P(()=>_(Z)&&_(Z).committed&&_(Z).entityId===_(t).entity.id?(Math.max(0,W(_(Z).initialStart,_(Z).initialEnd))+1)*_(J):_(m)),y=P(()=>Math.max(0,24-_(v))),b=P(()=>Math.max(24,_(m)+_(y))),x=P(()=>_(it)&&_(f)+_(b)<_(nt)),S=P(()=>_(it)&&_(f)>_(nt)+_(rt)),C=P(()=>ot[_(t).entity.id]??0),T=P(()=>_(C)>0&&_(C)<=_(b)-11);var E=Qe();let ee;var D=k(E);let O;var te=w(k(D),4),ne=e=>{var n=Ze();let r;var o=k(n,!0);i(n),d(n,(e,t)=>ct?.(e,t),()=>_(t).entity.id),A(e=>{r=u(n,1,`bar-label svelte-13deb53`,null,r,{"sticky-label":_(T)}),a(o,e)},[()=>fe(_(t).entity.title)]),l(e,n)};s(te,e=>{!_(x)&&!_(S)&&e(ne)}),i(D);var j=w(D,2);let N;var I=k(j);be(I,{size:14});var L=w(I,2),re=k(L,!0);i(L),d(L,e=>st?.(e)),i(j);var R=w(j,2);let ie;var ae=k(R),oe=k(ae,!0);i(ae),d(ae,e=>st?.(e)),de(w(ae,2),{size:14}),i(R),i(E),A((e,n)=>{ee=u(E,1,`entry-row svelte-13deb53`,null,ee,{completed:_(t).isCompleted}),O=u(D,1,`timeline-bar svelte-13deb53`,null,O,{"is-dragging":_(h),"dragging-resize":_(h)&&_(Z)?.mode!==`move`}),F(D,`left: ${_(f)??``}px; width: ${_(b)??``}px; --entry-color: ${_(t).color??``};`),N=u(j,1,`row-arrow row-arrow-left svelte-13deb53`,null,N,{visible:_(x)}),M(j,`aria-hidden`,!_(x)),M(j,`tabindex`,_(x)?0:-1),M(j,`title`,`Scroll back to ${_(t).entity.title}`),a(re,e),ie=u(R,1,`row-arrow row-arrow-right svelte-13deb53`,null,ie,{visible:_(S)}),M(R,`aria-hidden`,!_(S)),M(R,`tabindex`,_(S)?0:-1),M(R,`title`,`Scroll forward to ${_(t).entity.title}`),a(oe,n)},[()=>fe(_(t).entity.title),()=>fe(_(t).entity.title)]),r(`click`,D,()=>Et(_(t).entity)),r(`pointerdown`,D,e=>yt(e,_(t),_(b))),r(`pointermove`,D,St),r(`pointerup`,D,Ct),o(`pointercancel`,D,wt),o(`mouseenter`,D,e=>{if(_(Z))return;let{extraLines:n,suppressMetaKeys:r}=Mt(_(t));he(e,_(t).entity,{extraLines:n,suppressMetaKeys:r,hideFolder:!!g()})}),r(`mousemove`,D,e=>{_(Z)||_e(e)}),o(`mouseleave`,D,function(...e){ge?.apply(this,e)}),r(`click`,j,e=>Dt(e,_(f))),r(`click`,R,e=>Dt(e,_(f))),l(e,E)}),l(e,n)};s(m,e=>{(!_(n)||_(t).isUngrouped)&&e(h)}),l(e,c)}),i(h);var v=w(h,2);i(n),i(t),x(t,e=>L(X,e),()=>_(X)),A(()=>{F(n,`width: ${_(Y)??``}px;`),F(f,`width: ${_(Y)??``}px;`),F(h,`width: ${_(Y)??``}px;`),F(v,`left: ${_(He)??``}px;`)}),o(`scroll`,t,ut),l(e,t)};s(Qt,e=>{_(U).length===0?e($t):e(en,-1)}),i(Pt),A(()=>{Vt=u(Bt,1,`toolbar-icon-btn`,null,Vt,{active:_(V)===`type`}),M(Bt,`title`,_(V)===`type`?`Grouped by Type (click to ungroup)`:`Group by Type`)}),r(`click`,Bt,()=>L(V,_(V)===`type`?`none`:`type`,!0)),r(`click`,Kt,kt),l(t,Pt),c()}h([`click`,`keydown`,`pointerdown`,`pointermove`,`pointerup`,`mousemove`]);export{nt as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./CgOgBK5j.js","./FISIvbqq.js","./QsO256-z.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{B as e,Ft as t,G as n,Ht as r,I as i,K as a,M as o,O as s,P as c,Pt as l,R as u,S as d,St as f,T as p,U as m,V as h,Vt as g,W as _,X as v,Z as y,a as b,at as x,ct as S,g as C,gt as w,ht as T,j as E,k as ee,mt as D,n as te,o as O,ot as k,pt as A,qt as ne,st as j,u as re,v as M,vt as N,wt as P,x as ie,xt as F,yt as I,z as ae}from"./FISIvbqq.js";import{r as oe}from"./B4PrlkmE.js";import{t as se}from"./kNaey6uv.js";import"./xihTtKlq.js";import"./DjXtgWTP.js";import{$ as ce}from"./nqo2e2Yv.js";import{i as le}from"./CWZSexLW.js";import"./CWIHttTH.js";import{t as ue}from"./DIsSxB_C.js";import{c as de,d as fe,f as pe,m as me,p as he,r as ge,s as _e,u as ve}from"./DwuBUEvU.js";import"./sUAtda6y2.js";import{i as ye,n as be,r as xe,t as Se}from"./DPLkAijI2.js";import{a as Ce,r as we}from"./DiMsLIh3.js";import{t as Te}from"./6guf_P8c.js";import{o as Ee}from"./B9VQbssY.js";import{n as De,r as Oe}from"./BqButnP4.js";import{i as ke,n as Ae,r as je}from"./C8ZiSqQm.js";import{a as Me,c as Ne,d as Pe,i as Fe,l as Ie,o as Le,r as Re,s as ze,t as Be,u as Ve}from"./CKwV6HKc.js";import{t as He}from"./uHaS74te.js";import{t as Ue}from"./CqyFdLMa.js";var L=e(`<div><button class="nav-btn svelte-nvmrt1"><!></button> <button type="button" class="toolbar-text-btn today-btn" title="Jump to today">Today</button> <button class="nav-btn svelte-nvmrt1"><!></button> <div class="period-label svelte-nvmrt1"><span class="period-label-full svelte-nvmrt1"> </span> <span class="period-label-short svelte-nvmrt1"> </span></div></div>`);function We(e,t){let a=O(t,`prevTitle`,3,`Previous`),o=O(t,`nextTitle`,3,`Next`),s=O(t,`grow`,3,!1),c=O(t,`compactLabel`,3,!1);var l=L();let f;var p=A(l);be(A(p),{size:16}),r(p);var m=T(p,2),h=T(m,2);xe(A(h),{size:16}),r(h);var g=T(h,2),_=A(g),v=A(_,!0);r(_);var y=T(_,2),b=A(y,!0);r(y),r(g),r(l),j(()=>{f=d(l,1,`period-nav svelte-nvmrt1`,null,f,{grow:s(),compact:c()}),M(p,`title`,a()),M(p,`aria-label`,a()),M(h,`title`,o()),M(h,`aria-label`,o()),i(v,t.label),i(b,t.labelShort??t.label)}),n(`click`,p,function(...e){t.onPrev?.apply(this,e)}),n(`click`,m,function(...e){t.onToday?.apply(this,e)}),n(`click`,h,function(...e){t.onNext?.apply(this,e)}),u(e,l)}_([`click`]);var Ge=h(`<title> </title>`),Ke=h(`<svg><!><path d="M30,23V21H27.91a5.9592,5.9592,0,0,0-1.0244-2.4707L28.364,17.05,26.95,15.6362l-1.4788,1.4785A5.9584,5.9584,0,0,0,23,16.09V14H21v2.09a5.9584,5.9584,0,0,0-2.4709,1.0244L17.05,15.6362,15.636,17.05l1.4787,1.479A5.9618,5.9618,0,0,0,16.09,21H14v2h2.09a5.9618,5.9618,0,0,0,1.0244,2.4707L15.636,26.95,17.05,28.3638l1.4788-1.4785A5.9584,5.9584,0,0,0,21,27.91V30h2V27.91a5.9584,5.9584,0,0,0,2.4709-1.0244L26.95,28.3638,28.364,26.95l-1.4787-1.479A5.9592,5.9592,0,0,0,27.91,23Zm-8,3a4,4,0,1,1,4-4A4.0045,4.0045,0,0,1,22,26Z"></path><path d="M28,6a2,2,0,0,0-2-2H22V2H20V4H12V2H10V4H6A2,2,0,0,0,4,6V26a2,2,0,0,0,2,2h4V26H6V6h4V8h2V6h8V8h2V6h4v6h2Z"></path></svg>`);function qe(e,n){let a=b(n,[`children`,`$$slots`,`$$events`,`$$legacy`]),o=b(a,[`size`,`title`]);t(n,!1);let s=N(),d=N(),f=O(n,`size`,8,16),p=O(n,`title`,8,void 0);x(()=>(v(a),v(p())),()=>{I(s,a[`aria-label`]||a[`aria-labelledby`]||p())}),x(()=>(y(s),v(a)),()=>{I(d,{"aria-hidden":y(s)?void 0:!0,role:y(s)?`img`:void 0,focusable:Number(a.tabindex)===0?!0:void 0})}),k(),re();var m=Ke();C(m,()=>({xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 32`,fill:`currentColor`,preserveAspectRatio:`xMidYMid meet`,width:f(),height:f(),...y(d),...o}));var h=A(m),_=e=>{var t=Ge(),n=A(t,!0);r(t),j(()=>i(n,p())),u(e,t)};c(h,e=>{p()&&e(_)}),g(2),r(m),u(e,m),l()}var Je=ne({default:()=>R}),Ye=e(`<div class="toolbar-group"><!></div>`),Xe=e(`<button class="toolbar-icon-btn" aria-label="Back"><!></button>`),Ze=e(`<!> <!> <!>`,1),Qe=e(`<button class="sg-sheet-row"><span class="sg-sheet-row-label"> </span> <span class="sg-sheet-row-trail"><!></span></button>`),$e=e(`<button class="sg-sheet-row"><span class="sg-sheet-row-label"> </span> <span class="sg-sheet-row-trail"><!></span></button> <!>`,1),et=e(`<button><span class="sg-sheet-row-lead"><!></span> <span class="sg-sheet-row-label">Month</span></button> <button><span class="sg-sheet-row-lead"><!></span> <span class="sg-sheet-row-label">Week</span></button>`,1),tt=e(`<div class="date-field-divider svelte-dnwsps" role="separator"></div>`),nt=e(`<!> <button><span class="sg-sheet-row-lead"><!></span> <span class="sg-sheet-row-label"> </span></button>`,1),rt=e(`<!> <div class="sg-sheet-body"><!></div>`,1),it=e(`<!> <!>`,1),at=e(`<span> </span> <!>`,1),ot=e(`<div class="calendar-toolbar view-toolbar toolbar-row"><!> <div class="toolbar-group"><button><!></button> <!></div> <div class="toolbar-left toolbar-group svelte-dnwsps"><!> <!></div> <!> <div class="toolbar-right toolbar-group svelte-dnwsps"><!></div></div>`),st=e(`<div class="empty svelte-dnwsps"><p class="empty-title svelte-dnwsps">See your entries on a calendar</p> <p class="empty-hint svelte-dnwsps">To see tasks, events or other entries on a calendar, make sure that they use dates.</p></div>`),ct=e(`<div class="dow-header svelte-dnwsps"> </div>`),lt=e(`<span class="today-dot svelte-dnwsps" aria-hidden="true"></span>`),ut=e(`<button class="entity-chip svelte-dnwsps" draggable="true"><span class="chip-label svelte-dnwsps"> </span></button>`),dt=e(`<button class="day-view-all svelte-dnwsps">View all</button>`),ft=e(`<div><span><span class="day-number-text"> </span> <!></span> <div class="day-entities svelte-dnwsps"></div> <!></div>`),pt=e(`<div class="calendar-grid svelte-dnwsps"><!> <!></div>`),mt=e(`<div class="overflow-loading svelte-dnwsps"><!></div>`),ht=e(`<button class="overflow-item svelte-dnwsps"><span class="chip-dot"></span> <span class="overflow-item-title svelte-dnwsps"> </span> <span class="overflow-item-type svelte-dnwsps"> </span></button>`),gt=e(`<div class="overflow-list svelte-dnwsps"></div>`),_t=e(`<div class="overflow-backdrop svelte-dnwsps"></div> <div class="overflow-popover svelte-dnwsps"><!></div>`,1),vt=e(`<div><!> <!> <!></div> <!>`,1);function R(e,h){t(h,!0);let _=O(h,`view`,3,null),v=O(h,`lockedType`,3,null),b=O(h,`lockedFolder`,3,null),x=O(h,`lockedFolderPath`,3,null),C=O(h,`storageId`,3,null),k=O(h,`sharedConfig`,3,null),ne=O(h,`sharedConfigId`,3,null),re=O(h,`defaultDateField`,3,`date`),N=O(h,`entities`,3,null),be=O(h,`lockedMode`,3,null),L=O(h,`chrome`,3,!0),Ge=O(h,`anchorDate`,3,null),Ke=O(h,`overflowAfter`,3,2),Je=new Set([`updated_at`,`created_at`]),R=F(!1),z=F(`root`),yt=P(()=>y(z)===`mode`?`View`:y(z)===`sort`?`Sort by`:`Options`);S(()=>{y(R)||I(z,`root`)});function bt(){I(z,`root`)}let xt=P(()=>C()?`sg-calendarview-${C()}`:null);function St(){if(!y(xt))return;let e={year:y(B),month:y(V),day:y(H),mode:y(U)};try{localStorage.setItem(y(xt),JSON.stringify(e))}catch{}}let Ct=C()?`sg-calendarview-${C()}`:null,wt=(()=>{if(!Ct||typeof localStorage>`u`)return null;try{let e=localStorage.getItem(Ct);return e?JSON.parse(e):null}catch{return null}})(),Tt=new Date,Et=P(()=>v()??_()?.config?.selectedType??null),B=F(w(wt?.year??Tt.getFullYear())),V=F(w(wt?.month??Tt.getMonth()+1)),H=F(w(wt?.day??Tt.getDate())),U=F(w(be()??wt?.mode??`month`));S(()=>{y(B),y(V),y(H),y(U),St()}),S(()=>{if(Ge()==null)return;let[e,t,n]=Ge().split(`-`).map(Number);I(B,e,!0),I(V,t,!0),I(H,n,!0)});let Dt=k()??null,Ot=Dt===null?null:ne(),W=F(w(Dt?.dateField??re())),kt=F(w(Ot===null?null:JSON.stringify({dateField:y(W)})));S(()=>{let e=k(),t=ne();e==null||t===Ot||(I(W,e.dateField??re(),!0),I(kt,JSON.stringify({dateField:y(W)}),!0),Ot=t)}),S(()=>{if(y(W),Ot===null)return;let e=JSON.stringify({dateField:y(W)});e!==y(kt)&&(I(kt,e,!0),h.onConfigChange?.({dateField:y(W)}))});let G=P(()=>{let e=Je.has(y(W)),t=t=>e||Pe(t),n=[];if(N())for(let e of N())t(e.entityType)&&n.push(e);else for(let e of le.repos)if(!(b()&&e.name!==b()))for(let r of e.entities)t(r.entityType)&&n.push(r);return n}),At=P(()=>{let e=new Set;for(let t of y(G))for(let n of Object.keys(t.fields))e.add(n);return e}),K=P(()=>Ie(y(Et),y(At))),jt=P(()=>y(K).find(e=>e.key===y(W))?.label??y(W)),Mt=P(()=>y(K).some(e=>!e.system)?y(K).find(e=>e.system)?.key??null:null),q=P(()=>ze(y(G),y(W))),Nt=P(()=>y(G).length-y(q));function Pt(e){Wt(e),I(R,!1)}function Ft(e){I(U,e,!0),I(R,!1)}S(()=>{y(K).length>0&&!y(K).some(e=>e.key===y(W))&&I(W,y(K)[0].key,!0)});let It=P(()=>y(U)===`week`?Le(y(B),y(V),y(H),y(G),y(W)):Me(y(B),y(V),y(G),y(W))),Lt=P(()=>y(U)===`week`?Ne(y(It)):`${Fe[y(V)-1]} ${y(B)}`),Rt=P(()=>y(U)===`week`?Ne(y(It)):`${Fe[y(V)-1].slice(0,3)} ${y(B)}`);S(()=>{L()&&(Oe.count=y(G).length)}),te(()=>{L()&&(Oe.count=null)});function zt(e){let t=new Date(y(B),y(V)-1,y(H));t.setDate(t.getDate()+e),I(B,t.getFullYear(),!0),I(V,t.getMonth()+1),I(H,t.getDate(),!0)}function Bt(){y(U)===`week`?zt(-7):y(V)===1?(I(V,12),f(B,-1)):f(V,-1)}function Vt(){y(U)===`week`?zt(7):y(V)===12?(I(V,1),f(B)):f(V)}function Ht(){let e=new Date;I(B,e.getFullYear(),!0),I(V,e.getMonth()+1),I(H,e.getDate(),!0)}function Ut(){be()||I(U,y(U)===`month`?`week`:`month`,!0)}function Wt(e){e&&I(W,e,!0)}function Gt(e){oe(`/${e.repo}/${e.entityType}/${e.id}`)}let J=F(!1),Y=F(w([])),Kt=F(w({x:0,y:0})),qt=F(``),X=F(!1);function Jt(e,t,n){e.stopPropagation(),I(qt,new Date(n+`T00:00:00`).toLocaleDateString(`en-US`,{weekday:`short`,month:`short`,day:`numeric`}),!0);let r=e.currentTarget.getBoundingClientRect(),i=Math.min(320,t.length*36+40),a=r.left,o=r.bottom+4;a+260>window.innerWidth&&(a=window.innerWidth-260-8),a<8&&(a=8),o+i>window.innerHeight&&(o=r.top-i-4),o<8&&(o=8),I(Kt,{x:a,y:o},!0),I(J,!0),t.length>50?(I(Y,[],!0),I(X,!0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{y(J)&&(I(Y,t,!0),I(X,!1))})})):(I(Y,t,!0),I(X,!1))}function Yt(){I(J,!1),I(Y,[],!0),I(X,!1)}let Xt=new Set([`created_at`,`updated_at`]),Zt=P(()=>!Xt.has(y(W))),Z=F(null),Q=F(null);function Qt(e,t){I(Z,t,!0),e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`text/plain`,t.id),Ae()}function $t(e,t){!y(Z)||!y(Zt)||(e.preventDefault(),e.dataTransfer.dropEffect=`move`,I(Q,t,!0))}function en(){I(Q,null)}function tn(){I(Z,null),I(Q,null)}async function nn(e,t){if(e.preventDefault(),!y(Z))return;let n=y(Z);if(I(Z,null),I(Q,null),t!==Ve(n,y(W))){if(h.onReschedule){try{await h.onReschedule(n,t)}catch{}return}try{await ce(n.repo,n.entityType,n.id,{data:{[y(W)]:t}}),await le.refreshEntities(n.repo)}catch(e){console.error(`Failed to update entity date:`,e);let{toast:t}=await se(async()=>{let{toast:e}=await import(`./CgOgBK5j.js`).then(e=>e.n);return{toast:e}},__vite__mapDeps([0,1,2]),import.meta.url);t(`Could not reschedule — please try again`,{duration:4e3})}}}var rn=vt(),$=D(rn);let an;var on=A($),sn=e=>{var t=ot(),a=A(t),l=e=>{var t=Ye();Be(A(t),{get repoName(){return b()},get currentPath(){return x()}}),r(t),u(e,t)};c(a,e=>{b()&&x()&&e(l)});var f=T(a,2),p=A(f);let _;qe(A(p),{size:16}),r(p),s(T(p,2),()=>me,(e,t)=>{t(e,{get open(){return y(R)},set open(e){I(R,e,!0)},children:(e,t)=>{var a=it(),l=D(a);s(l,()=>he,(e,t)=>{t(e,{class:`toolbar-icon-btn mobile-overflow`,title:`More options`,"aria-label":`More options`,children:(e,t)=>{Te(e,{})},$$slots:{default:!0}})}),s(T(l,2),()=>fe,(e,t)=>{t(e,{side:`bottom`,class:`sg-mobile-sheet`,children:(e,t)=>{var a=rt(),l=D(a);s(l,()=>ve,(e,t)=>{t(e,{class:`sg-sheet-header`,children:(e,t)=>{var a=Ze(),o=D(a),l=e=>{var t=Xe();Ue(A(t),{size:16}),r(t),n(`click`,t,bt),u(e,t)};c(o,e=>{y(z)!==`root`&&e(l)});var d=T(o,2);s(d,()=>de,(e,t)=>{t(e,{class:`sg-sheet-title`,children:(e,t)=>{g();var n=m();j(()=>i(n,y(yt))),u(e,n)},$$slots:{default:!0}})}),s(T(d,2),()=>pe,(e,t)=>{t(e,{class:`dialog-close-btn`,"aria-label":`Close`,children:(e,t)=>{ye(e,{size:16})},$$slots:{default:!0}})}),u(e,a)},$$slots:{default:!0}})});var f=T(l,2),p=A(f),h=e=>{var t=$e(),a=D(t),o=A(a),s=A(o);r(o);var l=T(o,2);xe(A(l),{size:16}),r(l),r(a);var d=T(a,2),f=e=>{var t=Qe(),a=A(t),o=A(a);r(a);var s=T(a,2);xe(A(s),{size:16}),r(s),r(t),j(()=>i(o,`Sort by ${y(jt)??``}`)),n(`click`,t,()=>I(z,`sort`)),u(e,t)};c(d,e=>{y(K).length>1&&e(f)}),j(()=>i(s,`View ${y(U)===`week`?`Week`:`Month`}`)),n(`click`,a,()=>I(z,`mode`)),u(e,t)},_=e=>{var t=et(),i=D(t);let a;var o=A(i),s=A(o),l=e=>{_e(e,{size:18})};c(s,e=>{y(U)===`month`&&e(l)}),r(o),g(2),r(i);var f=T(i,2);let p;var m=A(f),h=A(m),_=e=>{_e(e,{size:18})};c(h,e=>{y(U)===`week`&&e(_)}),r(m),g(2),r(f),j(()=>{a=d(i,1,`sg-sheet-row`,null,a,{selected:y(U)===`month`}),p=d(f,1,`sg-sheet-row`,null,p,{selected:y(U)===`week`})}),n(`click`,i,()=>Ft(`month`)),n(`click`,f,()=>Ft(`week`)),u(e,t)},v=e=>{var t=ae();E(D(t),17,()=>y(K),o,(e,t)=>{var a=nt(),o=D(a),s=e=>{u(e,tt())};c(o,e=>{y(t).key===y(Mt)&&e(s)});var l=T(o,2);let f;var p=A(l),m=A(p),h=e=>{_e(e,{size:18})};c(m,e=>{y(W)===y(t).key&&e(h)}),r(p);var g=T(p,2),_=A(g,!0);r(g),r(l),j(()=>{f=d(l,1,`sg-sheet-row`,null,f,{selected:y(W)===y(t).key}),i(_,y(t).label)}),n(`click`,l,()=>Pt(y(t).key)),u(e,a)}),u(e,t)};c(p,e=>{y(z)===`root`?e(h):y(z)===`mode`?e(_,1):y(z)===`sort`&&e(v,2)}),r(f),u(e,a)},$$slots:{default:!0}})}),u(e,a)},$$slots:{default:!0}})}),r(f);var v=T(f,2),S=A(v),C=e=>{{let t=e=>{var t=at(),n=D(t),a=A(n,!0);r(n),ge(T(n,2),{size:16}),j(e=>i(a,e),[()=>y(K).find(e=>e.key===y(W))?.label??y(W)]),u(e,t)},n=P(()=>y(K).map(e=>({value:e.key,label:e.label,separatorBefore:e.key===y(Mt)})));De(e,{triggerClass:`toolbar-text-btn`,triggerTitle:`Date field`,title:`Date field`,align:`start`,get value(){return y(W)},get items(){return y(n)},onSelect:e=>Wt(e),trigger:t,$$slots:{trigger:!0}})}};c(S,e=>{y(K).length>1&&e(C)});var w=T(S,2),te=e=>{var t=ae();ee(D(t),()=>h.toolbarLeft),u(e,t)};c(w,e=>{h.toolbarLeft&&e(te)}),r(v);var O=T(v,2);{let e=P(()=>y(U)===`week`?`Previous week`:`Previous month`),t=P(()=>y(U)===`week`?`Next week`:`Next month`);We(O,{grow:!0,compactLabel:!0,get label(){return y(Lt)},get labelShort(){return y(Rt)},onPrev:Bt,onNext:Vt,onToday:Ht,get prevTitle(){return y(e)},get nextTitle(){return y(t)}})}var k=T(O,2),ne=A(k),re=e=>{var t=ae();ee(D(t),()=>h.toolbarRight),u(e,t)};c(ne,e=>{h.toolbarRight&&e(re)}),r(k),r(t),j(()=>{_=d(p,1,`toolbar-icon-btn mode-toggle svelte-dnwsps`,null,_,{active:y(U)===`week`}),M(p,`title`,y(U)===`week`?`Switch to month view`:`Switch to week view`)}),n(`click`,p,Ut),u(e,t)};c(on,e=>{L()&&e(sn)});var cn=T(on,2),ln=e=>{He(e,{children:(e,t)=>{g();var n=m();j(()=>i(n,`${y(q)??``} ${y(q)===1?`entry isn't`:`entries aren't`} on the calendar yet — add a date to place ${y(q)===1?`it`:`them`}.`)),u(e,n)},$$slots:{default:!0}})};c(cn,e=>{y(q)>0&&y(Nt)>0&&e(ln)});var un=T(cn,2),dn=e=>{u(e,st())},fn=e=>{var t=pt(),s=A(t);E(s,17,()=>Re,o,(e,t)=>{var n=ct(),a=A(n,!0);r(n),j(()=>i(a,y(t))),u(e,n)}),E(T(s,2),17,()=>y(It),o,(e,t,s,l)=>{let f=P(()=>y(t).entities.length>Ke());var p=ft();let m;var h=A(p);let g;var _=A(h),v=A(_,!0);r(_);var x=T(_,2),S=e=>{u(e,lt())};c(x,e=>{y(t).isToday&&e(S)}),r(h);var C=T(h,2);E(C,21,()=>y(t).entities,o,(e,t)=>{let o=P(()=>we(y(t).entityType));var s=ut();let c;var l=A(s),d=A(l,!0);r(l),r(s),j(e=>{c=ie(s,``,c,{"border-left-color":y(o)}),i(d,e)},[()=>Ee(y(t).title)]),a(`dragstart`,s,e=>Qt(e,y(t))),a(`dragend`,s,tn),n(`click`,s,()=>Gt(y(t))),a(`mouseenter`,s,e=>ke(e,y(t),{hideFolder:!!b()})),n(`mousemove`,s,function(...e){je?.apply(this,e)}),a(`mouseleave`,s,function(...e){Ae?.apply(this,e)}),u(e,s)}),r(C);var w=T(C,2),ee=e=>{var r=dt();j(()=>M(r,`title`,`View all ${y(t).entities.length??``}`)),n(`click`,r,e=>Jt(e,y(t).entities,y(t).dateStr)),u(e,r)};c(w,e=>{y(f)&&e(ee)}),r(p),j(()=>{m=d(p,1,`calendar-day svelte-dnwsps`,null,m,{"outside-month":!y(t).isCurrentMonth,today:y(t).isToday,"week-mode":y(U)===`week`,"has-overflow":y(f),"drop-target":y(Zt)&&y(Q)===y(t).dateStr}),g=d(h,1,`day-number svelte-dnwsps`,null,g,{"today-number":y(t).isToday}),i(v,y(t).day)}),a(`dragover`,p,e=>$t(e,y(t).dateStr)),a(`dragleave`,p,en),a(`drop`,p,e=>nn(e,y(t).dateStr)),u(e,p)}),r(t),u(e,t)};c(un,e=>{L()&&y(G).length>0&&y(Nt)===0?e(dn):e(fn,-1)}),r($);var pn=T($,2),mn=e=>{var t=_t(),a=D(t),s=T(a,2);let l;var d=A(s),f=e=>{var t=mt();ue(A(t),{size:20}),r(t),u(e,t)},m=e=>{var t=gt();E(t,21,()=>y(Y),o,(e,t)=>{let a=P(()=>we(y(t).entityType));var o=ht(),s=A(o);let c;var l=T(s,2),d=A(l,!0);r(l),p(l,e=>Se?.(e));var f=T(l,2),m=A(f,!0);r(f),r(o),j((e,t)=>{c=ie(s,``,c,{background:y(a)}),i(d,e),i(m,t)},[()=>Ee(y(t).title),()=>Ce(y(t).entityType)]),n(`click`,o,()=>{Yt(),Gt(y(t))}),u(e,o)}),r(t),u(e,t)};c(d,e=>{y(X)?e(f):e(m,-1)}),r(s),j(()=>l=ie(s,``,l,{left:`${y(Kt).x??``}px`,top:`${y(Kt).y??``}px`})),n(`click`,a,Yt),u(e,t)};c(pn,e=>{y(J)&&e(mn)}),j(()=>an=d($,1,`calendar-view svelte-dnwsps`,null,an,{widget:!L()})),u(e,rn),l()}_([`click`,`mousemove`]);export{Je as n,We as r,R as t};
|
|
2
|
+
import{B as e,Ft as t,G as n,Ht as r,I as i,K as a,M as o,O as s,P as c,Pt as l,R as u,S as d,St as f,T as p,U as m,V as h,Vt as g,W as _,X as v,Z as y,a as b,at as x,ct as S,g as C,gt as w,ht as T,j as E,k as ee,mt as D,n as te,o as O,ot as k,pt as A,qt as ne,st as j,u as re,v as M,vt as N,wt as P,x as ie,xt as F,yt as I,z as ae}from"./FISIvbqq.js";import{r as oe}from"./D8nBN3-t.js";import{t as se}from"./kNaey6uv.js";import"./xihTtKlq.js";import"./D2G8GgRX.js";import{$ as ce}from"./nqo2e2Yv.js";import{i as le}from"./CWZSexLW.js";import"./CWIHttTH.js";import{t as ue}from"./DIsSxB_C.js";import{c as de,d as fe,f as pe,m as me,p as he,r as ge,s as _e,u as ve}from"./DwuBUEvU.js";import"./BeMEksa_2.js";import{i as ye,n as be,r as xe,t as Se}from"./DPLkAijI2.js";import{a as Ce,r as we}from"./DiMsLIh3.js";import{t as Te}from"./6guf_P8c.js";import{o as Ee}from"./B1pVemww.js";import{n as De,r as Oe}from"./BqButnP4.js";import{i as ke,n as Ae,r as je}from"./C8ZiSqQm.js";import{a as Me,c as Ne,d as Pe,i as Fe,l as Ie,o as Le,r as Re,s as ze,t as Be,u as Ve}from"./Cg5kjIaW.js";import{t as He}from"./uHaS74te.js";import{t as Ue}from"./CqyFdLMa.js";var L=e(`<div><button class="nav-btn svelte-nvmrt1"><!></button> <button type="button" class="toolbar-text-btn today-btn" title="Jump to today">Today</button> <button class="nav-btn svelte-nvmrt1"><!></button> <div class="period-label svelte-nvmrt1"><span class="period-label-full svelte-nvmrt1"> </span> <span class="period-label-short svelte-nvmrt1"> </span></div></div>`);function We(e,t){let a=O(t,`prevTitle`,3,`Previous`),o=O(t,`nextTitle`,3,`Next`),s=O(t,`grow`,3,!1),c=O(t,`compactLabel`,3,!1);var l=L();let f;var p=A(l);be(A(p),{size:16}),r(p);var m=T(p,2),h=T(m,2);xe(A(h),{size:16}),r(h);var g=T(h,2),_=A(g),v=A(_,!0);r(_);var y=T(_,2),b=A(y,!0);r(y),r(g),r(l),j(()=>{f=d(l,1,`period-nav svelte-nvmrt1`,null,f,{grow:s(),compact:c()}),M(p,`title`,a()),M(p,`aria-label`,a()),M(h,`title`,o()),M(h,`aria-label`,o()),i(v,t.label),i(b,t.labelShort??t.label)}),n(`click`,p,function(...e){t.onPrev?.apply(this,e)}),n(`click`,m,function(...e){t.onToday?.apply(this,e)}),n(`click`,h,function(...e){t.onNext?.apply(this,e)}),u(e,l)}_([`click`]);var Ge=h(`<title> </title>`),Ke=h(`<svg><!><path d="M30,23V21H27.91a5.9592,5.9592,0,0,0-1.0244-2.4707L28.364,17.05,26.95,15.6362l-1.4788,1.4785A5.9584,5.9584,0,0,0,23,16.09V14H21v2.09a5.9584,5.9584,0,0,0-2.4709,1.0244L17.05,15.6362,15.636,17.05l1.4787,1.479A5.9618,5.9618,0,0,0,16.09,21H14v2h2.09a5.9618,5.9618,0,0,0,1.0244,2.4707L15.636,26.95,17.05,28.3638l1.4788-1.4785A5.9584,5.9584,0,0,0,21,27.91V30h2V27.91a5.9584,5.9584,0,0,0,2.4709-1.0244L26.95,28.3638,28.364,26.95l-1.4787-1.479A5.9592,5.9592,0,0,0,27.91,23Zm-8,3a4,4,0,1,1,4-4A4.0045,4.0045,0,0,1,22,26Z"></path><path d="M28,6a2,2,0,0,0-2-2H22V2H20V4H12V2H10V4H6A2,2,0,0,0,4,6V26a2,2,0,0,0,2,2h4V26H6V6h4V8h2V6h8V8h2V6h4v6h2Z"></path></svg>`);function qe(e,n){let a=b(n,[`children`,`$$slots`,`$$events`,`$$legacy`]),o=b(a,[`size`,`title`]);t(n,!1);let s=N(),d=N(),f=O(n,`size`,8,16),p=O(n,`title`,8,void 0);x(()=>(v(a),v(p())),()=>{I(s,a[`aria-label`]||a[`aria-labelledby`]||p())}),x(()=>(y(s),v(a)),()=>{I(d,{"aria-hidden":y(s)?void 0:!0,role:y(s)?`img`:void 0,focusable:Number(a.tabindex)===0?!0:void 0})}),k(),re();var m=Ke();C(m,()=>({xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 32`,fill:`currentColor`,preserveAspectRatio:`xMidYMid meet`,width:f(),height:f(),...y(d),...o}));var h=A(m),_=e=>{var t=Ge(),n=A(t,!0);r(t),j(()=>i(n,p())),u(e,t)};c(h,e=>{p()&&e(_)}),g(2),r(m),u(e,m),l()}var Je=ne({default:()=>R}),Ye=e(`<div class="toolbar-group"><!></div>`),Xe=e(`<button class="toolbar-icon-btn" aria-label="Back"><!></button>`),Ze=e(`<!> <!> <!>`,1),Qe=e(`<button class="sg-sheet-row"><span class="sg-sheet-row-label"> </span> <span class="sg-sheet-row-trail"><!></span></button>`),$e=e(`<button class="sg-sheet-row"><span class="sg-sheet-row-label"> </span> <span class="sg-sheet-row-trail"><!></span></button> <!>`,1),et=e(`<button><span class="sg-sheet-row-lead"><!></span> <span class="sg-sheet-row-label">Month</span></button> <button><span class="sg-sheet-row-lead"><!></span> <span class="sg-sheet-row-label">Week</span></button>`,1),tt=e(`<div class="date-field-divider svelte-dnwsps" role="separator"></div>`),nt=e(`<!> <button><span class="sg-sheet-row-lead"><!></span> <span class="sg-sheet-row-label"> </span></button>`,1),rt=e(`<!> <div class="sg-sheet-body"><!></div>`,1),it=e(`<!> <!>`,1),at=e(`<span> </span> <!>`,1),ot=e(`<div class="calendar-toolbar view-toolbar toolbar-row"><!> <div class="toolbar-group"><button><!></button> <!></div> <div class="toolbar-left toolbar-group svelte-dnwsps"><!> <!></div> <!> <div class="toolbar-right toolbar-group svelte-dnwsps"><!></div></div>`),st=e(`<div class="empty svelte-dnwsps"><p class="empty-title svelte-dnwsps">See your entries on a calendar</p> <p class="empty-hint svelte-dnwsps">To see tasks, events or other entries on a calendar, make sure that they use dates.</p></div>`),ct=e(`<div class="dow-header svelte-dnwsps"> </div>`),lt=e(`<span class="today-dot svelte-dnwsps" aria-hidden="true"></span>`),ut=e(`<button class="entity-chip svelte-dnwsps" draggable="true"><span class="chip-label svelte-dnwsps"> </span></button>`),dt=e(`<button class="day-view-all svelte-dnwsps">View all</button>`),ft=e(`<div><span><span class="day-number-text"> </span> <!></span> <div class="day-entities svelte-dnwsps"></div> <!></div>`),pt=e(`<div class="calendar-grid svelte-dnwsps"><!> <!></div>`),mt=e(`<div class="overflow-loading svelte-dnwsps"><!></div>`),ht=e(`<button class="overflow-item svelte-dnwsps"><span class="chip-dot"></span> <span class="overflow-item-title svelte-dnwsps"> </span> <span class="overflow-item-type svelte-dnwsps"> </span></button>`),gt=e(`<div class="overflow-list svelte-dnwsps"></div>`),_t=e(`<div class="overflow-backdrop svelte-dnwsps"></div> <div class="overflow-popover svelte-dnwsps"><!></div>`,1),vt=e(`<div><!> <!> <!></div> <!>`,1);function R(e,h){t(h,!0);let _=O(h,`view`,3,null),v=O(h,`lockedType`,3,null),b=O(h,`lockedFolder`,3,null),x=O(h,`lockedFolderPath`,3,null),C=O(h,`storageId`,3,null),k=O(h,`sharedConfig`,3,null),ne=O(h,`sharedConfigId`,3,null),re=O(h,`defaultDateField`,3,`date`),N=O(h,`entities`,3,null),be=O(h,`lockedMode`,3,null),L=O(h,`chrome`,3,!0),Ge=O(h,`anchorDate`,3,null),Ke=O(h,`overflowAfter`,3,2),Je=new Set([`updated_at`,`created_at`]),R=F(!1),z=F(`root`),yt=P(()=>y(z)===`mode`?`View`:y(z)===`sort`?`Sort by`:`Options`);S(()=>{y(R)||I(z,`root`)});function bt(){I(z,`root`)}let xt=P(()=>C()?`sg-calendarview-${C()}`:null);function St(){if(!y(xt))return;let e={year:y(B),month:y(V),day:y(H),mode:y(U)};try{localStorage.setItem(y(xt),JSON.stringify(e))}catch{}}let Ct=C()?`sg-calendarview-${C()}`:null,wt=(()=>{if(!Ct||typeof localStorage>`u`)return null;try{let e=localStorage.getItem(Ct);return e?JSON.parse(e):null}catch{return null}})(),Tt=new Date,Et=P(()=>v()??_()?.config?.selectedType??null),B=F(w(wt?.year??Tt.getFullYear())),V=F(w(wt?.month??Tt.getMonth()+1)),H=F(w(wt?.day??Tt.getDate())),U=F(w(be()??wt?.mode??`month`));S(()=>{y(B),y(V),y(H),y(U),St()}),S(()=>{if(Ge()==null)return;let[e,t,n]=Ge().split(`-`).map(Number);I(B,e,!0),I(V,t,!0),I(H,n,!0)});let Dt=k()??null,Ot=Dt===null?null:ne(),W=F(w(Dt?.dateField??re())),kt=F(w(Ot===null?null:JSON.stringify({dateField:y(W)})));S(()=>{let e=k(),t=ne();e==null||t===Ot||(I(W,e.dateField??re(),!0),I(kt,JSON.stringify({dateField:y(W)}),!0),Ot=t)}),S(()=>{if(y(W),Ot===null)return;let e=JSON.stringify({dateField:y(W)});e!==y(kt)&&(I(kt,e,!0),h.onConfigChange?.({dateField:y(W)}))});let G=P(()=>{let e=Je.has(y(W)),t=t=>e||Pe(t),n=[];if(N())for(let e of N())t(e.entityType)&&n.push(e);else for(let e of le.repos)if(!(b()&&e.name!==b()))for(let r of e.entities)t(r.entityType)&&n.push(r);return n}),At=P(()=>{let e=new Set;for(let t of y(G))for(let n of Object.keys(t.fields))e.add(n);return e}),K=P(()=>Ie(y(Et),y(At))),jt=P(()=>y(K).find(e=>e.key===y(W))?.label??y(W)),Mt=P(()=>y(K).some(e=>!e.system)?y(K).find(e=>e.system)?.key??null:null),q=P(()=>ze(y(G),y(W))),Nt=P(()=>y(G).length-y(q));function Pt(e){Wt(e),I(R,!1)}function Ft(e){I(U,e,!0),I(R,!1)}S(()=>{y(K).length>0&&!y(K).some(e=>e.key===y(W))&&I(W,y(K)[0].key,!0)});let It=P(()=>y(U)===`week`?Le(y(B),y(V),y(H),y(G),y(W)):Me(y(B),y(V),y(G),y(W))),Lt=P(()=>y(U)===`week`?Ne(y(It)):`${Fe[y(V)-1]} ${y(B)}`),Rt=P(()=>y(U)===`week`?Ne(y(It)):`${Fe[y(V)-1].slice(0,3)} ${y(B)}`);S(()=>{L()&&(Oe.count=y(G).length)}),te(()=>{L()&&(Oe.count=null)});function zt(e){let t=new Date(y(B),y(V)-1,y(H));t.setDate(t.getDate()+e),I(B,t.getFullYear(),!0),I(V,t.getMonth()+1),I(H,t.getDate(),!0)}function Bt(){y(U)===`week`?zt(-7):y(V)===1?(I(V,12),f(B,-1)):f(V,-1)}function Vt(){y(U)===`week`?zt(7):y(V)===12?(I(V,1),f(B)):f(V)}function Ht(){let e=new Date;I(B,e.getFullYear(),!0),I(V,e.getMonth()+1),I(H,e.getDate(),!0)}function Ut(){be()||I(U,y(U)===`month`?`week`:`month`,!0)}function Wt(e){e&&I(W,e,!0)}function Gt(e){oe(`/${e.repo}/${e.entityType}/${e.id}`)}let J=F(!1),Y=F(w([])),Kt=F(w({x:0,y:0})),qt=F(``),X=F(!1);function Jt(e,t,n){e.stopPropagation(),I(qt,new Date(n+`T00:00:00`).toLocaleDateString(`en-US`,{weekday:`short`,month:`short`,day:`numeric`}),!0);let r=e.currentTarget.getBoundingClientRect(),i=Math.min(320,t.length*36+40),a=r.left,o=r.bottom+4;a+260>window.innerWidth&&(a=window.innerWidth-260-8),a<8&&(a=8),o+i>window.innerHeight&&(o=r.top-i-4),o<8&&(o=8),I(Kt,{x:a,y:o},!0),I(J,!0),t.length>50?(I(Y,[],!0),I(X,!0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{y(J)&&(I(Y,t,!0),I(X,!1))})})):(I(Y,t,!0),I(X,!1))}function Yt(){I(J,!1),I(Y,[],!0),I(X,!1)}let Xt=new Set([`created_at`,`updated_at`]),Zt=P(()=>!Xt.has(y(W))),Z=F(null),Q=F(null);function Qt(e,t){I(Z,t,!0),e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`text/plain`,t.id),Ae()}function $t(e,t){!y(Z)||!y(Zt)||(e.preventDefault(),e.dataTransfer.dropEffect=`move`,I(Q,t,!0))}function en(){I(Q,null)}function tn(){I(Z,null),I(Q,null)}async function nn(e,t){if(e.preventDefault(),!y(Z))return;let n=y(Z);if(I(Z,null),I(Q,null),t!==Ve(n,y(W))){if(h.onReschedule){try{await h.onReschedule(n,t)}catch{}return}try{await ce(n.repo,n.entityType,n.id,{data:{[y(W)]:t}}),await le.refreshEntities(n.repo)}catch(e){console.error(`Failed to update entity date:`,e);let{toast:t}=await se(async()=>{let{toast:e}=await import(`./CgOgBK5j.js`).then(e=>e.n);return{toast:e}},__vite__mapDeps([0,1,2]),import.meta.url);t(`Could not reschedule — please try again`,{duration:4e3})}}}var rn=vt(),$=D(rn);let an;var on=A($),sn=e=>{var t=ot(),a=A(t),l=e=>{var t=Ye();Be(A(t),{get repoName(){return b()},get currentPath(){return x()}}),r(t),u(e,t)};c(a,e=>{b()&&x()&&e(l)});var f=T(a,2),p=A(f);let _;qe(A(p),{size:16}),r(p),s(T(p,2),()=>me,(e,t)=>{t(e,{get open(){return y(R)},set open(e){I(R,e,!0)},children:(e,t)=>{var a=it(),l=D(a);s(l,()=>he,(e,t)=>{t(e,{class:`toolbar-icon-btn mobile-overflow`,title:`More options`,"aria-label":`More options`,children:(e,t)=>{Te(e,{})},$$slots:{default:!0}})}),s(T(l,2),()=>fe,(e,t)=>{t(e,{side:`bottom`,class:`sg-mobile-sheet`,children:(e,t)=>{var a=rt(),l=D(a);s(l,()=>ve,(e,t)=>{t(e,{class:`sg-sheet-header`,children:(e,t)=>{var a=Ze(),o=D(a),l=e=>{var t=Xe();Ue(A(t),{size:16}),r(t),n(`click`,t,bt),u(e,t)};c(o,e=>{y(z)!==`root`&&e(l)});var d=T(o,2);s(d,()=>de,(e,t)=>{t(e,{class:`sg-sheet-title`,children:(e,t)=>{g();var n=m();j(()=>i(n,y(yt))),u(e,n)},$$slots:{default:!0}})}),s(T(d,2),()=>pe,(e,t)=>{t(e,{class:`dialog-close-btn`,"aria-label":`Close`,children:(e,t)=>{ye(e,{size:16})},$$slots:{default:!0}})}),u(e,a)},$$slots:{default:!0}})});var f=T(l,2),p=A(f),h=e=>{var t=$e(),a=D(t),o=A(a),s=A(o);r(o);var l=T(o,2);xe(A(l),{size:16}),r(l),r(a);var d=T(a,2),f=e=>{var t=Qe(),a=A(t),o=A(a);r(a);var s=T(a,2);xe(A(s),{size:16}),r(s),r(t),j(()=>i(o,`Sort by ${y(jt)??``}`)),n(`click`,t,()=>I(z,`sort`)),u(e,t)};c(d,e=>{y(K).length>1&&e(f)}),j(()=>i(s,`View ${y(U)===`week`?`Week`:`Month`}`)),n(`click`,a,()=>I(z,`mode`)),u(e,t)},_=e=>{var t=et(),i=D(t);let a;var o=A(i),s=A(o),l=e=>{_e(e,{size:18})};c(s,e=>{y(U)===`month`&&e(l)}),r(o),g(2),r(i);var f=T(i,2);let p;var m=A(f),h=A(m),_=e=>{_e(e,{size:18})};c(h,e=>{y(U)===`week`&&e(_)}),r(m),g(2),r(f),j(()=>{a=d(i,1,`sg-sheet-row`,null,a,{selected:y(U)===`month`}),p=d(f,1,`sg-sheet-row`,null,p,{selected:y(U)===`week`})}),n(`click`,i,()=>Ft(`month`)),n(`click`,f,()=>Ft(`week`)),u(e,t)},v=e=>{var t=ae();E(D(t),17,()=>y(K),o,(e,t)=>{var a=nt(),o=D(a),s=e=>{u(e,tt())};c(o,e=>{y(t).key===y(Mt)&&e(s)});var l=T(o,2);let f;var p=A(l),m=A(p),h=e=>{_e(e,{size:18})};c(m,e=>{y(W)===y(t).key&&e(h)}),r(p);var g=T(p,2),_=A(g,!0);r(g),r(l),j(()=>{f=d(l,1,`sg-sheet-row`,null,f,{selected:y(W)===y(t).key}),i(_,y(t).label)}),n(`click`,l,()=>Pt(y(t).key)),u(e,a)}),u(e,t)};c(p,e=>{y(z)===`root`?e(h):y(z)===`mode`?e(_,1):y(z)===`sort`&&e(v,2)}),r(f),u(e,a)},$$slots:{default:!0}})}),u(e,a)},$$slots:{default:!0}})}),r(f);var v=T(f,2),S=A(v),C=e=>{{let t=e=>{var t=at(),n=D(t),a=A(n,!0);r(n),ge(T(n,2),{size:16}),j(e=>i(a,e),[()=>y(K).find(e=>e.key===y(W))?.label??y(W)]),u(e,t)},n=P(()=>y(K).map(e=>({value:e.key,label:e.label,separatorBefore:e.key===y(Mt)})));De(e,{triggerClass:`toolbar-text-btn`,triggerTitle:`Date field`,title:`Date field`,align:`start`,get value(){return y(W)},get items(){return y(n)},onSelect:e=>Wt(e),trigger:t,$$slots:{trigger:!0}})}};c(S,e=>{y(K).length>1&&e(C)});var w=T(S,2),te=e=>{var t=ae();ee(D(t),()=>h.toolbarLeft),u(e,t)};c(w,e=>{h.toolbarLeft&&e(te)}),r(v);var O=T(v,2);{let e=P(()=>y(U)===`week`?`Previous week`:`Previous month`),t=P(()=>y(U)===`week`?`Next week`:`Next month`);We(O,{grow:!0,compactLabel:!0,get label(){return y(Lt)},get labelShort(){return y(Rt)},onPrev:Bt,onNext:Vt,onToday:Ht,get prevTitle(){return y(e)},get nextTitle(){return y(t)}})}var k=T(O,2),ne=A(k),re=e=>{var t=ae();ee(D(t),()=>h.toolbarRight),u(e,t)};c(ne,e=>{h.toolbarRight&&e(re)}),r(k),r(t),j(()=>{_=d(p,1,`toolbar-icon-btn mode-toggle svelte-dnwsps`,null,_,{active:y(U)===`week`}),M(p,`title`,y(U)===`week`?`Switch to month view`:`Switch to week view`)}),n(`click`,p,Ut),u(e,t)};c(on,e=>{L()&&e(sn)});var cn=T(on,2),ln=e=>{He(e,{children:(e,t)=>{g();var n=m();j(()=>i(n,`${y(q)??``} ${y(q)===1?`entry isn't`:`entries aren't`} on the calendar yet — add a date to place ${y(q)===1?`it`:`them`}.`)),u(e,n)},$$slots:{default:!0}})};c(cn,e=>{y(q)>0&&y(Nt)>0&&e(ln)});var un=T(cn,2),dn=e=>{u(e,st())},fn=e=>{var t=pt(),s=A(t);E(s,17,()=>Re,o,(e,t)=>{var n=ct(),a=A(n,!0);r(n),j(()=>i(a,y(t))),u(e,n)}),E(T(s,2),17,()=>y(It),o,(e,t,s,l)=>{let f=P(()=>y(t).entities.length>Ke());var p=ft();let m;var h=A(p);let g;var _=A(h),v=A(_,!0);r(_);var x=T(_,2),S=e=>{u(e,lt())};c(x,e=>{y(t).isToday&&e(S)}),r(h);var C=T(h,2);E(C,21,()=>y(t).entities,o,(e,t)=>{let o=P(()=>we(y(t).entityType));var s=ut();let c;var l=A(s),d=A(l,!0);r(l),r(s),j(e=>{c=ie(s,``,c,{"border-left-color":y(o)}),i(d,e)},[()=>Ee(y(t).title)]),a(`dragstart`,s,e=>Qt(e,y(t))),a(`dragend`,s,tn),n(`click`,s,()=>Gt(y(t))),a(`mouseenter`,s,e=>ke(e,y(t),{hideFolder:!!b()})),n(`mousemove`,s,function(...e){je?.apply(this,e)}),a(`mouseleave`,s,function(...e){Ae?.apply(this,e)}),u(e,s)}),r(C);var w=T(C,2),ee=e=>{var r=dt();j(()=>M(r,`title`,`View all ${y(t).entities.length??``}`)),n(`click`,r,e=>Jt(e,y(t).entities,y(t).dateStr)),u(e,r)};c(w,e=>{y(f)&&e(ee)}),r(p),j(()=>{m=d(p,1,`calendar-day svelte-dnwsps`,null,m,{"outside-month":!y(t).isCurrentMonth,today:y(t).isToday,"week-mode":y(U)===`week`,"has-overflow":y(f),"drop-target":y(Zt)&&y(Q)===y(t).dateStr}),g=d(h,1,`day-number svelte-dnwsps`,null,g,{"today-number":y(t).isToday}),i(v,y(t).day)}),a(`dragover`,p,e=>$t(e,y(t).dateStr)),a(`dragleave`,p,en),a(`drop`,p,e=>nn(e,y(t).dateStr)),u(e,p)}),r(t),u(e,t)};c(un,e=>{L()&&y(G).length>0&&y(Nt)===0?e(dn):e(fn,-1)}),r($);var pn=T($,2),mn=e=>{var t=_t(),a=D(t),s=T(a,2);let l;var d=A(s),f=e=>{var t=mt();ue(A(t),{size:20}),r(t),u(e,t)},m=e=>{var t=gt();E(t,21,()=>y(Y),o,(e,t)=>{let a=P(()=>we(y(t).entityType));var o=ht(),s=A(o);let c;var l=T(s,2),d=A(l,!0);r(l),p(l,e=>Se?.(e));var f=T(l,2),m=A(f,!0);r(f),r(o),j((e,t)=>{c=ie(s,``,c,{background:y(a)}),i(d,e),i(m,t)},[()=>Ee(y(t).title),()=>Ce(y(t).entityType)]),n(`click`,o,()=>{Yt(),Gt(y(t))}),u(e,o)}),r(t),u(e,t)};c(d,e=>{y(X)?e(f):e(m,-1)}),r(s),j(()=>l=ie(s,``,l,{left:`${y(Kt).x??``}px`,top:`${y(Kt).y??``}px`})),n(`click`,a,Yt),u(e,t)};c(pn,e=>{y(J)&&e(mn)}),j(()=>an=d($,1,`calendar-view svelte-dnwsps`,null,an,{widget:!L()})),u(e,rn),l()}_([`click`,`mousemove`]);export{Je as n,We as r,R as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as e,Ft as t,Ht as n,I as r,O as i,P as a,Pt as o,R as s,U as c,Vt as l,Z as u,ct as d,ht as f,mt as p,pt as m,st as h,wt as g,xt as _,yt as v,z as y}from"./FISIvbqq.js";import"./xihTtKlq.js";import{t as b}from"./
|
|
1
|
+
import{B as e,Ft as t,Ht as n,I as r,O as i,P as a,Pt as o,R as s,U as c,Vt as l,Z as u,ct as d,ht as f,mt as p,pt as m,st as h,wt as g,xt as _,yt as v,z as y}from"./FISIvbqq.js";import"./xihTtKlq.js";import{t as b}from"./DqGcR20a.js";import{A as x,D as S,E as C,M as w,T,j as E,k as D}from"./DwuBUEvU.js";import{f as O,g as k,m as A,p as j}from"./DxPoYrW02.js";import{t as M}from"./GC5Izn9E2.js";import{t as N}from"./CmWflMFc.js";var P=e(`<p class="dialog-error svelte-1p20661"> </p>`),F=e(`<!> <!> <!>`,1),I=e(`<!> <!>`,1),L=e(`<!> <!> <!>`,1);function R(e,R){t(R,!0);let z=g(()=>O.request),B=_(``),V=_(!1),H=_(null);d(()=>{let e=u(z);e&&(v(B,A({scopeLabel:e.scopeLabel,viz:e.viz,groupByLabel:e.groupByLabel}),!0),v(H,null))});async function U(){let e=u(z);if(!e||u(V))return;let t=u(B).trim();if(!t){v(H,`Enter a name`);return}v(V,!0),v(H,null);let n=await j.create(t,{config:k(e.scratch),viewType:e.viz,scope:e.defaultScope});v(V,!1),n?(O.close(),b.showToast(`Saved view “${t}”`)):v(H,`Could not save the view`)}var W=y();i(p(W),()=>w,(e,t)=>{t(e,{get open(){return O.open},onOpenChange:e=>{e||O.close()},children:(e,t)=>{var o=y();i(p(o),()=>E,(e,t)=>{t(e,{size:`sm`,children:(e,t)=>{var o=L(),d=p(o);i(d,()=>x,(e,t)=>{t(e,{class:`close-only-header`,children:(e,t)=>{var n=y();i(p(n),()=>T,(e,t)=>{t(e,{})}),s(e,n)},$$slots:{default:!0}})});var _=f(d,2);i(_,()=>S,(e,t)=>{t(e,{class:`dialog-body-lg`,children:(e,t)=>{var o=F(),d=p(o);i(d,()=>D,(e,t)=>{t(e,{children:(e,t)=>{l(),s(e,c(`Save view`))},$$slots:{default:!0}})});var g=f(d,2);N(g,{type:`text`,placeholder:`View name`,get value(){return u(B)},set value(e){v(B,e,!0)}});var _=f(g,2),y=e=>{var t=P(),i=m(t,!0);n(t),h(()=>r(i,u(H))),s(e,t)};a(_,e=>{u(H)&&e(y)}),s(e,o)},$$slots:{default:!0}})}),i(f(_,2),()=>C,(e,t)=>{t(e,{children:(e,t)=>{var n=I(),r=p(n);M(r,{variant:`ghost`,onclick:()=>O.close(),children:(e,t)=>{l(),s(e,c(`Cancel`))},$$slots:{default:!0}});var i=f(r,2);{let e=g(()=>!u(B).trim());M(i,{variant:`accent`,enterKey:!0,get disabled(){return u(e)},get loading(){return u(V)},onclick:U,children:(e,t)=>{l(),s(e,c(`Save view`))},$$slots:{default:!0}})}s(e,n)},$$slots:{default:!0}})}),s(e,o)},$$slots:{default:!0}})}),s(e,o)},$$slots:{default:!0}})}),s(e,W),o()}export{R as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$ as e,A as t,G as n,H as r,L as i,M as a,Q as o,R as s,U as c,W as l,X as u,Z as d,at as ee,ct as te,dt as f,it as ne,lt as re,nt as ie,o as ae,p as oe,q as p,rt as m,st as se,ut as ce,x as le}from"./CsIWxmio.js";var h={cullArea:null,cullable:!1,cullableChildren:!0},g=class e{constructor(e,t,n){this._x=t||0,this._y=n||0,this._observer=e}clone(t){return new e(t??this._observer,this._x,this._y)}set(e=0,t=e){return(this._x!==e||this._y!==t)&&(this._x=e,this._y=t,this._observer._onUpdate(this)),this}copyFrom(e){return(this._x!==e.x||this._y!==e.y)&&(this._x=e.x,this._y=e.y,this._observer._onUpdate(this)),this}copyTo(e){return e.set(this._x,this._y),e}equals(e){return e.x===this._x&&e.y===this._y}toString(){return`[pixi.js/math:ObservablePoint x=${this._x} y=${this._y} scope=${this._observer}]`}get x(){return this._x}set x(e){this._x!==e&&(this._x=e,this._observer._onUpdate(this))}get y(){return this._y}set y(e){this._y!==e&&(this._y=e,this._observer._onUpdate(this))}},ue={get isCachedAsTexture(){return!!this.renderGroup?.isCachedAsTexture},cacheAsTexture(e){typeof e==`boolean`&&e===!1?this.disableRenderGroup():(this.enableRenderGroup(),this.renderGroup.enableCacheAsTexture(e===!0?{}:e))},updateCacheTexture(){this.renderGroup?.updateCacheTexture()},get cacheAsBitmap(){return this.isCachedAsTexture},set cacheAsBitmap(e){o(`v8.6.0`,`cacheAsBitmap is deprecated, use cacheAsTexture instead.`),this.cacheAsTexture(e)}};function _(e,t,n){let r=e.length,i;if(t>=r||n===0)return;n=t+n>r?r-t:n;let a=r-n;for(i=t;i<a;++i)e[i]=e[i+n];e.length=a}var v={allowChildren:!0,removeChildren(e=0,t){let n=t??this.children.length,r=n-e,i=[];if(r>0&&r<=n){for(let t=n-1;t>=e;t--){let e=this.children[t];e&&(i.push(e),e.parent=null)}_(this.children,e,n);let t=this.renderGroup||this.parentRenderGroup;t&&t.removeChildren(i);for(let e=0;e<i.length;++e){let t=i[e];t.parentRenderLayer?.detach(t),this.emit(`childRemoved`,t,this,e),i[e].emit(`removed`,this)}return i.length>0&&this._didViewChangeTick++,i}else if(r===0&&this.children.length===0)return i;throw RangeError(`removeChildren: numeric values are outside the acceptable range.`)},removeChildAt(e){let t=this.getChildAt(e);return this.removeChild(t)},getChildAt(e){if(e<0||e>=this.children.length)throw Error(`getChildAt: Index (${e}) does not exist.`);return this.children[e]},setChildIndex(e,t){if(t<0||t>=this.children.length)throw Error(`The index ${t} supplied is out of bounds ${this.children.length}`);this.getChildIndex(e),this.addChildAt(e,t)},getChildIndex(e){let t=this.children.indexOf(e);if(t===-1)throw Error(`The supplied Container must be a child of the caller`);return t},addChildAt(t,n){this.allowChildren||o(e,`addChildAt: Only Containers will be allowed to add children in v8.0.0`);let{children:r}=this;if(n<0||n>r.length)throw Error(`${t}addChildAt: The index ${n} supplied is out of bounds ${r.length}`);let i=t.parent===this;if(t.parent){let e=t.parent.children.indexOf(t);if(i){if(e===n)return t;t.parent.children.splice(e,1)}else t.removeFromParent()}n===r.length?r.push(t):r.splice(n,0,t),t.parent=this,t.didChange=!0,t._updateFlags=15;let a=this.renderGroup||this.parentRenderGroup;return a&&a.addChild(t),this.sortableChildren&&(this.sortDirty=!0),i?t:(this.emit(`childAdded`,t,this,n),t.emit(`added`,this),t)},swapChildren(e,t){if(e===t)return;let n=this.getChildIndex(e),r=this.getChildIndex(t);this.children[n]=t,this.children[r]=e;let i=this.renderGroup||this.parentRenderGroup;i&&(i.structureDidChange=!0),this._didContainerChangeTick++},removeFromParent(){this.parent?.removeChild(this)},reparentChild(...e){return e.length===1?this.reparentChildAt(e[0],this.children.length):(e.forEach(e=>this.reparentChildAt(e,this.children.length)),e[0])},reparentChildAt(e,t){if(e.parent===this)return this.setChildIndex(e,t),e;let n=e.worldTransform.clone();e.removeFromParent(),this.addChildAt(e,t);let r=this.worldTransform.clone();return r.invert(),n.prepend(r),e.setFromMatrix(n),e},replaceChild(e,t){e.updateLocalTransform(),this.addChildAt(t,this.getChildIndex(e)),t.setFromMatrix(e.localTransform),t.updateLocalTransform(),this.removeChild(e)}},y={collectRenderables(e,t,n){this.parentRenderLayer&&this.parentRenderLayer!==n||this.globalDisplayStatus<7||!this.includeInBuild||(this.sortableChildren&&this.sortChildren(),this.isSimple?this.collectRenderablesSimple(e,t,n):this.renderGroup?t.renderPipes.renderGroup.addRenderGroup(this.renderGroup,e):this.collectRenderablesWithEffects(e,t,n))},collectRenderablesSimple(e,t,n){let r=this.children,i=r.length;for(let a=0;a<i;a++)r[a].collectRenderables(e,t,n)},collectRenderablesWithEffects(e,t,n){let{renderPipes:r}=t;for(let t=0;t<this.effects.length;t++){let n=this.effects[t];r[n.pipe].push(n,this,e)}this.collectRenderablesSimple(e,t,n);for(let t=this.effects.length-1;t>=0;t--){let n=this.effects[t];r[n.pipe].pop(n,this,e)}}},b=class{constructor(){this.pipe=`filter`,this.priority=1}destroy(){for(let e=0;e<this.filters.length;e++)this.filters[e].destroy();this.filters=null,this.filterArea=null}},de=class{constructor(){this._effectClasses=[],this._tests=[],this._initialized=!1}init(){this._initialized||(this._initialized=!0,this._effectClasses.forEach(e=>{this.add({test:e.test,maskClass:e})}))}add(e){this._tests.push(e)}getMaskEffect(e){this._initialized||this.init();for(let t=0;t<this._tests.length;t++){let n=this._tests[t];if(n.test(e))return p.get(n.maskClass,e)}return e}returnMaskEffect(e){p.return(e)}},x=new de;f.handleByList(ce.MaskEffect,x._effectClasses);var fe={_maskEffect:null,_maskOptions:{inverse:!1,channel:`red`},_filterEffect:null,effects:[],_markStructureAsChanged(){let e=this.renderGroup||this.parentRenderGroup;e&&(e.structureDidChange=!0)},addEffect(e){this.effects.indexOf(e)===-1&&(this.effects.push(e),this.effects.sort((e,t)=>e.priority-t.priority),this._markStructureAsChanged(),this._updateIsSimple())},removeEffect(e){let t=this.effects.indexOf(e);t!==-1&&(this.effects.splice(t,1),this._markStructureAsChanged(),this._updateIsSimple())},set mask(e){let t=this._maskEffect;t?.mask!==e&&(t&&(this.removeEffect(t),x.returnMaskEffect(t),this._maskEffect=null),e!=null&&(this._maskEffect=x.getMaskEffect(e),this.addEffect(this._maskEffect)))},get mask(){return this._maskEffect?.mask},setMask(e){this._maskOptions={...this._maskOptions,...e},e.mask&&(this.mask=e.mask),this._markStructureAsChanged()},set filters(e){!Array.isArray(e)&&e&&(e=[e]);let t=this._filterEffect||=new b;e=e;let n=e?.length>0,r=n!==t.filters?.length>0;e=Array.isArray(e)?e.slice(0):e,t.filters=Object.freeze(e),r&&(n?this.addEffect(t):(this.removeEffect(t),t.filters=e??null))},get filters(){return this._filterEffect?.filters},set filterArea(e){this._filterEffect||=new b,this._filterEffect.filterArea=e},get filterArea(){return this._filterEffect?.filterArea}},pe={label:null,get name(){return o(e,`Container.name property has been removed, use Container.label instead`),this.label},set name(t){o(e,`Container.name property has been removed, use Container.label instead`),this.label=t},getChildByName(e,t=!1){return this.getChildByLabel(e,t)},getChildByLabel(e,t=!1){let n=this.children;for(let t=0;t<n.length;t++){let r=n[t];if(r.label===e||e instanceof RegExp&&e.test(r.label))return r}if(t)for(let t=0;t<n.length;t++){let r=n[t].getChildByLabel(e,!0);if(r)return r}return null},getChildrenByLabel(e,t=!1,n=[]){let r=this.children;for(let t=0;t<r.length;t++){let i=r[t];(i.label===e||e instanceof RegExp&&e.test(i.label))&&n.push(i)}if(t)for(let t=0;t<r.length;t++)r[t].getChildrenByLabel(e,!0,n);return n}},S=p.getPool(m),C=p.getPool(n),me=new m,he={getFastGlobalBounds(e,t){t||=new n,t.clear(),this._getGlobalBoundsRecursive(!!e,t,this.parentRenderLayer),t.isValid||t.set(0,0,0,0);let r=this.renderGroup||this.parentRenderGroup;return t.applyMatrix(r.worldTransform),t},_getGlobalBoundsRecursive(e,t,n){let r=t;if(e&&this.parentRenderLayer&&this.parentRenderLayer!==n||this.localDisplayStatus!==7||!this.measurable)return;let i=!!this.effects.length;if((this.renderGroup||i)&&(r=C.get().clear()),this.boundsArea)t.addRect(this.boundsArea,this.worldTransform);else{if(this.renderPipeId){let e=this.bounds;r.addFrame(e.minX,e.minY,e.maxX,e.maxY,this.groupTransform)}let t=this.children;for(let i=0;i<t.length;i++)t[i]._getGlobalBoundsRecursive(e,r,n)}if(i){let e=!1,n=this.renderGroup||this.parentRenderGroup;for(let t=0;t<this.effects.length;t++)this.effects[t].addBounds&&(e||(e=!0,r.applyMatrix(n.worldTransform)),this.effects[t].addBounds(r,!0));e&&r.applyMatrix(n.worldTransform.copyTo(me).invert()),t.addBounds(r),C.return(r)}else this.renderGroup&&(t.addBounds(r,this.relativeGroupTransform),C.return(r))}};function ge(e,t,n){n.clear();let r,i;return e.parent?t?r=e.parent.worldTransform:(i=S.get().identity(),r=T(e,i)):r=m.IDENTITY,w(e,n,r,t),i&&S.return(i),n.isValid||n.set(0,0,0,0),n}function w(e,t,n,r){if(!e.visible||!e.measurable)return;let i;r?i=e.worldTransform:(e.updateLocalTransform(),i=S.get(),i.appendFrom(e.localTransform,n));let a=t,o=!!e.effects.length;if(o&&(t=C.get().clear()),e.boundsArea)t.addRect(e.boundsArea,i);else{let n=e.bounds;n&&!n.isEmpty()&&(t.matrix=i,t.addBounds(n));for(let n=0;n<e.children.length;n++)w(e.children[n],t,i,r)}if(o){for(let n=0;n<e.effects.length;n++)e.effects[n].addBounds?.(t);a.addBounds(t,m.IDENTITY),C.return(t)}r||S.return(i)}function T(e,t){let n=e.parent;return n&&(T(n,t),n.updateLocalTransform(),t.append(n.localTransform)),t}var E=16777215;function D(e,t){return e===E?t:t===E?e:l(e,t)}function O(e){return((e&255)<<16)+(e&65280)+(e>>16&255)}var k={getGlobalAlpha(e){if(e)return this.renderGroup?this.renderGroup.worldAlpha:this.parentRenderGroup?this.parentRenderGroup.worldAlpha*this.alpha:this.alpha;let t=this.alpha,n=this.parent;for(;n;)t*=n.alpha,n=n.parent;return t},getGlobalTransform(e=new m,t){if(t)return e.copyFrom(this.worldTransform);this.updateLocalTransform();let n=T(this,S.get().identity());return e.appendFrom(this.localTransform,n),S.return(n),e},getGlobalTint(e){if(e)return this.renderGroup?O(this.renderGroup.worldColor):this.parentRenderGroup?O(D(this.localColor,this.parentRenderGroup.worldColor)):this.tint;let t=this.localColor,n=this.parent;for(;n;)t=D(t,n.localColor),n=n.parent;return O(t)}};function A(e,t,n){return t.clear(),n||=m.IDENTITY,j(e,t,n,e,!0),t.isValid||t.set(0,0,0,0),t}function j(e,t,n,r,i){let a;if(i)a=S.get(),a=n.copyTo(a);else{if(!e.visible||!e.measurable)return;e.updateLocalTransform();let t=e.localTransform;a=S.get(),a.appendFrom(t,n)}let o=t,s=!!e.effects.length;if(s&&(t=C.get().clear()),e.boundsArea)t.addRect(e.boundsArea,a);else{e.renderPipeId&&(t.matrix=a,t.addBounds(e.bounds));let n=e.children;for(let e=0;e<n.length;e++)j(n[e],t,a,r,!1)}if(s){for(let n=0;n<e.effects.length;n++)e.effects[n].addLocalBounds?.(t,r);o.addBounds(t,m.IDENTITY),C.return(t)}S.return(a)}function M(e,t){let n=e.children;for(let e=0;e<n.length;e++){let r=n[e],i=r.uid,a=(r._didViewChangeTick&65535)<<16|r._didContainerChangeTick&65535,o=t.index;(t.data[o]!==i||t.data[o+1]!==a)&&(t.data[t.index]=i,t.data[t.index+1]=a,t.didChange=!0),t.index=o+2,r.children.length&&M(r,t)}return t.didChange}var _e=new m,N={_localBoundsCacheId:-1,_localBoundsCacheData:null,_setWidth(e,t){let n=Math.sign(this.scale.x)||1;t===0?this.scale.x=n:this.scale.x=e/t*n},_setHeight(e,t){let n=Math.sign(this.scale.y)||1;t===0?this.scale.y=n:this.scale.y=e/t*n},getLocalBounds(){this._localBoundsCacheData||={data:[],index:1,didChange:!1,localBounds:new n};let e=this._localBoundsCacheData;return e.index=1,e.didChange=!1,e.data[0]!==this._didViewChangeTick&&(e.didChange=!0,e.data[0]=this._didViewChangeTick),M(this,e),e.didChange&&A(this,e.localBounds,_e),e.localBounds},getBounds(e,t){return ge(this,e,t||new n)}},P={_onRender:null,set onRender(e){let t=this.renderGroup||this.parentRenderGroup;if(!e){this._onRender&&t?.removeOnRender(this),this._onRender=null;return}this._onRender||t?.addOnRender(this),this._onRender=e},get onRender(){return this._onRender}},F={_zIndex:0,sortDirty:!1,sortableChildren:!1,get zIndex(){return this._zIndex},set zIndex(e){this._zIndex!==e&&(this._zIndex=e,this.depthOfChildModified())},depthOfChildModified(){this.parent&&(this.parent.sortableChildren=!0,this.parent.sortDirty=!0),this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0)},sortChildren(){this.sortDirty&&(this.sortDirty=!1,this.children.sort(ve))}};function ve(e,t){return e._zIndex-t._zIndex}var I={getGlobalPosition(e=new ne,t=!1){return this.parent?this.parent.toGlobal(this._position,e,t):(e.x=this._position.x,e.y=this._position.y),e},toGlobal(e,t,n=!1){let r=this.getGlobalTransform(S.get(),n);return t=r.apply(e,t),S.return(r),t},toLocal(e,t,n,r){t&&(e=t.toGlobal(e,n,r));let i=this.getGlobalTransform(S.get(),r);return n=i.applyInverse(e,n),S.return(i),n}},ye=0,L=class{constructor(e){this._poolKeyHash=Object.create(null),this._texturePool={},this.textureOptions=e||{},this.enableFullScreen=!1,this.textureStyle=new s(this.textureOptions)}createTexture(e,t,n,r){return new a({source:new i({...this.textureOptions,width:e,height:t,resolution:1,antialias:n,autoGarbageCollect:!1,autoGenerateMipmaps:r}),label:`texturePool_${ye++}`})}getOptimalTexture(e,t,n=1,i,a=!1){let o=Math.ceil(e*n-1e-6),s=Math.ceil(t*n-1e-6);o=r(o),s=r(s);let c=+!!i,l=+!!a,u=(o<<17)+(s<<2)+(l<<1)+c;this._texturePool[u]||(this._texturePool[u]=[]);let d=this._texturePool[u].pop();return d||=this.createTexture(o,s,i,a),d.source._resolution=n,d.source.width=o/n,d.source.height=s/n,d.source.pixelWidth=o,d.source.pixelHeight=s,d.frame.x=0,d.frame.y=0,d.frame.width=e,d.frame.height=t,d.updateUvs(),this._poolKeyHash[d.uid]=u,d}getSameSizeTexture(e,t=!1){let n=e.source;return this.getOptimalTexture(e.width,e.height,n._resolution,t)}returnTexture(e,t=!1){let n=this._poolKeyHash[e.uid];t&&(e.source.style=this.textureStyle),this._texturePool[n].push(e)}clear(e){if(e=e!==!1,e)for(let e in this._texturePool){let t=this._texturePool[e];if(t)for(let e=0;e<t.length;e++)t[e].destroy(!0)}this._texturePool={}}},R=new L;u.register(R);var z=class{constructor(){this.renderPipeId=`renderGroup`,this.root=null,this.canBundle=!1,this.renderGroupParent=null,this.renderGroupChildren=[],this.worldTransform=new m,this.worldColorAlpha=4294967295,this.worldColor=16777215,this.worldAlpha=1,this.childrenToUpdate=Object.create(null),this.updateTick=0,this.gcTick=0,this.childrenRenderablesToUpdate={list:[],index:0},this.structureDidChange=!0,this.instructionSet=new c,this._onRenderContainers=[],this.textureNeedsUpdate=!0,this.isCachedAsTexture=!1,this._matrixDirty=7}init(e){this.root=e,e._onRender&&this.addOnRender(e),e.didChange=!0;let t=e.children;for(let e=0;e<t.length;e++){let n=t[e];n._updateFlags=15,this.addChild(n)}}enableCacheAsTexture(e={}){this.textureOptions=e,this.isCachedAsTexture=!0,this.textureNeedsUpdate=!0}disableCacheAsTexture(){this.isCachedAsTexture=!1,this.texture&&=(R.returnTexture(this.texture,!0),null)}updateCacheTexture(){this.textureNeedsUpdate=!0;let e=this._parentCacheAsTextureRenderGroup;e&&!e.textureNeedsUpdate&&e.updateCacheTexture()}reset(){this.renderGroupChildren.length=0;for(let e in this.childrenToUpdate){let t=this.childrenToUpdate[e];t.list.fill(null),t.index=0}this.childrenRenderablesToUpdate.index=0,this.childrenRenderablesToUpdate.list.fill(null),this.root=null,this.updateTick=0,this.structureDidChange=!0,this._onRenderContainers.length=0,this.renderGroupParent=null,this.disableCacheAsTexture()}get localTransform(){return this.root.localTransform}addRenderGroupChild(e){e.renderGroupParent&&e.renderGroupParent._removeRenderGroupChild(e),e.renderGroupParent=this,this.renderGroupChildren.push(e)}_removeRenderGroupChild(e){let t=this.renderGroupChildren.indexOf(e);t>-1&&this.renderGroupChildren.splice(t,1),e.renderGroupParent=null}addChild(e){if(this.structureDidChange=!0,e.parentRenderGroup=this,e.updateTick=-1,e.parent===this.root?e.relativeRenderGroupDepth=1:e.relativeRenderGroupDepth=e.parent.relativeRenderGroupDepth+1,e.didChange=!0,this.onChildUpdate(e),e.renderGroup){this.addRenderGroupChild(e.renderGroup);return}e._onRender&&this.addOnRender(e);let t=e.children;for(let e=0;e<t.length;e++)this.addChild(t[e])}removeChild(e){if(this.structureDidChange=!0,e._onRender&&(e.renderGroup||this.removeOnRender(e)),e.parentRenderGroup=null,e.renderGroup){this._removeRenderGroupChild(e.renderGroup);return}let t=e.children;for(let e=0;e<t.length;e++)this.removeChild(t[e])}removeChildren(e){for(let t=0;t<e.length;t++)this.removeChild(e[t])}onChildUpdate(e){let t=this.childrenToUpdate[e.relativeRenderGroupDepth];t||=this.childrenToUpdate[e.relativeRenderGroupDepth]={index:0,list:[]},t.list[t.index++]=e}updateRenderable(e){e.globalDisplayStatus<7||(this.instructionSet.renderPipes[e.renderPipeId].updateRenderable(e),e.didViewUpdate=!1)}onChildViewUpdate(e){this.childrenRenderablesToUpdate.list[this.childrenRenderablesToUpdate.index++]=e}get isRenderable(){return this.root.localDisplayStatus===7&&this.worldAlpha>0}addOnRender(e){this._onRenderContainers.push(e)}removeOnRender(e){this._onRenderContainers.splice(this._onRenderContainers.indexOf(e),1)}runOnRender(e){for(let t=0;t<this._onRenderContainers.length;t++)this._onRenderContainers[t]._onRender(e)}destroy(){this.disableCacheAsTexture(),this.renderGroupParent=null,this.root=null,this.childrenRenderablesToUpdate=null,this.childrenToUpdate=null,this.renderGroupChildren=null,this._onRenderContainers=null,this.instructionSet=null}getChildren(e=[]){let t=this.root.children;for(let n=0;n<t.length;n++)this._getChildren(t[n],e);return e}_getChildren(e,t=[]){if(t.push(e),e.renderGroup)return t;let n=e.children;for(let e=0;e<n.length;e++)this._getChildren(n[e],t);return t}invalidateMatrices(){this._matrixDirty=7}get inverseWorldTransform(){return this._matrixDirty&1?(this._matrixDirty&=-2,this._inverseWorldTransform||=new m,this._inverseWorldTransform.copyFrom(this.worldTransform).invert()):this._inverseWorldTransform}get textureOffsetInverseTransform(){return this._matrixDirty&2?(this._matrixDirty&=-3,this._textureOffsetInverseTransform||=new m,this._textureOffsetInverseTransform.copyFrom(this.inverseWorldTransform).translate(-this._textureBounds.x,-this._textureBounds.y)):this._textureOffsetInverseTransform}get inverseParentTextureTransform(){if(!(this._matrixDirty&4))return this._inverseParentTextureTransform;this._matrixDirty&=-5;let e=this._parentCacheAsTextureRenderGroup;return e?(this._inverseParentTextureTransform||=new m,this._inverseParentTextureTransform.copyFrom(this.worldTransform).prepend(e.inverseWorldTransform).translate(-e._textureBounds.x,-e._textureBounds.y)):this.worldTransform}get cacheToLocalTransform(){return this.isCachedAsTexture?this.textureOffsetInverseTransform:this._parentCacheAsTextureRenderGroup?this._parentCacheAsTextureRenderGroup.textureOffsetInverseTransform:null}};function be(e,t,n={}){for(let r in t)!n[r]&&t[r]!==void 0&&(e[r]=t[r])}var B=new g(null),V=new g(null),H=new g(null,1,1),U=new g(null),xe=1,Se=2,Ce=4,we=8,W=class t extends re{constructor(e={}){super(),this.uid=ie(`renderable`),this._updateFlags=15,this.renderGroup=null,this.parentRenderGroup=null,this.parentRenderGroupIndex=0,this.didChange=!1,this.didViewUpdate=!1,this.relativeRenderGroupDepth=0,this.children=[],this.parent=null,this.includeInBuild=!0,this.measurable=!0,this.isSimple=!0,this.parentRenderLayer=null,this.updateTick=-1,this.localTransform=new m,this.relativeGroupTransform=new m,this.groupTransform=this.relativeGroupTransform,this.destroyed=!1,this._position=new g(this,0,0),this._scale=H,this._pivot=V,this._origin=U,this._skew=B,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._rotation=0,this.localColor=16777215,this.localAlpha=1,this.groupAlpha=1,this.groupColor=16777215,this.groupColorAlpha=4294967295,this.localBlendMode=`inherit`,this.groupBlendMode=`normal`,this.localDisplayStatus=7,this.globalDisplayStatus=7,this._didContainerChangeTick=0,this._didViewChangeTick=0,this._didLocalTransformChangeId=-1,this.effects=[],be(this,e,{children:!0,parent:!0,effects:!0}),e.children?.forEach(e=>this.addChild(e)),e.parent?.addChild(this)}static mixin(e){o(`8.8.0`,`Container.mixin is deprecated, please use extensions.mixin instead.`),f.mixin(t,e)}set _didChangeId(e){this._didViewChangeTick=e>>12&4095,this._didContainerChangeTick=e&4095}get _didChangeId(){return this._didContainerChangeTick&4095|(this._didViewChangeTick&4095)<<12}addChild(...t){if(this.allowChildren||o(e,`addChild: Only Containers will be allowed to add children in v8.0.0`),t.length>1){for(let e=0;e<t.length;e++)this.addChild(t[e]);return t[0]}let n=t[0],r=this.renderGroup||this.parentRenderGroup;return n.parent===this?(this.children.splice(this.children.indexOf(n),1),this.children.push(n),r&&(r.structureDidChange=!0),n):(n.parent&&n.parent.removeChild(n),this.children.push(n),this.sortableChildren&&(this.sortDirty=!0),n.parent=this,n.didChange=!0,n._updateFlags=15,r&&r.addChild(n),this.emit(`childAdded`,n,this,this.children.length-1),n.emit(`added`,this),this._didViewChangeTick++,n._zIndex!==0&&n.depthOfChildModified(),n)}removeChild(...e){if(e.length>1){for(let t=0;t<e.length;t++)this.removeChild(e[t]);return e[0]}let t=e[0],n=this.children.indexOf(t);return n>-1&&(this._didViewChangeTick++,this.children.splice(n,1),this.renderGroup?this.renderGroup.removeChild(t):this.parentRenderGroup&&this.parentRenderGroup.removeChild(t),t.parentRenderLayer&&t.parentRenderLayer.detach(t),t.parent=null,this.emit(`childRemoved`,t,this,n),t.emit(`removed`,this)),t}_onUpdate(e){e&&e===this._skew&&this._updateSkew(),this._didContainerChangeTick++,!this.didChange&&(this.didChange=!0,this.parentRenderGroup&&this.parentRenderGroup.onChildUpdate(this))}set isRenderGroup(e){!!this.renderGroup!==e&&(e?this.enableRenderGroup():this.disableRenderGroup())}get isRenderGroup(){return!!this.renderGroup}enableRenderGroup(){if(this.renderGroup)return;let e=this.parentRenderGroup;e?.removeChild(this),this.renderGroup=p.get(z,this),this.groupTransform=m.IDENTITY,e?.addChild(this),this._updateIsSimple()}disableRenderGroup(){if(!this.renderGroup)return;let e=this.parentRenderGroup;e?.removeChild(this),p.return(this.renderGroup),this.renderGroup=null,this.groupTransform=this.relativeGroupTransform,e?.addChild(this),this._updateIsSimple()}_updateIsSimple(){this.isSimple=!this.renderGroup&&this.effects.length===0}get worldTransform(){return this._worldTransform||=new m,this.renderGroup?this._worldTransform.copyFrom(this.renderGroup.worldTransform):this.parentRenderGroup&&this._worldTransform.appendFrom(this.relativeGroupTransform,this.parentRenderGroup.worldTransform),this._worldTransform}get x(){return this._position.x}set x(e){this._position.x=e}get y(){return this._position.y}set y(e){this._position.y=e}get position(){return this._position}set position(e){this._position.copyFrom(e)}get rotation(){return this._rotation}set rotation(e){this._rotation!==e&&(this._rotation=e,this._onUpdate(this._skew))}get angle(){return this.rotation*se}set angle(e){this.rotation=e*ee}get pivot(){return this._pivot===V&&(this._pivot=new g(this,0,0)),this._pivot}set pivot(e){this._pivot===V&&(this._pivot=new g(this,0,0),this._origin!==U&&d(`Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.`)),typeof e==`number`?this._pivot.set(e):this._pivot.copyFrom(e)}get skew(){return this._skew===B&&(this._skew=new g(this,0,0)),this._skew}set skew(e){this._skew===B&&(this._skew=new g(this,0,0)),this._skew.copyFrom(e)}get scale(){return this._scale===H&&(this._scale=new g(this,1,1)),this._scale}set scale(e){this._scale===H&&(this._scale=new g(this,0,0)),typeof e==`string`&&(e=parseFloat(e)),typeof e==`number`?this._scale.set(e):this._scale.copyFrom(e)}get origin(){return this._origin===U&&(this._origin=new g(this,0,0)),this._origin}set origin(e){this._origin===U&&(this._origin=new g(this,0,0),this._pivot!==V&&d(`Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.`)),typeof e==`number`?this._origin.set(e):this._origin.copyFrom(e)}get width(){return Math.abs(this.scale.x*this.getLocalBounds().width)}set width(e){let t=this.getLocalBounds().width;this._setWidth(e,t)}get height(){return Math.abs(this.scale.y*this.getLocalBounds().height)}set height(e){let t=this.getLocalBounds().height;this._setHeight(e,t)}getSize(e){e||={};let t=this.getLocalBounds();return e.width=Math.abs(this.scale.x*t.width),e.height=Math.abs(this.scale.y*t.height),e}setSize(e,t){let n=this.getLocalBounds();typeof e==`object`?(t=e.height??e.width,e=e.width):t??=e,e!==void 0&&this._setWidth(e,n.width),t!==void 0&&this._setHeight(t,n.height)}_updateSkew(){let e=this._rotation,t=this._skew;this._cx=Math.cos(e+t._y),this._sx=Math.sin(e+t._y),this._cy=-Math.sin(e-t._x),this._sy=Math.cos(e-t._x)}updateTransform(e){return this.position.set(typeof e.x==`number`?e.x:this.position.x,typeof e.y==`number`?e.y:this.position.y),this.scale.set(typeof e.scaleX==`number`?e.scaleX||1:this.scale.x,typeof e.scaleY==`number`?e.scaleY||1:this.scale.y),this.rotation=typeof e.rotation==`number`?e.rotation:this.rotation,this.skew.set(typeof e.skewX==`number`?e.skewX:this.skew.x,typeof e.skewY==`number`?e.skewY:this.skew.y),this.pivot.set(typeof e.pivotX==`number`?e.pivotX:this.pivot.x,typeof e.pivotY==`number`?e.pivotY:this.pivot.y),this.origin.set(typeof e.originX==`number`?e.originX:this.origin.x,typeof e.originY==`number`?e.originY:this.origin.y),this}setFromMatrix(e){e.decompose(this)}updateLocalTransform(){let e=this._didContainerChangeTick;if(this._didLocalTransformChangeId===e)return;this._didLocalTransformChangeId=e;let t=this.localTransform,n=this._scale,r=this._pivot,i=this._origin,a=this._position,o=n._x,s=n._y,c=r._x,l=r._y,u=-i._x,d=-i._y;t.a=this._cx*o,t.b=this._sx*o,t.c=this._cy*s,t.d=this._sy*s,t.tx=a._x-(c*t.a+l*t.c)+(u*t.a+d*t.c)-u,t.ty=a._y-(c*t.b+l*t.d)+(u*t.b+d*t.d)-d}set alpha(e){e!==this.localAlpha&&(this.localAlpha=e,this._updateFlags|=1,this._onUpdate())}get alpha(){return this.localAlpha}set tint(e){let t=te.shared.setValue(e??16777215).toBgrNumber();t!==this.localColor&&(this.localColor=t,this._updateFlags|=1,this._onUpdate())}get tint(){return O(this.localColor)}set blendMode(e){this.localBlendMode!==e&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=2,this.localBlendMode=e,this._onUpdate())}get blendMode(){return this.localBlendMode}get visible(){return!!(this.localDisplayStatus&2)}set visible(e){let t=e?2:0;(this.localDisplayStatus&2)!==t&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=4,this.localDisplayStatus^=2,this._onUpdate(),this.emit(`visibleChanged`,e))}get culled(){return!(this.localDisplayStatus&4)}set culled(e){let t=e?0:4;(this.localDisplayStatus&4)!==t&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=4,this.localDisplayStatus^=4,this._onUpdate())}get renderable(){return!!(this.localDisplayStatus&1)}set renderable(e){let t=+!!e;(this.localDisplayStatus&1)!==t&&(this._updateFlags|=4,this.localDisplayStatus^=1,this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._onUpdate())}get isRenderable(){return this.localDisplayStatus===7&&this.groupAlpha>0}destroy(e=!1){if(this.destroyed)return;this.destroyed=!0;let t;if(this.children.length&&(t=this.removeChildren(0,this.children.length)),this.removeFromParent(),this.parent=null,this._maskEffect=null,this._filterEffect=null,this.effects=null,this._position=null,this._scale=null,this._pivot=null,this._origin=null,this._skew=null,this.emit(`destroyed`,this),this.removeAllListeners(),(typeof e==`boolean`?e:e?.children)&&t)for(let n=0;n<t.length;++n)t[n].destroy(e);this.renderGroup?.destroy(),this.renderGroup=null}};f.mixin(W,v,he,I,P,N,fe,pe,F,h,ue,k,y);var G=(e=>(e[e.INTERACTION=50]=`INTERACTION`,e[e.HIGH=25]=`HIGH`,e[e.NORMAL=0]=`NORMAL`,e[e.LOW=-25]=`LOW`,e[e.UTILITY=-50]=`UTILITY`,e))(G||{}),K=class{constructor(e,t=null,n=0,r=!1){this.next=null,this.previous=null,this._destroyed=!1,this._fn=e,this._context=t,this.priority=n,this._once=r}match(e,t=null){return this._fn===e&&this._context===t}emit(e){this._fn&&(this._context?this._fn.call(this._context,e):this._fn(e));let t=this.next;return this._once&&this.destroy(!0),this._destroyed&&(this.next=null),t}connect(e){this.previous=e,e.next&&(e.next.previous=this),this.next=e.next,e.next=this}destroy(e=!1){this._destroyed=!0,this._fn=null,this._context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);let t=this.next;return this.next=e?null:t,this.previous=null,t}},Te=class e{constructor(){this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new K(null,null,1/0),this.deltaMS=1/e.targetFPMS,this.elapsedMS=1/e.targetFPMS,this._tick=e=>{this._requestId=null,this.started&&(this.update(e),this.started&&this._requestId===null&&this._head.next&&(this._requestId=requestAnimationFrame(this._tick)))}}_requestIfNeeded(){this._requestId===null&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))}_cancelIfNeeded(){this._requestId!==null&&(cancelAnimationFrame(this._requestId),this._requestId=null)}_startIfPossible(){this.started?this._requestIfNeeded():this.autoStart&&this.start()}add(e,t,n=G.NORMAL){return this._addListener(new K(e,t,n))}addOnce(e,t,n=G.NORMAL){return this._addListener(new K(e,t,n,!0))}_addListener(e){let t=this._head.next,n=this._head;if(!t)e.connect(n);else{for(;t;){if(e.priority>t.priority){e.connect(n);break}n=t,t=t.next}e.previous||e.connect(n)}return this._startIfPossible(),this}remove(e,t){let n=this._head.next;for(;n;)n=n.match(e,t)?n.destroy():n.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let e=0,t=this._head;for(;t=t.next;)e++;return e}start(){this.started||(this.started=!0,this._requestIfNeeded())}stop(){this.started&&(this.started=!1,this._cancelIfNeeded())}destroy(){if(!this._protected){this.stop();let e=this._head.next;for(;e;)e=e.destroy(!0);this._head.destroy(),this._head=null}}update(t=performance.now()){let n;if(t>this.lastTime){if(n=this.elapsedMS=t-this.lastTime,n>this._maxElapsedMS&&(n=this._maxElapsedMS),n*=this.speed,this._minElapsedMS){let e=t-this._lastFrame|0;if(e<this._minElapsedMS)return;this._lastFrame=t-e%this._minElapsedMS}this.deltaMS=n,this.deltaTime=this.deltaMS*e.targetFPMS;let r=this._head,i=r.next;for(;i;)i=i.emit(this);r.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=t}get FPS(){return 1e3/this.elapsedMS}get minFPS(){return 1e3/this._maxElapsedMS}set minFPS(t){let n=Math.min(Math.max(0,t)/1e3,e.targetFPMS);this._maxElapsedMS=1/n,this._minElapsedMS&&t>this.maxFPS&&(this.maxFPS=t)}get maxFPS(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0}set maxFPS(e){e===0?this._minElapsedMS=0:(e<this.minFPS&&(this.minFPS=e),this._minElapsedMS=1/(e/1e3))}static get shared(){if(!e._shared){let t=e._shared=new e;t.autoStart=!0,t._protected=!0}return e._shared}static get system(){if(!e._system){let t=e._system=new e;t.autoStart=!0,t._protected=!0}return e._system}};Te.targetFPMS=.06;var Ee=Te,De=class extends W{constructor(e){super(e),this.canBundle=!0,this.allowChildren=!1,this._roundPixels=0,this._lastUsed=-1,this._gpuData=Object.create(null),this.autoGarbageCollect=!0,this._gcLastUsed=-1,this._bounds=new n(0,1,0,0),this._boundsDirty=!0,this.autoGarbageCollect=e.autoGarbageCollect??!0}get bounds(){return this._boundsDirty?(this.updateBounds(),this._boundsDirty=!1,this._bounds):this._bounds}get roundPixels(){return!!this._roundPixels}set roundPixels(e){this._roundPixels=+!!e}containsPoint(e){let t=this.bounds,{x:n,y:r}=e;return n>=t.minX&&n<=t.maxX&&r>=t.minY&&r<=t.maxY}onViewUpdate(){if(this._didViewChangeTick++,this._boundsDirty=!0,this.didViewUpdate)return;this.didViewUpdate=!0;let e=this.renderGroup||this.parentRenderGroup;e&&e.onChildViewUpdate(this)}unload(){this.emit(`unload`,this);for(let e in this._gpuData)this._gpuData[e]?.destroy();this._gpuData=Object.create(null),this.onViewUpdate()}destroy(e){this.unload(),super.destroy(e),this._bounds=null}collectRenderablesSimple(e,t,n){let{renderPipes:r}=t;r.blendMode.pushBlendMode(this,this.groupBlendMode,e);let i=r[this.renderPipeId];i?.addRenderable&&i.addRenderable(this,e),this.didViewUpdate=!1;let a=this.children,o=a.length;for(let r=0;r<o;r++)a[r].collectRenderables(e,t,n);r.blendMode.popBlendMode(e)}};function Oe(e,t,n){let{width:r,height:i}=n.orig,a=n.trim;if(a){let n=a.width,o=a.height;e.minX=a.x-t._x*r,e.maxX=e.minX+n,e.minY=a.y-t._y*i,e.maxY=e.minY+o}else e.minX=-t._x*r,e.maxX=e.minX+r,e.minY=-t._y*i,e.maxY=e.minY+i}var ke=class e extends De{constructor(e=a.EMPTY){e instanceof a&&(e={texture:e});let{texture:t=a.EMPTY,anchor:n,roundPixels:r,width:i,height:o,...s}=e;super({label:`Sprite`,...s}),this.renderPipeId=`sprite`,this.batched=!0,this._visualBounds={minX:0,maxX:1,minY:0,maxY:0},this._anchor=new g({_onUpdate:()=>{this.onViewUpdate()}}),n?this.anchor=n:t.defaultAnchor&&(this.anchor=t.defaultAnchor),this.texture=t,this.allowChildren=!1,this.roundPixels=r??!1,i!==void 0&&(this.width=i),o!==void 0&&(this.height=o)}static from(t,n=!1){return t instanceof a?new e(t):new e(a.from(t,n))}set texture(e){e||=a.EMPTY;let t=this._texture;t!==e&&(t&&t.dynamic&&t.off(`update`,this.onViewUpdate,this),e.dynamic&&e.on(`update`,this.onViewUpdate,this),this._texture=e,this._width&&this._setWidth(this._width,this._texture.orig.width),this._height&&this._setHeight(this._height,this._texture.orig.height),this.onViewUpdate())}get texture(){return this._texture}get visualBounds(){return Oe(this._visualBounds,this._anchor,this._texture),this._visualBounds}get sourceBounds(){return o(`8.6.1`,`Sprite.sourceBounds is deprecated, use visualBounds instead.`),this.visualBounds}updateBounds(){let e=this._anchor,t=this._texture,n=this._bounds,{width:r,height:i}=t.orig;n.minX=-e._x*r,n.maxX=n.minX+r,n.minY=-e._y*i,n.maxY=n.minY+i}destroy(e=!1){if(super.destroy(e),typeof e==`boolean`?e:e?.texture){let t=typeof e==`boolean`?e:e?.textureSource;this._texture.destroy(t)}this._texture=null,this._visualBounds=null,this._bounds=null,this._anchor=null}get anchor(){return this._anchor}set anchor(e){typeof e==`number`?this._anchor.set(e):this._anchor.copyFrom(e)}get width(){return Math.abs(this.scale.x)*this._texture.orig.width}set width(e){this._setWidth(e,this._texture.orig.width),this._width=e}get height(){return Math.abs(this.scale.y)*this._texture.orig.height}set height(e){this._setHeight(e,this._texture.orig.height),this._height=e}getSize(e){return e||={},e.width=Math.abs(this.scale.x)*this._texture.orig.width,e.height=Math.abs(this.scale.y)*this._texture.orig.height,e}setSize(e,t){typeof e==`object`?(t=e.height??e.width,e=e.width):t??=e,e!==void 0&&this._setWidth(e,this._texture.orig.width),t!==void 0&&this._setHeight(t,this._texture.orig.height)}},Ae=class extends i{constructor(e){e.resource||=t.get().createCanvas(),e.width||(e.width=e.resource.width,e.autoDensity||(e.width/=e.resolution)),e.height||(e.height=e.resource.height,e.autoDensity||(e.height/=e.resolution)),super(e),this.uploadMethodId=`image`,this.autoDensity=e.autoDensity,this.resizeCanvas(),this.transparent=!!e.transparent}resizeCanvas(){this.autoDensity&&`style`in this.resource&&(this.resource.style.width=`${this.width}px`,this.resource.style.height=`${this.height}px`),(this.resource.width!==this.pixelWidth||this.resource.height!==this.pixelHeight)&&(this.resource.width=this.pixelWidth,this.resource.height=this.pixelHeight)}resize(e=this.width,t=this.height,n=this._resolution){let r=super.resize(e,t,n);return r&&this.resizeCanvas(),r}static test(e){return globalThis.HTMLCanvasElement&&e instanceof HTMLCanvasElement||globalThis.OffscreenCanvas&&e instanceof OffscreenCanvas}get context2D(){return this._context2D||=this.resource.getContext(`2d`)}};Ae.extension=ce.TextureSource;var je={normal:0,add:1,multiply:2,screen:3,overlay:4,erase:5,"normal-npm":6,"add-npm":7,"screen-npm":8,min:9,max:10},q=0,J=1,Y=2,X=3,Z=4,Q=5,$=class e{constructor(){this.data=0,this.blendMode=`normal`,this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(this.data&1<<q)}set blend(e){!!(this.data&1<<q)!==e&&(this.data^=1<<q)}get offsets(){return!!(this.data&1<<J)}set offsets(e){!!(this.data&1<<J)!==e&&(this.data^=1<<J)}set cullMode(e){if(e===`none`){this.culling=!1;return}this.culling=!0,this.clockwiseFrontFace=e===`front`}get cullMode(){return this.culling?this.clockwiseFrontFace?`front`:`back`:`none`}get culling(){return!!(this.data&1<<Y)}set culling(e){!!(this.data&1<<Y)!==e&&(this.data^=1<<Y)}get depthTest(){return!!(this.data&1<<X)}set depthTest(e){!!(this.data&1<<X)!==e&&(this.data^=1<<X)}get depthMask(){return!!(this.data&1<<Q)}set depthMask(e){!!(this.data&1<<Q)!==e&&(this.data^=1<<Q)}get clockwiseFrontFace(){return!!(this.data&1<<Z)}set clockwiseFrontFace(e){!!(this.data&1<<Z)!==e&&(this.data^=1<<Z)}get blendMode(){return this._blendMode}set blendMode(e){this.blend=e!==`none`,this._blendMode=e,this._blendModeId=je[e]||0}get polygonOffset(){return this._polygonOffset}set polygonOffset(e){this.offsets=!!e,this._polygonOffset=e}toString(){return`[pixi.js/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`}static for2d(){let t=new e;return t.depthTest=!1,t.blend=!0,t}};$.default2d=$.for2d();var Me=$,Ne=class e extends ae{constructor(t){t={...e.defaultOptions,...t},super(t),this.enabled=!0,this._state=Me.for2d(),this.blendMode=t.blendMode,this.padding=t.padding,typeof t.antialias==`boolean`?this.antialias=t.antialias?`on`:`off`:this.antialias=t.antialias,this.resolution=t.resolution,this.blendRequired=t.blendRequired,this.clipToViewport=t.clipToViewport,this.addResource(`uTexture`,0,1),t.blendRequired&&this.addResource(`uBackTexture`,0,3)}apply(e,t,n,r){e.applyFilter(this,t,n,r)}get blendMode(){return this._state.blendMode}set blendMode(e){this._state.blendMode=e}static from(t){let{gpu:n,gl:r,...i}=t,a,o;return n&&(a=oe.from(n)),r&&(o=le.from(r)),new e({gpuProgram:a,glProgram:o,...i})}};Ne.defaultOptions={blendMode:`normal`,resolution:1,padding:0,antialias:`off`,blendRequired:!1,clipToViewport:!0};var Pe=Ne;export{he as A,_ as B,M as C,D,k as E,x as F,g as H,de as I,b as L,S as M,pe as N,ge as O,fe as P,y as R,N as S,O as T,h as U,ue as V,R as _,Oe as a,F as b,K as c,Se as d,xe as f,z as g,be as h,ke as i,C as j,T as k,G as l,Ce as m,Me as n,De as o,we as p,Ae as r,Ee as s,Pe as t,W as u,L as v,A as w,P as x,I as y,v as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{dt as e}from"./CsIWxmio.js";import{u as t}from"./BH8Lm2ff.js";import{d as n,l as r,n as i,t as a,u as o}from"./BNq2--8a.js";import"./nacCpTNj.js";import"./B7P31uII.js";e.add(n),e.mixin(t,o),e.add(r),e.add(i),e.mixin(t,a);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Z as e,it as t,lt as n,ut as r}from"./CsIWxmio2.js";import{B as i,l as a,o,s}from"./BnYohOts2.js";var c=class{constructor(e){this._lastTransform=``,this._observer=null,this._tickerAttached=!1,this.updateTranslation=()=>{if(!this._canvas)return;let e=this._canvas.getBoundingClientRect(),t=this._canvas.width,n=this._canvas.height,r=e.width/t*this._renderer.resolution,i=e.height/n*this._renderer.resolution,a=`translate(${e.left}px, ${e.top}px) scale(${r}, ${i})`;a!==this._lastTransform&&(this._domElement.style.transform=a,this._lastTransform=a)},this._domElement=e.domElement,this._renderer=e.renderer,!(globalThis.OffscreenCanvas&&this._renderer.canvas instanceof OffscreenCanvas)&&(this._canvas=this._renderer.canvas,this._attachObserver())}get canvas(){return this._canvas}ensureAttached(){!this._domElement.parentNode&&this._canvas.parentNode&&(this._canvas.parentNode.appendChild(this._domElement),this.updateTranslation())}_attachObserver(){`ResizeObserver`in globalThis?(this._observer&&=(this._observer.disconnect(),null),this._observer=new ResizeObserver(e=>{for(let t of e){if(t.target!==this._canvas)continue;let e=this.canvas.width,n=this.canvas.height,r=t.contentRect.width/e*this._renderer.resolution,i=t.contentRect.height/n*this._renderer.resolution;(this._lastScaleX!==r||this._lastScaleY!==i)&&(this.updateTranslation(),this._lastScaleX=r,this._lastScaleY=i)}}),this._observer.observe(this._canvas)):this._tickerAttached||s.shared.add(this.updateTranslation,this,a.HIGH)}destroy(){this._observer?(this._observer.disconnect(),this._observer=null):this._tickerAttached&&s.shared.remove(this.updateTranslation),this._domElement=null,this._renderer=null,this._canvas=null,this._tickerAttached=!1,this._lastTransform=``,this._lastScaleX=null,this._lastScaleY=null}},l=class e{constructor(n){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=e.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new t,this.page=new t,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=n}get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get data(){return this}composedPath(){return this.manager&&(!this.path||this.path[this.path.length-1]!==this.target)&&(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}initEvent(e,t,n){throw Error(`initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.`)}initUIEvent(e,t,n,r,i){throw Error(`initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.`)}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){this.propagationStopped=!0}},u=/iPhone/i,d=/iPod/i,f=/iPad/i,p=/\biOS-universal(?:.+)Mac\b/i,m=/\bAndroid(?:.+)Mobile\b/i,h=/Android/i,g=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,_=/Silk/i,v=/Windows Phone/i,y=/\bWindows(?:.+)ARM\b/i,b=/BlackBerry/i,x=/BB10/i,S=/Opera Mini/i,C=/\b(CriOS|Chrome)(?:.+)Mobile/i,w=/Mobile(?:.+)Firefox\b/i,T=function(e){return e!==void 0&&e.platform===`MacIntel`&&typeof e.maxTouchPoints==`number`&&e.maxTouchPoints>1&&typeof MSStream>`u`};function E(e){return function(t){return t.test(e)}}function D(e){var t={userAgent:``,platform:``,maxTouchPoints:0};!e&&typeof navigator<`u`?t={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof e==`string`?t.userAgent=e:e&&e.userAgent&&(t={userAgent:e.userAgent,platform:e.platform,maxTouchPoints:e.maxTouchPoints||0});var n=t.userAgent,r=n.split(`[FBAN`);r[1]!==void 0&&(n=r[0]),r=n.split(`Twitter`),r[1]!==void 0&&(n=r[0]);var i=E(n),a={apple:{phone:i(u)&&!i(v),ipod:i(d),tablet:!i(u)&&(i(f)||T(t))&&!i(v),universal:i(p),device:(i(u)||i(d)||i(f)||i(p)||T(t))&&!i(v)},amazon:{phone:i(g),tablet:!i(g)&&i(_),device:i(g)||i(_)},android:{phone:!i(v)&&i(g)||!i(v)&&i(m),tablet:!i(v)&&!i(g)&&!i(m)&&(i(_)||i(h)),device:!i(v)&&(i(g)||i(_)||i(m)||i(h))||i(/\bokhttp\b/i)},windows:{phone:i(v),tablet:i(y),device:i(v)||i(y)},other:{blackberry:i(b),blackberry10:i(x),opera:i(S),firefox:i(w),chrome:i(C),device:i(b)||i(x)||i(S)||i(w)||i(C)},any:!1,phone:!1,tablet:!1};return a.any=a.apple.device||a.android.device||a.windows.device||a.other.device,a.phone=a.apple.phone||a.android.phone||a.windows.phone,a.tablet=a.apple.tablet||a.android.tablet||a.windows.tablet,a}var O=(D.default??D)(globalThis.navigator),k=9,A=100,j=0,ee=0,M=2,N=1,P=-1e3,F=-1e3,I=2,L=class e{constructor(e,t=O){this._mobileInfo=t,this.debug=!1,this._activateOnTab=!0,this._deactivateOnMouseMove=!0,this._isActive=!1,this._isMobileAccessibility=!1,this._div=null,this._pools={},this._renderId=0,this._children=[],this._androidUpdateCount=0,this._androidUpdateFrequency=500,this._isRunningTests=!1,this._boundOnKeyDown=this._onKeyDown.bind(this),this._boundOnMouseMove=this._onMouseMove.bind(this),this._hookDiv=null,(t.tablet||t.phone)&&this._createTouchHook(),this._renderer=e}get isActive(){return this._isActive}get isMobileAccessibility(){return this._isMobileAccessibility}get hookDiv(){return this._hookDiv}get div(){return this._div}_createTouchHook(){let e=document.createElement(`button`);e.style.width=`${N}px`,e.style.height=`${N}px`,e.style.position=`absolute`,e.style.top=`${P}px`,e.style.left=`${F}px`,e.style.zIndex=I.toString(),e.style.backgroundColor=`#FF0000`,e.title=`select to enable accessibility for this content`,e.addEventListener(`focus`,()=>{this._isMobileAccessibility=!0,this._activate(),this._destroyTouchHook()}),document.body.appendChild(e),this._hookDiv=e}_destroyTouchHook(){this._hookDiv&&=(document.body.removeChild(this._hookDiv),null)}_activate(){if(this._isActive)return;this._isActive=!0,this._div||(this._div=document.createElement(`div`),this._div.style.position=`absolute`,this._div.style.top=`${j}px`,this._div.style.left=`${ee}px`,this._div.style.pointerEvents=`none`,this._div.style.zIndex=M.toString(),this._canvasObserver=new c({domElement:this._div,renderer:this._renderer})),this._activateOnTab&&globalThis.addEventListener(`keydown`,this._boundOnKeyDown,!1),this._deactivateOnMouseMove&&globalThis.document.addEventListener(`mousemove`,this._boundOnMouseMove,!0);let e=this._renderer.view.canvas;if(e.parentNode)this._canvasObserver.ensureAttached(),this._initAccessibilitySetup();else{let t=new MutationObserver(()=>{e.parentNode&&(t.disconnect(),this._canvasObserver.ensureAttached(),this._initAccessibilitySetup())});t.observe(document.body,{childList:!0,subtree:!0})}}_initAccessibilitySetup(){this._renderer.runners.postrender.add(this),this._renderer.lastObjectRendered&&this._updateAccessibleObjects(this._renderer.lastObjectRendered)}_deactivate(){if(!(!this._isActive||this._isMobileAccessibility)){this._isActive=!1,globalThis.document.removeEventListener(`mousemove`,this._boundOnMouseMove,!0),this._activateOnTab&&globalThis.addEventListener(`keydown`,this._boundOnKeyDown,!1),this._renderer.runners.postrender.remove(this);for(let e of this._children)e._accessibleDiv?.parentNode&&(e._accessibleDiv.parentNode.removeChild(e._accessibleDiv),e._accessibleDiv=null),e._accessibleActive=!1;for(let e in this._pools)this._pools[e].forEach(e=>{e.parentNode&&e.parentNode.removeChild(e)}),delete this._pools[e];this._div?.parentNode&&this._div.parentNode.removeChild(this._div),this._pools={},this._children=[]}}_updateAccessibleObjects(e){if(!e.visible||!e.accessibleChildren)return;e.accessible&&(e._accessibleActive||this._addChild(e),e._renderId=this._renderId);let t=e.children;if(t)for(let e=0;e<t.length;e++)this._updateAccessibleObjects(t[e])}init(t){let n={accessibilityOptions:{...e.defaultOptions,...t?.accessibilityOptions||{}}};this.debug=n.accessibilityOptions.debug,this._activateOnTab=n.accessibilityOptions.activateOnTab,this._deactivateOnMouseMove=n.accessibilityOptions.deactivateOnMouseMove,n.accessibilityOptions.enabledByDefault&&this._activate(),this._renderer.runners.postrender.remove(this)}postrender(){let e=performance.now();if(this._mobileInfo.android.device&&e<this._androidUpdateCount||(this._androidUpdateCount=e+this._androidUpdateFrequency,(!this._renderer.renderingToScreen||!this._renderer.view.canvas)&&!this._isRunningTests))return;let t=new Set;if(this._renderer.lastObjectRendered){this._updateAccessibleObjects(this._renderer.lastObjectRendered);for(let e of this._children)e._renderId===this._renderId&&t.add(this._children.indexOf(e))}for(let e=this._children.length-1;e>=0;e--){let n=this._children[e];t.has(e)||(n._accessibleDiv&&n._accessibleDiv.parentNode&&(n._accessibleDiv.parentNode.removeChild(n._accessibleDiv),this._getPool(n.accessibleType).push(n._accessibleDiv),n._accessibleDiv=null),n._accessibleActive=!1,i(this._children,e,1))}this._renderer.renderingToScreen&&this._canvasObserver.ensureAttached();for(let e=0;e<this._children.length;e++){let t=this._children[e];if(!t._accessibleActive||!t._accessibleDiv)continue;let n=t._accessibleDiv,r=t.hitArea||t.getBounds().rectangle;if(t.hitArea){let e=t.worldTransform;n.style.left=`${e.tx+r.x*e.a}px`,n.style.top=`${e.ty+r.y*e.d}px`,n.style.width=`${r.width*e.a}px`,n.style.height=`${r.height*e.d}px`}else this._capHitArea(r),n.style.left=`${r.x}px`,n.style.top=`${r.y}px`,n.style.width=`${r.width}px`,n.style.height=`${r.height}px`}this._renderId++}_updateDebugHTML(e){e.innerHTML=`type: ${e.type}</br> title : ${e.title}</br> tabIndex: ${e.tabIndex}`}_capHitArea(e){e.x<0&&(e.width+=e.x,e.x=0),e.y<0&&(e.height+=e.y,e.y=0);let{width:t,height:n}=this._renderer;e.x+e.width>t&&(e.width=t-e.x),e.y+e.height>n&&(e.height=n-e.y)}_addChild(e){let t=this._getPool(e.accessibleType).pop();t?(t.innerHTML=``,t.removeAttribute(`title`),t.removeAttribute(`aria-label`),t.tabIndex=0):(e.accessibleType===`button`?t=document.createElement(`button`):(t=document.createElement(e.accessibleType),t.style.cssText=`
|
|
1
|
+
import{Z as e,it as t,lt as n,ut as r}from"./CsIWxmio.js";import{B as i,l as a,o,s}from"./BH8Lm2ff.js";var c=class{constructor(e){this._lastTransform=``,this._observer=null,this._tickerAttached=!1,this.updateTranslation=()=>{if(!this._canvas)return;let e=this._canvas.getBoundingClientRect(),t=this._canvas.width,n=this._canvas.height,r=e.width/t*this._renderer.resolution,i=e.height/n*this._renderer.resolution,a=`translate(${e.left}px, ${e.top}px) scale(${r}, ${i})`;a!==this._lastTransform&&(this._domElement.style.transform=a,this._lastTransform=a)},this._domElement=e.domElement,this._renderer=e.renderer,!(globalThis.OffscreenCanvas&&this._renderer.canvas instanceof OffscreenCanvas)&&(this._canvas=this._renderer.canvas,this._attachObserver())}get canvas(){return this._canvas}ensureAttached(){!this._domElement.parentNode&&this._canvas.parentNode&&(this._canvas.parentNode.appendChild(this._domElement),this.updateTranslation())}_attachObserver(){`ResizeObserver`in globalThis?(this._observer&&=(this._observer.disconnect(),null),this._observer=new ResizeObserver(e=>{for(let t of e){if(t.target!==this._canvas)continue;let e=this.canvas.width,n=this.canvas.height,r=t.contentRect.width/e*this._renderer.resolution,i=t.contentRect.height/n*this._renderer.resolution;(this._lastScaleX!==r||this._lastScaleY!==i)&&(this.updateTranslation(),this._lastScaleX=r,this._lastScaleY=i)}}),this._observer.observe(this._canvas)):this._tickerAttached||s.shared.add(this.updateTranslation,this,a.HIGH)}destroy(){this._observer?(this._observer.disconnect(),this._observer=null):this._tickerAttached&&s.shared.remove(this.updateTranslation),this._domElement=null,this._renderer=null,this._canvas=null,this._tickerAttached=!1,this._lastTransform=``,this._lastScaleX=null,this._lastScaleY=null}},l=class e{constructor(n){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=e.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new t,this.page=new t,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=n}get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get data(){return this}composedPath(){return this.manager&&(!this.path||this.path[this.path.length-1]!==this.target)&&(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}initEvent(e,t,n){throw Error(`initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.`)}initUIEvent(e,t,n,r,i){throw Error(`initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.`)}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){this.propagationStopped=!0}},u=/iPhone/i,d=/iPod/i,f=/iPad/i,p=/\biOS-universal(?:.+)Mac\b/i,m=/\bAndroid(?:.+)Mobile\b/i,h=/Android/i,g=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,_=/Silk/i,v=/Windows Phone/i,y=/\bWindows(?:.+)ARM\b/i,b=/BlackBerry/i,x=/BB10/i,S=/Opera Mini/i,C=/\b(CriOS|Chrome)(?:.+)Mobile/i,w=/Mobile(?:.+)Firefox\b/i,T=function(e){return e!==void 0&&e.platform===`MacIntel`&&typeof e.maxTouchPoints==`number`&&e.maxTouchPoints>1&&typeof MSStream>`u`};function E(e){return function(t){return t.test(e)}}function D(e){var t={userAgent:``,platform:``,maxTouchPoints:0};!e&&typeof navigator<`u`?t={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof e==`string`?t.userAgent=e:e&&e.userAgent&&(t={userAgent:e.userAgent,platform:e.platform,maxTouchPoints:e.maxTouchPoints||0});var n=t.userAgent,r=n.split(`[FBAN`);r[1]!==void 0&&(n=r[0]),r=n.split(`Twitter`),r[1]!==void 0&&(n=r[0]);var i=E(n),a={apple:{phone:i(u)&&!i(v),ipod:i(d),tablet:!i(u)&&(i(f)||T(t))&&!i(v),universal:i(p),device:(i(u)||i(d)||i(f)||i(p)||T(t))&&!i(v)},amazon:{phone:i(g),tablet:!i(g)&&i(_),device:i(g)||i(_)},android:{phone:!i(v)&&i(g)||!i(v)&&i(m),tablet:!i(v)&&!i(g)&&!i(m)&&(i(_)||i(h)),device:!i(v)&&(i(g)||i(_)||i(m)||i(h))||i(/\bokhttp\b/i)},windows:{phone:i(v),tablet:i(y),device:i(v)||i(y)},other:{blackberry:i(b),blackberry10:i(x),opera:i(S),firefox:i(w),chrome:i(C),device:i(b)||i(x)||i(S)||i(w)||i(C)},any:!1,phone:!1,tablet:!1};return a.any=a.apple.device||a.android.device||a.windows.device||a.other.device,a.phone=a.apple.phone||a.android.phone||a.windows.phone,a.tablet=a.apple.tablet||a.android.tablet||a.windows.tablet,a}var O=(D.default??D)(globalThis.navigator),k=9,A=100,j=0,ee=0,M=2,N=1,P=-1e3,F=-1e3,I=2,L=class e{constructor(e,t=O){this._mobileInfo=t,this.debug=!1,this._activateOnTab=!0,this._deactivateOnMouseMove=!0,this._isActive=!1,this._isMobileAccessibility=!1,this._div=null,this._pools={},this._renderId=0,this._children=[],this._androidUpdateCount=0,this._androidUpdateFrequency=500,this._isRunningTests=!1,this._boundOnKeyDown=this._onKeyDown.bind(this),this._boundOnMouseMove=this._onMouseMove.bind(this),this._hookDiv=null,(t.tablet||t.phone)&&this._createTouchHook(),this._renderer=e}get isActive(){return this._isActive}get isMobileAccessibility(){return this._isMobileAccessibility}get hookDiv(){return this._hookDiv}get div(){return this._div}_createTouchHook(){let e=document.createElement(`button`);e.style.width=`${N}px`,e.style.height=`${N}px`,e.style.position=`absolute`,e.style.top=`${P}px`,e.style.left=`${F}px`,e.style.zIndex=I.toString(),e.style.backgroundColor=`#FF0000`,e.title=`select to enable accessibility for this content`,e.addEventListener(`focus`,()=>{this._isMobileAccessibility=!0,this._activate(),this._destroyTouchHook()}),document.body.appendChild(e),this._hookDiv=e}_destroyTouchHook(){this._hookDiv&&=(document.body.removeChild(this._hookDiv),null)}_activate(){if(this._isActive)return;this._isActive=!0,this._div||(this._div=document.createElement(`div`),this._div.style.position=`absolute`,this._div.style.top=`${j}px`,this._div.style.left=`${ee}px`,this._div.style.pointerEvents=`none`,this._div.style.zIndex=M.toString(),this._canvasObserver=new c({domElement:this._div,renderer:this._renderer})),this._activateOnTab&&globalThis.addEventListener(`keydown`,this._boundOnKeyDown,!1),this._deactivateOnMouseMove&&globalThis.document.addEventListener(`mousemove`,this._boundOnMouseMove,!0);let e=this._renderer.view.canvas;if(e.parentNode)this._canvasObserver.ensureAttached(),this._initAccessibilitySetup();else{let t=new MutationObserver(()=>{e.parentNode&&(t.disconnect(),this._canvasObserver.ensureAttached(),this._initAccessibilitySetup())});t.observe(document.body,{childList:!0,subtree:!0})}}_initAccessibilitySetup(){this._renderer.runners.postrender.add(this),this._renderer.lastObjectRendered&&this._updateAccessibleObjects(this._renderer.lastObjectRendered)}_deactivate(){if(!(!this._isActive||this._isMobileAccessibility)){this._isActive=!1,globalThis.document.removeEventListener(`mousemove`,this._boundOnMouseMove,!0),this._activateOnTab&&globalThis.addEventListener(`keydown`,this._boundOnKeyDown,!1),this._renderer.runners.postrender.remove(this);for(let e of this._children)e._accessibleDiv?.parentNode&&(e._accessibleDiv.parentNode.removeChild(e._accessibleDiv),e._accessibleDiv=null),e._accessibleActive=!1;for(let e in this._pools)this._pools[e].forEach(e=>{e.parentNode&&e.parentNode.removeChild(e)}),delete this._pools[e];this._div?.parentNode&&this._div.parentNode.removeChild(this._div),this._pools={},this._children=[]}}_updateAccessibleObjects(e){if(!e.visible||!e.accessibleChildren)return;e.accessible&&(e._accessibleActive||this._addChild(e),e._renderId=this._renderId);let t=e.children;if(t)for(let e=0;e<t.length;e++)this._updateAccessibleObjects(t[e])}init(t){let n={accessibilityOptions:{...e.defaultOptions,...t?.accessibilityOptions||{}}};this.debug=n.accessibilityOptions.debug,this._activateOnTab=n.accessibilityOptions.activateOnTab,this._deactivateOnMouseMove=n.accessibilityOptions.deactivateOnMouseMove,n.accessibilityOptions.enabledByDefault&&this._activate(),this._renderer.runners.postrender.remove(this)}postrender(){let e=performance.now();if(this._mobileInfo.android.device&&e<this._androidUpdateCount||(this._androidUpdateCount=e+this._androidUpdateFrequency,(!this._renderer.renderingToScreen||!this._renderer.view.canvas)&&!this._isRunningTests))return;let t=new Set;if(this._renderer.lastObjectRendered){this._updateAccessibleObjects(this._renderer.lastObjectRendered);for(let e of this._children)e._renderId===this._renderId&&t.add(this._children.indexOf(e))}for(let e=this._children.length-1;e>=0;e--){let n=this._children[e];t.has(e)||(n._accessibleDiv&&n._accessibleDiv.parentNode&&(n._accessibleDiv.parentNode.removeChild(n._accessibleDiv),this._getPool(n.accessibleType).push(n._accessibleDiv),n._accessibleDiv=null),n._accessibleActive=!1,i(this._children,e,1))}this._renderer.renderingToScreen&&this._canvasObserver.ensureAttached();for(let e=0;e<this._children.length;e++){let t=this._children[e];if(!t._accessibleActive||!t._accessibleDiv)continue;let n=t._accessibleDiv,r=t.hitArea||t.getBounds().rectangle;if(t.hitArea){let e=t.worldTransform;n.style.left=`${e.tx+r.x*e.a}px`,n.style.top=`${e.ty+r.y*e.d}px`,n.style.width=`${r.width*e.a}px`,n.style.height=`${r.height*e.d}px`}else this._capHitArea(r),n.style.left=`${r.x}px`,n.style.top=`${r.y}px`,n.style.width=`${r.width}px`,n.style.height=`${r.height}px`}this._renderId++}_updateDebugHTML(e){e.innerHTML=`type: ${e.type}</br> title : ${e.title}</br> tabIndex: ${e.tabIndex}`}_capHitArea(e){e.x<0&&(e.width+=e.x,e.x=0),e.y<0&&(e.height+=e.y,e.y=0);let{width:t,height:n}=this._renderer;e.x+e.width>t&&(e.width=t-e.x),e.y+e.height>n&&(e.height=n-e.y)}_addChild(e){let t=this._getPool(e.accessibleType).pop();t?(t.innerHTML=``,t.removeAttribute(`title`),t.removeAttribute(`aria-label`),t.tabIndex=0):(e.accessibleType===`button`?t=document.createElement(`button`):(t=document.createElement(e.accessibleType),t.style.cssText=`
|
|
2
2
|
color: transparent;
|
|
3
3
|
pointer-events: none;
|
|
4
4
|
padding: 0;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Jt as e,Kt as t}from"./FISIvbqq.js";import{$ as n,A as r,G as i,K as a,M as o,Q as s,U as c,W as l,Z as u,ct as d,dt as f,et as p,it as m,lt as h,nt as g,q as _,rt as v,ut as y,z as b}from"./CsIWxmio.js";import{t as x}from"./3e54b3S0.js";import{R as S,n as C,t as w}from"./DJ61sY6B.js";import{t as T}from"./CGG26Xmx.js";function E(e,t,n,r,i,a){let o=e-n,s=t-r,c=i-n,l=a-r,u=o*c+s*l,d=c*c+l*l,f=-1;d!==0&&(f=u/d);let p,m;f<0?(p=n,m=r):f>1?(p=i,m=a):(p=n+f*c,m=r+f*l);let h=e-p,g=t-m;return h*h+g*g}var D=class e{constructor(e=0,t=0,n=0){this.type=`circle`,this.x=e,this.y=t,this.radius=n}clone(){return new e(this.x,this.y,this.radius)}contains(e,t){if(this.radius<=0)return!1;let n=this.radius*this.radius,r=this.x-e,i=this.y-t;return r*=r,i*=i,r+i<=n}strokeContains(e,t,n,r=.5){if(this.radius===0)return!1;let i=this.x-e,a=this.y-t,o=this.radius,s=(1-r)*n,c=Math.sqrt(i*i+a*a);return c<=o+s&&c>o-(n-s)}getBounds(e){return e||=new a,e.x=this.x-this.radius,e.y=this.y-this.radius,e.width=this.radius*2,e.height=this.radius*2,e}copyFrom(e){return this.x=e.x,this.y=e.y,this.radius=e.radius,this}copyTo(e){return e.copyFrom(this),e}toString(){return`[pixi.js/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`}},O=class e{constructor(e=0,t=0,n=0,r=0){this.type=`ellipse`,this.x=e,this.y=t,this.halfWidth=n,this.halfHeight=r}clone(){return new e(this.x,this.y,this.halfWidth,this.halfHeight)}contains(e,t){if(this.halfWidth<=0||this.halfHeight<=0)return!1;let n=(e-this.x)/this.halfWidth,r=(t-this.y)/this.halfHeight;return n*=n,r*=r,n+r<=1}strokeContains(e,t,n,r=.5){let{halfWidth:i,halfHeight:a}=this;if(i<=0||a<=0)return!1;let o=n*(1-r),s=n-o,c=i-s,l=a-s,u=i+o,d=a+o,f=e-this.x,p=t-this.y,m=f*f/(c*c)+p*p/(l*l),h=f*f/(u*u)+p*p/(d*d);return m>1&&h<=1}getBounds(e){return e||=new a,e.x=this.x-this.halfWidth,e.y=this.y-this.halfHeight,e.width=this.halfWidth*2,e.height=this.halfHeight*2,e}copyFrom(e){return this.x=e.x,this.y=e.y,this.halfWidth=e.halfWidth,this.halfHeight=e.halfHeight,this}copyTo(e){return e.copyFrom(this),e}toString(){return`[pixi.js/math:Ellipse x=${this.x} y=${this.y} halfWidth=${this.halfWidth} halfHeight=${this.halfHeight}]`}},k,A,j=class e{constructor(...e){this.type=`polygon`;let t=Array.isArray(e[0])?e[0]:e;if(typeof t[0]!=`number`){let e=[];for(let n=0,r=t.length;n<r;n++)e.push(t[n].x,t[n].y);t=e}this.points=t,this.closePath=!0}isClockwise(){let e=0,t=this.points,n=t.length;for(let r=0;r<n;r+=2){let i=t[r],a=t[r+1],o=t[(r+2)%n],s=t[(r+3)%n];e+=(o-i)*(s+a)}return e<0}containsPolygon(e){let t=this.getBounds(k),n=e.getBounds(A);if(!t.containsRect(n))return!1;let r=e.points;for(let e=0;e<r.length;e+=2){let t=r[e],n=r[e+1];if(!this.contains(t,n))return!1}return!0}clone(){let t=new e(this.points.slice());return t.closePath=this.closePath,t}contains(e,t){let n=!1,r=this.points.length/2;for(let i=0,a=r-1;i<r;a=i++){let r=this.points[i*2],o=this.points[i*2+1],s=this.points[a*2],c=this.points[a*2+1];o>t!=c>t&&e<(s-r)*((t-o)/(c-o))+r&&(n=!n)}return n}strokeContains(e,t,n,r=.5){let i=n*n,a=i*(1-r),o=i-a,{points:s}=this,c=s.length-(this.closePath?0:2);for(let n=0;n<c;n+=2){let r=s[n],i=s[n+1],c=s[(n+2)%s.length],l=s[(n+3)%s.length];if(E(e,t,r,i,c,l)<=(Math.sign((c-r)*(t-i)-(l-i)*(e-r))<0?o:a))return!0}return!1}getBounds(e){e||=new a;let t=this.points,n=1/0,r=-1/0,i=1/0,o=-1/0;for(let e=0,a=t.length;e<a;e+=2){let a=t[e],s=t[e+1];n=a<n?a:n,r=a>r?a:r,i=s<i?s:i,o=s>o?s:o}return e.x=n,e.width=r-n,e.y=i,e.height=o-i,e}copyFrom(e){return this.points=e.points.slice(),this.closePath=e.closePath,this}copyTo(e){return e.copyFrom(this),e}toString(){return`[pixi.js/math:PolygoncloseStroke=${this.closePath}points=${this.points.reduce((e,t)=>`${e}, ${t}`,``)}]`}get lastX(){return this.points[this.points.length-2]}get lastY(){return this.points[this.points.length-1]}get x(){return s(`8.11.0`,`Polygon.lastX is deprecated, please use Polygon.lastX instead.`),this.points[this.points.length-2]}get y(){return s(`8.11.0`,`Polygon.y is deprecated, please use Polygon.lastY instead.`),this.points[this.points.length-1]}get startX(){return this.points[0]}get startY(){return this.points[1]}},M=(e,t,n,r,i,a,o)=>{let s=e-n,c=t-r,l=Math.sqrt(s*s+c*c);return l>=i-a&&l<=i+o},N=class e{constructor(e=0,t=0,n=0,r=0,i=20){this.type=`roundedRectangle`,this.x=e,this.y=t,this.width=n,this.height=r,this.radius=i}getBounds(e){return e||=new a,e.x=this.x,e.y=this.y,e.width=this.width,e.height=this.height,e}clone(){return new e(this.x,this.y,this.width,this.height,this.radius)}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}copyTo(e){return e.copyFrom(this),e}contains(e,t){if(this.width<=0||this.height<=0)return!1;if(e>=this.x&&e<=this.x+this.width&&t>=this.y&&t<=this.y+this.height){let n=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(t>=this.y+n&&t<=this.y+this.height-n||e>=this.x+n&&e<=this.x+this.width-n)return!0;let r=e-(this.x+n),i=t-(this.y+n),a=n*n;if(r*r+i*i<=a||(r=e-(this.x+this.width-n),r*r+i*i<=a)||(i=t-(this.y+this.height-n),r*r+i*i<=a)||(r=e-(this.x+n),r*r+i*i<=a))return!0}return!1}strokeContains(e,t,n,r=.5){let{x:i,y:a,width:o,height:s,radius:c}=this,l=n*(1-r),u=n-l,d=i+c,f=a+c,p=o-c*2,m=s-c*2,h=i+o,g=a+s;return(e>=i-l&&e<=i+u||e>=h-u&&e<=h+l)&&t>=f&&t<=f+m||(t>=a-l&&t<=a+u||t>=g-u&&t<=g+l)&&e>=d&&e<=d+p?!0:e<d&&t<f&&M(e,t,d,f,c,u,l)||e>h-c&&t<f&&M(e,t,h-c,f,c,u,l)||e>h-c&&t>g-c&&M(e,t,h-c,g-c,c,u,l)||e<d&&t>g-c&&M(e,t,d,g-c,c,u,l)}toString(){return`[pixi.js/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`}},P=e(t(((e,t)=>{t.exports=i;var n={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},r=/([astvzqmhlc])([^astvzqmhlc]*)/gi;function i(e){var t=[];return e.replace(r,function(e,r,i){var a=r.toLowerCase();for(i=o(i),a==`m`&&i.length>2&&(t.push([r].concat(i.splice(0,2))),a=`l`,r=r==`m`?`l`:`L`);;){if(i.length==n[a])return i.unshift(r),t.push(i);if(i.length<n[a])throw Error(`malformed path data`);t.push([r].concat(i.splice(0,n[a])))}}),t}var a=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;function o(e){var t=e.match(a);return t?t.map(Number):[]}}))(),1);function F(e,t){let n=(0,P.default)(e),r=[],i=null,a=0,o=0;for(let e=0;e<n.length;e++){let s=n[e],c=s[0],l=s;switch(c){case`M`:a=l[1],o=l[2],t.moveTo(a,o);break;case`m`:a+=l[1],o+=l[2],t.moveTo(a,o);break;case`H`:a=l[1],t.lineTo(a,o);break;case`h`:a+=l[1],t.lineTo(a,o);break;case`V`:o=l[1],t.lineTo(a,o);break;case`v`:o+=l[1],t.lineTo(a,o);break;case`L`:a=l[1],o=l[2],t.lineTo(a,o);break;case`l`:a+=l[1],o+=l[2],t.lineTo(a,o);break;case`C`:a=l[5],o=l[6],t.bezierCurveTo(l[1],l[2],l[3],l[4],a,o);break;case`c`:t.bezierCurveTo(a+l[1],o+l[2],a+l[3],o+l[4],a+l[5],o+l[6]),a+=l[5],o+=l[6];break;case`S`:a=l[3],o=l[4],t.bezierCurveToShort(l[1],l[2],a,o);break;case`s`:t.bezierCurveToShort(a+l[1],o+l[2],a+l[3],o+l[4]),a+=l[3],o+=l[4];break;case`Q`:a=l[3],o=l[4],t.quadraticCurveTo(l[1],l[2],a,o);break;case`q`:t.quadraticCurveTo(a+l[1],o+l[2],a+l[3],o+l[4]),a+=l[3],o+=l[4];break;case`T`:a=l[1],o=l[2],t.quadraticCurveToShort(a,o);break;case`t`:a+=l[1],o+=l[2],t.quadraticCurveToShort(a,o);break;case`A`:a=l[6],o=l[7],t.arcToSvg(l[1],l[2],l[3],l[4],l[5],a,o);break;case`a`:a+=l[6],o+=l[7],t.arcToSvg(l[1],l[2],l[3],l[4],l[5],a,o);break;case`Z`:case`z`:t.closePath(),r.length>0&&(i=r.pop(),i?(a=i.startX,o=i.startY):(a=0,o=0)),i=null;break;default:u(`Unknown SVG path command: ${c}`)}c!==`Z`&&c!==`z`&&i===null&&(i={startX:a,startY:o},r.push(i))}return t}function I(e,t,n,r,i,a,o,s=null){let c=0;n*=t,i*=a;let l=s.a,u=s.b,d=s.c,f=s.d,p=s.tx,m=s.ty;for(;c<o;){let o=e[n],s=e[n+1];r[i]=l*o+d*s+p,r[i+1]=u*o+f*s+m,i+=a,n+=t,c++}}function ee(e,t,n,r){let i=0;for(t*=n;i<r;)e[t]=0,e[t+1]=0,t+=n,i++}function L(e,t,n,r,i){let a=t.a,o=t.b,s=t.c,c=t.d,l=t.tx,u=t.ty;n||=0,r||=2,i||=e.length/r-n;let d=n*r;for(let t=0;t<i;t++){let t=e[d],n=e[d+1];e[d]=a*t+s*n+l,e[d+1]=o*t+c*n+u,d+=r}}var te=new v,ne=class{constructor(){this.packAsQuad=!1,this.batcherName=`default`,this.topology=`triangle-list`,this.applyTransform=!0,this.roundPixels=0,this._batcher=null,this._batch=null}get uvs(){return this.geometryData.uvs}get positions(){return this.geometryData.vertices}get indices(){return this.geometryData.indices}get blendMode(){return this.renderable&&this.applyTransform?this.renderable.groupBlendMode:`normal`}get color(){let e=this.baseColor,t=e>>16|e&65280|(e&255)<<16,n=this.renderable;return n?l(t,n.groupColor)+(this.alpha*n.groupAlpha*255<<24):t+(this.alpha*255<<24)}get transform(){return this.renderable?.groupTransform||te}copyTo(e){e.indexOffset=this.indexOffset,e.indexSize=this.indexSize,e.attributeOffset=this.attributeOffset,e.attributeSize=this.attributeSize,e.baseColor=this.baseColor,e.alpha=this.alpha,e.texture=this.texture,e.geometryData=this.geometryData,e.topology=this.topology}reset(){this.applyTransform=!0,this.renderable=null,this.topology=`triangle-list`}destroy(){this.renderable=null,this.texture=null,this.geometryData=null,this._batcher=null,this._batch=null}},R={extension:{type:y.ShapeBuilder,name:`circle`},build(e,t){let n,r,i,a,o,s;if(e.type===`circle`){let t=e;if(o=s=t.radius,o<=0)return!1;n=t.x,r=t.y,i=a=0}else if(e.type===`ellipse`){let t=e;if(o=t.halfWidth,s=t.halfHeight,o<=0||s<=0)return!1;n=t.x,r=t.y,i=a=0}else{let t=e,c=t.width/2,l=t.height/2;n=t.x+c,r=t.y+l,o=s=Math.max(0,Math.min(t.radius,Math.min(c,l))),i=c-o,a=l-s}if(i<0||a<0)return!1;let c=Math.ceil(2.3*Math.sqrt(o+s)),l=c*8+(i?4:0)+(a?4:0);if(l===0)return!1;if(c===0)return t[0]=t[6]=n+i,t[1]=t[3]=r+a,t[2]=t[4]=n-i,t[5]=t[7]=r-a,!0;let u=0,d=c*4+(i?2:0)+2,f=d,p=l,m=i+o,h=a,g=n+m,_=n-m,v=r+h;if(t[u++]=g,t[u++]=v,t[--d]=v,t[--d]=_,a){let e=r-h;t[f++]=_,t[f++]=e,t[--p]=e,t[--p]=g}for(let e=1;e<c;e++){let l=Math.PI/2*(e/c),m=i+Math.cos(l)*o,h=a+Math.sin(l)*s,g=n+m,_=n-m,v=r+h,y=r-h;t[u++]=g,t[u++]=v,t[--d]=v,t[--d]=_,t[f++]=_,t[f++]=y,t[--p]=y,t[--p]=g}m=i,h=a+s,g=n+m,_=n-m,v=r+h;let y=r-h;return t[u++]=g,t[u++]=v,t[--p]=y,t[--p]=g,i&&(t[u++]=_,t[u++]=v,t[--p]=y,t[--p]=_),!0},triangulate(e,t,n,r,i,a){if(e.length===0)return;let o=0,s=0;for(let t=0;t<e.length;t+=2)o+=e[t],s+=e[t+1];o/=e.length/2,s/=e.length/2;let c=r;t[c*n]=o,t[c*n+1]=s;let l=c++;for(let r=0;r<e.length;r+=2)t[c*n]=e[r],t[c*n+1]=e[r+1],r>0&&(i[a++]=c,i[a++]=l,i[a++]=c-1),c++;i[a++]=l+1,i[a++]=l,i[a++]=c-1}},re={...R,extension:{...R.extension,name:`ellipse`}},ie={...R,extension:{...R.extension,name:`roundedRectangle`}},ae=1e-4,z=1e-4;function oe(e){let t=e.length;if(t<6)return 1;let n=0;for(let r=0,i=e[t-2],a=e[t-1];r<t;r+=2){let t=e[r],o=e[r+1];n+=(t-i)*(o+a),i=t,a=o}return n<0?-1:1}function se(e,t,n,r,i,a,o,s){let c=e-n*i,l=t-r*i,u=e+n*a,d=t+r*a,f,p;o?(f=r,p=-n):(f=-r,p=n);let m=c+f,h=l+p,g=u+f,_=d+p;return s.push(m,h),s.push(g,_),2}function B(e,t,n,r,i,a,o,s){let c=n-e,l=r-t,u=Math.atan2(c,l),d=Math.atan2(i-e,a-t);s&&u<d?u+=Math.PI*2:!s&&u>d&&(d+=Math.PI*2);let f=u,p=d-u,m=Math.abs(p),h=Math.sqrt(c*c+l*l),g=(15*m*Math.sqrt(h)/Math.PI>>0)+1,_=p/g;if(f+=_,s){o.push(e,t),o.push(n,r);for(let n=1,r=f;n<g;n++,r+=_)o.push(e,t),o.push(e+Math.sin(r)*h,t+Math.cos(r)*h);o.push(e,t),o.push(i,a)}else{o.push(n,r),o.push(e,t);for(let n=1,r=f;n<g;n++,r+=_)o.push(e+Math.sin(r)*h,t+Math.cos(r)*h),o.push(e,t);o.push(i,a),o.push(e,t)}return g*2}function ce(e,t,n,r,i,a){let o=ae;if(e.length===0)return;let s=t,c=s.alignment;if(t.alignment!==.5){let t=oe(e);n&&(t*=-1),c=(c-.5)*t+.5}let l=new m(e[0],e[1]),u=new m(e[e.length-2],e[e.length-1]),d=r,f=Math.abs(l.x-u.x)<o&&Math.abs(l.y-u.y)<o;if(d){e=e.slice(),f&&(e.pop(),e.pop(),u.set(e[e.length-2],e[e.length-1]));let t=(l.x+u.x)*.5,n=(u.y+l.y)*.5;e.unshift(t,n),e.push(t,n)}let p=i,h=e.length/2,g=e.length,_=p.length/2,v=s.width/2,y=v*v,b=s.miterLimit*s.miterLimit,x=e[0],S=e[1],C=e[2],w=e[3],T=0,E=0,D=-(S-w),O=x-C,k=0,A=0,j=Math.sqrt(D*D+O*O);D/=j,O/=j,D*=v,O*=v;let M=c,N=(1-M)*2,P=M*2;d||(s.cap===`round`?g+=B(x-D*(N-P)*.5,S-O*(N-P)*.5,x-D*N,S-O*N,x+D*P,S+O*P,p,!0)+2:s.cap===`square`&&(g+=se(x,S,D,O,N,P,!0,p))),p.push(x-D*N,S-O*N),p.push(x+D*P,S+O*P);for(let t=1;t<h-1;++t){x=e[(t-1)*2],S=e[(t-1)*2+1],C=e[t*2],w=e[t*2+1],T=e[(t+1)*2],E=e[(t+1)*2+1],D=-(S-w),O=x-C,j=Math.sqrt(D*D+O*O),D/=j,O/=j,D*=v,O*=v,k=-(w-E),A=C-T,j=Math.sqrt(k*k+A*A),k/=j,A/=j,k*=v,A*=v;let n=C-x,r=S-w,i=C-T,a=E-w,o=n*i+r*a,c=r*i-a*n,l=c<0;if(Math.abs(c)<.001*Math.abs(o)){p.push(C-D*N,w-O*N),p.push(C+D*P,w+O*P),o>=0&&(s.join===`round`?g+=B(C,w,C-D*N,w-O*N,C-k*N,w-A*N,p,!1)+4:g+=2,p.push(C-k*P,w-A*P),p.push(C+k*N,w+A*N));continue}let u=(-D+x)*(-O+w)-(-D+C)*(-O+S),d=(-k+T)*(-A+w)-(-k+C)*(-A+E),f=(n*d-i*u)/c,m=(a*u-r*d)/c,h=(f-C)*(f-C)+(m-w)*(m-w),_=C+(f-C)*N,M=w+(m-w)*N,F=C-(f-C)*P,I=w-(m-w)*P,ee=Math.min(n*n+r*r,i*i+a*a),L=l?N:P;h<=ee+L*L*y?s.join===`bevel`||h/y>b?(l?(p.push(_,M),p.push(C+D*P,w+O*P),p.push(_,M),p.push(C+k*P,w+A*P)):(p.push(C-D*N,w-O*N),p.push(F,I),p.push(C-k*N,w-A*N),p.push(F,I)),g+=2):s.join===`round`?l?(p.push(_,M),p.push(C+D*P,w+O*P),g+=B(C,w,C+D*P,w+O*P,C+k*P,w+A*P,p,!0)+4,p.push(_,M),p.push(C+k*P,w+A*P)):(p.push(C-D*N,w-O*N),p.push(F,I),g+=B(C,w,C-D*N,w-O*N,C-k*N,w-A*N,p,!1)+4,p.push(C-k*N,w-A*N),p.push(F,I)):(p.push(_,M),p.push(F,I)):(p.push(C-D*N,w-O*N),p.push(C+D*P,w+O*P),s.join===`round`?l?g+=B(C,w,C+D*P,w+O*P,C+k*P,w+A*P,p,!0)+2:g+=B(C,w,C-D*N,w-O*N,C-k*N,w-A*N,p,!1)+2:s.join===`miter`&&h/y<=b&&(l?(p.push(F,I),p.push(F,I)):(p.push(_,M),p.push(_,M)),g+=2),p.push(C-k*N,w-A*N),p.push(C+k*P,w+A*P),g+=2)}x=e[(h-2)*2],S=e[(h-2)*2+1],C=e[(h-1)*2],w=e[(h-1)*2+1],D=-(S-w),O=x-C,j=Math.sqrt(D*D+O*O),D/=j,O/=j,D*=v,O*=v,p.push(C-D*N,w-O*N),p.push(C+D*P,w+O*P),d||(s.cap===`round`?g+=B(C-D*(N-P)*.5,w-O*(N-P)*.5,C-D*N,w-O*N,C+D*P,w+O*P,p,!1)+2:s.cap===`square`&&(g+=se(C,w,D,O,N,P,!1,p)));let F=z*z;for(let e=_;e<g+_-2;++e)x=p[e*2],S=p[e*2+1],C=p[(e+1)*2],w=p[(e+1)*2+1],T=p[(e+2)*2],E=p[(e+2)*2+1],!(Math.abs(x*(w-E)+C*(E-S)+T*(S-w))<F)&&a.push(e,e+1,e+2)}function le(e,t,n,r){let i=ae;if(e.length===0)return;let a=e[0],o=e[1],s=e[e.length-2],c=e[e.length-1],l=t||Math.abs(a-s)<i&&Math.abs(o-c)<i,u=n,d=e.length/2,f=u.length/2;for(let t=0;t<d;t++)u.push(e[t*2]),u.push(e[t*2+1]);for(let e=0;e<d-1;e++)r.push(f+e,f+e+1);l&&r.push(f+d-1,f)}function V(e,t,n,r,i,a,o){let s=S(e,t,2);if(!s)return;for(let e=0;e<s.length;e+=3)a[o++]=s[e]+i,a[o++]=s[e+1]+i,a[o++]=s[e+2]+i;let c=i*r;for(let t=0;t<e.length;t+=2)n[c]=e[t],n[c+1]=e[t+1],c+=r}var ue=[],de={extension:{type:y.ShapeBuilder,name:`polygon`},build(e,t){for(let n=0;n<e.points.length;n++)t[n]=e.points[n];return!0},triangulate(e,t,n,r,i,a){V(e,ue,t,n,r,i,a)}},fe={extension:{type:y.ShapeBuilder,name:`rectangle`},build(e,t){let n=e,r=n.x,i=n.y,a=n.width,o=n.height;return a>0&&o>0?(t[0]=r,t[1]=i,t[2]=r+a,t[3]=i,t[4]=r+a,t[5]=i+o,t[6]=r,t[7]=i+o,!0):!1},triangulate(e,t,n,r,i,a){let o=0;r*=n,t[r+o]=e[0],t[r+o+1]=e[1],o+=n,t[r+o]=e[2],t[r+o+1]=e[3],o+=n,t[r+o]=e[6],t[r+o+1]=e[7],o+=n,t[r+o]=e[4],t[r+o+1]=e[5],o+=n;let s=r/n;i[a++]=s,i[a++]=s+1,i[a++]=s+2,i[a++]=s+1,i[a++]=s+3,i[a++]=s+2}},pe={extension:{type:y.ShapeBuilder,name:`triangle`},build(e,t){return t[0]=e.x,t[1]=e.y,t[2]=e.x2,t[3]=e.y2,t[4]=e.x3,t[5]=e.y3,!0},triangulate(e,t,n,r,i,a){let o=0;r*=n,t[r+o]=e[0],t[r+o+1]=e[1],o+=n,t[r+o]=e[2],t[r+o+1]=e[3],o+=n,t[r+o]=e[4],t[r+o+1]=e[5];let s=r/n;i[a++]=s,i[a++]=s+1,i[a++]=s+2}},me=[{offset:0,color:`white`},{offset:1,color:`black`}],H=class e{constructor(...t){this.uid=g(`fillGradient`),this._tick=0,this.type=`linear`,this.colorStops=[];let n=_e(t);n={...n.type===`radial`?e.defaultRadialOptions:e.defaultLinearOptions,...b(n)},this._textureSize=n.textureSize,this._wrapMode=n.wrapMode,n.type===`radial`?(this.center=n.center,this.outerCenter=n.outerCenter??this.center,this.innerRadius=n.innerRadius,this.outerRadius=n.outerRadius,this.scale=n.scale,this.rotation=n.rotation):(this.start=n.start,this.end=n.end),this.textureSpace=n.textureSpace,this.type=n.type,n.colorStops.forEach(e=>{this.addColorStop(e.offset,e.color)})}addColorStop(e,t){return this.colorStops.push({offset:e,color:d.shared.setValue(t).toHexa()}),this}buildLinearGradient(){if(this.texture)return;let{x:e,y:t}=this.start,{x:n,y:r}=this.end,i=n-e,a=r-t,s=i<0||a<0;if(this._wrapMode===`clamp-to-edge`){if(i<0){let t=e;e=n,n=t,i*=-1}if(a<0){let e=t;t=r,r=e,a*=-1}}let c=this.colorStops.length?this.colorStops:me,l=this._textureSize,{canvas:u,context:d}=ge(l,1),f=s?d.createLinearGradient(this._textureSize,0,0,0):d.createLinearGradient(0,0,this._textureSize,0);he(f,c),d.fillStyle=f,d.fillRect(0,0,l,1),this.texture=new o({source:new x({resource:u,addressMode:this._wrapMode})});let p=Math.sqrt(i*i+a*a),m=Math.atan2(a,i),h=new v;h.scale(p/l,1),h.rotate(m),h.translate(e,t),this.textureSpace===`local`&&h.scale(l,l),this.transform=h}buildGradient(){this.texture||this._tick++,this.type===`linear`?this.buildLinearGradient():this.buildRadialGradient()}buildRadialGradient(){if(this.texture)return;let e=this.colorStops.length?this.colorStops:me,t=this._textureSize,{canvas:n,context:r}=ge(t,t),{x:i,y:a}=this.center,{x:s,y:c}=this.outerCenter,l=this.innerRadius,u=this.outerRadius,d=s-u,f=c-u,p=t/(u*2),m=(i-d)*p,h=(a-f)*p,g=r.createRadialGradient(m,h,l*p,(s-d)*p,(c-f)*p,u*p);he(g,e),r.fillStyle=e[e.length-1].color,r.fillRect(0,0,t,t),r.fillStyle=g,r.translate(m,h),r.rotate(this.rotation),r.scale(1,this.scale),r.translate(-m,-h),r.fillRect(0,0,t,t),this.texture=new o({source:new x({resource:n,addressMode:this._wrapMode})});let _=new v;_.scale(1/p,1/p),_.translate(d,f),this.textureSpace===`local`&&_.scale(t,t),this.transform=_}destroy(){this.texture?.destroy(!0),this.texture=null,this.transform=null,this.colorStops=[],this.start=null,this.end=null,this.center=null,this.outerCenter=null}get styleKey(){return`fill-gradient-${this.uid}-${this._tick}`}};H.defaultLinearOptions={start:{x:0,y:0},end:{x:0,y:1},colorStops:[],textureSpace:`local`,type:`linear`,textureSize:256,wrapMode:`clamp-to-edge`},H.defaultRadialOptions={center:{x:.5,y:.5},innerRadius:0,outerRadius:.5,colorStops:[],scale:1,textureSpace:`local`,type:`radial`,textureSize:256,wrapMode:`clamp-to-edge`};var U=H;function he(e,t){for(let n=0;n<t.length;n++){let r=t[n];e.addColorStop(r.offset,r.color)}}function ge(e,t){let n=r.get().createCanvas(e,t);return{canvas:n,context:n.getContext(`2d`)}}function _e(e){let t=e[0]??{};return(typeof t==`number`||e[1])&&(s(`8.5.2`,`use options object instead`),t={type:`linear`,start:{x:e[0],y:e[1]},end:{x:e[2],y:e[3]},textureSpace:e[4],textureSize:e[5]??U.defaultLinearOptions.textureSize}),t}var ve=new v,ye=new a;function be(e,t,n,r){let i=t.matrix?e.copyFrom(t.matrix).invert():e.identity();if(t.textureSpace===`local`){let e=n.getBounds(ye);t.width&&e.pad(t.width);let{x:r,y:a}=e,o=1/e.width,s=1/e.height,c=-r*o,l=-a*s,u=i.a,d=i.b,f=i.c,p=i.d;i.a*=o,i.b*=o,i.c*=s,i.d*=s,i.tx=c*u+l*f+i.tx,i.ty=c*d+l*p+i.ty}else i.translate(t.texture.frame.x,t.texture.frame.y),i.scale(1/t.texture.source.width,1/t.texture.source.height);let a=t.texture.source.style;return!(t.fill instanceof U)&&a.addressMode===`clamp-to-edge`&&(a.addressMode=`repeat`,a.update()),r&&i.append(ve.copyFrom(r).invert()),i}var W={};f.handleByMap(y.ShapeBuilder,W),f.add(fe,de,pe,R,re,ie);var xe=new a,Se=new v;function Ce(e,t){let{geometryData:n,batches:r}=t;r.length=0,n.indices.length=0,n.vertices.length=0,n.uvs.length=0;for(let t=0;t<e.instructions.length;t++){let i=e.instructions[t];if(i.action===`texture`)we(i.data,r,n);else if(i.action===`fill`||i.action===`stroke`){let e=i.action===`stroke`,t=i.data.path.shapePath,a=i.data.style,o=i.data.hole;e&&o&&Te(o.shapePath,a,!0,r,n),o&&(t.shapePrimitives[t.shapePrimitives.length-1].holes=o.shapePath.shapePrimitives),Te(t,a,e,r,n)}}}function we(e,t,n){let r=[],i=W.rectangle,a=xe;a.x=e.dx,a.y=e.dy,a.width=e.dw,a.height=e.dh;let o=e.transform;if(!i.build(a,r))return;let{vertices:s,uvs:c,indices:l}=n,u=l.length,d=s.length/2;o&&L(r,o),i.triangulate(r,s,2,d,l,u);let f=e.image,p=f.uvs;c.push(p.x0,p.y0,p.x1,p.y1,p.x3,p.y3,p.x2,p.y2);let m=_.get(ne);m.indexOffset=u,m.indexSize=l.length-u,m.attributeOffset=d,m.attributeSize=s.length/2-d,m.baseColor=e.style,m.alpha=e.alpha,m.texture=f,m.geometryData=n,t.push(m)}function Te(e,t,n,r,i){let{vertices:a,uvs:s,indices:c}=i;e.shapePrimitives.forEach(({shape:e,transform:l,holes:u})=>{let d=[],f=W[e.type];if(!f.build(e,d))return;let p=c.length,m=a.length/2,h=`triangle-list`;if(l&&L(d,l),n){let n=e.closePath??!0,r=t;r.pixelLine?(le(d,n,a,c),h=`line-list`):ce(d,r,!1,n,a,c)}else if(u){let e=[],t=d.slice();Ee(u).forEach(n=>{e.push(t.length/2),t.push(...n)}),V(t,e,a,2,m,c,p)}else f.triangulate(d,a,2,m,c,p);let g=s.length/2,v=t.texture;if(v!==o.WHITE){let n=be(Se,t,e,l);I(a,2,m,s,g,2,a.length/2-m,n)}else ee(s,g,2,a.length/2-m);let y=_.get(ne);y.indexOffset=p,y.indexSize=c.length-p,y.attributeOffset=m,y.attributeSize=a.length/2-m,y.baseColor=t.color,y.alpha=t.alpha,y.texture=v,y.geometryData=i,y.topology=h,r.push(y)})}function Ee(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n].shape,i=[];W[r.type].build(r,i)&&t.push(i)}return t}var De=class{constructor(){this.batches=[],this.geometryData={vertices:[],uvs:[],indices:[]}}reset(){this.batches&&this.batches.forEach(e=>{_.return(e)}),this.graphicsData&&_.return(this.graphicsData),this.isBatchable=!1,this.context=null,this.batches.length=0,this.geometryData.indices.length=0,this.geometryData.vertices.length=0,this.geometryData.uvs.length=0,this.graphicsData=null}destroy(){this.reset(),this.batches=null,this.geometryData=null}},Oe=class{constructor(){this.instructions=new c}init(e){let t=e.maxTextures;this.batcher?this.batcher._updateMaxTextures(t):this.batcher=new C({maxTextures:t}),this.instructions.reset()}get geometry(){return s(p,`GraphicsContextRenderData#geometry is deprecated, please use batcher.geometry instead.`),this.batcher.geometry}destroy(){this.batcher.destroy(),this.instructions.destroy(),this.batcher=null,this.instructions=null}},G=class e{constructor(e){this._renderer=e,this._managedContexts=new w({renderer:e,type:`resource`,name:`graphicsContext`})}init(t){e.defaultOptions.bezierSmoothness=t?.bezierSmoothness??e.defaultOptions.bezierSmoothness}getContextRenderData(e){return e._gpuData[this._renderer.uid].graphicsData||this._initContextRenderData(e)}updateGpuContext(e){let t=!!e._gpuData[this._renderer.uid],n=e._gpuData[this._renderer.uid]||this._initContext(e);if(e.dirty||!t){t&&n.reset(),Ce(e,n);let r=e.batchMode;e.customShader||r===`no-batch`?n.isBatchable=!1:r===`auto`?n.isBatchable=n.geometryData.vertices.length<400:n.isBatchable=!0,e.dirty=!1}return n}getGpuContext(e){return e._gpuData[this._renderer.uid]||this._initContext(e)}_initContextRenderData(e){let t=_.get(Oe,{maxTextures:this._renderer.limits.maxBatchableTextures}),n=e._gpuData[this._renderer.uid],{batches:r,geometryData:i}=n;n.graphicsData=t;let a=i.vertices.length,o=i.indices.length;for(let e=0;e<r.length;e++)r[e].applyTransform=!1;let s=t.batcher;s.ensureAttributeBuffer(a),s.ensureIndexBuffer(o),s.begin();for(let e=0;e<r.length;e++){let t=r[e];s.add(t)}s.finish(t.instructions);let c=s.geometry;c.indexBuffer.setDataWithSize(s.indexBuffer,s.indexSize,!0),c.buffers[0].setDataWithSize(s.attributeBuffer.float32View,s.attributeSize,!0);let l=s.batches;for(let e=0;e<l.length;e++){let t=l[e];t.bindGroup=T(t.textures.textures,t.textures.count,this._renderer.limits.maxBatchableTextures)}return t}_initContext(e){let t=new De;return t.context=e,e._gpuData[this._renderer.uid]=t,this._managedContexts.add(e),t}destroy(){this._managedContexts.destroy(),this._renderer=null}};G.extension={type:[y.WebGLSystem,y.WebGPUSystem],name:`graphicsContext`},G.defaultOptions={bezierSmoothness:.5};var K=G,ke=8,q=1.1920929e-7,Ae=1;function J(e,t,n,r,i,a,o,s,c,l){let u=(Ae-Math.min(.99,Math.max(0,l??K.defaultOptions.bezierSmoothness)))/1;return u*=u,je(t,n,r,i,a,o,s,c,e,u),e}function je(e,t,n,r,i,a,o,s,c,l){Me(e,t,n,r,i,a,o,s,c,l,0),c.push(o,s)}function Me(e,t,n,r,i,a,o,s,c,l,u){if(u>ke)return;let d=(e+n)/2,f=(t+r)/2,p=(n+i)/2,m=(r+a)/2,h=(i+o)/2,g=(a+s)/2,_=(d+p)/2,v=(f+m)/2,y=(p+h)/2,b=(m+g)/2,x=(_+y)/2,S=(v+b)/2;if(u>0){let u=o-e,d=s-t,f=Math.abs((n-o)*d-(r-s)*u),p=Math.abs((i-o)*d-(a-s)*u);if(f>q&&p>q){if((f+p)*(f+p)<=l*(u*u+d*d)){c.push(x,S);return}}else if(f>q){if(f*f<=l*(u*u+d*d)){c.push(x,S);return}}else if(p>q){if(p*p<=l*(u*u+d*d)){c.push(x,S);return}}else if(u=x-(e+o)/2,d=S-(t+s)/2,u*u+d*d<=l){c.push(x,S);return}}Me(e,t,d,f,_,v,x,S,c,l,u+1),Me(x,S,y,b,h,g,o,s,c,l,u+1)}var Ne=8,Pe=1.1920929e-7,Fe=1;function Ie(e,t,n,r,i,a,o,s){let c=(Fe-Math.min(.99,Math.max(0,s??K.defaultOptions.bezierSmoothness)))/1;return c*=c,Le(t,n,r,i,a,o,e,c),e}function Le(e,t,n,r,i,a,o,s){Re(o,e,t,n,r,i,a,s,0),o.push(i,a)}function Re(e,t,n,r,i,a,o,s,c){if(c>Ne)return;let l=(t+r)/2,u=(n+i)/2,d=(r+a)/2,f=(i+o)/2,p=(l+d)/2,m=(u+f)/2,h=a-t,g=o-n,_=Math.abs((r-a)*g-(i-o)*h);if(_>Pe){if(_*_<=s*(h*h+g*g)){e.push(p,m);return}}else if(h=p-(t+a)/2,g=m-(n+o)/2,h*h+g*g<=s){e.push(p,m);return}Re(e,t,n,l,u,p,m,s,c+1),Re(e,p,m,d,f,a,o,s,c+1)}function ze(e,t,n,r,i,a,o,s){let c=Math.abs(i-a);(!o&&i>a||o&&a>i)&&(c=2*Math.PI-c),s||=Math.max(6,Math.floor(6*r**(1/3)*(c/Math.PI))),s=Math.max(s,3);let l=c/s,u=i;l*=o?-1:1;for(let i=0;i<s+1;i++){let i=Math.cos(u),a=Math.sin(u),o=t+i*r,s=n+a*r;e.push(o,s),u+=l}}function Be(e,t,n,r,i,a){let o=e[e.length-2],s=e[e.length-1]-n,c=o-t,l=i-n,u=r-t,d=Math.abs(s*u-c*l);if(d<1e-8||a===0){(e[e.length-2]!==t||e[e.length-1]!==n)&&e.push(t,n);return}let f=s*s+c*c,p=l*l+u*u,m=s*l+c*u,h=a*Math.sqrt(f)/d,g=a*Math.sqrt(p)/d,_=h*m/f,v=g*m/p,y=h*u+g*c,b=h*l+g*s,x=c*(g+_),S=s*(g+_),C=u*(h+v),w=l*(h+v),T=Math.atan2(S-b,x-y),E=Math.atan2(w-b,C-y);ze(e,y+t,b+n,a,T,E,c*l>u*s)}var Y=Math.PI*2,Ve={centerX:0,centerY:0,ang1:0,ang2:0},He=({x:e,y:t},n,r,i,a,o,s,c)=>{e*=n,t*=r;let l=i*e-a*t,u=a*e+i*t;return c.x=l+o,c.y=u+s,c};function Ue(e,t){let n=t===-1.5707963267948966?-.551915024494:4/3*Math.tan(t/4),r=t===1.5707963267948966?.551915024494:n,i=Math.cos(e),a=Math.sin(e),o=Math.cos(e+t),s=Math.sin(e+t);return[{x:i-a*r,y:a+i*r},{x:o+s*r,y:s-o*r},{x:o,y:s}]}var We=(e,t,n,r)=>{let i=e*r-t*n<0?-1:1,a=e*n+t*r;return a>1&&(a=1),a<-1&&(a=-1),i*Math.acos(a)},Ge=(e,t,n,r,i,a,o,s,c,l,u,d,f)=>{let p=i**2,m=a**2,h=u**2,g=d**2,_=p*m-p*g-m*h;_<0&&(_=0),_/=p*g+m*h,_=Math.sqrt(_)*(o===s?-1:1);let v=_*i/a*d,y=_*-a/i*u,b=l*v-c*y+(e+n)/2,x=c*v+l*y+(t+r)/2,S=(u-v)/i,C=(d-y)/a,w=(-u-v)/i,T=(-d-y)/a,E=We(1,0,S,C),D=We(S,C,w,T);s===0&&D>0&&(D-=Y),s===1&&D<0&&(D+=Y),f.centerX=b,f.centerY=x,f.ang1=E,f.ang2=D};function Ke(e,t,n,r,i,a,o,s=0,c=0,l=0){if(a===0||o===0)return;let u=Math.sin(s*Y/360),d=Math.cos(s*Y/360),f=d*(t-r)/2+u*(n-i)/2,p=-u*(t-r)/2+d*(n-i)/2;if(f===0&&p===0)return;a=Math.abs(a),o=Math.abs(o);let m=f**2/a**2+p**2/o**2;m>1&&(a*=Math.sqrt(m),o*=Math.sqrt(m)),Ge(t,n,r,i,a,o,c,l,u,d,f,p,Ve);let{ang1:h,ang2:g}=Ve,{centerX:_,centerY:v}=Ve,y=Math.abs(g)/(Y/4);Math.abs(1-y)<1e-7&&(y=1);let b=Math.max(Math.ceil(y),1);g/=b;let x=e[e.length-2],S=e[e.length-1],C={x:0,y:0};for(let t=0;t<b;t++){let t=Ue(h,g),{x:n,y:r}=He(t[0],a,o,d,u,_,v,C),{x:i,y:s}=He(t[1],a,o,d,u,_,v,C),{x:c,y:l}=He(t[2],a,o,d,u,_,v,C);J(e,x,S,n,r,i,s,c,l),x=c,S=l,h+=g}}function qe(e,t,n){let r=(e,t)=>{let n=t.x-e.x,r=t.y-e.y,i=Math.sqrt(n*n+r*r);return{len:i,nx:n/i,ny:r/i}},i=(t,n)=>{t===0?e.moveTo(n.x,n.y):e.lineTo(n.x,n.y)},a=t[t.length-1];for(let o=0;o<t.length;o++){let s=t[o%t.length],c=s.radius??n;if(c<=0){i(o,s),a=s;continue}let l=t[(o+1)%t.length],u=r(s,a),d=r(s,l);if(u.len<1e-4||d.len<1e-4){i(o,s),a=s;continue}let f=Math.asin(u.nx*d.ny-u.ny*d.nx),p=1,m=!1;u.nx*d.nx-u.ny*-d.ny<0?f<0?f=Math.PI+f:(f=Math.PI-f,p=-1,m=!0):f>0&&(p=-1,m=!0);let h=f/2,g,_=Math.abs(Math.cos(h)*c/Math.sin(h));_>Math.min(u.len/2,d.len/2)?(_=Math.min(u.len/2,d.len/2),g=Math.abs(_*Math.sin(h)/Math.cos(h))):g=c;let v=s.x+d.nx*_+-d.ny*g*p,y=s.y+d.ny*_+d.nx*g*p,b=Math.atan2(u.ny,u.nx)+Math.PI/2*p,x=Math.atan2(d.ny,d.nx)-Math.PI/2*p;o===0&&e.moveTo(v+Math.cos(b)*g,y+Math.sin(b)*g),e.arc(v,y,g,b,x,m),a=s}}function Je(e,t,n,r){let i=(e,t)=>Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2),a=(e,t,n)=>({x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}),o=t.length;for(let s=0;s<o;s++){let c=t[(s+1)%o],l=c.radius??n;if(l<=0){s===0?e.moveTo(c.x,c.y):e.lineTo(c.x,c.y);continue}let u=t[s],d=t[(s+2)%o],f=i(u,c),p;p=f<1e-4?c:a(c,u,Math.min(f/2,l)/f);let m=i(d,c),h;h=m<1e-4?c:a(c,d,Math.min(m/2,l)/m),s===0?e.moveTo(p.x,p.y):e.lineTo(p.x,p.y),e.quadraticCurveTo(c.x,c.y,h.x,h.y,r)}}var Ye=new a,Xe=class{constructor(e){this.shapePrimitives=[],this._currentPoly=null,this._bounds=new i,this._graphicsPath2D=e,this.signed=e.checkForHoles}moveTo(e,t){return this.startPoly(e,t),this}lineTo(e,t){this._ensurePoly();let n=this._currentPoly.points,r=n[n.length-2],i=n[n.length-1];return(r!==e||i!==t)&&n.push(e,t),this}arc(e,t,n,r,i,a){this._ensurePoly(!1);let o=this._currentPoly.points;return ze(o,e,t,n,r,i,a),this}arcTo(e,t,n,r,i){this._ensurePoly();let a=this._currentPoly.points;return Be(a,e,t,n,r,i),this}arcToSvg(e,t,n,r,i,a,o){let s=this._currentPoly.points;return Ke(s,this._currentPoly.lastX,this._currentPoly.lastY,a,o,e,t,n,r,i),this}bezierCurveTo(e,t,n,r,i,a,o){this._ensurePoly();let s=this._currentPoly;return J(this._currentPoly.points,s.lastX,s.lastY,e,t,n,r,i,a,o),this}quadraticCurveTo(e,t,n,r,i){this._ensurePoly();let a=this._currentPoly;return Ie(this._currentPoly.points,a.lastX,a.lastY,e,t,n,r,i),this}closePath(){return this.endPoly(!0),this}addPath(e,t){this.endPoly(),t&&!t.isIdentity()&&(e=e.clone(!0),e.transform(t));let n=this.shapePrimitives,r=n.length;for(let t=0;t<e.instructions.length;t++){let n=e.instructions[t];this[n.action](...n.data)}if(e.checkForHoles&&n.length-r>1){let e=null;for(let t=r;t<n.length;t++){let r=n[t];if(r.shape.type===`polygon`){let i=r.shape,a=e?.shape;a&&a.containsPolygon(i)?(e.holes||=[],e.holes.push(r),n.copyWithin(t,t+1),n.length--,t--):e=r}}}return this}finish(e=!1){this.endPoly(e)}rect(e,t,n,r,i){return this.drawShape(new a(e,t,n,r),i),this}circle(e,t,n,r){return this.drawShape(new D(e,t,n),r),this}poly(e,t,n){let r=new j(e);return r.closePath=t,this.drawShape(r,n),this}regularPoly(e,t,n,r,i=0,a){r=Math.max(r|0,3);let o=-1*Math.PI/2+i,s=Math.PI*2/r,c=[];for(let i=0;i<r;i++){let r=o-i*s;c.push(e+n*Math.cos(r),t+n*Math.sin(r))}return this.poly(c,!0,a),this}roundPoly(e,t,n,r,i,a=0,o){if(r=Math.max(r|0,3),i<=0)return this.regularPoly(e,t,n,r,a);let s=n*Math.sin(Math.PI/r)-.001;i=Math.min(i,s);let c=-1*Math.PI/2+a,l=Math.PI*2/r,u=(r-2)*Math.PI/r/2;for(let a=0;a<r;a++){let r=a*l+c,s=e+n*Math.cos(r),d=t+n*Math.sin(r),f=r+Math.PI+u,p=r-Math.PI-u,m=s+i*Math.cos(f),h=d+i*Math.sin(f),g=s+i*Math.cos(p),_=d+i*Math.sin(p);a===0?this.moveTo(m,h):this.lineTo(m,h),this.quadraticCurveTo(s,d,g,_,o)}return this.closePath()}roundShape(e,t,n=!1,r){return e.length<3?this:(n?Je(this,e,t,r):qe(this,e,t),this.closePath())}filletRect(e,t,n,r,i){if(i===0)return this.rect(e,t,n,r);let a=Math.min(n,r)/2,o=Math.min(a,Math.max(-a,i)),s=e+n,c=t+r,l=o<0?-o:0,u=Math.abs(o);return this.moveTo(e,t+u).arcTo(e+l,t+l,e+u,t,u).lineTo(s-u,t).arcTo(s-l,t+l,s,t+u,u).lineTo(s,c-u).arcTo(s-l,c-l,e+n-u,c,u).lineTo(e+u,c).arcTo(e+l,c-l,e,c-u,u).closePath()}chamferRect(e,t,n,r,i,a){if(i<=0)return this.rect(e,t,n,r);let o=Math.min(i,Math.min(n,r)/2),s=e+n,c=t+r,l=[e+o,t,s-o,t,s,t+o,s,c-o,s-o,c,e+o,c,e,c-o,e,t+o];for(let e=l.length-1;e>=2;e-=2)l[e]===l[e-2]&&l[e-1]===l[e-3]&&l.splice(e-1,2);return this.poly(l,!0,a)}ellipse(e,t,n,r,i){return this.drawShape(new O(e,t,n,r),i),this}roundRect(e,t,n,r,i,a){return this.drawShape(new N(e,t,n,r,i),a),this}drawShape(e,t){return this.endPoly(),this.shapePrimitives.push({shape:e,transform:t}),this}startPoly(e,t){let n=this._currentPoly;return n&&this.endPoly(),n=new j,n.points.push(e,t),this._currentPoly=n,this}endPoly(e=!1){let t=this._currentPoly;return t&&t.points.length>2&&(t.closePath=e,this.shapePrimitives.push({shape:t})),this._currentPoly=null,this}_ensurePoly(e=!0){if(!this._currentPoly&&(this._currentPoly=new j,e)){let e=this.shapePrimitives[this.shapePrimitives.length-1];if(e){let t=e.shape.x,n=e.shape.y;if(e.transform&&!e.transform.isIdentity()){let r=e.transform,i=t;t=r.a*t+r.c*n+r.tx,n=r.b*i+r.d*n+r.ty}this._currentPoly.points.push(t,n)}else this._currentPoly.points.push(0,0)}}buildPath(){let e=this._graphicsPath2D;this.shapePrimitives.length=0,this._currentPoly=null;for(let t=0;t<e.instructions.length;t++){let n=e.instructions[t];this[n.action](...n.data)}this.finish()}get bounds(){let e=this._bounds;e.clear();let t=this.shapePrimitives;for(let n=0;n<t.length;n++){let r=t[n],i=r.shape.getBounds(Ye);r.transform?e.addRect(i,r.transform):e.addRect(i)}return e}},X=class e{constructor(e,t=!1){this.instructions=[],this.uid=g(`graphicsPath`),this._dirty=!0,this.checkForHoles=t,typeof e==`string`?F(e,this):this.instructions=e?.slice()??[]}get shapePath(){return this._shapePath||=new Xe(this),this._dirty&&(this._dirty=!1,this._shapePath.buildPath()),this._shapePath}addPath(e,t){return e=e.clone(),this.instructions.push({action:`addPath`,data:[e,t]}),this._dirty=!0,this}arc(...e){return this.instructions.push({action:`arc`,data:e}),this._dirty=!0,this}arcTo(...e){return this.instructions.push({action:`arcTo`,data:e}),this._dirty=!0,this}arcToSvg(...e){return this.instructions.push({action:`arcToSvg`,data:e}),this._dirty=!0,this}bezierCurveTo(...e){return this.instructions.push({action:`bezierCurveTo`,data:e}),this._dirty=!0,this}bezierCurveToShort(e,t,n,r,i){let a=this.instructions[this.instructions.length-1],o=this.getLastPoint(m.shared),s=0,c=0;if(!a||a.action!==`bezierCurveTo`)s=o.x,c=o.y;else{s=a.data[2],c=a.data[3];let e=o.x,t=o.y;s=e+(e-s),c=t+(t-c)}return this.instructions.push({action:`bezierCurveTo`,data:[s,c,e,t,n,r,i]}),this._dirty=!0,this}closePath(){return this.instructions.push({action:`closePath`,data:[]}),this._dirty=!0,this}ellipse(...e){return this.instructions.push({action:`ellipse`,data:e}),this._dirty=!0,this}lineTo(...e){return this.instructions.push({action:`lineTo`,data:e}),this._dirty=!0,this}moveTo(...e){return this.instructions.push({action:`moveTo`,data:e}),this}quadraticCurveTo(...e){return this.instructions.push({action:`quadraticCurveTo`,data:e}),this._dirty=!0,this}quadraticCurveToShort(e,t,n){let r=this.instructions[this.instructions.length-1],i=this.getLastPoint(m.shared),a=0,o=0;if(!r||r.action!==`quadraticCurveTo`)a=i.x,o=i.y;else{a=r.data[0],o=r.data[1];let e=i.x,t=i.y;a=e+(e-a),o=t+(t-o)}return this.instructions.push({action:`quadraticCurveTo`,data:[a,o,e,t,n]}),this._dirty=!0,this}rect(e,t,n,r,i){return this.instructions.push({action:`rect`,data:[e,t,n,r,i]}),this._dirty=!0,this}circle(e,t,n,r){return this.instructions.push({action:`circle`,data:[e,t,n,r]}),this._dirty=!0,this}roundRect(...e){return this.instructions.push({action:`roundRect`,data:e}),this._dirty=!0,this}poly(...e){return this.instructions.push({action:`poly`,data:e}),this._dirty=!0,this}regularPoly(...e){return this.instructions.push({action:`regularPoly`,data:e}),this._dirty=!0,this}roundPoly(...e){return this.instructions.push({action:`roundPoly`,data:e}),this._dirty=!0,this}roundShape(...e){return this.instructions.push({action:`roundShape`,data:e}),this._dirty=!0,this}filletRect(...e){return this.instructions.push({action:`filletRect`,data:e}),this._dirty=!0,this}chamferRect(...e){return this.instructions.push({action:`chamferRect`,data:e}),this._dirty=!0,this}star(e,t,n,r,i,a,o){i||=r/2;let s=-1*Math.PI/2+a,c=n*2,l=Math.PI*2/c,u=[];for(let n=0;n<c;n++){let a=n%2?i:r,o=n*l+s;u.push(e+a*Math.cos(o),t+a*Math.sin(o))}return this.poly(u,!0,o),this}clone(t=!1){let n=new e;if(n.checkForHoles=this.checkForHoles,!t)n.instructions=this.instructions.slice();else for(let e=0;e<this.instructions.length;e++){let t=this.instructions[e];n.instructions.push({action:t.action,data:t.data.slice()})}return n}clear(){return this.instructions.length=0,this._dirty=!0,this}transform(e){if(e.isIdentity())return this;let t=e.a,n=e.b,r=e.c,i=e.d,a=e.tx,o=e.ty,s=0,c=0,l=0,d=0,f=0,p=0,m=0,h=0;for(let g=0;g<this.instructions.length;g++){let _=this.instructions[g],v=_.data;switch(_.action){case`moveTo`:case`lineTo`:s=v[0],c=v[1],v[0]=t*s+r*c+a,v[1]=n*s+i*c+o;break;case`bezierCurveTo`:l=v[0],d=v[1],f=v[2],p=v[3],s=v[4],c=v[5],v[0]=t*l+r*d+a,v[1]=n*l+i*d+o,v[2]=t*f+r*p+a,v[3]=n*f+i*p+o,v[4]=t*s+r*c+a,v[5]=n*s+i*c+o;break;case`quadraticCurveTo`:l=v[0],d=v[1],s=v[2],c=v[3],v[0]=t*l+r*d+a,v[1]=n*l+i*d+o,v[2]=t*s+r*c+a,v[3]=n*s+i*c+o;break;case`arcToSvg`:s=v[5],c=v[6],m=v[0],h=v[1],v[0]=t*m+r*h,v[1]=n*m+i*h,v[5]=t*s+r*c+a,v[6]=n*s+i*c+o;break;case`circle`:v[4]=Z(v[3],e);break;case`rect`:v[4]=Z(v[4],e);break;case`ellipse`:v[8]=Z(v[8],e);break;case`roundRect`:v[5]=Z(v[5],e);break;case`addPath`:v[0].transform(e);break;case`poly`:v[2]=Z(v[2],e);break;case`regularPoly`:case`chamferRect`:v[5]=Z(v[5],e);break;case`closePath`:break;default:u(`unknown transform action`,_.action);break}}return this._dirty=!0,this}get bounds(){return this.shapePath.bounds}getLastPoint(e){let t=this.instructions.length-1,n=this.instructions[t];if(!n)return e.x=0,e.y=0,e;for(;n.action===`closePath`;){if(t--,t<0)return e.x=0,e.y=0,e;n=this.instructions[t]}switch(n.action){case`moveTo`:case`lineTo`:e.x=n.data[0],e.y=n.data[1];break;case`quadraticCurveTo`:e.x=n.data[2],e.y=n.data[3];break;case`bezierCurveTo`:e.x=n.data[4],e.y=n.data[5];break;case`arc`:case`arcToSvg`:e.x=n.data[5],e.y=n.data[6];break;case`addPath`:n.data[0].getLastPoint(e);break}return e}};function Z(e,t){return e?e.prepend(t):t.clone()}function Q(e,t,n){let r=e.getAttribute(t);return r?Number(r):n}function Ze(e,t){let n=e.querySelectorAll(`defs`);for(let e=0;e<n.length;e++){let r=n[e];for(let e=0;e<r.children.length;e++){let n=r.children[e];switch(n.nodeName.toLowerCase()){case`lineargradient`:t.defs[n.id]=Qe(n);break;case`radialgradient`:t.defs[n.id]=$e(n);break;default:break}}}}function Qe(e){let t=new U(Q(e,`x1`,0),Q(e,`y1`,0),Q(e,`x2`,1),Q(e,`y2`,0),(e.getAttribute(`gradientUnits`)||`objectBoundingBox`)===`objectBoundingBox`?`local`:`global`);for(let n=0;n<e.children.length;n++){let r=e.children[n],i=Q(r,`offset`,0),a=d.shared.setValue(r.getAttribute(`stop-color`)).toNumber();t.addColorStop(i,a)}return t}function $e(e){return u(`[SVG Parser] Radial gradients are not yet supported`),new U(0,0,1,0)}function et(e){let t=e.match(/url\s*\(\s*['"]?\s*#([^'"\s)]+)\s*['"]?\s*\)/i);return t?t[1]:``}var tt={fill:{type:`paint`,default:0},"fill-opacity":{type:`number`,default:1},stroke:{type:`paint`,default:0},"stroke-width":{type:`number`,default:1},"stroke-opacity":{type:`number`,default:1},"stroke-linecap":{type:`string`,default:`butt`},"stroke-linejoin":{type:`string`,default:`miter`},"stroke-miterlimit":{type:`number`,default:10},"stroke-dasharray":{type:`string`,default:`none`},"stroke-dashoffset":{type:`number`,default:0},opacity:{type:`number`,default:1}};function nt(e,t){let n=e.getAttribute(`style`),r={},i={},a={strokeStyle:r,fillStyle:i,useFill:!1,useStroke:!1};for(let n in tt){let r=e.getAttribute(n);r&&rt(t,a,n,r.trim())}if(n){let e=n.split(`;`);for(let n=0;n<e.length;n++){let[r,i]=e[n].trim().split(`:`);tt[r]&&rt(t,a,r,i.trim())}}return{strokeStyle:a.useStroke?r:null,fillStyle:a.useFill?i:null,useFill:a.useFill,useStroke:a.useStroke}}function rt(e,t,n,r){switch(n){case`stroke`:if(r!==`none`){if(r.startsWith(`url(`)){let n=et(r);t.strokeStyle.fill=e.defs[n]}else t.strokeStyle.color=d.shared.setValue(r).toNumber();t.useStroke=!0}break;case`stroke-width`:t.strokeStyle.width=Number(r);break;case`fill`:if(r!==`none`){if(r.startsWith(`url(`)){let n=et(r);t.fillStyle.fill=e.defs[n]}else t.fillStyle.color=d.shared.setValue(r).toNumber();t.useFill=!0}break;case`fill-opacity`:t.fillStyle.alpha=Number(r);break;case`stroke-opacity`:t.strokeStyle.alpha=Number(r);break;case`opacity`:t.fillStyle.alpha=Number(r),t.strokeStyle.alpha=Number(r);break}}function it(e){if(e.length<=2)return!0;let t=e.map(e=>e.area).sort((e,t)=>t-e),[n,r]=t,i=t[t.length-1],a=n/r,o=r/i;return!(a>3&&o<2)}function at(e,t=0){let n=e.instructions[t];if(!n||n.action!==`fill`)throw Error(`Expected fill instruction at index ${t}, got ${n?.action||`undefined`}`);return n.data}function ot(e){return e.split(/(?=[Mm])/).filter(e=>e.trim().length>0)}function st(e){let t=e.match(/[-+]?[0-9]*\.?[0-9]+/g);if(!t||t.length<4)return 0;let n=t.map(Number),r=[],i=[];for(let e=0;e<n.length;e+=2)e+1<n.length&&(r.push(n[e]),i.push(n[e+1]));if(r.length===0||i.length===0)return 0;let a=Math.min(...r),o=Math.max(...r),s=Math.min(...i),c=Math.max(...i);return(o-a)*(c-s)}function ct(e,t){let n=new X(e,!1);for(let e of n.instructions)t.instructions.push(e)}function lt(e,t){if(typeof e==`string`){let t=document.createElement(`div`);t.innerHTML=e.trim(),e=t.querySelector(`svg`)}let n={context:t,defs:{},path:new X};Ze(e,n);let r=e.children,{fillStyle:i,strokeStyle:a}=nt(e,n);for(let e=0;e<r.length;e++){let t=r[e];t.nodeName.toLowerCase()!==`defs`&&ut(t,n,i,a)}return t}function ut(e,t,n,r){let i=e.children,{fillStyle:a,strokeStyle:o}=nt(e,t);a&&n?n={...n,...a}:a&&(n=a),o&&r?r={...r,...o}:o&&(r=o);let s=!n&&!r;s&&(n={color:0});let c,l,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T;switch(e.nodeName.toLowerCase()){case`path`:{S=e.getAttribute(`d`);let i=e.getAttribute(`fill-rule`),a=ot(S),o=i===`evenodd`,s=a.length>1;if(o&&s){let e=a.map(e=>({path:e,area:st(e)}));if(e.sort((e,t)=>t.area-e.area),a.length>3||!it(e))for(let i=0;i<e.length;i++){let a=e[i],o=i===0;t.context.beginPath();let s=new X(void 0,!0);ct(a.path,s),t.context.path(s),o?(n&&t.context.fill(n),r&&t.context.stroke(r)):t.context.cut()}else for(let i=0;i<e.length;i++){let a=e[i],o=i%2==1;t.context.beginPath();let s=new X(void 0,!0);ct(a.path,s),t.context.path(s),o?t.context.cut():(n&&t.context.fill(n),r&&t.context.stroke(r))}}else C=new X(S,i?i===`evenodd`:!0),t.context.path(C),n&&t.context.fill(n),r&&t.context.stroke(r);break}case`circle`:h=Q(e,`cx`,0),g=Q(e,`cy`,0),_=Q(e,`r`,0),t.context.ellipse(h,g,_,_),n&&t.context.fill(n),r&&t.context.stroke(r);break;case`rect`:c=Q(e,`x`,0),l=Q(e,`y`,0),w=Q(e,`width`,0),T=Q(e,`height`,0),v=Q(e,`rx`,0),y=Q(e,`ry`,0),v||y?t.context.roundRect(c,l,w,T,v||y):t.context.rect(c,l,w,T),n&&t.context.fill(n),r&&t.context.stroke(r);break;case`ellipse`:h=Q(e,`cx`,0),g=Q(e,`cy`,0),v=Q(e,`rx`,0),y=Q(e,`ry`,0),t.context.beginPath(),t.context.ellipse(h,g,v,y),n&&t.context.fill(n),r&&t.context.stroke(r);break;case`line`:d=Q(e,`x1`,0),f=Q(e,`y1`,0),p=Q(e,`x2`,0),m=Q(e,`y2`,0),t.context.beginPath(),t.context.moveTo(d,f),t.context.lineTo(p,m),r&&t.context.stroke(r);break;case`polygon`:x=e.getAttribute(`points`),b=x.match(/-?\d+/g).map(e=>parseInt(e,10)),t.context.poly(b,!0),n&&t.context.fill(n),r&&t.context.stroke(r);break;case`polyline`:x=e.getAttribute(`points`),b=x.match(/-?\d+/g).map(e=>parseInt(e,10)),t.context.poly(b,!1),r&&t.context.stroke(r);break;case`g`:case`svg`:break;default:u(`[SVG parser] <${e.nodeName}> elements unsupported`);break}s&&(n=null);for(let e=0;e<i.length;e++)ut(i[e],t,n,r)}var dt={repeat:{addressModeU:`repeat`,addressModeV:`repeat`},"repeat-x":{addressModeU:`repeat`,addressModeV:`clamp-to-edge`},"repeat-y":{addressModeU:`clamp-to-edge`,addressModeV:`repeat`},"no-repeat":{addressModeU:`clamp-to-edge`,addressModeV:`clamp-to-edge`}},ft=class{constructor(e,t){this.uid=g(`fillPattern`),this._tick=0,this.transform=new v,this.texture=e,this.transform.scale(1/e.frame.width,1/e.frame.height),t&&(e.source.style.addressModeU=dt[t].addressModeU,e.source.style.addressModeV=dt[t].addressModeV)}setTransform(e){let t=this.texture;this.transform.copyFrom(e),this.transform.invert(),this.transform.scale(1/t.frame.width,1/t.frame.height),this._tick++}get texture(){return this._texture}set texture(e){this._texture!==e&&(this._texture=e,this._tick++)}get styleKey(){return`fill-pattern-${this.uid}-${this._tick}`}destroy(){this.texture.destroy(!0),this.texture=null}};function pt(e){return d.isColorLike(e)}function mt(e){return e instanceof ft}function ht(e){return e instanceof U}function gt(e){return e instanceof o}function _t(e,t,n){let r=d.shared.setValue(t??0);return e.color=r.toNumber(),e.alpha=r.alpha===1?n.alpha:r.alpha,e.texture=o.WHITE,{...n,...e}}function vt(e,t,n){return e.texture=t,{...n,...e}}function yt(e,t,n){return e.fill=t,e.color=16777215,e.texture=t.texture,e.matrix=t.transform,{...n,...e}}function bt(e,t,n){return t.buildGradient(),e.fill=t,e.color=16777215,e.texture=t.texture,e.matrix=t.transform,e.textureSpace=t.textureSpace,{...n,...e}}function xt(e,t){let n={...t,...e},r=d.shared.setValue(n.color);return n.alpha*=r.alpha,n.color=r.toNumber(),n}function $(e,t){if(e==null)return null;let n={},r=e;return pt(e)?_t(n,e,t):gt(e)?vt(n,e,t):mt(e)?yt(n,e,t):ht(e)?bt(n,e,t):r.fill&&mt(r.fill)?yt(r,r.fill,t):r.fill&&ht(r.fill)?bt(r,r.fill,t):xt(r,t)}function St(e,t){let{width:n,alignment:r,miterLimit:i,cap:a,join:o,pixelLine:s,...c}=t,l=$(e,c);return l?{width:n,alignment:r,miterLimit:i,cap:a,join:o,pixelLine:s,...l}:null}function Ct(e,t){let n=1,r=e.shapePath.shapePrimitives;for(let e=0;e<r.length;e++){let i=r[e].shape;if(i.type!==`polygon`)continue;let a=i.points,o=a.length;if(o<6)continue;let s=i.closePath;for(let e=0;e<o;e+=2){if(!s&&(e===0||e===o-2))continue;let r=(e-2+o)%o,i=(e+2)%o,c=a[r],l=a[r+1],u=a[e],d=a[e+1],f=a[i],p=a[i+1],m=c-u,h=l-d,g=f-u,_=p-d,v=m*m+h*h,y=g*g+_*_;if(v<1e-12||y<1e-12)continue;let b=(m*g+h*_)/Math.sqrt(v*y);b<-1?b=-1:b>1&&(b=1);let x=Math.sqrt((1-b)*.5);if(x<1e-6)continue;let S=Math.min(1/x,t);S>n&&(n=S)}}return n}var wt=new m,Tt=new v,Et=class e extends h{constructor(){super(...arguments),this._gpuData=Object.create(null),this.autoGarbageCollect=!0,this._gcLastUsed=-1,this.uid=g(`graphicsContext`),this.dirty=!0,this.batchMode=`auto`,this.instructions=[],this.destroyed=!1,this._activePath=new X,this._transform=new v,this._fillStyle={...e.defaultFillStyle},this._strokeStyle={...e.defaultStrokeStyle},this._stateStack=[],this._tick=0,this._bounds=new i,this._boundsDirty=!0}clone(){let t=new e;return t.batchMode=this.batchMode,t.instructions=this.instructions.slice(),t._activePath=this._activePath.clone(),t._transform=this._transform.clone(),t._fillStyle={...this._fillStyle},t._strokeStyle={...this._strokeStyle},t._stateStack=this._stateStack.slice(),t._bounds=this._bounds.clone(),t._boundsDirty=!0,t}get fillStyle(){return this._fillStyle}set fillStyle(t){this._fillStyle=$(t,e.defaultFillStyle)}get strokeStyle(){return this._strokeStyle}set strokeStyle(t){this._strokeStyle=St(t,e.defaultStrokeStyle)}setFillStyle(t){return this._fillStyle=$(t,e.defaultFillStyle),this}setStrokeStyle(t){return this._strokeStyle=$(t,e.defaultStrokeStyle),this}texture(e,t,n,r,i,a){return this.instructions.push({action:`texture`,data:{image:e,dx:n||0,dy:r||0,dw:i||e.frame.width,dh:a||e.frame.height,transform:this._transform.clone(),alpha:this._fillStyle.alpha,style:t||t===0?d.shared.setValue(t).toNumber():16777215}}),this.onUpdate(),this}beginPath(){return this._activePath=new X,this}fill(t,r){let i,a=this.instructions[this.instructions.length-1];return i=this._tick===0&&a?.action===`stroke`?a.data.path:this._activePath.clone(),i?(t!=null&&(r!==void 0&&typeof t==`number`&&(s(n,`GraphicsContext.fill(color, alpha) is deprecated, use GraphicsContext.fill({ color, alpha }) instead`),t={color:t,alpha:r}),this._fillStyle=$(t,e.defaultFillStyle)),this.instructions.push({action:`fill`,data:{style:this.fillStyle,path:i}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}_initNextPathLocation(){let{x:e,y:t}=this._activePath.getLastPoint(m.shared);this._activePath.clear(),this._activePath.moveTo(e,t)}stroke(t){let n,r=this.instructions[this.instructions.length-1];return n=this._tick===0&&r?.action===`fill`?r.data.path:this._activePath.clone(),n?(t!=null&&(this._strokeStyle=St(t,e.defaultStrokeStyle)),this.instructions.push({action:`stroke`,data:{style:this.strokeStyle,path:n}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}cut(){for(let e=0;e<2;e++){let t=this.instructions[this.instructions.length-1-e],n=this._activePath.clone();if(t&&(t.action===`stroke`||t.action===`fill`))if(t.data.hole)t.data.hole.addPath(n);else{t.data.hole=n;break}}return this._initNextPathLocation(),this}arc(e,t,n,r,i,a){this._tick++;let o=this._transform;return this._activePath.arc(o.a*e+o.c*t+o.tx,o.b*e+o.d*t+o.ty,n,r,i,a),this}arcTo(e,t,n,r,i){this._tick++;let a=this._transform;return this._activePath.arcTo(a.a*e+a.c*t+a.tx,a.b*e+a.d*t+a.ty,a.a*n+a.c*r+a.tx,a.b*n+a.d*r+a.ty,i),this}arcToSvg(e,t,n,r,i,a,o){this._tick++;let s=this._transform;return this._activePath.arcToSvg(e,t,n,r,i,s.a*a+s.c*o+s.tx,s.b*a+s.d*o+s.ty),this}bezierCurveTo(e,t,n,r,i,a,o){this._tick++;let s=this._transform;return this._activePath.bezierCurveTo(s.a*e+s.c*t+s.tx,s.b*e+s.d*t+s.ty,s.a*n+s.c*r+s.tx,s.b*n+s.d*r+s.ty,s.a*i+s.c*a+s.tx,s.b*i+s.d*a+s.ty,o),this}closePath(){return this._tick++,this._activePath?.closePath(),this}ellipse(e,t,n,r){return this._tick++,this._activePath.ellipse(e,t,n,r,this._transform.clone()),this}circle(e,t,n){return this._tick++,this._activePath.circle(e,t,n,this._transform.clone()),this}path(e){return this._tick++,this._activePath.addPath(e,this._transform.clone()),this}lineTo(e,t){this._tick++;let n=this._transform;return this._activePath.lineTo(n.a*e+n.c*t+n.tx,n.b*e+n.d*t+n.ty),this}moveTo(e,t){this._tick++;let n=this._transform,r=this._activePath.instructions,i=n.a*e+n.c*t+n.tx,a=n.b*e+n.d*t+n.ty;return r.length===1&&r[0].action===`moveTo`?(r[0].data[0]=i,r[0].data[1]=a,this):(this._activePath.moveTo(i,a),this)}quadraticCurveTo(e,t,n,r,i){this._tick++;let a=this._transform;return this._activePath.quadraticCurveTo(a.a*e+a.c*t+a.tx,a.b*e+a.d*t+a.ty,a.a*n+a.c*r+a.tx,a.b*n+a.d*r+a.ty,i),this}rect(e,t,n,r){return this._tick++,this._activePath.rect(e,t,n,r,this._transform.clone()),this}roundRect(e,t,n,r,i){return this._tick++,this._activePath.roundRect(e,t,n,r,i,this._transform.clone()),this}poly(e,t){return this._tick++,this._activePath.poly(e,t,this._transform.clone()),this}regularPoly(e,t,n,r,i=0,a){return this._tick++,this._activePath.regularPoly(e,t,n,r,i,a),this}roundPoly(e,t,n,r,i,a){return this._tick++,this._activePath.roundPoly(e,t,n,r,i,a),this}roundShape(e,t,n,r){return this._tick++,this._activePath.roundShape(e,t,n,r),this}filletRect(e,t,n,r,i){return this._tick++,this._activePath.filletRect(e,t,n,r,i),this}chamferRect(e,t,n,r,i,a){return this._tick++,this._activePath.chamferRect(e,t,n,r,i,a),this}star(e,t,n,r,i=0,a=0){return this._tick++,this._activePath.star(e,t,n,r,i,a,this._transform.clone()),this}svg(e){return this._tick++,lt(e,this),this}restore(){let e=this._stateStack.pop();return e&&(this._transform=e.transform,this._fillStyle=e.fillStyle,this._strokeStyle=e.strokeStyle),this}save(){return this._stateStack.push({transform:this._transform.clone(),fillStyle:{...this._fillStyle},strokeStyle:{...this._strokeStyle}}),this}getTransform(){return this._transform}resetTransform(){return this._transform.identity(),this}rotate(e){return this._transform.rotate(e),this}scale(e,t=e){return this._transform.scale(e,t),this}setTransform(e,t,n,r,i,a){return e instanceof v?(this._transform.set(e.a,e.b,e.c,e.d,e.tx,e.ty),this):(this._transform.set(e,t,n,r,i,a),this)}transform(e,t,n,r,i,a){return e instanceof v?(this._transform.append(e),this):(Tt.set(e,t,n,r,i,a),this._transform.append(Tt),this)}translate(e,t=e){return this._transform.translate(e,t),this}clear(){return this._activePath.clear(),this.instructions.length=0,this.resetTransform(),this.onUpdate(),this}onUpdate(){this._boundsDirty=!0,this.dirty=!0,this.emit(`update`,this,16)}get bounds(){if(!this._boundsDirty)return this._bounds;this._boundsDirty=!1;let e=this._bounds;e.clear();for(let t=0;t<this.instructions.length;t++){let n=this.instructions[t],r=n.action;if(r===`fill`){let t=n.data;e.addBounds(t.path.bounds)}else if(r===`texture`){let t=n.data;e.addFrame(t.dx,t.dy,t.dx+t.dw,t.dy+t.dh,t.transform)}if(r===`stroke`){let t=n.data,r=t.style.alignment,i=t.style.width*(1-r);t.style.join===`miter`&&(i*=Ct(t.path,t.style.miterLimit));let a=t.path.bounds;e.addFrame(a.minX-i,a.minY-i,a.maxX+i,a.maxY+i)}}return e.isValid||e.set(0,0,0,0),e}containsPoint(e){if(!this.bounds.containsPoint(e.x,e.y))return!1;let t=this.instructions,n=!1;for(let r=0;r<t.length;r++){let i=t[r],a=i.data,o=a.path;if(!i.action||!o)continue;let s=a.style,c=o.shapePath.shapePrimitives;for(let t=0;t<c.length;t++){let r=c[t].shape;if(!s||!r)continue;let o=c[t].transform,l=o?o.applyInverse(e,wt):e;if(i.action===`fill`)n=r.contains(l.x,l.y);else{let e=s;n=r.strokeContains(l.x,l.y,e.width,e.alignment)}let u=a.hole;if(u){let e=u.shapePath?.shapePrimitives;if(e)for(let t=0;t<e.length;t++)e[t].shape.contains(l.x,l.y)&&(n=!1)}if(n)return!0}}return n}unload(){this.emit(`unload`,this);for(let e in this._gpuData)this._gpuData[e]?.destroy();this._gpuData=Object.create(null)}destroy(e=!1){if(!this.destroyed){if(this.destroyed=!0,this._stateStack.length=0,this._transform=null,this.unload(),this.emit(`destroy`,this),this.removeAllListeners(),typeof e==`boolean`?e:e?.texture){let t=typeof e==`boolean`?e:e?.textureSource;this._fillStyle.texture&&(this._fillStyle.fill&&`uid`in this._fillStyle.fill?this._fillStyle.fill.destroy():this._fillStyle.texture.destroy(t)),this._strokeStyle.texture&&(this._strokeStyle.fill&&`uid`in this._strokeStyle.fill?this._strokeStyle.fill.destroy():this._strokeStyle.texture.destroy(t))}this._fillStyle=null,this._strokeStyle=null,this.instructions=null,this._activePath=null,this._bounds=null,this._stateStack=null,this.customShader=null,this._transform=null}}};Et.defaultFillStyle={color:16777215,alpha:1,texture:o.WHITE,matrix:null,fill:null,textureSpace:`local`},Et.defaultStrokeStyle={width:1,color:16777215,alpha:1,alignment:.5,miterLimit:10,cap:`butt`,join:`miter`,texture:o.WHITE,matrix:null,fill:null,textureSpace:`local`,pixelLine:!1};var Dt=Et;export{D as $,W as A,ae as B,ze as C,Oe as D,De as E,de as F,ne as G,R as H,V as I,I as J,L as K,le as L,U as M,pe as N,K as O,fe as P,O as Q,ce as R,Be as S,J as T,re as U,z as V,ie as W,N as X,F as Y,j as Z,X as _,ft as a,Je as b,st as c,at as d,E as et,nt as f,Q as g,Ze as h,St as i,be as j,Ce as k,ot as l,et as m,Ct as n,lt as o,tt as p,ee as q,$ as r,ct as s,Dt as t,it as u,Xe as v,Ie as w,Ke as x,qe as y,oe as z};
|