@galacean/cli 2.0.0-alpha.11 → 2.0.0-alpha.12
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/cli.bundle.cjs +3084 -2863
- package/dist/viewport-client/_static/Accordion-4897319b.js +6 -0
- package/dist/viewport-client/_static/AmbientLightAsset-f70b95f1.js +5 -0
- package/dist/viewport-client/_static/AnimationClipAsset-01f3deb6.js +1 -0
- package/dist/viewport-client/_static/AnimatorControllerAsset-b7424e9c.js +1 -0
- package/dist/viewport-client/_static/AnimatorStore-fd98c00e.js +1 -0
- package/dist/viewport-client/_static/AssetPreviewer-24e31d97.js +6 -0
- package/dist/viewport-client/_static/AssetViewer-bc198e16.js +1 -0
- package/dist/viewport-client/_static/AudioAsset-eae03324.js +1 -0
- package/dist/viewport-client/_static/AudioComponent-44070c2c.js +1 -0
- package/dist/viewport-client/_static/Callout-cb4a55ff.js +1 -0
- package/dist/viewport-client/_static/CameraComponent-907ac745.js +1 -0
- package/dist/viewport-client/_static/CanvasRenderer-9dd98cb3.js +1 -0
- package/dist/viewport-client/_static/Component-f923abb1.js +1 -0
- package/dist/viewport-client/_static/DirectLight-58f5fe9e.js +1 -0
- package/dist/viewport-client/_static/FontAsset-abfb9a8a.js +5 -0
- package/dist/viewport-client/_static/FormItemArray-66be8701.js +1 -0
- package/dist/viewport-client/_static/GlTFAsset-9c68f862.js +20 -0
- package/dist/viewport-client/_static/IconPlayerPlayFilled-b058c98f.js +6 -0
- package/dist/viewport-client/_static/IconPointFilled-a304fd34.js +6 -0
- package/dist/viewport-client/_static/InstanceEditorAsset-a70e73fe.js +1 -0
- package/dist/viewport-client/_static/LightBaseComponent-fbc3ae49.js +1 -0
- package/dist/viewport-client/_static/LottieAnimationComponent-1c3e02a5.js +1 -0
- package/dist/viewport-client/_static/LottieAsset-377c1419.js +1 -0
- package/dist/viewport-client/_static/MarkdownAsset-7ea387a9.js +1 -0
- package/dist/viewport-client/_static/MaterialAsset-74a15124.js +1 -0
- package/dist/viewport-client/_static/MaterialInspector-aec1248b.js +1 -0
- package/dist/viewport-client/_static/Menu-cd3be298.js +17 -0
- package/dist/viewport-client/_static/MeshAsset-73e2cc8e.js +1 -0
- package/dist/viewport-client/_static/MeshRendererBaseComponent-3a0e09ed.js +1 -0
- package/dist/viewport-client/_static/MeshRendererComponent-5385d30f.js +1 -0
- package/dist/viewport-client/_static/MeshThumbnail-49273f71.js +1 -0
- package/dist/viewport-client/_static/ParticleRendererComponent-5a7b57d9.js +21 -0
- package/dist/viewport-client/_static/PhysicsMaterialAsset-a5ac9f82.js +1 -0
- package/dist/viewport-client/_static/PhysicsStore-0729e76d.js +1 -0
- package/dist/viewport-client/_static/PointLight-0e1d1546.js +1 -0
- package/dist/viewport-client/_static/PostProcessComponent-8276d33c.js +1 -0
- package/dist/viewport-client/_static/PrefabAsset-1a7edfbd.js +1 -0
- package/dist/viewport-client/_static/PrimitiveMesh-3ce6fa2f.js +1 -0
- package/dist/viewport-client/_static/ProxyConfigs-4de3304c.js +1 -0
- package/dist/viewport-client/_static/ReferencedMaterial-a87818f3.js +1 -0
- package/dist/viewport-client/_static/RenderTargetAsset-33c0d9e7.js +1 -0
- package/dist/viewport-client/_static/SceneAsset-8917c210.js +1 -0
- package/dist/viewport-client/_static/ShaderAsset-cb3ff628.js +185 -0
- package/dist/viewport-client/_static/ShaderChunkAsset-83f923f4.js +5 -0
- package/dist/viewport-client/_static/ShaderUIScriptAsset-d13fa4e2.js +516 -0
- package/dist/viewport-client/_static/SkinnedMeshRendererComponent-2a8323bf.js +1 -0
- package/dist/viewport-client/_static/SpineAnimationComponent-e733d50f.js +1 -0
- package/dist/viewport-client/_static/SpineSkeletonDataAsset-b64a3ee3.js +1 -0
- package/dist/viewport-client/_static/SpotLight-ca6c0c3b.js +1 -0
- package/dist/viewport-client/_static/SpriteAsset-9a31ec24.js +1 -0
- package/dist/viewport-client/_static/SpriteAtlasAsset-a862db46.js +1 -0
- package/dist/viewport-client/_static/SpriteBaseComponent-f6f1731f.js +1 -0
- package/dist/viewport-client/_static/SpriteMaskComponent-778be04f.js +1 -0
- package/dist/viewport-client/_static/SpriteRendererComponent-2b4d153b.js +1 -0
- package/dist/viewport-client/_static/TaskQueue-05c94a4d.js +1 -0
- package/dist/viewport-client/_static/TextBaseComponent-69233798.js +11 -0
- package/dist/viewport-client/_static/TextRendererComponent-130b4e99.js +1 -0
- package/dist/viewport-client/_static/TextureAsset-28fedf2a.js +36 -0
- package/dist/viewport-client/_static/ThumbnailMixin-35997457.js +1 -0
- package/dist/viewport-client/_static/ThumbnailRegistry-495c18c9.js +1 -0
- package/dist/viewport-client/_static/Tooltip-33f770ba.js +1 -0
- package/dist/viewport-client/_static/TrailRendererComponent-148550b5.js +1 -0
- package/dist/viewport-client/_static/TransformBaseComponent-02318c5a.js +1 -0
- package/dist/viewport-client/_static/TransformComponent-96106065.js +1 -0
- package/dist/viewport-client/_static/ViewerManager-202b570a.js +1 -0
- package/dist/viewport-client/_static/XRReferenceImageAsset-6a6adb3b.js +1 -0
- package/dist/viewport-client/_static/assetEditorActions-c4e5962f.js +1 -0
- package/dist/viewport-client/_static/audio-244358e2.js +1 -0
- package/dist/viewport-client/_static/bundlers-9b0d37fc.js +1 -0
- package/dist/viewport-client/_static/createOnModelChange-b57a0da8.js +1 -0
- package/dist/viewport-client/_static/encode-ac4bb64e.js +1 -0
- package/dist/viewport-client/_static/enum-58295f88.js +1 -0
- package/dist/viewport-client/_static/glTFIO-45ff9a17.js +1 -0
- package/dist/viewport-client/_static/index-0a8702e2.js +11217 -0
- package/dist/viewport-client/_static/index-237c84cd.js +20 -0
- package/dist/viewport-client/_static/index-37c74ae9.js +26 -0
- package/dist/viewport-client/_static/index-4cca0201.js +1 -0
- package/dist/viewport-client/_static/index-59732f86.js +1 -0
- package/dist/viewport-client/_static/index-6c8198f6.js +2 -0
- package/dist/viewport-client/_static/index-6f827618.js +1 -0
- package/dist/viewport-client/_static/index-803ca489.js +1 -0
- package/dist/viewport-client/_static/index-85a6cf6a.js +1 -0
- package/dist/viewport-client/_static/index-98982ce2.js +1 -0
- package/dist/viewport-client/_static/index-b3d51f87.js +1 -0
- package/dist/viewport-client/_static/index-be6bc38a.js +177 -0
- package/dist/viewport-client/_static/index-c403cbcd.js +1 -0
- package/dist/viewport-client/_static/index-e46ec5b1.js +16 -0
- package/dist/viewport-client/_static/index-e73966ae.js +1 -0
- package/dist/viewport-client/_static/index-e95b4498.js +1 -0
- package/dist/viewport-client/_static/index-f5a67a46.js +1 -0
- package/dist/viewport-client/_static/ktx-parse.modern-6c9f771f.js +1 -0
- package/dist/viewport-client/_static/ktx2-encoder-1e63c1eb.js +1 -0
- package/dist/viewport-client/_static/ktx2-worker-a04f41ea.js +1 -0
- package/dist/viewport-client/_static/meshopt_simplifier.module-cd99529d.js +1 -0
- package/dist/viewport-client/_static/module-107b7430.js +56 -0
- package/dist/viewport-client/_static/module-5c85b07e.js +1 -0
- package/dist/viewport-client/_static/module-6406b050.js +1 -0
- package/dist/viewport-client/_static/postmen-45d4c238.js +1 -0
- package/dist/viewport-client/_static/scriptPropertyActions-d3a583d2.js +1 -0
- package/dist/viewport-client/_static/utilities-e09052e3.js +11 -0
- package/dist/viewport-client/index.html +20 -0
- package/package.json +2 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var Se=Object.defineProperty;var Te=(n,e,t)=>e in n?Se(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var u=(n,e,t)=>(Te(n,typeof e!="symbol"?e+"":e,t),t);import{aT as z,aU as N,aD as p,cC as K,e4 as $,aJ as B,bz as Q,n as J,eH as xe,bT as Ae,b8 as Re,cK as L,E as O,eL as we,eM as Me,eN as Ie,p as y,C as R,s as b,e as A,eI as E,f as Pe,eO as f,eP as _,eQ as te,aH as ze,b5 as de,t as ue,b6 as he,eR as je,J as se,eS as Le,u as Ee,K as Oe,eT as S,eU as P,ep as q,eV as X,ay as fe,H as Be,bq as Fe,d1 as De,d2 as Ue,d4 as qe,d3 as ke,d0 as Ve,d5 as Ne}from"./index-0a8702e2.js";import"./InstanceEditorAsset-a70e73fe.js";import"./ThumbnailMixin-35997457.js";import"./AssetPreviewer-24e31d97.js";import"./CanvasRenderer-9dd98cb3.js";import"./postmen-45d4c238.js";import{c as W}from"./Component-f923abb1.js";import{F as We}from"./FormItemArray-66be8701.js";import{S as $e}from"./SpriteBaseComponent-f6f1731f.js";import{T as He}from"./TextBaseComponent-69233798.js";import{T as I}from"./TransformBaseComponent-02318c5a.js";import{S as Ge}from"./Callout-cb4a55ff.js";import"./ThumbnailRegistry-495c18c9.js";import"./IconPlayerPlayFilled-b058c98f.js";import"./Accordion-4897319b.js";const Ke=z(({item:n,onPropsChange:e})=>{const{t}=N(),i=n.props;return p.jsxs(p.Fragment,{children:[p.jsx(K,{label:t("ui.transition.color.normal.label"),value:i.normal,onChange:a=>{e(r=>{r.normal=a})}}),p.jsx(K,{label:t("ui.transition.color.hover.label"),value:i.hover,onChange:a=>{e(r=>{r.hover=a})}}),p.jsx(K,{label:t("ui.transition.color.pressed.label"),value:i.pressed,onChange:a=>{e(r=>{r.pressed=a})}}),p.jsx(K,{label:t("ui.transition.color.disabled.label"),value:i.disabled,onChange:a=>{e(r=>{r.disabled=a})}})]})});function Qe(n,e){const t=n.props;e.normal.copyFrom(t.normal),e.hover.copyFrom(t.hover),e.pressed.copyFrom(t.pressed),e.disabled.copyFrom(t.disabled)}const Je=z(({item:n,onPropsChange:e})=>{const{t}=N(),i=n.props;return p.jsxs(p.Fragment,{children:[p.jsx($,{label:t("ui.transition.scale.normal.label"),value:i.normal,min:.5,max:2,step:.05,onChange:a=>{e(r=>{r.normal=a})}}),p.jsx($,{label:t("ui.transition.scale.hover.label"),value:i.hover,min:.5,max:2,step:.05,onChange:a=>{e(r=>{r.hover=a})}}),p.jsx($,{label:t("ui.transition.scale.pressed.label"),value:i.pressed,min:.5,max:2,step:.05,onChange:a=>{e(r=>{r.pressed=a})}}),p.jsx($,{label:t("ui.transition.scale.disabled.label"),value:i.disabled,min:.5,max:2,step:.05,onChange:a=>{e(r=>{r.disabled=a})}})]})});function Xe(n,e){const t=n.props;e.normal=t.normal,e.hover=t.hover,e.pressed=t.pressed,e.disabled=t.disabled}const re=new WeakMap;function Ye(n){const e=(re.get(n)??0)+1;return re.set(n,e),e}function ae(n,e){return re.get(n)===e}function Y(n,e,t,i,a){if(!i){if(!ae(e,t))return;a(null);return}n.getAssetByRef(i).then(r=>{ae(e,t)&&a((r==null?void 0:r.engineObject)??null)}).catch(r=>{ae(e,t)&&(console.warn("[SpriteTransitionOption] syncSpriteTransition failed:",r),a(null))})}function Ze(n,e,t){const{normal:i,hover:a,pressed:r,disabled:o}=e.props,l=Ye(t);Y(n.assetStore,t,l,i,c=>{t.normal=c}),Y(n.assetStore,t,l,a,c=>{t.hover=c}),Y(n.assetStore,t,l,r,c=>{t.pressed=c}),Y(n.assetStore,t,l,o,c=>{t.disabled=c})}function Z(n,e,t){if(!e)return t(null),()=>{};let i=!1;return n.getAssetByRef(e).then(a=>{i||t(a??null)}).catch(()=>{i||t(null)}),()=>{i=!0}}const et=z(({item:n,model:e,onPropsChange:t})=>{const[i,a]=B.useState(null),[r,o]=B.useState(null),[l,c]=B.useState(null),[g,m]=B.useState(null),{normal:s,hover:d,pressed:h,disabled:T}=n.props,{assetStore:C}=e.root,G=Object.values(C.assets).filter(v=>v.getMetaConfig().type==="sprite");return B.useEffect(()=>Z(C,s,a),[C,s]),B.useEffect(()=>Z(C,d,o),[C,d]),B.useEffect(()=>Z(C,h,c),[C,h]),B.useEffect(()=>Z(C,T,m),[C,T]),p.jsxs(p.Fragment,{children:[p.jsx(Q,{label:"Normal Sprite",dropLayer:J.Sprite,asset:i,value:i==null?void 0:i.name,assets:G,onSelect:v=>{t(U=>{U.normal=(v==null?void 0:v.getCurrentRef())??null})},onDelete:()=>{t(v=>{v.normal=null})},onLocate:()=>{s!=null&&s.refId&&C.selectAsset(s.refId)}}),p.jsx(Q,{label:"Hover Sprite",dropLayer:J.Sprite,asset:r,value:r==null?void 0:r.name,assets:G,onSelect:v=>{t(U=>{U.hover=(v==null?void 0:v.getCurrentRef())??null})},onDelete:()=>{t(v=>{v.hover=null})},onLocate:()=>{d!=null&&d.refId&&C.selectAsset(d.refId)}}),p.jsx(Q,{label:"Pressed Sprite",dropLayer:J.Sprite,asset:l,value:l==null?void 0:l.name,assets:G,onSelect:v=>{t(U=>{U.pressed=(v==null?void 0:v.getCurrentRef())??null})},onDelete:()=>{t(v=>{v.pressed=null})},onLocate:()=>{h!=null&&h.refId&&C.selectAsset(h.refId)}}),p.jsx(Q,{label:"Disabled Sprite",dropLayer:J.Sprite,asset:g,value:g==null?void 0:g.name,assets:G,onSelect:v=>{t(U=>{U.disabled=(v==null?void 0:v.getCurrentRef())??null})},onDelete:()=>{t(v=>{v.disabled=null})},onLocate:()=>{T!=null&&T.refId&&C.selectAsset(T.refId)}})]})});function tt(n,e,t){Ze(n,e,t)}function nt(n,e,t){if(!t)return null;const i=n.entities.get(t);if(!i)return null;for(let a=0,r=e.length;a<r;a++){const o=i.getComponentByTypeName(e[a]);if(o)return{ownerId:t,componentId:o.id}}return null}function it(n,e){n.selectEntity((e==null?void 0:e.ownerId)??null)}function at(n,e){const t=(e==null?void 0:e.ownerId)??null;return{entityId:t,entity:t?n.entities.get(t)??null:null}}const ye=z(n=>{const{inspectorConfig:{property:e,label:t,disabled:i,info:a,componentTypes:r},model:o,onModelChange:l}=n,c=o.root.sceneStore,g=c.rootEntity.children,m=c.entities,{entityId:s,entity:d}=at(c,o[e]??null),{t:h}=N();function T(C){l==null||l(e,nt(c,r,C))}return p.jsx(xe,{info:a,entities:g,entityMap:Ae(m),label:t,value:s,disabled:i,displayValue:d==null?void 0:d.name,placeholder:h("Select component..."),onSelect:T,onLocate:()=>{it(c,o[e]??null)},onDelete:()=>{T(null)}})}),oe={SpriteTransition:{class:"SpriteTransition",props:{target:null,normal:null,hover:null,pressed:null,disabled:null,duration:0}},ColorTransition:{class:"ColorTransition",props:{target:null,normal:{r:1,g:1,b:1,a:1},hover:{r:1,g:1,b:1,a:1},pressed:{r:1,g:1,b:1,a:1},disabled:{r:1,g:1,b:1,a:1},duration:0}},ScaleTransition:{class:"ScaleTransition",props:{target:null,normal:1,hover:1,pressed:1.2,disabled:1,duration:.1}}},rt=z(({item:n,index:e,model:t,onModelChange:i})=>{var g;const{t:a}=N();let r,o;switch(n.class){case"SpriteTransition":r=et,o=["Image"];break;case"ColorTransition":r=Ke,o=["Image","Text"];break;case"ScaleTransition":r=Je,o=["Image","Text"];break}const l=m=>{const s=L(t.transitions);m(s),i==null||i("transitions",s)},c=m=>{l(s=>{const d=s[e];d&&m(d)})};return p.jsxs(p.Fragment,{children:[p.jsx(ye,{inspectorConfig:{label:a("ui.transition.target.label"),info:a("ui.transition.target.info"),property:"target",componentTypes:o,value:((g=n.props.target)==null?void 0:g.ownerId)??null},model:n.props,onModelChange:(m,s)=>{c(d=>{d.props.target=s})}}),p.jsx(Re,{label:a("ui.transition.type.label"),info:a("ui.transition.type.info"),value:n.class,options:[{label:a("ui.transition.type.sprite"),value:"SpriteTransition"},{label:a("ui.transition.type.scale"),value:"ScaleTransition"},{label:a("ui.transition.type.color"),value:"ColorTransition"}],onChange:m=>{oe[m].class!==n.class&&c(d=>{const h=oe[m],T=d.props.target;d.class=h.class,d.props={...d.props,duration:h.props.duration,normal:L(h.props.normal),hover:L(h.props.hover),pressed:L(h.props.pressed),disabled:L(h.props.disabled),target:T}})}}),p.jsx(r,{item:n,model:t,onPropsChange:m=>{c(s=>{m(s.props)})}}),p.jsx($,{label:a("ui.transition.duration.label"),info:a("ui.transition.duration.info"),value:n.props.duration,min:0,max:2,step:.05,onChange:m=>{c(s=>{s.props.duration=m})}})]})}),ot=z(({model:n,inspectorConfig:e,onModelChange:t})=>{const{label:i}=e,{t:a}=N(),r=n.transitions,o=l=>{const c=L(r);l(c),t==null||t("transitions",c)};return p.jsx(We,{label:i,items:r.map((l,c)=>{const g={SpriteTransition:a("ui.transition.type.sprite"),ColorTransition:a("ui.transition.type.color"),ScaleTransition:a("ui.transition.type.scale")};return{removable:!0,children:p.jsx(rt,{item:l,index:c,model:n,onModelChange:t}),id:c+"",name:g[l.class]||l.class}}),addable:!0,onAdd:()=>{o(l=>{var m;const c=L(oe.SpriteTransition),g=(m=l[0])==null?void 0:m.props.target;c.props.target=g?L(g):null,l.push(c)})},onDelete:l=>{o(c=>{c.splice(parseInt(l.id),1)})}})});var st=Object.defineProperty,lt=Object.getOwnPropertyDescriptor,le=(n,e,t,i)=>{for(var a=i>1?void 0:i?lt(e,t):e,r=n.length-1,o;r>=0;r--)(o=n[r])&&(a=(i?o(e,t,a):o(a))||a);return i&&a&&st(e,t,a),a};let ee=class extends O{constructor(e,t){super(e,t);u(this,"_transitionMap",new Map);u(this,"interactive",!0);u(this,"transitions",[])}syncTransitionsFromModel(){const e=this.transitions,t=this._transitionMap;for(const[i,a]of Array.from(t.entries()))e.includes(i)||(a&&this.engineObject.removeTransition(a),t.delete(i));for(let i=0,a=e.length;i<a;i++)this.addTransition(e[i])}_onInitComplete(){const e=this.transitions;for(let t=0,i=e.length;t<i;t++)this.addTransition(e[t])}addTransition(e){var m;const t=e==null?void 0:e.class;if(!(t==="SpriteTransition"||t==="ColorTransition"||t==="ScaleTransition")){console.warn(`[ButtonComponent] Unsupported transition.class: ${t}`);return}const a=this.transitions;let r=a.indexOf(e);if(r===-1)r=a.push(e)-1;else{const s=this._transitionMap.get(a[r]);s&&(this.engineObject.removeTransition(s),this._transitionMap.delete(e))}const o=this._transitionMap;let l;const c=this.engineObject;switch(t){case"SpriteTransition":l=new Ie,tt(this.root,e,l);break;case"ColorTransition":l=new Me,Qe(e,l);break;case"ScaleTransition":l=new we,Xe(e,l);break}const g=e.props.target;if(g){const s=(m=this.root.sceneStore.entities.get(g.ownerId))==null?void 0:m.getComponentById(g.componentId);s==null||s.onReady().then(()=>{(s==null?void 0:s.status)==="ready"&&(l.target=s==null?void 0:s.engineObject)})}c.addTransition(l),o.set(a[r],l)}getTransition(e){return this._transitionMap.get(e)}};le([y({label:"ui.button.interactive.label",info:"ui.button.interactive.info",type:R.Toggle,onChange(n,e,t){const i=n.engineObject;i.interactive=t;const a=i._getInteractiveState(),r=i.transitions;for(let o=0,l=r.length;o<l;o++)r[o]._setState(a,!0)}}),b()],ee.prototype,"interactive",2);le([b({type:"methods",key:"addTransition",onSerialize:n=>n.map(e=>[{class:e.class,props:L(e.props)}]),onDeserialize:n=>n.map(e=>e[0])}),y({label:A("ui.button.transitions.label"),info:A("ui.button.transitions.info"),customComponent:ot,triggerAfterInit:!1,onChange(n){n.syncTransitionsFromModel();const e=n.engineObject,t=e._getInteractiveState(),i=e.transitions;for(let a=0,r=i.length;a<r;a++)i[a]._setState(t,!0)}}),b()],ee.prototype,"transitions",2);ee=le([W({type:"Button",componentsMenu:{group:"UI",label:"component.ui-button.title"},dependentComponent:{type:"UITransform",dependentMode:E.AutoAdd},mutuallyComponent:{type:"Transform",dependentMode:E.AutoDel}})],ee);var be=Object.defineProperty,ct=Object.getOwnPropertyDescriptor,pt=(n,e,t)=>e in n?be(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,ne=(n,e,t,i)=>{for(var a=i>1?void 0:i?ct(e,t):e,r=n.length-1,o;r>=0;r--)(o=n[r])&&(a=(i?o(e,t,a):o(a))||a);return i&&a&&be(e,t,a),a},dt=(n,e,t)=>(pt(n,typeof e!="symbol"?e+"":e,t),t);let F=class extends $e{constructor(e,t){super(e,t);u(this,"raycastEnabled",!0);u(this,"raycastPadding",{x:0,y:0,z:0,w:0});u(this,"material",{refId:F._internalImageMaterialRefId});this.formSchema.addGroup("ui.image.raycast.title",["raycastEnabled","raycastPadding"])}_onInitComplete(){this.raycastEnabled=!1,this.applyBoundPathChange("raycastEnabled",R.Toggle,!1)}};dt(F,"_internalImageMaterialRefId","0000204");ne([y({label:"ui.image.raycast.enabled.label",info:"ui.image.raycast.enabled.info",type:R.Toggle,bindPath:"raycastEnabled"}),b()],F.prototype,"raycastEnabled",2);ne([y({label:"ui.image.raycast.padding.label",info:"ui.image.raycast.padding.info",type:R.Vector4,slotMapping:{x:A("ui.image.raycast.padding.left"),y:A("ui.image.raycast.padding.down"),z:A("ui.image.raycast.padding.right"),w:A("ui.image.raycast.padding.up")}}),b()],F.prototype,"raycastPadding",2);ne([y({label:"ui.image.material.label",info:"ui.image.material.info",type:R.AssetPicker,assetType:"Material",customFilter:n=>{var e;return((e=n.engineObject.shader)==null?void 0:e.name)!=="particle-shader"},onChange:async n=>{const{material:e}=n,t=n.engineObject;if(!e){t.setMaterial(null);return}const{refId:i}=e;if(i===F._internalImageMaterialRefId)t.setMaterial(t.engine._getUIDefaultMaterial());else{const a=await n.root.assetStore.getAssetByRef(e);a?t.setMaterial(a.engineObject):console.error(`Material asset not found: ${e.refId}`)}}}),Pe({engineKey:"setMaterial",getEngineValue:n=>n.getMaterial()}),b({type:"methods",key:"setMaterial",onSerialize:n=>n?[[n]]:void 0,onDeserialize(n){return n?n[0][0]:void 0}})],F.prototype,"material",2);F=ne([W({type:"Image",componentsMenu:{group:"UI",label:"component.ui-image.title"},dependentComponent:{type:"UITransform",dependentMode:E.AutoAdd},mutuallyComponent:{type:"Transform",dependentMode:E.AutoDel}})],F);var ut=Object.defineProperty,ht=Object.getOwnPropertyDescriptor,gt=(n,e,t,i)=>{for(var a=i>1?void 0:i?ht(e,t):e,r=n.length-1,o;r>=0;r--)(o=n[r])&&(a=(i?o(e,t,a):o(a))||a);return i&&a&&ut(e,t,a),a};let ge=class extends He{constructor(n,e){super(n,e)}};ge=gt([W({type:"Text",componentsMenu:{group:"UI",label:"component.ui-text.title"},dependentComponent:{type:"UITransform",dependentMode:E.AutoAdd},mutuallyComponent:{type:"Transform",dependentMode:E.AutoDel}})],ge);function ce(n,e,t){var o;const i=(o=n._getParentTransform())==null?void 0:o._rect;if(!i)return;const a=n._rect,r=n.position.x;switch(e){case f.Left:n.alignLeft=r-i.x+a.x,t.push("alignLeft");break;case f.Right:n.alignRight=i.x+i.width-a.x-a.width-r,t.push("alignRight");break;case f.Center:n.alignCenter=r-i.x-i.width*.5+a.x+a.width*.5,t.push("alignCenter");break;case f.LeftAndRight:n.alignLeft=r-i.x+a.x,n.alignRight=i.x+i.width-a.x-a.width-r,t.push("alignLeft","alignRight");break}}function pe(n,e,t){var o;const i=(o=n._getParentTransform())==null?void 0:o._rect;if(!i)return;const a=n._rect,r=n.position.y;switch(e){case _.Top:n.alignTop=i.y+i.height-a.y-a.height-r,t.push("alignTop");break;case _.Bottom:n.alignBottom=r-i.y+a.y,t.push("alignBottom");break;case _.Middle:n.alignMiddle=r-i.y-i.height*.5+a.y+a.height*.5,t.push("alignMiddle");break;case _.TopAndBottom:n.alignTop=i.y+i.height-a.y-a.height-r,n.alignBottom=r-i.y+a.y,t.push("alignTop","alignBottom");break}}function mt(n,e,t=n.horizontalAlignment,i=n.verticalAlignment){e.length=0;const a=n.engineObject;return a.horizontalAlignment=f.None,a.verticalAlignment=_.None,ce(a,t,e),pe(a,i,e),a.horizontalAlignment=t,a.verticalAlignment=i,e}const ft=te({position:"relative",width:"95%",height:"100%","border-radius":"5px",background:"#00000000",border:"1px solid #646c75",display:"flex","justify-content":"center","align-items":"center","flex-shrink":0})(),yt=te({position:"absolute",width:"calc(100% - 40px)",height:"calc(100% - 33px)",border:"1px solid #646c75","border-radius":"5px","pointer-events":"none"})(),bt=te({display:"grid",width:"100%",padding:"var(--space-0_5)","grid-template-columns":"minmax(0px, 1.3fr) repeat(3, minmax(0px, 1fr))","grid-template-rows":"auto","column-gap":"var(--space-1)",alignItems:"center"})(),vt=te({display:"grid",columnGap:"$1","align-items":"flex-start","grid-column":"2 / -1","column-gap":"var(--space-1)","row-gap":"var(--space-1)"})(),me=ze("div",{display:"grid",gap:"var(--space-1)",variants:{column:{1:{gridTemplateColumns:"1fr"},2:{gridTemplateColumns:"repeat(2, 1fr)"},3:{gridTemplateColumns:"repeat(3, 1fr)"}}}}),_t=[],D=z(()=>null),Ct=z(({model:n,onModelChange:e})=>{const t=n.engineObject,i=(s,d)=>{const h=mt(n,_t,s,d);for(let T=0;T<h.length;T++){const C=h[T];n._syncTransformToEditor(C,t[C]),e==null||e(C,n[C])}},a=s=>d=>{e==null||e(s,d)},r=s=>{switch(s){case f.None:return 1;case f.Left:case f.Right:case f.Center:return 2;case f.LeftAndRight:return 3;default:return 1}},o=(s,d="")=>p.jsx(je,{startSlot:d,value:n[s],onValueChange:a(s)},s),l=s=>{const d=n.horizontalAlignment;let h=d;d&s?h=d&~s:d===f.Center||s===f.Center?h=s:h=d|s,e==null||e("horizontalAlignment",h),i(h,n.verticalAlignment)},c=s=>{const d=n.verticalAlignment;let h=d;d&s?h=d&~s:d===_.Middle||s===_.Middle?h=s:h=d|s,e==null||e("verticalAlignment",h),i(n.horizontalAlignment,h)},g=s=>!!(n.horizontalAlignment&s),m=s=>!!(n.verticalAlignment&s);return p.jsxs("div",{className:bt,children:[p.jsxs("div",{className:ft,id:"ring",children:[p.jsx("div",{className:yt}),p.jsx(k,{...St,isActive:g(f.Left),onClick:()=>l(f.Left)}),p.jsx(k,{...Tt,isActive:g(f.Right),onClick:()=>l(f.Right)}),p.jsx(k,{...xt,isActive:g(f.Center),onClick:()=>l(f.Center)}),p.jsx(k,{...At,isActive:m(_.Top),onClick:()=>c(_.Top)}),p.jsx(k,{...Rt,isActive:m(_.Bottom),onClick:()=>c(_.Bottom)}),p.jsx(k,{...wt,isActive:m(_.Middle),onClick:()=>c(_.Middle)})]}),p.jsxs("div",{className:vt,children:[p.jsxs(me,{column:r(n.horizontalAlignment),children:[p.jsx(de,{startSlot:n.horizontalAlignment===f.None?"Horizontal":"",value:n.horizontalAlignment,onValueChange:s=>{e==null||e("horizontalAlignment",s),i(s,n.verticalAlignment)},children:ue(f).map(s=>p.jsx(he,{value:s.value,children:s.label},s.value))}),n.horizontalAlignment===f.Left&&o("alignLeft"),n.horizontalAlignment===f.Right&&o("alignRight"),n.horizontalAlignment===f.Center&&o("alignCenter"),n.horizontalAlignment===f.LeftAndRight&&p.jsxs(p.Fragment,{children:[o("alignLeft","Left"),o("alignRight","Right")]})]}),p.jsxs(me,{column:r(n.verticalAlignment),children:[p.jsx(de,{startSlot:n.verticalAlignment===_.None?"Vertical":"",value:n.verticalAlignment,onValueChange:s=>{e==null||e("verticalAlignment",s),i(n.horizontalAlignment,s)},children:ue(_).map(s=>p.jsx(he,{value:s.value,children:s.label},s.value))}),n.verticalAlignment===_.Top&&o("alignTop"),n.verticalAlignment===_.Bottom&&o("alignBottom"),n.verticalAlignment===_.Middle&&o("alignMiddle"),n.verticalAlignment===_.TopAndBottom&&p.jsxs(p.Fragment,{children:[o("alignTop","Top"),o("alignBottom","Bottom")]})]})]})]})}),St={left:2,top:"cal(50% - 12px)",width:16,height:25,lw:10,lh:1,activeLH:3,orientation:"h"},Tt={right:2,top:"cal(50% - 12px)",width:16,height:25,lw:10,lh:1,activeLH:3,orientation:"h"},xt={left:"cal(50% - 12px)",top:"cal(50% - 4px)",width:24,height:8,lw:14,lh:1,activeLH:3,orientation:"h"},At={left:"cal(50% - 12px)",top:2,width:25,height:12,lw:1,lh:10,activeLW:3,orientation:"v"},Rt={left:"cal(50% - 12px)",bottom:2,width:25,height:12,lw:1,lh:10,activeLW:3,orientation:"v"},wt={left:"cal(50% - 12px)",top:"cal(50% - 4px)",width:8,h:24,lw:1,lh:14,activeLW:3,orientation:"v"},k=z(function({isActive:e,onClick:t,...i}){return p.jsx("button",{onClick:t,style:{background:"transparent",padding:0,border:0,cursor:"pointer",display:"flex",position:"absolute",justifyContent:"center",alignItems:"center",...i},children:p.jsx("span",{style:{display:"block",background:e?"#1e88e5":"#a8acb3",borderRadius:e?"2px":"0px",width:i.orientation==="h"?i.lw:e&&i.activeLW||i.lw,height:i.orientation==="v"?i.lh:e&&i.activeLH||i.lh,transition:"all 0.15s ease"}})})});var ve=Object.defineProperty,Mt=Object.getOwnPropertyDescriptor,It=(n,e,t)=>e in n?ve(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,M=(n,e,t,i)=>{for(var a=i>1?void 0:i?Mt(e,t):e,r=n.length-1,o;r>=0;r--)(o=n[r])&&(a=(i?o(e,t,a):o(a))||a);return i&&a&&ve(e,t,a),a},Pt=(n,e,t)=>(It(n,typeof e!="symbol"?e+"":e,t),t);let x=class extends I{constructor(e,t){super(e,t);u(this,"_tempPropertiesForPosition",[]);u(this,"_tempPropertiesForSize",[]);u(this,"disabled",!1);u(this,"size",{x:100,y:100});u(this,"pivot",{x:.5,y:.5});u(this,"alignment",{});u(this,"horizontalAlignment",f.None);u(this,"verticalAlignment",_.None);u(this,"alignLeft",0);u(this,"alignCenter",0);u(this,"alignRight",0);u(this,"alignTop",0);u(this,"alignMiddle",0);u(this,"alignBottom",0);u(this,"syncEngineToEditor",se((e=!1)=>{const t=this.engineObject,{size:i,pivot:a,position:r,rotation:o,scale:l}=t;!e&&this._isLock?(r.copyFrom(this.position),o.copyFrom(this.rotation),l.copyFrom(this.scale),i.copyFrom(this.size),a.copyFrom(this.pivot),t.horizontalAlignment=this.horizontalAlignment,t.alignLeft=this.alignLeft,t.alignCenter=this.alignCenter,t.alignRight=this.alignRight,t.verticalAlignment=this.verticalAlignment,t.alignTop=this.alignTop,t.alignMiddle=this.alignMiddle,t.alignBottom=this.alignBottom):(this._syncTransformToEditor("position",r),this._syncTransformToEditor("rotation",o),this._syncTransformToEditor("scale",l),this._syncTransformToEditor("size",i),this._syncTransformToEditor("pivot",a),this._syncTransformToEditor("horizontalAlignment",t.horizontalAlignment),this._syncTransformToEditor("alignLeft",t.alignLeft),this._syncTransformToEditor("alignCenter",t.alignCenter),this._syncTransformToEditor("alignRight",t.alignRight),this._syncTransformToEditor("verticalAlignment",t.verticalAlignment),this._syncTransformToEditor("alignTop",t.alignTop),this._syncTransformToEditor("alignMiddle",t.alignMiddle),this._syncTransformToEditor("alignBottom",t.alignBottom))}));u(this,"_engineParentEntity");u(this,"_isLock",!1);u(this,"_lockWorldMatrix");this._onParentChange=this._onParentChange.bind(this),this._onParentTransformChange=this._onParentTransformChange.bind(this),this.formSchema.addGroup("ui.transform.relativeLayout",["alignment"],{when:i=>{var a,r;return!((r=(a=i.entityModel)==null?void 0:a.getComponentByTypeName("UICanvas"))!=null&&r.isRootCanvas())}})}static roundVector2(e,t){return t.x=I.roundToThreeDecimal(e.x),t.y=I.roundToThreeDecimal(e.y),t}static equalVector2(e,t){return e.x===t.x&&e.y===t.y}_updateEditorSize(){const e=this.engineObject,t=I.roundVector2(e.size,I._tempVector2);I.copyVector2(t,this.size)}_updateEditorPosition(){const e=this.engineObject,t=I.roundVector3(e.position,I._tempVector3);I.copyVector3(t,this.position)}onInitComplete(){var e;this._onTransformModify=this._onTransformModify.bind(this),(e=this.engineObject.entity)==null||e._updateFlagManager.addListener(this._onTransformModify)}_onTransformModify(e){this.engineObject;const t=512,i=1024;e&t&&this._updateEditorSize(),(e&t||e&i)&&(this.horizontalAlignment||this.verticalAlignment)&&this._updateEditorPosition()}syncRotation(e=!1){!e&&this._isLock?this.engineObject.rotation.copyFrom(this.rotation):this._syncTransformToEditor("rotation",this.engineObject.rotation)}syncTransformToEditor(e){this._isLock||(super.syncTransformToEditor(e),this._syncTransformToEditor("size",e.size),this._syncTransformToEditor("pivot",e.pivot),this._syncTransformToEditor("horizontalAlignment",e.horizontalAlignment),this._syncTransformToEditor("alignLeft",e.alignLeft),this._syncTransformToEditor("alignCenter",e.alignCenter),this._syncTransformToEditor("alignRight",e.alignRight),this._syncTransformToEditor("verticalAlignment",e.verticalAlignment),this._syncTransformToEditor("alignTop",e.alignTop),this._syncTransformToEditor("alignMiddle",e.alignMiddle),this._syncTransformToEditor("alignBottom",e.alignBottom))}destroy(e){var t,i;(i=(t=this.engineObject)==null?void 0:t.entity)==null||i._updateFlagManager.removeListener(this._onTransformModify),super.destroy(e)}checkCanDisable(){return{code:1,msg:"ui.transform.error.cant-disable"}}checkCanDeletable(){return{code:1,msg:"ui.transform.error.cant-delete"}}_onPositionChange(){const{horizontalAlignment:e,verticalAlignment:t}=this;if(e||t){const i=this.engineObject,a=this._tempPropertiesForPosition;a.length=0,i.horizontalAlignment=f.None,i.verticalAlignment=_.None,i.position.copyFrom(this.position),ce(i,e,a),pe(i,t,a),i.horizontalAlignment=e,i.verticalAlignment=t;for(let r=0;r<a.length;r++){const o=a[r];this._syncTransformToEditor(o,i[o])}}else this.engineObject.position.copyFrom(this.position)}_onParentChange(e){e&Le.Parent&&this._updateParent(this.engineObject.entity.parent)}_updateParent(e){const t=this._engineParentEntity;t!==e&&(t&&t._updateFlagManager.removeListener(this._onParentTransformChange),e&&e._updateFlagManager.addListener(this._onParentTransformChange),this._engineParentEntity=e,this._onParentTransformChange())}_onParentTransformChange(){this.engineObject.worldMatrix.copyFrom(this._lockWorldMatrix),this.syncEngineToEditor(!0)}lock(e){this._isLock=!0,this._lockWorldMatrix?this._lockWorldMatrix.copyFrom(e):this._lockWorldMatrix=e.clone();const t=this.engineObject.entity;t._registerModifyListener(this._onParentChange),this._updateParent(t.parent)}unlock(){var e;this._isLock=!1,this.engineObject.entity._unRegisterModifyListener(this._onParentChange),(e=this._engineParentEntity)==null||e._updateFlagManager.removeListener(this._onParentTransformChange)}onShow(){this.syncEngineToEditor(!0)}get ignoreToJSON(){return!0}getEditable(){return!this.disabled}onAddToEntity(e){for(let t=0;t<e.components.length;t++){const i=e.components[t];if((i.type==="Transform"||i.type==="UITransform")&&i!==this){e.removeComponent(i);break}}e.setComponentIndex(this,0)}getAnimatableProperties(){let e=[];const t=i=>{if(!(i!=null&&i.length))return e;i.filter(a=>a.property==="alignment"?!1:!a.when||a.when(this)).forEach(a=>{a.type==="Group"?t(a.children):e.push({property:a.property,label:a.label,type:a.type})})};return t(this.formSchema.items),e=e.concat(this._additionAnimatableProperties),e}_syncTransformToEditor(e,t){switch(e){case"horizontalAlignment":case"verticalAlignment":{this[e]!==t&&(this[e]=t,this.notifyPropertyChange(e,!1));break}case"alignLeft":case"alignCenter":case"alignRight":case"alignTop":case"alignMiddle":case"alignBottom":{const i=I.roundToThreeDecimal(t);this[e]!==i&&(this[e]=i,this.notifyPropertyChange(e,!1));break}case"size":case"pivot":{const i=this[e],a=x.roundVector2(t,x._tempVector2);x.equalVector2(a,i)||(i.x=a.x,i.y=a.y,this.notifyPropertyChange(e,!1));break}default:super._syncTransformToEditor(e,t);break}}};Pt(x,"_tempVector2",{x:0,y:0});M([Ee],x.prototype,"disabled",2);M([y({label:A("ui.transform.size.label"),info:A("ui.transform.size.info"),type:R.Vector2,slotMapping:{x:"W",y:"H"},onChange:(n,e,t)=>{const i=n.engineObject,a=n.size,{x:r,y:o}=i.size,{horizontalAlignment:l,verticalAlignment:c}=n,g=I.roundToThreeDecimal(r)!==a.x,m=I.roundToThreeDecimal(o)!==a.y;if(!(!g&&!m))if(l||c){const s=n._tempPropertiesForSize;s.length=0,s.push("position"),i.horizontalAlignment=f.None,i.verticalAlignment=_.None,i.size.copyFrom(a),ce(i,l,s),pe(i,c,s),i.horizontalAlignment=l,i.verticalAlignment=c;for(let d=0;d<s.length;d++){const h=s[d];n._syncTransformToEditor(h,i[h])}}else i.size.copyFrom(a)}}),b()],x.prototype,"size",2);M([y({label:A("ui.transform.pivot.label"),info:A("ui.transform.pivot.info"),type:R.Vector2,onChange:(n,e,t)=>{const i=n.pivot,a=n.engineObject;a.pivot.set(i.x,i.y),n._syncTransformToEditor("position",a.position)}}),b()],x.prototype,"pivot",2);M([y({customComponent:Ct,when:n=>{var e,t;return!((t=(e=n.entityModel)==null?void 0:e.getComponentByTypeName("UICanvas"))!=null&&t.isRootCanvas())}})],x.prototype,"alignment",2);M([y({label:A("ui.transform.horizontalAlignment.label"),customComponent:D,onChange:n=>{n.engineObject.horizontalAlignment=n.horizontalAlignment}}),b()],x.prototype,"horizontalAlignment",2);M([y({label:A("ui.transform.verticalAlignment.label"),customComponent:D,onChange:n=>{n.engineObject.verticalAlignment=n.verticalAlignment}}),b()],x.prototype,"verticalAlignment",2);M([y({label:A("ui.transform.alignLeft.label"),customComponent:D,onChange:n=>{n.engineObject.alignLeft=n.alignLeft,n._updateEditorPosition()}}),b()],x.prototype,"alignLeft",2);M([y({label:A("ui.transform.alignCenter.label"),customComponent:D,onChange:n=>{n.engineObject.alignCenter=n.alignCenter,n._updateEditorPosition()}}),b()],x.prototype,"alignCenter",2);M([y({label:A("ui.transform.alignRight.label"),customComponent:D,onChange:n=>{n.engineObject.alignRight=n.alignRight,n._updateEditorPosition()}}),b()],x.prototype,"alignRight",2);M([y({label:A("ui.transform.alignTop.label"),customComponent:D,onChange:n=>{n.engineObject.alignTop=n.alignTop,n._updateEditorPosition()}}),b()],x.prototype,"alignTop",2);M([y({label:A("ui.transform.alignMiddle.label"),customComponent:D,onChange:n=>{n.engineObject.alignMiddle=n.alignMiddle,n._updateEditorPosition()}}),b()],x.prototype,"alignMiddle",2);M([y({label:A("ui.transform.alignBottom.label"),customComponent:D,onChange:n=>{n.engineObject.alignBottom=n.alignBottom,n._updateEditorPosition()}}),b()],x.prototype,"alignBottom",2);M([se],x.prototype,"syncRotation",1);x=M([W({type:"UITransform",componentsMenu:{group:"UI",label:"component.ui-transform.title"},mutuallyComponent:{type:"Transform",dependentMode:E.AutoDel}})],x);const zt=z(({model:n,inspectorConfig:e})=>{const{t}=N(),i=n.enabled?t("ui.canvas.warning.not-root-canvas-reason-not-closest"):t("ui.canvas.warning.not-root-canvas-reason-disabled");return p.jsxs(Ge,{type:"warning",css:{width:"100%"},children:[t("ui.canvas.warning.not-root-canvas")," ",i]})});function V(n){n.run().then(e=>{n.isActive()&&(n.shouldApply&&!n.shouldApply(e)||n.apply(e))}).catch(()=>{})}function jt(n,e){var t;return e?((t=n.entities.get(e.ownerId))==null?void 0:t.getComponentById(e.componentId))??null:null}var _e=Object.defineProperty,Lt=Object.getOwnPropertyDescriptor,Et=(n,e,t)=>e in n?_e(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,j=(n,e,t,i)=>{for(var a=i>1?void 0:i?Lt(e,t):e,r=n.length-1,o;r>=0;r--)(o=n[r])&&(a=(i?o(e,t,a):o(a))||a);return i&&a&&_e(e,t,a),a},Ce=(n,e,t)=>(Et(n,typeof e!="symbol"?e+"":e,t),t);let w=class extends O{constructor(e,t){super(e,t);u(this,"_cameraListener");u(this,"_initReadySequence",0);u(this,"_cameraReadySequence",0);u(this,"_poseReadySequence",0);u(this,"_sizeReadySequence",0);u(this,"_canvasReadySequence",0);u(this,"debouncedRootCanvasCheck",Oe(this._triggerRootCanvasCheck.bind(this),500,{edges:["trailing"]}));u(this,"warning","");u(this,"renderMode",S.ScreenSpaceOverlay);u(this,"referenceResolution",{x:800,y:600});u(this,"referenceResolutionPerUnit",100);u(this,"renderCamera",null);u(this,"resolutionAdaptationMode",P.HeightAdaptation);u(this,"sortOrder",0);u(this,"distance",10);this._onCanvasSizeListener=this._onCanvasSizeListener.bind(this),this._triggerRootCanvasCheck=this._triggerRootCanvasCheck.bind(this),this._onCameraModifyListener=this._onCameraModifyListener.bind(this),this._onCameraTransformListener=this._onCameraTransformListener.bind(this),this.formSchema.addGroup("ui.canvas.adaptation",["referenceResolution","resolutionAdaptationMode","referenceResolutionPerUnit"],{collapsible:!1,when:i=>i.isRootCanvas()})}onInitComplete(){this.applyBoundPathChange("renderMode",R.Select,S.WorldSpace);const e=this._getTransformModel();if(!e)return;const t=++this._initReadySequence;V({run:async()=>(await e.onReady(),e),isActive:()=>this._isSequenceActive(t,this._initReadySequence),shouldApply:()=>{var i;return((i=this._getTransformModel())==null?void 0:i.status)==="ready"},apply:()=>{q.on("UICanvasEnabled",this.debouncedRootCanvasCheck),q.on("UICanvasDisable",this.debouncedRootCanvasCheck),this._engineObject.engine.canvas._sizeUpdateFlagManager.addListener(this._onCanvasSizeListener);const i=this.root.projectStore.currentScene;i&&(i.initComplete?this.debouncedRootCanvasCheck():V({run:async()=>(await i.onReady(),i),isActive:()=>this._isSequenceActive(t,this._initReadySequence),shouldApply:a=>a.status==="ready",apply:()=>{this.debouncedRootCanvasCheck()}}))}})}_isSequenceActive(e,t){return!this.destroyed&&e===t}_triggerRootCanvasCheck(){var e,t;this._enabled&&this.isRootCanvas()?(this._onRenderCameraDirty(),this._onRenderModeDirty()):(this._setCameraListener(null),(t=(e=this.entityModel)==null?void 0:e.transform)==null||t.unlock(),this._setTransformDisabled(!1))}_onRenderModeDirty(){var t,i;switch(this.renderMode){case S.ScreenSpaceCamera:case S.ScreenSpaceOverlay:this._adapterPoseInScreenSpace(),this._adapterSizeInScreenSpace(),this._setTransformDisabled(!0);break;case S.WorldSpace:(i=(t=this.entityModel)==null?void 0:t.transform)==null||i.unlock(),this._setTransformDisabled(!1);break}}_setCameraListener(e){if(e){const t=++this._cameraReadySequence;V({run:async()=>(await e.onReady(),e),isActive:()=>this._isSequenceActive(t,this._cameraReadySequence),shouldApply:i=>i.status==="ready",apply:i=>{const a=i.engineObject,r=this._cameraListener;r!==a&&(this._cameraListener=a,r&&(r.entity._updateFlagManager.removeListener(this._onCameraTransformListener),r._unRegisterModifyListener(this._onCameraModifyListener)),a&&(a.entity._updateFlagManager.addListener(this._onCameraTransformListener),a._registerModifyListener(this._onCameraModifyListener)))}})}else{this._cameraReadySequence++;const t=this._cameraListener;t&&(t.entity._updateFlagManager.removeListener(this._onCameraTransformListener),t._unRegisterModifyListener(this._onCameraModifyListener)),this._cameraListener=null}}_onRenderCameraDirty(){this._setCameraListener(this.renderMode===S.ScreenSpaceCamera?this._getCameraModel():null)}onEnabled(){super.onEnabled(),q.dispatch("UICanvasEnabled",this)}onDisabled(){super.onDisabled(),q.dispatch("UICanvasDisable",this)}isRootCanvas(){var e;return!!((e=this.engineObject)!=null&&e._isRootCanvas)}destroy(e){this._initReadySequence++,this._cameraReadySequence++,this._poseReadySequence++,this._sizeReadySequence++,this._canvasReadySequence++,q.off("UICanvasEnabled",this.debouncedRootCanvasCheck),q.off("UICanvasDisable",this.debouncedRootCanvasCheck),this._setCameraListener(null),this._engineObject.engine.canvas._sizeUpdateFlagManager.removeListener(this._onCanvasSizeListener),super.destroy(e)}_setTransformDisabled(e){var i;const t=(i=this.entityModel)==null?void 0:i.transform;t&&(t.disabled=e)}_onCameraModifyListener(e){switch(e){case X.ProjectionType:case X.AspectRatio:this._adapterSizeInScreenSpace();break;case X.FieldOfView:!this._cameraListener.isOrthographic&&this._adapterSizeInScreenSpace();break;case X.OrthographicSize:this._cameraListener.isOrthographic&&this._adapterSizeInScreenSpace();break}}_onCameraTransformListener(){this.renderMode===S.ScreenSpaceCamera&&this._adapterPoseInScreenSpace()}_adapterPoseInScreenSpace(){var a,r;const e=this.engineObject,t=e.entity.transform,i=this._getCameraModel();if(this.renderMode===S.ScreenSpaceCamera&&i){const o=++this._poseReadySequence;V({run:async()=>(await i.onReady(),i),isActive:()=>this._isSequenceActive(o,this._poseReadySequence),shouldApply:l=>l.status==="ready",apply:l=>{var g,m;const c=l.engineObject;if(!this._isSameEntityOrChildEntity(c.entity)){const{transform:s}=c.entity,{worldPosition:d,worldForward:h}=s,T=e.distance;t.setWorldPosition(d.x+h.x*T,d.y+h.y*T,d.z+h.z*T),t.worldRotationQuaternion.copyFrom(s.worldRotationQuaternion),(m=(g=this.entityModel)==null?void 0:g.transform)==null||m.lock(t.worldMatrix),this._syncPose()}}})}else{this._poseReadySequence++;const{canvas:o}=e.engine,l=o.height,c=o.width;t.setWorldPosition(c*.5,l*.5,0),t.worldRotationQuaternion.set(0,0,0,1),(r=(a=this.entityModel)==null?void 0:a.transform)==null||r.lock(t.worldMatrix),this._syncPose()}}_adapterSizeInScreenSpace(){let e,t;const i=this._getCameraModel();if(this.renderMode===S.ScreenSpaceCamera&&i){const a=++this._sizeReadySequence;V({run:async()=>(await i.onReady(),i),isActive:()=>this._isSequenceActive(a,this._sizeReadySequence),shouldApply:r=>r.status==="ready",apply:r=>{const o=r.engineObject;t=o.isOrthographic?o.orthographicSize*2:2*(Math.tan(Fe.degreeToRadian(o.fieldOfView*.5))*this.engineObject.distance),e=o.aspectRatio*t,this._applySize(e,t)}})}else{this._sizeReadySequence++;const{canvas:a}=this.engineObject.engine;this._applySize(a.width,a.height)}}_onCanvasSizeListener(){const e=++this._canvasReadySequence;V({run:async()=>(await this.onReady(),this),isActive:()=>this._isSequenceActive(e,this._canvasReadySequence),shouldApply:t=>t.status==="ready",apply:()=>{const t=this._getCameraModel(),i=this.renderMode;if(i===S.ScreenSpaceOverlay||i===S.ScreenSpaceCamera&&!t){const a=this.engineObject,{canvas:r}=a.engine;a.entity.transform.setWorldPosition(r.width*.5,r.height*.5,0),this._adapterSizeInScreenSpace()}}})}_applySize(e,t){const i=this.engineObject.entity.transform,{x:a,y:r}=this.referenceResolution;let o,l,c;switch(this.resolutionAdaptationMode){case P.WidthAdaptation:o=l=c=e/a;break;case P.HeightAdaptation:o=l=c=t/r;break;case P.BothAdaptation:o=e/a,l=t/r,c=(o+l)*.5;break;case P.ExpandAdaptation:o=l=c=Math.min(e/a,t/r);break;case P.ShrinkAdaptation:o=l=c=Math.max(e/a,t/r);break}const g=w._tempMat;fe.affineTransformation(w._tempVec3.set(o,l,c),i.worldRotationQuaternion,i.worldPosition,g),i.worldMatrix.copyFrom(g),i.size.set(e/o,t/l),this._syncPose()}_syncPose(){var t;const e=(t=this.entityModel)==null?void 0:t.transform;e&&e.syncEngineToEditor(!0)}_getTransformModel(){var e;return(e=this.entityModel)==null?void 0:e.transform}_getCameraModel(){return jt(this.root.sceneStore,this.renderCamera)}_isSameEntityOrChildEntity(e){const t=this.engineObject.entity;for(;e;){if(e===t)return!0;e=e.parent}return!1}};Ce(w,"_tempVec3",new Be);Ce(w,"_tempMat",new fe);j([y({label:"ui.canvas.warning.label",info:"ui.canvas.warning.info",customComponent:zt,when:n=>!n.isRootCanvas()})],w.prototype,"warning",2);j([y({label:"ui.canvas.render-mode.label",info:"ui.canvas.render-mode.info",type:R.Select,value:S.ScreenSpaceOverlay,when:n=>n.isRootCanvas(),triggerAfterInit:!1,options:[{label:"ui.canvas.render-mode.screen-space-overlay",value:S.ScreenSpaceOverlay},{label:"ui.canvas.render-mode.screen-space-camera",value:S.ScreenSpaceCamera},{label:"ui.canvas.render-mode.world-space",value:S.WorldSpace}],onChange(n,e,t){n._onRenderCameraDirty(),n._onRenderModeDirty()}}),b()],w.prototype,"renderMode",2);j([y({label:"ui.canvas.resolution.label",info:"ui.canvas.resolution.info",type:R.Vector2,slotMapping:{x:"W",y:"H"},triggerAfterInit:!1,when:n=>n.isRootCanvas()&&n.renderMode!==S.WorldSpace,onChange:(n,e,t)=>{n._adapterSizeInScreenSpace()}}),b()],w.prototype,"referenceResolution",2);j([y({label:"ui.canvas.resolution-per-unit.label",info:"ui.canvas.resolution-per-unit.info",type:R.Number,when:n=>n.isRootCanvas(),bindPath:"referenceResolutionPerUnit"}),b()],w.prototype,"referenceResolutionPerUnit",2);j([y({label:"ui.canvas.render-camera.label",info:"ui.canvas.render-camera.info",customComponent:ye,triggerAfterInit:!1,componentTypes:["Camera"],when:n=>n.isRootCanvas()&&n.renderMode===S.ScreenSpaceCamera,onChange:(n,e,t)=>{n._onRenderCameraDirty(),n._onRenderModeDirty()}}),b()],w.prototype,"renderCamera",2);j([y({label:"ui.canvas.adaptation-mode.label",info:"ui.canvas.adaptation-mode.info",type:R.Select,value:P.HeightAdaptation,triggerAfterInit:!1,when:n=>n.isRootCanvas()&&n.renderMode!==S.WorldSpace,options:[{label:"ui.canvas.adaptation-mode.width",value:P.WidthAdaptation},{label:"ui.canvas.adaptation-mode.height",value:P.HeightAdaptation},{label:"ui.canvas.adaptation-mode.both",value:P.BothAdaptation},{label:"ui.canvas.adaptation-mode.expand",value:P.ExpandAdaptation},{label:"ui.canvas.adaptation-mode.shrink",value:P.ShrinkAdaptation}],onChange(n,e,t){n._adapterSizeInScreenSpace()}}),b()],w.prototype,"resolutionAdaptationMode",2);j([y({label:"ui.canvas.sort-order.label",info:"ui.canvas.sort-order.info",type:R.Number,when:n=>n.isRootCanvas()&&n.renderMode===S.ScreenSpaceOverlay,bindPath:"sortOrder"}),b()],w.prototype,"sortOrder",2);j([y({label:"ui.canvas.distance.label",info:"ui.canvas.distance.info",type:R.Number,when:n=>n.isRootCanvas()&&n.renderMode===S.ScreenSpaceCamera,bindPath:"distance",triggerAfterInit:!1,onChange:(n,e,t)=>{n.renderCamera&&(n._adapterPoseInScreenSpace(),n._adapterSizeInScreenSpace())}}),b()],w.prototype,"distance",2);j([se],w.prototype,"_setTransformDisabled",1);w=j([W({type:"UICanvas",componentsMenu:{group:"UI",label:"component.ui-canvas.title"},dependentComponent:{type:"UITransform",dependentMode:E.AutoAdd},mutuallyComponent:{type:"Transform",dependentMode:E.AutoDel},unique:!0})],w);var Ot=Object.defineProperty,Bt=Object.getOwnPropertyDescriptor,ie=(n,e,t,i)=>{for(var a=i>1?void 0:i?Bt(e,t):e,r=n.length-1,o;r>=0;r--)(o=n[r])&&(a=(i?o(e,t,a):o(a))||a);return i&&a&&Ot(e,t,a),a};let H=class extends O{constructor(e,t){super(e,t);u(this,"alpha",1);u(this,"interactive",!0);u(this,"ignoreParentGroup",!1)}};ie([y({label:"ui.group.alpha.label",info:"ui.group.alpha.info",type:R.Slider,bindPath:"alpha",min:0,max:1,dragStep:.02}),b()],H.prototype,"alpha",2);ie([y({label:"ui.group.interactive.label",info:"ui.group.interactive.info",type:R.Toggle,bindPath:"interactive"}),b()],H.prototype,"interactive",2);ie([y({label:"ui.group.ignore-parent.label",info:"ui.group.ignore-parent.info",type:R.Toggle,bindPath:"ignoreParentGroup"}),b()],H.prototype,"ignoreParentGroup",2);H=ie([W({type:"UIGroup",componentsMenu:{group:"UI",label:"component.ui-group.title"},unique:!0})],H);O.registerCustomEngineComponent("UICanvas",De);O.registerCustomEngineComponent("UIGroup",Ue);O.registerCustomEngineComponent("Image",qe);O.registerCustomEngineComponent("Button",ke);O.registerCustomEngineComponent("UITransform",Ve);O.registerCustomEngineComponent("Text",Ne);export{ee as ButtonComponent,F as ImageComponent,ge as TextComponent,w as UICanvasComponent,H as UIGroupComponent,x as UITransformComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{aD as e,aE as m,aF as i,aG as l}from"./index-0a8702e2.js";function c(t){const{label:r,info:o,value:s,displayType:a="text"}=t;return e.jsxs(m,{...i(t),children:[a==="text"&&e.jsx(l,{size:"sm",selectable:!0,code:!0,children:s}),a==="image"&&e.jsx("img",{src:s,alt:r})]})}export{c as F};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{E as h,c as y,b as T,a as f,S as n}from"./ShaderAsset-cb3ff628.js";import{S as P}from"./ShaderUIScriptAsset-d13fa4e2.js";import"./index-0a8702e2.js";import"./InstanceEditorAsset-a70e73fe.js";import"./ThumbnailRegistry-495c18c9.js";import"./AssetPreviewer-24e31d97.js";import"./IconPlayerPlayFilled-b058c98f.js";import"./ProxyConfigs-4de3304c.js";import"./IconPointFilled-a304fd34.js";import"./index-98982ce2.js";import"./index-be6bc38a.js";export{h as EShaderPropertyType,y as ShaderAsset,T as ShaderPropertyEnumType,f as ShaderPropertyRangeType,n as ShaderTemplateConfigs,P as ShaderUIScript};
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import{aJ as c}from"./index-0a8702e2.js";let S={data:""},F=e=>{if(typeof window=="object"){let t=(e?e.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return t.nonce=window.__nonce__,t.parentNode||(e||document.head).appendChild(t),t.firstChild}return e||S},H=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,L=/\/\*[^]*?\*\/| +/g,D=/\n+/g,b=(e,t)=>{let a="",s="",o="";for(let r in e){let n=e[r];r[0]=="@"?r[1]=="i"?a=r+" "+n+";":s+=r[1]=="f"?b(n,r):r+"{"+b(n,r[1]=="k"?"":t)+"}":typeof n=="object"?s+=b(n,t?t.replace(/([^,])+/g,i=>r.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,l=>/&/.test(l)?l.replace(/&/g,i):i?i+" "+l:l)):r):n!=null&&(r=/^--/.test(r)?r:r.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=b.p?b.p(r,n):r+":"+n+";")}return a+(t&&o?t+"{"+o+"}":o)+s},y={},T=e=>{if(typeof e=="object"){let t="";for(let a in e)t+=a+T(e[a]);return t}return e},U=(e,t,a,s,o)=>{let r=T(e),n=y[r]||(y[r]=(l=>{let d=0,p=11;for(;d<l.length;)p=101*p+l.charCodeAt(d++)>>>0;return"go"+p})(r));if(!y[n]){let l=r!==e?e:(d=>{let p,f,m=[{}];for(;p=H.exec(d.replace(L,""));)p[4]?m.shift():p[3]?(f=p[3].replace(D," ").trim(),m.unshift(m[0][f]=m[0][f]||{})):m[0][p[1]]=p[2].replace(D," ").trim();return m[0]})(e);y[n]=b(o?{["@keyframes "+n]:l}:l,a?"":"."+n)}let i=a&&y.g?y.g:null;return a&&(y.g=y[n]),((l,d,p,f)=>{f?d.data=d.data.replace(f,l):d.data.indexOf(l)===-1&&(d.data=p?l+d.data:d.data+l)})(y[n],t,s,i),n},J=(e,t,a)=>e.reduce((s,o,r)=>{let n=t[r];if(n&&n.call){let i=n(a),l=i&&i.props&&i.props.className||/^go/.test(i)&&i;n=l?"."+l:i&&typeof i=="object"?i.props?"":b(i,""):i===!1?"":i}return s+o+(n??"")},"");function N(e){let t=this||{},a=e.call?e(t.p):e;return U(a.unshift?a.raw?J(a,[].slice.call(arguments,1),t.p):a.reduce((s,o)=>Object.assign(s,o&&o.call?o(t.p):o),{}):a,F(t.target),t.g,t.o,t.k)}let _,C,I;N.bind({g:1});let h=N.bind({k:1});function R(e,t,a,s){b.p=t,_=e,C=a,I=s}function x(e,t){let a=this||{};return function(){let s=arguments;function o(r,n){let i=Object.assign({},r),l=i.className||o.className;a.p=Object.assign({theme:C&&C()},i),a.o=/ *go\d+/.test(l),i.className=N.apply(a,s)+(l?" "+l:""),t&&(i.ref=n);let d=e;return e[0]&&(d=i.as||e,delete i.as),I&&d[0]&&I(i),_(d,i)}return t?t(o):o}}var Y=e=>typeof e=="function",j=(e,t)=>Y(e)?e(t):e,Z=(()=>{let e=0;return()=>(++e).toString()})(),M=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),q=20,$=new Map,B=1e3,P=e=>{if($.has(e))return;let t=setTimeout(()=>{$.delete(e),v({type:4,toastId:e})},B);$.set(e,t)},G=e=>{let t=$.get(e);t&&clearTimeout(t)},z=(e,t)=>{switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,q)};case 1:return t.toast.id&&G(t.toast.id),{...e,toasts:e.toasts.map(r=>r.id===t.toast.id?{...r,...t.toast}:r)};case 2:let{toast:a}=t;return e.toasts.find(r=>r.id===a.id)?z(e,{type:1,toast:a}):z(e,{type:0,toast:a});case 3:let{toastId:s}=t;return s?P(s):e.toasts.forEach(r=>{P(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===s||s===void 0?{...r,visible:!1}:r)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(r=>r.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let o=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(r=>({...r,pauseDuration:r.pauseDuration+o}))}}},k=[],O={toasts:[],pausedAt:void 0},v=e=>{O=z(O,e),k.forEach(t=>{t(O)})},Q={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},V=(e={})=>{let[t,a]=c.useState(O);c.useEffect(()=>(k.push(a),()=>{let o=k.indexOf(a);o>-1&&k.splice(o,1)}),[t]);let s=t.toasts.map(o=>{var r,n;return{...e,...e[o.type],...o,duration:o.duration||((r=e[o.type])==null?void 0:r.duration)||(e==null?void 0:e.duration)||Q[o.type],style:{...e.style,...(n=e[o.type])==null?void 0:n.style,...o.style}}});return{...t,toasts:s}},W=(e,t="blank",a)=>({createdAt:Date.now(),visible:!0,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...a,id:(a==null?void 0:a.id)||Z()}),w=e=>(t,a)=>{let s=W(t,e,a);return v({type:2,toast:s}),s.id},u=(e,t)=>w("blank")(e,t);u.error=w("error");u.success=w("success");u.loading=w("loading");u.custom=w("custom");u.dismiss=e=>{v({type:3,toastId:e})};u.remove=e=>v({type:4,toastId:e});u.promise=(e,t,a)=>{let s=u.loading(t.loading,{...a,...a==null?void 0:a.loading});return e.then(o=>(u.success(j(t.success,o),{id:s,...a,...a==null?void 0:a.success}),o)).catch(o=>{u.error(j(t.error,o),{id:s,...a,...a==null?void 0:a.error})}),e};var X=(e,t)=>{v({type:1,toast:{id:e,height:t}})},K=()=>{v({type:5,time:Date.now()})},ee=e=>{let{toasts:t,pausedAt:a}=V(e);c.useEffect(()=>{if(a)return;let r=Date.now(),n=t.map(i=>{if(i.duration===1/0)return;let l=(i.duration||0)+i.pauseDuration-(r-i.createdAt);if(l<0){i.visible&&u.dismiss(i.id);return}return setTimeout(()=>u.dismiss(i.id),l)});return()=>{n.forEach(i=>i&&clearTimeout(i))}},[t,a]);let s=c.useCallback(()=>{a&&v({type:6,time:Date.now()})},[a]),o=c.useCallback((r,n)=>{let{reverseOrder:i=!1,gutter:l=8,defaultPosition:d}=n||{},p=t.filter(g=>(g.position||d)===(r.position||d)&&g.height),f=p.findIndex(g=>g.id===r.id),m=p.filter((g,A)=>A<f&&g.visible).length;return p.filter(g=>g.visible).slice(...i?[m+1]:[0,m]).reduce((g,A)=>g+(A.height||0)+l,0)},[t]);return{toasts:t,handlers:{updateHeight:X,startPause:K,endPause:s,calculateOffset:o}}},te=h`
|
|
2
|
+
from {
|
|
3
|
+
transform: scale(0) rotate(45deg);
|
|
4
|
+
opacity: 0;
|
|
5
|
+
}
|
|
6
|
+
to {
|
|
7
|
+
transform: scale(1) rotate(45deg);
|
|
8
|
+
opacity: 1;
|
|
9
|
+
}`,ae=h`
|
|
10
|
+
from {
|
|
11
|
+
transform: scale(0);
|
|
12
|
+
opacity: 0;
|
|
13
|
+
}
|
|
14
|
+
to {
|
|
15
|
+
transform: scale(1);
|
|
16
|
+
opacity: 1;
|
|
17
|
+
}`,re=h`
|
|
18
|
+
from {
|
|
19
|
+
transform: scale(0) rotate(90deg);
|
|
20
|
+
opacity: 0;
|
|
21
|
+
}
|
|
22
|
+
to {
|
|
23
|
+
transform: scale(1) rotate(90deg);
|
|
24
|
+
opacity: 1;
|
|
25
|
+
}`,oe=x("div")`
|
|
26
|
+
width: 20px;
|
|
27
|
+
opacity: 0;
|
|
28
|
+
height: 20px;
|
|
29
|
+
border-radius: 10px;
|
|
30
|
+
background: ${e=>e.primary||"#ff4b4b"};
|
|
31
|
+
position: relative;
|
|
32
|
+
transform: rotate(45deg);
|
|
33
|
+
|
|
34
|
+
animation: ${te} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
|
|
35
|
+
forwards;
|
|
36
|
+
animation-delay: 100ms;
|
|
37
|
+
|
|
38
|
+
&:after,
|
|
39
|
+
&:before {
|
|
40
|
+
content: '';
|
|
41
|
+
animation: ${ae} 0.15s ease-out forwards;
|
|
42
|
+
animation-delay: 150ms;
|
|
43
|
+
position: absolute;
|
|
44
|
+
border-radius: 3px;
|
|
45
|
+
opacity: 0;
|
|
46
|
+
background: ${e=>e.secondary||"#fff"};
|
|
47
|
+
bottom: 9px;
|
|
48
|
+
left: 4px;
|
|
49
|
+
height: 2px;
|
|
50
|
+
width: 12px;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&:before {
|
|
54
|
+
animation: ${re} 0.15s ease-out forwards;
|
|
55
|
+
animation-delay: 180ms;
|
|
56
|
+
transform: rotate(90deg);
|
|
57
|
+
}
|
|
58
|
+
`,se=h`
|
|
59
|
+
from {
|
|
60
|
+
transform: rotate(0deg);
|
|
61
|
+
}
|
|
62
|
+
to {
|
|
63
|
+
transform: rotate(360deg);
|
|
64
|
+
}
|
|
65
|
+
`,ie=x("div")`
|
|
66
|
+
width: 12px;
|
|
67
|
+
height: 12px;
|
|
68
|
+
box-sizing: border-box;
|
|
69
|
+
border: 2px solid;
|
|
70
|
+
border-radius: 100%;
|
|
71
|
+
border-color: ${e=>e.secondary||"#e0e0e0"};
|
|
72
|
+
border-right-color: ${e=>e.primary||"#616161"};
|
|
73
|
+
animation: ${se} 1s linear infinite;
|
|
74
|
+
`,ne=h`
|
|
75
|
+
from {
|
|
76
|
+
transform: scale(0) rotate(45deg);
|
|
77
|
+
opacity: 0;
|
|
78
|
+
}
|
|
79
|
+
to {
|
|
80
|
+
transform: scale(1) rotate(45deg);
|
|
81
|
+
opacity: 1;
|
|
82
|
+
}`,le=h`
|
|
83
|
+
0% {
|
|
84
|
+
height: 0;
|
|
85
|
+
width: 0;
|
|
86
|
+
opacity: 0;
|
|
87
|
+
}
|
|
88
|
+
40% {
|
|
89
|
+
height: 0;
|
|
90
|
+
width: 6px;
|
|
91
|
+
opacity: 1;
|
|
92
|
+
}
|
|
93
|
+
100% {
|
|
94
|
+
opacity: 1;
|
|
95
|
+
height: 10px;
|
|
96
|
+
}`,de=x("div")`
|
|
97
|
+
width: 20px;
|
|
98
|
+
opacity: 0;
|
|
99
|
+
height: 20px;
|
|
100
|
+
border-radius: 10px;
|
|
101
|
+
background: ${e=>e.primary||"#61d345"};
|
|
102
|
+
position: relative;
|
|
103
|
+
transform: rotate(45deg);
|
|
104
|
+
|
|
105
|
+
animation: ${ne} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
|
|
106
|
+
forwards;
|
|
107
|
+
animation-delay: 100ms;
|
|
108
|
+
&:after {
|
|
109
|
+
content: '';
|
|
110
|
+
box-sizing: border-box;
|
|
111
|
+
animation: ${le} 0.2s ease-out forwards;
|
|
112
|
+
opacity: 0;
|
|
113
|
+
animation-delay: 200ms;
|
|
114
|
+
position: absolute;
|
|
115
|
+
border-right: 2px solid;
|
|
116
|
+
border-bottom: 2px solid;
|
|
117
|
+
border-color: ${e=>e.secondary||"#fff"};
|
|
118
|
+
bottom: 6px;
|
|
119
|
+
left: 6px;
|
|
120
|
+
height: 10px;
|
|
121
|
+
width: 6px;
|
|
122
|
+
}
|
|
123
|
+
`,ce=x("div")`
|
|
124
|
+
position: absolute;
|
|
125
|
+
`,pe=x("div")`
|
|
126
|
+
position: relative;
|
|
127
|
+
display: flex;
|
|
128
|
+
justify-content: center;
|
|
129
|
+
align-items: center;
|
|
130
|
+
min-width: 20px;
|
|
131
|
+
min-height: 20px;
|
|
132
|
+
`,ue=h`
|
|
133
|
+
from {
|
|
134
|
+
transform: scale(0.6);
|
|
135
|
+
opacity: 0.4;
|
|
136
|
+
}
|
|
137
|
+
to {
|
|
138
|
+
transform: scale(1);
|
|
139
|
+
opacity: 1;
|
|
140
|
+
}`,me=x("div")`
|
|
141
|
+
position: relative;
|
|
142
|
+
transform: scale(0.6);
|
|
143
|
+
opacity: 0.4;
|
|
144
|
+
min-width: 20px;
|
|
145
|
+
animation: ${ue} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
|
|
146
|
+
forwards;
|
|
147
|
+
`,fe=({toast:e})=>{let{icon:t,type:a,iconTheme:s}=e;return t!==void 0?typeof t=="string"?c.createElement(me,null,t):t:a==="blank"?null:c.createElement(pe,null,c.createElement(ie,{...s}),a!=="loading"&&c.createElement(ce,null,a==="error"?c.createElement(oe,{...s}):c.createElement(de,{...s})))},ge=e=>`
|
|
148
|
+
0% {transform: translate3d(0,${e*-200}%,0) scale(.6); opacity:.5;}
|
|
149
|
+
100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
|
|
150
|
+
`,ye=e=>`
|
|
151
|
+
0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}
|
|
152
|
+
100% {transform: translate3d(0,${e*-150}%,-1px) scale(.6); opacity:0;}
|
|
153
|
+
`,he="0%{opacity:0;} 100%{opacity:1;}",be="0%{opacity:1;} 100%{opacity:0;}",xe=x("div")`
|
|
154
|
+
display: flex;
|
|
155
|
+
align-items: center;
|
|
156
|
+
background: #fff;
|
|
157
|
+
color: #363636;
|
|
158
|
+
line-height: 1.3;
|
|
159
|
+
will-change: transform;
|
|
160
|
+
box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05);
|
|
161
|
+
max-width: 350px;
|
|
162
|
+
pointer-events: auto;
|
|
163
|
+
padding: 8px 10px;
|
|
164
|
+
border-radius: 8px;
|
|
165
|
+
`,ve=x("div")`
|
|
166
|
+
display: flex;
|
|
167
|
+
justify-content: center;
|
|
168
|
+
margin: 4px 10px;
|
|
169
|
+
color: inherit;
|
|
170
|
+
flex: 1 1 auto;
|
|
171
|
+
white-space: pre-line;
|
|
172
|
+
`,we=(e,t)=>{let a=e.includes("top")?1:-1,[s,o]=M()?[he,be]:[ge(a),ye(a)];return{animation:t?`${h(s)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${h(o)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},Ee=c.memo(({toast:e,position:t,style:a,children:s})=>{let o=e.height?we(e.position||t||"top-center",e.visible):{opacity:0},r=c.createElement(fe,{toast:e}),n=c.createElement(ve,{...e.ariaProps},j(e.message,e));return c.createElement(xe,{className:e.className,style:{...o,...a,...e.style}},typeof s=="function"?s({icon:r,message:n}):c.createElement(c.Fragment,null,r,n))});R(c.createElement);var $e=({id:e,className:t,style:a,onHeightUpdate:s,children:o})=>{let r=c.useCallback(n=>{if(n){let i=()=>{let l=n.getBoundingClientRect().height;s(e,l)};i(),new MutationObserver(i).observe(n,{subtree:!0,childList:!0,characterData:!0})}},[e,s]);return c.createElement("div",{ref:r,className:t,style:a},o)},ke=(e,t)=>{let a=e.includes("top"),s=a?{top:0}:{bottom:0},o=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:M()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(a?1:-1)}px)`,...s,...o}},Oe=N`
|
|
173
|
+
z-index: 9999;
|
|
174
|
+
> * {
|
|
175
|
+
pointer-events: auto;
|
|
176
|
+
}
|
|
177
|
+
`,E=16,Ne=({reverseOrder:e,position:t="top-center",toastOptions:a,gutter:s,children:o,containerStyle:r,containerClassName:n})=>{let{toasts:i,handlers:l}=ee(a);return c.createElement("div",{style:{position:"fixed",zIndex:9999,top:E,left:E,right:E,bottom:E,pointerEvents:"none",...r},className:n,onMouseEnter:l.startPause,onMouseLeave:l.endPause},i.map(d=>{let p=d.position||t,f=l.calculateOffset(d,{reverseOrder:e,gutter:s,defaultPosition:t}),m=ke(p,f);return c.createElement($e,{id:d.id,key:d.id,onHeightUpdate:l.updateHeight,className:d.visible?Oe:"",style:m},d.type==="custom"?j(d.message,d):o?o(d):c.createElement(Ee,{toast:d,position:p}))}))};export{Ne as I,u as n};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{P as a}from"./PostProcessComponent-8276d33c.js";import"./index-0a8702e2.js";import"./InstanceEditorAsset-a70e73fe.js";import"./ThumbnailRegistry-495c18c9.js";import"./AssetPreviewer-24e31d97.js";import"./IconPlayerPlayFilled-b058c98f.js";import"./Component-f923abb1.js";import"./Menu-cd3be298.js";import"./Accordion-4897319b.js";export{a as PostProcessComponent};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import{aC as Q,aD as e,aJ as d,bF as ce,bL as X,aH as m,e1 as he,aK as fe,aG as ue,eQ as Y,bx as E,fl as pe,bH as ge,bR as me,ei as xe,ek as ve,el as Ce,em as we,fm as be,eu as _,et as k,fn as ye,fo as $e}from"./index-0a8702e2.js";import{aM as $0,ev as j0,fW as R0,fp as S0,fP as I0,fr as k0,fq as M0,aI as P0,fs as L0,ct as T0,aV as V0,cn as E0,g3 as Z0,g4 as H0,fG as F0,fD as D0,fF as A0,fX as B0,fI as z0,fH as N0,eR as O0,fQ as _0,fE as U0,ew as G0,fJ as W0,fK as K0,fL as Q0,b5 as X0,b6 as Y0,by as q0,b4 as J0,b7 as e1,fM as t1,eZ as o1,fN as n1,fO as r1,fV as i1,fS as s1,fT as l1,fU as a1,fR as d1,g2 as c1,fx as h1,fu as f1,g0 as u1,cm as p1,fz as g1,fy as m1,fA as x1,f$ as v1,fZ as C1,fw as w1,bQ as b1,fC as y1,co as $1,g1 as j1,fY as R1,fB as S1,f_ as I1,fv as k1,ft as M1,g5 as P1}from"./index-0a8702e2.js";import{I as je}from"./Accordion-4897319b.js";import{A as T1,a as V1}from"./Accordion-4897319b.js";import{B as Z1}from"./index-37c74ae9.js";import{S as F1}from"./Callout-cb4a55ff.js";import{C as A1,D as B1,K as z1,d as N1,h as O1,j as _1,M as U1,i as G1,g as W1,e as K1,f as Q1,a as X1,b as Y1,c as q1,k as J1,S as eo}from"./Menu-cd3be298.js";import{T as oo}from"./Tooltip-33f770ba.js";import{I as Re}from"./index-be6bc38a.js";import{n as ro}from"./index-be6bc38a.js";import{O as Se,C as Ie,D as q,T as J,a as ke,b as Me,R as Pe,P as Le}from"./utilities-e09052e3.js";import{A as so,s as lo}from"./utilities-e09052e3.js";import"./IconPlayerPlayFilled-b058c98f.js";/**
|
|
2
|
+
* @license @tabler/icons-react v3.24.0 - MIT
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/var Te=Q("outline","chevron-left","IconChevronLeft",[["path",{d:"M15 6l-6 6l6 6",key:"svg-0"}]]);/**
|
|
7
|
+
* @license @tabler/icons-react v3.24.0 - MIT
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the MIT license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/var Ve=Q("outline","dots","IconDots",[["path",{d:"M5 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-0"}],["path",{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-1"}],["path",{d:"M19 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-2"}]]);const _t=t=>e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:t.size||100,height:t.size||100,viewBox:"0 0 446.39 458.52",version:"1.1",fill:"CurrentColor",...t,children:[e.jsx("defs",{children:e.jsx("clipPath",{id:"clip1",children:e.jsx("path",{d:"M 0 0 L 446.390625 0 L 446.390625 458.519531 L 0 458.519531 Z M 0 0 "})})}),e.jsxs("g",{id:"surface1",children:[e.jsx("path",{d:"M 328.820313 194.449219 C 328.820313 203.382813 321.578125 210.628906 312.644531 210.628906 C 303.710938 210.628906 296.464844 203.382813 296.464844 194.449219 C 296.464844 185.515625 303.710938 178.273438 312.644531 178.273438 C 321.578125 178.273438 328.820313 185.515625 328.820313 194.449219 "}),e.jsx("g",{clipPath:"url(#clip1)",clipRule:"nonzero",children:e.jsx("path",{d:"M 364.691406 171.390625 C 364.691406 129.925781 331.078125 96.3125 289.613281 96.3125 C 248.148438 96.3125 214.535156 129.925781 214.535156 171.390625 C 214.535156 212.855469 248.148438 246.46875 289.613281 246.46875 C 331.078125 246.46875 364.691406 212.855469 364.691406 171.390625 M 0 269.007813 C 0 147.867188 98.203125 49.664063 219.339844 49.664063 C 223.683594 49.664063 227.988281 49.804688 232.269531 50.054688 L 232.269531 0.00390625 C 350.523438 0.00390625 446.386719 96.714844 446.386719 214.96875 C 446.386719 233.636719 443.992188 251.742188 439.503906 269.007813 L 74.363281 269.007813 L 60.765625 269.089844 C 60.765625 339.925781 118.191406 397.355469 189.03125 397.355469 C 208.363281 397.355469 226.695313 393.070313 243.136719 385.410156 L 245.71875 397.683594 C 246.828125 402.972656 253.519531 404.691406 257.042969 400.589844 L 265.667969 390.546875 C 267.066406 388.921875 269.175781 388.085938 271.308594 388.3125 L 284.472656 389.726563 C 289.84375 390.304688 293.546875 384.46875 290.734375 379.855469 L 283.851563 368.546875 C 282.734375 366.714844 282.59375 364.449219 283.46875 362.492188 L 288.878906 350.410156 C 291.089844 345.476563 286.683594 340.152344 281.425781 341.402344 L 268.542969 344.457031 C 266.457031 344.949219 264.257813 344.386719 262.667969 342.945313 L 252.847656 334.066406 C 248.839844 330.441406 242.417969 332.988281 241.976563 338.371094 C 241.976563 338.371094 240.914063 351.425781 240.902344 351.566406 C 213.523438 349.976563 198.492188 325.605469 201.597656 305.414063 L 322.5625 305.414063 C 354.328125 305.414063 368.726563 337.375 355.578125 359.457031 C 323.035156 416.488281 267.324219 457.410156 189.199219 458.5 C 84.8125 459.960938 0 373.488281 0 269.089844 "})})]})]}),Ee=d.forwardRef(function(o,r){return e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:100,height:120,viewBox:"0 0 100 120",fill:"none",ref:r,...o,children:[e.jsx("path",{fill:"#0071CC",fillRule:"evenodd",d:"m60 0 40 40v66c0 7.732-6.268 14-14 14H14c-7.732 0-14-6.268-14-14V14C0 6.268 6.268 0 14 0h46Z",clipRule:"evenodd"}),e.jsx("mask",{id:"a",width:100,height:120,x:0,y:0,maskUnits:"userSpaceOnUse",style:{maskType:"luminance"},children:e.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"m60 0 40 40v66c0 7.732-6.268 14-14 14H14c-7.732 0-14-6.268-14-14V14C0 6.268 6.268 0 14 0h46Z",clipRule:"evenodd"})}),e.jsx("g",{mask:"url(#a)",children:e.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M25.08 69.969a44.033 44.033 0 0 1-.71-.728 6.842 6.842 0 0 1-.677-.832 4.595 4.595 0 0 1-.502-.936 2.82 2.82 0 0 1-.191-1.04c0-.67.208-1.277.624-1.82.416-.544.925-1.116 1.525-1.716L36.035 52.08a15.75 15.75 0 0 1 1.647-1.439 3.06 3.06 0 0 1 1.89-.641c.461 0 .935.127 1.42.381.486.255 1.006.659 1.56 1.214.532.531.908 1.022 1.127 1.473.22.45.33.907.33 1.37 0 .693-.202 1.334-.607 1.924-.404.589-.872 1.15-1.404 1.681l-8.528 8.459 8.459 8.32c.554.555 1.04 1.115 1.456 1.682.416.566.624 1.184.624 1.854 0 .463-.116.936-.347 1.422-.231.485-.647 1.028-1.248 1.63-.532.53-1.023.906-1.473 1.126-.451.22-.908.33-1.37.33-.67 0-1.3-.209-1.89-.625a13.194 13.194 0 0 1-1.715-1.456L25.08 69.97Zm38.204 10.816a13.194 13.194 0 0 1-1.716 1.456c-.59.416-1.219.624-1.89.624-.461 0-.918-.11-1.369-.33-.45-.219-.941-.594-1.473-1.126-.601-.6-1.017-1.144-1.248-1.63-.231-.485-.347-.958-.347-1.42 0-.67.208-1.29.624-1.855.416-.567.902-1.127 1.456-1.682l8.46-8.32-8.529-8.459c-.532-.532-1-1.092-1.404-1.681a3.331 3.331 0 0 1-.607-1.925c0-.462.11-.918.33-1.369.22-.45.595-.942 1.126-1.473.555-.555 1.075-.96 1.56-1.214.486-.254.96-.381 1.422-.381a3.06 3.06 0 0 1 1.89.641 15.75 15.75 0 0 1 1.646 1.44L74.1 62.896c.6.6 1.109 1.172 1.525 1.715a2.92 2.92 0 0 1 .624 1.82c0 .37-.064.717-.19 1.04a4.595 4.595 0 0 1-.503.937c-.208.3-.434.578-.676.832-.243.254-.48.497-.711.728L63.284 80.785Z",clipRule:"evenodd"})}),e.jsx("path",{fill:"#005EA9",fillRule:"evenodd",d:"M100 40H74.707C66.975 40 60 33.025 60 25.293V0l40 40Z",clipRule:"evenodd"})]})}),Ut=Ee,Ze=d.forwardRef(function(o,r){return e.jsxs("svg",{width:100,height:120,viewBox:"0 0 100 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",...o,ref:r,children:[e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M60 0L100 40V106C100 113.732 93.732 120 86 120H14C6.26801 120 0 113.732 0 106V14C0 6.26801 6.26801 0 14 0H60Z",fill:"#D6409F"}),e.jsx("mask",{id:"mask0_14_251",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:0,y:0,width:100,height:120,children:e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M60 0L100 40V106C100 113.732 93.732 120 86 120H14C6.26801 120 0 113.732 0 106V14C0 6.26801 6.26801 0 14 0H60Z",fill:"white"})}),e.jsx("g",{mask:"url(#mask0_14_251)"}),e.jsx("path",{d:"M57.4 72.66C55.3693 72.66 53.6284 73.8696 52.8304 75.6H45.85C45.0146 75.6 44.2133 75.2681 43.6226 74.6774C43.0319 74.0866 42.7 73.2854 42.7 72.45V64.365C43.6576 64.8228 44.7181 65.1 45.85 65.1H52.8304C53.3075 66.1463 54.1287 66.9976 55.1571 67.5121C56.1855 68.0266 57.3592 68.1733 58.4826 67.9278C59.6061 67.6823 60.6115 67.0594 61.3315 66.1628C62.0516 65.2662 62.4428 64.1499 62.44 63C62.4406 61.8512 62.0482 60.7368 61.328 59.8418C60.6079 58.9468 59.6032 58.325 58.4809 58.0798C57.3587 57.8345 56.1862 57.9805 55.1584 58.4935C54.1305 59.0066 53.3091 59.8557 52.8304 60.9H45.85C45.0146 60.9 44.2133 60.5681 43.6226 59.9774C43.0319 59.3866 42.7 58.5854 42.7 57.75V52.8696C43.7463 52.3924 44.5975 51.5713 45.1121 50.5429C45.6266 49.5144 45.7733 48.3408 45.5278 47.2174C45.2823 46.0939 44.6594 45.0885 43.7628 44.3684C42.8661 43.6484 41.7499 43.2572 40.6 43.26C39.4512 43.2594 38.3368 43.6518 37.4418 44.3719C36.5468 45.0921 35.925 46.0967 35.6798 47.219C35.4345 48.3413 35.5805 49.5137 36.0935 50.5416C36.6065 51.5695 37.4557 52.3909 38.5 52.8696V72.45C38.5 74.3993 39.2744 76.2688 40.6527 77.6472C42.0311 79.0256 43.9006 79.8 45.85 79.8H52.8304C53.3075 80.8463 54.1287 81.6976 55.1571 82.2121C56.1855 82.7266 57.3592 82.8733 58.4826 82.6278C59.6061 82.3823 60.6115 81.7594 61.3315 80.8628C62.0516 79.9662 62.4428 78.8499 62.44 77.7C62.44 76.3633 61.909 75.0814 60.9638 74.1362C60.0186 73.191 58.7367 72.66 57.4 72.66ZM57.4 60.0915C58.1708 60.0915 58.9101 60.3977 59.4551 60.9428C60.0002 61.4878 60.3064 62.2271 60.3064 62.9979C60.3064 63.7687 60.0002 64.508 59.4551 65.053C58.9101 65.5981 58.1708 65.9043 57.4 65.9043C56.6292 65.9043 55.8899 65.5981 55.3448 65.053C54.7998 64.508 54.4936 63.7687 54.4936 62.9979C54.4936 62.2271 54.7998 61.4878 55.3448 60.9428C55.8899 60.3977 56.6292 60.0915 57.4 60.0915ZM40.6 45.3915C41.3708 45.3915 42.1101 45.6977 42.6551 46.2428C43.2002 46.7878 43.5064 47.5271 43.5064 48.2979C43.5064 49.0687 43.2002 49.808 42.6551 50.353C42.1101 50.8981 41.3708 51.2043 40.6 51.2043C39.8292 51.2043 39.0899 50.8981 38.5448 50.353C37.9998 49.808 37.6936 49.0687 37.6936 48.2979C37.6936 47.5271 37.9998 46.7878 38.5448 46.2428C39.0899 45.6977 39.8292 45.3915 40.6 45.3915ZM57.4 80.6085C57.018 80.6085 56.6398 80.5333 56.2869 80.3871C55.9341 80.2409 55.6134 80.0267 55.3434 79.7566C55.0733 79.4865 54.859 79.1659 54.7129 78.813C54.5667 78.4602 54.4915 78.0819 54.4915 77.7C54.4915 77.318 54.5667 76.9398 54.7129 76.587C54.859 76.2341 55.0733 75.9135 55.3434 75.6434C55.6134 75.3733 55.9341 75.1591 56.2869 75.0129C56.6398 74.8667 57.018 74.7915 57.4 74.7915C58.1714 74.7915 58.9112 75.0979 59.4566 75.6434C60.0021 76.1888 60.3085 76.9286 60.3085 77.7C60.3085 78.4714 60.0021 79.2112 59.4566 79.7566C58.9112 80.3021 58.1714 80.6085 57.4 80.6085Z",fill:"white"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M100 40H74.7071C66.9751 40 60 33.0249 60 25.2929V0L100 40Z",fill:"#C2298A"})]})}),Gt=Ze,He=d.forwardRef((t,o)=>e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:100,height:120,viewBox:"0 0 100 120",fill:"none",...t,ref:o,children:[e.jsx("path",{fill:"#6E56CF",fillRule:"evenodd",d:"m60 0 40 40v66c0 7.732-6.268 14-14 14H14c-7.732 0-14-6.268-14-14V14C0 6.268 6.268 0 14 0h46Z",clipRule:"evenodd"}),e.jsx("mask",{id:"a",width:100,height:120,x:0,y:0,maskUnits:"userSpaceOnUse",style:{maskType:"luminance"},children:e.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"m60 0 40 40v66c0 7.732-6.268 14-14 14H14c-7.732 0-14-6.268-14-14V14C0 6.268 6.268 0 14 0h46Z",clipRule:"evenodd"})}),e.jsx("path",{fill:"#6550B9",fillRule:"evenodd",d:"M100 40H74.707C66.975 40 60 33.025 60 25.293V0l40 40Z",clipRule:"evenodd"}),e.jsx("path",{fill:"#fff",d:"M66.02 77.178 54.635 54.924c-1.483-2.897-5.62-2.906-7.115-.015L36.017 77.163C34.64 79.826 36.573 83 39.57 83h22.89c2.99 0 4.923-3.16 3.56-5.822Z"}),e.jsx("mask",{id:"b",width:47,height:45,x:2,y:46,maskUnits:"userSpaceOnUse",style:{maskType:"alpha"},children:e.jsx("path",{fill:"#6550B9",d:"m2 46 23.382 45L49 46H2Z"})}),e.jsxs("g",{fill:"#6550B9",mask:"url(#b)",children:[e.jsx("rect",{width:40,height:5,x:27,y:53,rx:2.5}),e.jsx("rect",{width:40,height:5,x:26,y:61,rx:2.5}),e.jsx("rect",{width:40,height:5,x:26,y:69,rx:2.5})]})]})),Wt=He,Fe=t=>e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 120",width:100,height:120,fill:"none",...t,children:[e.jsx("path",{fill:"#424242",fillRule:"evenodd",d:"m60 0 40 40v66c0 7.732-6.268 14-14 14H14c-7.732 0-14-6.268-14-14V14C0 6.268 6.268 0 14 0h46Z",clipRule:"evenodd"}),e.jsx("mask",{id:"a",width:100,height:120,x:0,y:0,maskUnits:"userSpaceOnUse",style:{maskType:"luminance"},children:e.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"m60 0 40 40v66c0 7.732-6.268 14-14 14H14c-7.732 0-14-6.268-14-14V14C0 6.268 6.268 0 14 0h46Z",clipRule:"evenodd"})}),e.jsx("path",{fill:"#2C2929",fillRule:"evenodd",d:"M100 40H74.707C66.975 40 60 33.025 60 25.293V0l40 40Z",clipRule:"evenodd"}),e.jsx("path",{stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:4,d:"M36 56.659V52h30v4.659M51 52v34m-7.5 0h15"})]}),Kt=Fe,De=t=>e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 120",width:100,height:120,fill:"none",...t,children:[e.jsx("path",{fill:"#12A594",fillRule:"evenodd",d:"m60 0 40 40v66c0 7.732-6.268 14-14 14H14c-7.732 0-14-6.268-14-14V14C0 6.268 6.268 0 14 0h46Z",clipRule:"evenodd"}),e.jsx("path",{fill:"#0D9B8A",fillRule:"evenodd",d:"M100 40H74.707C66.975 40 60 33.025 60 25.293V0l40 40Z",clipRule:"evenodd"}),e.jsx("path",{fill:"#F3FBF9",d:"M65.121 51c-10.009 0-13.718 7.347-16.7 13.25l-1.949 3.775c-3.157 6.26-5.517 10.064-11.598 10.064-.377 0-.751.076-1.1.225a2.868 2.868 0 0 0-.933.64c-.267.275-.478.601-.623.96a3.025 3.025 0 0 0 .001 2.26c.145.36.356.685.623.96a2.84 2.84 0 0 0 2.032.866c10.013 0 13.722-7.347 16.705-13.25l1.944-3.775c3.162-6.26 5.522-10.064 11.598-10.064.378 0 .752-.076 1.102-.224.349-.148.666-.366.934-.64.267-.275.48-.601.624-.96a3.003 3.003 0 0 0-.626-3.221A2.84 2.84 0 0 0 65.12 51Z"})]}),Qt=De,Ae=t=>e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 120",width:100,height:120,fill:"none",...t,children:[e.jsx("path",{fill:"#0090FF",fillRule:"evenodd",d:"m60 0 40 40v66c0 7.732-6.268 14-14 14H14c-7.732 0-14-6.268-14-14V14C0 6.268 6.268 0 14 0h46Z",clipRule:"evenodd"}),e.jsx("mask",{id:"a",width:100,height:120,x:0,y:0,maskUnits:"userSpaceOnUse",style:{maskType:"luminance"},children:e.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"m60 0 40 40v66c0 7.732-6.268 14-14 14H14c-7.732 0-14-6.268-14-14V14C0 6.268 6.268 0 14 0h46Z",clipRule:"evenodd"})}),e.jsx("path",{fill:"#0D74CE",fillRule:"evenodd",d:"M100 40H74.707C66.975 40 60 33.025 60 25.293V0l40 40Z",clipRule:"evenodd"}),e.jsx("path",{fill:"#fff",d:"m49.696 51.41 5.58 2.088-5.78 2.194-5.778-2.194 5.58-2.088c.127-.05.27-.05.405 0h-.007Zm-11.017 3.087v7.888c-.093.028-.185.056-.278.092l-6.832 2.559A3.937 3.937 0 0 0 29 68.713v8.38a3.94 3.94 0 0 0 2.384 3.608l6.832 2.967a4.043 4.043 0 0 0 3.21 0l8.07-3.509 8.078 3.509a4.043 4.043 0 0 0 3.21 0l6.832-2.967A3.943 3.943 0 0 0 70 77.094V68.72c0-1.638-1.025-3.1-2.57-3.684l-6.831-2.56c-.093-.035-.185-.063-.278-.09v-7.89c0-1.638-1.025-3.1-2.569-3.684l-6.832-2.559a4.069 4.069 0 0 0-2.826 0l-6.832 2.56c-1.558.583-2.583 2.052-2.583 3.684ZM56.898 62.8l-5.864 2.194v-6.272l5.864-2.222v6.3Zm-16.881 2.834 5.58 2.088-5.78 2.186-5.778-2.186 5.58-2.088c.127-.05.27-.05.405 0h-.007Zm1.338 14.37V72.94l5.864-2.222v6.743l-5.864 2.545Zm17.621-14.37c.128-.05.27-.05.406 0l5.58 2.088-5.787 2.186-5.778-2.186 5.579-2.088Zm7.26 11.973-5.523 2.398v-7.066l5.864-2.222v6.377a.561.561 0 0 1-.342.513Z"})]}),Xt=Ae,Be=t=>e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 120",width:100,height:120,fill:"none",...t,children:[e.jsx("path",{fill:"#82827C",fillRule:"evenodd",d:"m60 0 40 40v66c0 7.732-6.268 14-14 14H14c-7.732 0-14-6.268-14-14V14C0 6.268 6.268 0 14 0h46Z",clipRule:"evenodd"}),e.jsx("mask",{id:"a",width:100,height:120,x:0,y:0,maskUnits:"userSpaceOnUse",style:{maskType:"luminance"},children:e.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"m60 0 40 40v66c0 7.732-6.268 14-14 14H14c-7.732 0-14-6.268-14-14V14C0 6.268 6.268 0 14 0h46Z",clipRule:"evenodd"})}),e.jsx("path",{fill:"#63635E",fillRule:"evenodd",d:"M100 40H74.707C66.975 40 60 33.025 60 25.293V0l40 40Z",clipRule:"evenodd"}),e.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M56.918 52h-3.759l-3.614 7.273h-6.014L47.145 52h-3.759l-3.613 7.273h-6.014L37.373 52H34a4 4 0 0 0-4 4v22a4 4 0 0 0 4 4h31.09a4 4 0 0 0 4-4V56a4 4 0 0 0-4-4h-2.158l-3.614 7.273h-6.014L56.918 52Z",clipRule:"evenodd"})]}),Yt=Be,ze=t=>e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 120",width:100,height:120,fill:"none",...t,children:[e.jsx("path",{fill:"#424242",fillRule:"evenodd",d:"m60 0 40 40v66c0 7.732-6.268 14-14 14H14c-7.732 0-14-6.268-14-14V14C0 6.268 6.268 0 14 0h46Z",clipRule:"evenodd"}),e.jsx("mask",{id:"a",width:100,height:120,x:0,y:0,maskUnits:"userSpaceOnUse",style:{maskType:"luminance"},children:e.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"m60 0 40 40v66c0 7.732-6.268 14-14 14H14c-7.732 0-14-6.268-14-14V14C0 6.268 6.268 0 14 0h46Z",clipRule:"evenodd"})}),e.jsx("path",{fill:"#2C2929",fillRule:"evenodd",d:"M100 40H74.707C66.975 40 60 33.025 60 25.293V0l40 40Z",clipRule:"evenodd"}),e.jsx("path",{fill:"#fff",d:"M50.3 63.94c1.62.28 3.065.624 4.336 1.035 1.291.41 2.378.849 3.26 1.315.88.448 1.64.97 2.275 1.567s1.127 1.176 1.476 1.736c.369.56.656 1.203.861 1.93.205.728.338 1.4.4 2.016.061.597.092 1.296.092 2.099 0 1.492-.307 2.92-.923 4.281-.615 1.362-1.383 2.491-2.306 3.387-.902.877-1.845 1.576-2.83 2.099-.983.522-1.875.783-2.675.783-.43 0-.645-.186-.645-.56 0-.242.164-.512.492-.81a8.195 8.195 0 0 0 2.306-3.331c.492-1.306.738-2.491.738-3.555 0-.634-.01-1.128-.03-1.483-.021-.354-.093-.84-.216-1.455-.102-.616-.266-1.11-.492-1.483-.205-.392-.523-.83-.953-1.316a5.133 5.133 0 0 0-1.569-1.231c-.614-.336-1.404-.644-2.367-.924-.943-.298-2.03-.532-3.26-.7-1.558-.205-2.963-.475-4.213-.811-1.23-.355-2.255-.728-3.075-1.12a9.44 9.44 0 0 1-2.091-1.37c-.574-.523-1.015-1.008-1.323-1.456a5.606 5.606 0 0 1-.707-1.567c-.164-.579-.267-1.054-.307-1.428a12.73 12.73 0 0 1-.062-1.315c0-.56.092-1.091.277-1.595.287-.802.943-1.567 1.968-2.295s1.917-1.092 2.675-1.092c.37 0 .646.075.83.224.206.131.308.42.308.868 0 1.418.092 2.537.277 3.358.205.821.625 1.512 1.26 2.071.636.56 1.405.98 2.307 1.26.902.28 2.204.569 3.906.867ZM45.287 87c-1.558 0-2.932-.187-4.12-.56-1.17-.354-2.45-1.11-3.845-2.267-.676-.56-1.015-1.147-1.015-1.763 0-.504.226-.96.677-1.371 1.353-1.231 2.573-1.847 3.66-1.847.697 0 1.476.326 2.337.98 1.189.932 2.173 1.539 2.952 1.818.8.28 1.732.42 2.798.42.902 0 1.733-.158 2.491-.475.78-.318 1.24-.476 1.384-.476.512 0 .769.298.769.895 0 .299-.133.681-.4 1.148-.267.466-.687.98-1.26 1.539-.554.541-1.405.998-2.553 1.371-1.128.392-2.42.588-3.875.588Zm15.314-37.67c0 .728-.533 1.456-1.599 2.183-1.045.728-1.958 1.092-2.737 1.092-.492 0-1.158-.168-1.998-.504a40.837 40.837 0 0 0-2.86-1.008 10.023 10.023 0 0 0-3.076-.503c-1.722 0-3.331.298-4.828.895-1.476.579-3.054 1.502-4.735 2.771-1.107.84-1.804 1.26-2.092 1.26-.45 0-.676-.224-.676-.672 0-.299.195-.756.584-1.372.39-.615.759-1.12 1.107-1.51C41.3 47.986 46.087 46 52.052 46c1.128 0 2.337.13 3.63.392 1.29.242 2.428.634 3.412 1.175 1.005.523 1.507 1.11 1.507 1.763Z"})]}),qt=ze,Ne=t=>e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 120",width:100,height:120,fill:"none",...t,children:[e.jsx("path",{fill:"#E54D2E",fillRule:"evenodd",d:"m60 0 40 40v66c0 7.732-6.268 14-14 14H14c-7.732 0-14-6.268-14-14V14C0 6.268 6.268 0 14 0h46Z",clipRule:"evenodd"}),e.jsx("path",{fill:"#D13415",fillRule:"evenodd",d:"M100 40H74.707C66.975 40 60 33.025 60 25.293V0l40 40Z",clipRule:"evenodd"}),e.jsx("path",{fill:"#fff",d:"M30.59 82.138a5.145 5.145 0 0 0 7.272 0 5.143 5.143 0 1 0 7.275 7.272c1.517-1.517 2.303-4.161 1.731-6.231-.304-1.095-.353-2.422.45-3.224l9.089-9.09-6.186 1.8v-2.888l-4.329 1.444-.028-4.357-5.819 5.819c-.804.802-2.13.753-3.226.449-2.068-.572-4.712.214-6.229 1.731a5.145 5.145 0 0 0 0 7.275Z"}),e.jsx("path",{fill:"#fff",d:"M53.863 51.59c-1.517 1.517-2.303 4.161-1.731 6.231.304 1.095.353 2.42-.45 3.224l-5.818 5.819.026 4.359 4.33-1.446v2.89l6.187-1.802 2.548-2.547c.802-.803 2.13-.754 3.226-.45 2.068.572 4.712-.214 6.229-1.731a5.143 5.143 0 0 0-7.272-7.275 5.143 5.143 0 0 0-7.275-7.272Z",opacity:.8})]}),Jt=Ne,Oe=t=>e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 120",width:100,height:120,fill:"none",...t,children:[e.jsx("path",{fill:"#E54D2E",fillRule:"evenodd",d:"m60 0 40 40v66c0 7.732-6.268 14-14 14H14c-7.732 0-14-6.268-14-14V14C0 6.268 6.268 0 14 0h46Z",clipRule:"evenodd"}),e.jsx("path",{fill:"#D13415",fillRule:"evenodd",d:"M100 40H74.707C66.975 40 60 33.025 60 25.293V0l40 40Z",clipRule:"evenodd"}),e.jsx("path",{fill:"#fff",d:"M40.008 52.325c.129 3.93 2.849 6.111 8.274 6.959 4.596.721 8.742.355 10.096-3.584 2.636-7.68-3.622-5.77-9.044-6.622-5.425-.853-9.534-3.065-9.327 3.247ZM41.638 68.46c.503 2.933 3.237 4.614 7.421 4.501 4.184-.115 7.306-1.749 7.74-4.913.8-5.858-3.814-3.592-7.998-3.48-4.187.116-8.156-1.864-7.163 3.892ZM47.082 81.89c.831 2.19 3.11 3.115 6.19 2.456 3.08-.656 5.208-1.677 5.035-4.174-.312-4.62-3.355-3.167-6.433-2.507-3.081.653-6.415-.075-4.792 4.224ZM49.724 92.125c.242 1.849 1.84 2.938 4.343 2.92 2.507-.022 4.404-1.01 4.727-2.99.603-3.668-2.2-2.303-4.706-2.282-2.508.02-4.84-1.275-4.364 2.352Z"})]}),e0=Oe,_e=t=>e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 120",width:100,height:120,fill:"none",...t,children:[e.jsx("path",{fill:"#30A46C",fillRule:"evenodd",d:"m60 0 40 40v66c0 7.732-6.268 14-14 14H14c-7.732 0-14-6.268-14-14V14C0 6.268 6.268 0 14 0h46Z",clipRule:"evenodd"}),e.jsx("path",{fill:"#218358",fillRule:"evenodd",d:"M100 40H74.707C66.975 40 60 33.025 60 25.293V0l40 40Z",clipRule:"evenodd"}),e.jsx("path",{fill:"#fff",d:"M67.125 80.042V54.958c0-1.97-1.763-3.583-3.917-3.583H35.792c-2.154 0-3.917 1.612-3.917 3.583v25.084c0 1.97 1.763 3.583 3.917 3.583h27.416c2.154 0 3.917-1.612 3.917-3.583Zm-23.696-8.995 4.113 4.533 6.07-7.148c.392-.466 1.175-.466 1.567.018l6.874 8.385a.831.831 0 0 1 .093.938.93.93 0 0 1-.362.361 1.048 1.048 0 0 1-.514.134H37.79c-.823 0-1.274-.86-.765-1.451l4.877-5.734c.372-.465 1.116-.483 1.527-.035Z"})]}),t0=_e,Ue=t=>e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 120",width:100,height:120,fill:"none",...t,children:[e.jsx("path",{fill:"#30A46C",fillRule:"evenodd",d:"m60 0 40 40v66c0 7.732-6.268 14-14 14H14c-7.732 0-14-6.268-14-14V14C0 6.268 6.268 0 14 0h46Z",clipRule:"evenodd"}),e.jsx("rect",{width:35.25,height:32.25,x:36,y:52,fill:"#8ECEAA",rx:3}),e.jsx("path",{fill:"#218358",fillRule:"evenodd",d:"M100 40H74.707C66.975 40 60 33.025 60 25.293V0l40 40Z",clipRule:"evenodd"}),e.jsx("g",{filter:"url(#a)",children:e.jsx("path",{fill:"#fff",d:"M66.25 75.667V50.583c0-1.97-1.763-3.583-3.917-3.583H34.917C32.763 47 31 48.612 31 50.583v25.084c0 1.97 1.763 3.583 3.917 3.583h27.416c2.154 0 3.917-1.612 3.917-3.583Zm-23.696-8.995 4.113 4.533 6.07-7.148c.392-.466 1.175-.466 1.567.018l6.874 8.385a.831.831 0 0 1 .093.938.93.93 0 0 1-.362.361 1.048 1.048 0 0 1-.514.134h-23.48c-.823 0-1.274-.86-.765-1.451l4.877-5.734c.372-.465 1.116-.483 1.527-.035Z"})}),e.jsx("defs",{children:e.jsxs("filter",{id:"a",width:43.25,height:40.25,x:29,y:46,colorInterpolationFilters:"sRGB",filterUnits:"userSpaceOnUse",children:[e.jsx("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),e.jsx("feColorMatrix",{in:"SourceAlpha",result:"hardAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),e.jsx("feOffset",{dx:2,dy:3}),e.jsx("feGaussianBlur",{stdDeviation:2}),e.jsx("feComposite",{in2:"hardAlpha",operator:"out"}),e.jsx("feColorMatrix",{values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.05 0"}),e.jsx("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_18_316"}),e.jsx("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_18_316",result:"shape"})]})})]}),o0=Ue,Ge=t=>e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 120",width:100,height:120,fill:"none",...t,children:[e.jsx("path",{fill:"#A3B0BF",fillRule:"evenodd",d:"m60 0 40 40v66c0 7.732-6.268 14-14 14H14c-7.732 0-14-6.268-14-14V14C0 6.268 6.268 0 14 0h46Z",clipRule:"evenodd"}),e.jsx("path",{fill:"#758B9F",fillRule:"evenodd",d:"M100 40H74.707C66.975 40 60 33.025 60 25.293V0l40 40Z",clipRule:"evenodd"})]}),n0=Ge,We=t=>e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 120",width:100,height:120,fill:"none",...t,children:[e.jsx("path",{fill:"#00A2C7",fillRule:"evenodd",d:"m60 0 40 40v66c0 7.732-6.268 14-14 14H14c-7.732 0-14-6.268-14-14V14C0 6.268 6.268 0 14 0h46Z",clipRule:"evenodd"}),e.jsx("mask",{id:"a",width:100,height:120,x:0,y:0,maskUnits:"userSpaceOnUse",style:{maskType:"luminance"},children:e.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"m60 0 40 40v66c0 7.732-6.268 14-14 14H14c-7.732 0-14-6.268-14-14V14C0 6.268 6.268 0 14 0h46Z",clipRule:"evenodd"})}),e.jsx("path",{fill:"#107D98",fillRule:"evenodd",d:"M100 40H74.707C66.975 40 60 33.025 60 25.293V0l40 40Z",clipRule:"evenodd"}),e.jsx("path",{fill:"#fff",d:"M67.4 51.177c-4 1.397-9.6 2.794-17.4 2.794-7.8 0-13.8-1.596-17.4-2.794-1.2-.599-2.6.4-2.6 1.797v27.941c0 1.398 1.4 2.395 2.6 1.996 4.2-1.397 9.6-2.993 17.4-2.993 7.8 0 13.4 1.596 17.4 2.993 1.4.4 2.6-.598 2.6-1.996V52.973c0-1.397-1.4-2.395-2.6-1.796ZM50 72.932c-4.6 0-9 .2-13 .798l7.4-8.781 4 4.79 5.6-6.786 9 10.777c-4-.598-8.4-.798-13-.798Z"})]}),r0=We;var D="Progress",A=100,[Ke,i0]=ce(D),[Qe,Xe]=Ke(D),ee=d.forwardRef((t,o)=>{const{__scopeProgress:r,value:s=null,max:n,getValueLabel:i=Ye,...l}=t;(n||n===0)&&!U(n)&&console.error(qe(`${n}`,"Progress"));const a=U(n)?n:A;s!==null&&!G(s,a)&&console.error(Je(`${s}`,"Progress"));const c=G(s,a)?s:null,h=P(c)?i(c,a):void 0;return e.jsx(Qe,{scope:r,value:c,max:a,children:e.jsx(X.div,{"aria-valuemax":a,"aria-valuemin":0,"aria-valuenow":P(c)?c:void 0,"aria-valuetext":h,role:"progressbar","data-state":ne(c,a),"data-value":c??void 0,"data-max":a,...l,ref:o})})});ee.displayName=D;var te="ProgressIndicator",oe=d.forwardRef((t,o)=>{const{__scopeProgress:r,...s}=t,n=Xe(te,r);return e.jsx(X.div,{"data-state":ne(n.value,n.max),"data-value":n.value??void 0,"data-max":n.max,...s,ref:o})});oe.displayName=te;function Ye(t,o){return`${Math.round(t/o*100)}%`}function ne(t,o){return t==null?"indeterminate":t===o?"complete":"loading"}function P(t){return typeof t=="number"}function U(t){return P(t)&&!isNaN(t)&&t>0}function G(t,o){return P(t)&&!isNaN(t)&&t<=o&&t>=0}function qe(t,o){return`Invalid prop \`max\` of value \`${t}\` supplied to \`${o}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${A}\`.`}function Je(t,o){return`Invalid prop \`value\` of value \`${t}\` supplied to \`${o}\`. The \`value\` prop must be:
|
|
12
|
+
- a positive number
|
|
13
|
+
- less than the value passed to \`max\` (or ${A} if no \`max\` prop is set)
|
|
14
|
+
- \`null\` or \`undefined\` if the progress is indeterminate.
|
|
15
|
+
|
|
16
|
+
Defaulting to \`null\`.`}var et=ee,tt=oe;const ot=m(et,{position:"relative",width:"100%",backgroundColor:"$softBg",borderRadius:"$round",overflow:"hidden",boxSizing:"border-box",border:"1px solid transparent",variants:{size:{sm:{height:"$1"},md:{height:"$1_5"},lg:{height:"$2"}}},defaultVariants:{size:"md"}}),nt=m(tt,{width:"100%",height:"100%",borderRadius:"$round",backgroundColor:"$selectionBg",transition:"transform .2s ease-out, background-color .2s ease-out"});function s0(t){const o=Math.max(0,Math.min(100,t.value??0));return e.jsx(ot,{...t,children:e.jsx(nt,{style:{transform:`translateX(-${100-o}%)`}})})}const l0=m("div",{position:"relative",width:0,height:0,borderLeft:"6px solid transparent",borderRight:"6px solid transparent",borderRadius:"2px",borderTop:"6px solid CurrentColor",transformOrigin:"center",variants:{animate:{true:{transition:"transform .2s"}},size:{xs:{borderLeftWidth:"4px",borderRightWidth:"4px",borderTopWidth:"4px"}},direction:{rightbottom:{transform:"rotate(-45deg)"},leftbottom:{transform:"rotate(45deg)"},righttop:{transform:"rotate(135deg)"},lefttop:{transform:"rotate(-135deg)"},right:{transform:"rotate(90deg)"},left:{transform:"rotate(-90deg)"},top:{transform:"rotate(180deg)"},bottom:{transform:"rotate(0deg)"}}}}),re=m("span",{visibility:"hidden",position:"relative",cursor:"pointer",color:"$gray10","& > svg":{height:"14px",width:"14px",strokeWidth:1.8}}),rt=m("div",{maxWidth:"100%",display:"inline-block","&:hover":{[`${re}`]:{visibility:"visible"}},variants:{focused:{true:{backgroundColor:"$gray1"}}}});function a0(t){const{value:o,onBlur:r,showIcon:s,css:n,onEdit:i}=t,l=d.useRef(null),[a,c]=d.useState(o),[h,u]=d.useState(!1),[f,v]=d.useState(!1);d.useEffect(()=>{c(o)},[o]);const C=async()=>{v(!0),r&&typeof r=="function"&&await r(a),u(!1),v(!1)},p=()=>{u(!0),i&&i(),setTimeout(()=>{var g;(g=l.current)==null||g.focus()},0)},b=g=>{g.stopPropagation(),g.key==="Enter"&&C(),g.key==="Escape"&&(c(o),C())};return e.jsx(rt,{focused:h,css:n,children:h?e.jsx(he,{disabled:f,ref:l,value:a,onKeyDown:b,onChange:g=>{g.preventDefault(),g.stopPropagation(),c(g.target.value)},onKeyUp:g=>{g.preventDefault(),g.stopPropagation(),g.key==="Enter"&&C()},onBlur:()=>{C()}}):e.jsxs(fe,{align:"v",onClick:g=>{g.stopPropagation(),!s&&p()},gap:"xs",wrap:"false",css:n,children:[e.jsx(ue,{ellipsis:!0,size:1,css:n,children:a}),s&&e.jsx(re,{onClick:p,children:e.jsx(je,{})})]})})}const ie=Y({color:"$grayA11","& > div:first-child":{marginRight:"$2"},"div[role=status]":{margin:0}})(),it=Y({[`& .${ie}`]:{minHeight:"$7",padding:"$1_5 $2",borderRadius:"$3",border:"1px solid $gray6",backgroundColor:"$toasterBg",color:"$grayA11",fontSize:"$1",boxShadow:"0 5px 10px rgba(0,0,0,0.08)"}})();function d0(t){const{toastOptions:o,containerStyle:r,...s}=t;return e.jsx(Re,{containerStyle:{inset:38,...r},toastOptions:{...o,className:ie,success:{iconTheme:{primary:"var(--colors-green10)",secondary:"var(--colors-white)"}},error:{iconTheme:{primary:"var(--colors-red9)",secondary:"var(--colors-white)"}}},containerClassName:it,...s})}const Z=m("tr",{color:"$gray11"}),B=m("th",{fontWeight:"unset",textAlign:"start",fontSize:"$2",padding:"$2",borderBottom:"1px solid $gray3",userSelect:"none","&:nth-child(1)":{paddingLeft:"$2"},variants:{align:{start:{textAlign:"start"},center:{textAlign:"center"},end:{textAlign:"end"}},border:{solid:{borderBottom:"1px solid $gray3"},dashed:{borderBottom:"1px dashed $gray8"}}},defaultVariants:{align:"start",border:"solid"}}),L=m("td",{py:"$2",borderBottom:"1px solid $gray3",fontSize:"$2",padding:"$2",verticalAlign:"middle",userSelect:"none",variants:{align:{start:{textAlign:"start"},center:{textAlign:"center"},end:{textAlign:"end"}},border:{solid:{borderBottom:"1px solid $gray3"},dashed:{borderBottom:"1px dashed $gray8"}}},defaultVariants:{align:"start",border:"solid"}}),st=m("thead",{[`& ${B}`]:{fontSize:"$1",color:"$gray9"},[`& ${L}`]:{fontSize:"$1",color:"$gray9"}}),lt=m("tbody",{width:"100%",[`& ${Z}`]:{"&:hover":{backgroundColor:"$gray2"}}}),at=m("table",{width:"100%",tableLayout:"fixed",borderSpacing:0,variants:{compact:{true:{[`& ${B}`]:{padding:"$2 $0_5","&:nth-child(1)":{paddingLeft:"$2"}},[`& ${L}`]:{padding:"$0_5",fontSize:"$1"}}}}});function c0(t){const{columns:o=[],dataSource:r=[],rowKey:s,compact:n,onClickRow:i}=t;return e.jsxs(at,{compact:n,children:[e.jsx("colgroup",{children:o.map(l=>e.jsx("col",{span:1,style:{width:l.width||"auto"}},l.key))}),e.jsx(st,{children:e.jsx(Z,{children:o.map(l=>e.jsx(B,{children:l.title},l.key))})}),e.jsx(lt,{children:r.map((l,a)=>{const c=[];return o.forEach(h=>{if(h.render){c.push(e.jsx(L,{children:h.render(l[h.dataIndex],l)},h.key));return}c.push(e.jsx(L,{children:l[h.dataIndex]},h.key))}),e.jsx(Z,{onClick:h=>{i&&(h.stopPropagation(),i(l))},children:c},a)})})]})}const dt=m("div",{position:"relative",display:"flex",alignItems:"center",width:"300px",height:"$7",fontSize:"$1",boxSizing:"border-box",justifyContent:"space-between",padding:"0 $2",color:"white",backgroundColor:"$blue9",borderRadius:"$1","& > span:nth-child(2)":{display:"flex",alignItems:"center",height:"$5",fontSize:"$xs",padding:"0 $2",borderRadius:"$round",backgroundColor:"white",color:"$blue9"}});function h0(t){const{text:o,size:r}=t;return e.jsxs(dt,{children:[e.jsx("span",{children:o}),r>1&&e.jsx("span",{children:r})]})}const ct=m("div",{display:"flex",position:"absolute",width:"calc(100% - $sizes$8)",height:"$1",alignItems:"center",marginLeft:"$3",marginTop:"-$0_5",outline:"none",flexDirection:"row-reverse"}),ht=m("div",{position:"relative",height:1,outline:"none",pointerEvents:"none",flexDirection:"row-reverse",'&[data-drop-target="true"]':{backgroundColor:"#fff","&::after":{content:'""',position:"absolute",top:-4,left:-8,width:6,height:6,borderRadius:"$round",border:"1px solid white",zIndex:1}}});function f0(t){const{item:o,position:r,dropLayer:s,level:n,onDrop:i}=t,[l,a]=E.useState(!1),c=pe({accept:s??0,onEnter(u,f){f&&a(!0)},onLeave(){a(!1)},onDrop:(u,f)=>{a(!1),i(u,f,r)}}),h={width:`calc(100% - ${n*12}px)`};return e.jsx(ct,{ref:c,role:"option","aria-selected":"false","data-key":`${o}-${r}`,"aria-level":n,children:e.jsx(ht,{style:h,"data-drop-target":l})})}const j="...",R=(t,o)=>{const r=o-t+1;return Array.from({length:r},(s,n)=>n+t)},ft=t=>{const{totalCount:o,pageSize:r,siblingCount:s=1,currentPage:n}=t;return d.useMemo(()=>{const l=Math.ceil(o/r);if(s+5>=l)return R(1,l);const c=Math.max(n-s,1),h=Math.min(n+s,l),u=c>3,f=h<l-3,v=1,C=l;if(!u&&f){const p=3+2*s;return[...R(1,p),j,l]}if(u&&!f){const p=3+2*s,b=R(l-p+1,l);return[v,j,...b]}if(u&&f){const p=R(c,h);return[v,j,...p,j,C]}return R(1,l)},[o,r,s,n])},ut=m("ul",{display:"flex",alignItems:"center"}),M=m("li",{display:"inline-flex",alignItems:"center",justifyContent:"center",border:"1px solid $border",color:"$text",userSelect:"none",cursor:"pointer",marginRight:"$2",transition:"$borderColor, $backgroundColor, $color, $shadow","&:last-child":{marginRight:0},"&:hover":{borderColor:"$borderStrong",backgroundColor:"$surfaceSubtle"},"&:focus-visible":{borderColor:"$borderStrong",boxShadow:"$focus"},variants:{active:{true:{backgroundColor:"$selectionBg",borderColor:"$selectionBorder",color:"$selectionText","&:hover":{borderColor:"$selectionBorder",backgroundColor:"$selectionBgHover",color:"$selectionText"}}},disabled:{true:{backgroundColor:"$surface",color:"$textMuted",cursor:"initial","&:hover":{borderColor:"$border",backgroundColor:"$surface"}}},size:{sm:{height:"$sm",width:"$sm",fontSize:"$1",borderRadius:"$sm","& > svg":{width:"$iconSm",height:"$iconSm"}},md:{height:"$md",width:"$md",fontSize:"$2",borderRadius:"$md","& > svg":{width:"$iconMd",height:"$iconMd"}}}},defaultVariants:{size:"sm"}});function u0(t){const{totalCount:o,onPageChange:r,currentPage:s,pageSize:n,siblingCount:i=1,size:l}=t,[a=1,c]=ge({prop:s,onChange:r,defaultProp:t.currentPage}),h=ft({currentPage:a,totalCount:o,siblingCount:i,pageSize:n}),u=h[h.length-1];if(a===0||h.length<2)return null;const f=()=>{a>=u||c(a+1)},v=()=>{a!==1&&c(a-1)},C=p=>{c(p)};return e.jsxs(ut,{children:[e.jsx(M,{size:l,onClick:v,disabled:a===1,children:e.jsx(Te,{})}),h.map((p,b)=>p===j?e.jsx(M,{size:l,children:e.jsx(Ve,{})},`${j}_${b}`):e.jsx(M,{onClick:()=>C(p),active:p===a,size:l,children:p},p)),e.jsx(M,{size:l,onClick:f,disabled:a===u,children:e.jsx(me,{})})]})}function W(t,o){if(typeof t=="function")return t(o);t!=null&&(t.current=o)}function pt(...t){return o=>{let r=!1;const s=t.map(n=>{const i=W(n,o);return!r&&typeof i=="function"&&(r=!0),i});if(r)return()=>{for(let n=0;n<s.length;n++){const i=s[n];typeof i=="function"?i():W(t[n],null)}}}}function gt(...t){return d.useCallback(pt(...t),t)}function mt(t){const o=xt(t),r=d.forwardRef((s,n)=>{const{children:i,...l}=s,a=d.Children.toArray(i),c=a.find(Ct);if(c){const h=c.props.children,u=a.map(f=>f===c?d.Children.count(h)>1?d.Children.only(null):d.isValidElement(h)?h.props.children:null:f);return e.jsx(o,{...l,ref:n,children:d.isValidElement(h)?d.cloneElement(h,void 0,u):null})}return e.jsx(o,{...l,ref:n,children:i})});return r.displayName=`${t}.Slot`,r}function xt(t){const o=d.forwardRef((r,s)=>{const{children:n,...i}=r,l=d.isValidElement(n)?bt(n):void 0,a=gt(l,s);if(d.isValidElement(n)){const c=wt(i,n.props);return n.type!==d.Fragment&&(c.ref=a),d.cloneElement(n,c)}return d.Children.count(n)>1?d.Children.only(null):null});return o.displayName=`${t}.SlotClone`,o}var vt=Symbol("radix.slottable");function Ct(t){return d.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===vt}function wt(t,o){const r={...o};for(const s in o){const n=t[s],i=o[s];/^on[A-Z]/.test(s)?n&&i?r[s]=(...a)=>{const c=i(...a);return n(...a),c}:n&&(r[s]=n):s==="style"?r[s]={...n,...i}:s==="className"&&(r[s]=[n,i].filter(Boolean).join(" "))}return{...t,...r}}function bt(t){var s,n;let o=(s=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:s.get,r=o&&"isReactWarning"in o&&o.isReactWarning;return r?t.ref:(o=(n=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:n.get,r=o&&"isReactWarning"in o&&o.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}var yt=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],$t=yt.reduce((t,o)=>{const r=mt(`Primitive.${o}`),s=d.forwardRef((n,i)=>{const{asChild:l,...a}=n,c=l?r:o;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),e.jsx(c,{...a,ref:i})});return s.displayName=`Primitive.${o}`,{...t,[o]:s}},{}),jt=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Rt="VisuallyHidden",se=d.forwardRef((t,o)=>e.jsx($t.span,{...t,ref:o,style:{...jt,...t.style}}));se.displayName=Rt;var St=se;const It=m(null,{all:"unset",display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:1,border:"1px solid transparent",boxSizing:"border-box",cursor:"pointer","&:focus-visible":{boxShadow:"0 0 0 2px $colors$blueA7"},"&:disabled":{backgroundColor:"$grayA3",color:"$grayA8",cursor:"not-allowed"}}),kt=m(Se,{position:"fixed",inset:0,animation:`${xe} 150ms cubic-bezier(0.16, 1, 0.3, 1)`}),Mt=m(Ie,{position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",minWidth:"440px",maxHeight:"85vh",padding:"$3",borderRadius:"$5",overflow:"hidden",backgroundColor:"$subbg",boxShadow:"$popContainer",animation:`${ve} 150ms cubic-bezier(0.16, 1, 0.3, 1)`,"&:focus":{outline:"none"},"&[data-state=open]":{animation:`${Ce} 250ms ease`},"&[data-state=closed]":{animation:`${we} 250ms ease`}}),Pt=m(q,It,{position:"absolute",appearance:"none",height:"$6",width:"$6",top:"$2",right:"$2",alignItems:"center",justifyContent:"center",border:"none",borderRadius:"$3",color:"$gray10",zIndex:2,backgroundColor:"transparent","& > svg":{height:"18px",width:"18px"},"&:hover":{color:"$gray12",backgroundColor:"$gray4"},"&:focus":{boxShadow:"0 0 0 3px $colors$grayA7"},"&:focus-visble":{boxShadow:"0 0 0 3px $colors$grayA7"}});function Lt({children:t,zIndex:o,css:r,...s}){return e.jsxs(Le,{children:[e.jsx(kt,{className:"DialogOverlay",style:{zIndex:o}}),e.jsx(Mt,{className:"DialogContent",...s,css:{...r,zIndex:o},children:t})]})}const Tt=Pe,Vt=Lt,p0=q;function g0(t){return e.jsx(J,{asChild:!0,children:t.children})}function m0(t){const{trigger:o,children:r,closable:s,onOpenChange:n,disabled:i,css:l,zIndex:a,className:c,id:h,modal:u=!0,...f}=t;return e.jsxs(Tt,{onOpenChange:n,modal:u,...f,children:[o&&e.jsx(J,{asChild:!0,disabled:i,children:o}),e.jsxs(Vt,{id:h,css:l,zIndex:a,className:c,children:[e.jsxs(St,{children:[e.jsx(ke,{}),e.jsx(Me,{})]}),r,s&&e.jsx(Pt,{children:e.jsx(be,{})})]})]})}const K=m("div",{"&:after":{content:'""',position:"absolute"},variants:{variant:{solid:{borderColor:"$border","&:hover":{"&::after":{borderColor:"$blue10"}}},transparent:{"&::after":{borderColor:"transparent"},"&:hover":{"&::after":{borderColor:"$blue10"}}}},needPosition:{true:{position:"absolute"}},direction:{horizontal:{height:"100%",width:"4px",position:"absolute",cursor:"col-resize","&::after":{width:"4px",height:"100%",borderLeftWidth:"4px",borderLeftStyle:"solid",transition:"all .2s ease"}},vertical:{position:"absolute",height:"4px",width:"100%",cursor:"row-resize","&:after":{width:"100%",height:"4px",borderBottom:"4px solid $border",borderLeft:"none",transition:"all .2s ease"}}},position:{left:{top:0,left:0},right:{top:0,right:0},top:{top:0,left:0},bottom:{bottom:0,left:0}}},defaultVariants:{needPosition:!0,direction:"horizontal",position:"right",variant:"solid"}}),x0=d.forwardRef(function(o,r){const{children:s,range:n,direction:i="horizontal",handlerPosition:l="right",asChild:a=!1,variant:c="transparent",reverse:h=!1}=o,u=d.useRef(null),f=d.useRef(null),[v,C]=d.useState(n||{max:0,min:0}),[p,b]=d.useState({x:0,y:0}),[g,z]=d.useState({width:0,height:0}),[V,N]=d.useState(!1),S=({clientX:x,clientY:w})=>{if(!V)return;let y,$;h?(i==="horizontal"&&(y=k(g.width-(x-p.x),v.min,v.max)),i==="vertical"&&($=k(g.height-(w-p.y),v.min,v.max))):(i==="horizontal"&&(y=k(g.width+(x-p.x),v.min,v.max)),i==="vertical"&&($=k(g.height+(w-p.y),v.min,v.max))),i==="horizontal"&&(f.current.style.width=`${y}px`),i==="vertical"&&(f.current.style.height=`${$}px`)},I=d.useCallback(()=>{N(!1),z(x=>({...x,width:f.current.offsetWidth,height:f.current.offsetHeight}))},[]),O=x=>{x.preventDefault(),N(!0),b({x:x.clientX,y:x.clientY})};if(d.useEffect(()=>{const{offsetWidth:x,offsetHeight:w}=f.current;if(z({width:x,height:w}),!o.range){let y,$;i==="horizontal"&&(y=x-50,$=x+50,f.current.style.width=`${x}px`),i==="vertical"&&(y=w-50,$=w+50,f.current.style.height=`${w}px`),C({min:y,max:$})}f.current.style.flexGrow="initial"},[]),d.useEffect(()=>(u.current&&u.current.addEventListener("mousedown",O),V?(window.addEventListener("mousemove",S),window.addEventListener("mouseup",I)):(window.removeEventListener("mousemove",S),window.removeEventListener("mouseup",I)),()=>{u.current&&u.current.removeEventListener("mousedown",O),window.removeEventListener("mousemove",S),window.removeEventListener("mouseup",I)}),[V,i,S,I]),a){const x=E.Children.only(s),w=e.jsx(K,{variant:c,needPosition:!1,ref:u,direction:i,position:l},"resize-handler");return E.cloneElement(x,{...x.props,ref:_([r,f,x.props.ref]),style:{...x.props.style||{},position:"relative"}},[x.props.children,w])}return e.jsxs("div",{ref:_([r,f]),style:{position:"relative"},children:[s,e.jsx(K,{variant:c,ref:u,direction:i,position:l})]})}),le="galacean-editor-theme",T=new Set,ae=()=>typeof window<"u",de=()=>!ae(),H={light:ye.className,dark:$e.className,system:"system"},F="dark",Et=()=>{if(de())return F;try{const t=window.localStorage.getItem(le);return typeof t=="string"?t:F}catch(t){return console.warn(t),null}},Zt=()=>de()?F:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";function Ht(){if(!ae())return"dark";const t=document.documentElement;let o=Et();return o==null&&(o=Zt()),t.classList.add(H[o]),o}function v0(t){T.add(t)}function C0(t){T.delete(t)}const Ft=()=>{const[t,o]=d.useState(""),r=i=>{const l=document.documentElement;l.classList.remove(H[t]),l.classList.add(H[i]),o(i)},s=i=>{try{typeof i=="string"&&window.localStorage.setItem(le,i)}catch(l){console.warn(l)}};d.useEffect(()=>{const i=Ht();n(i)},[]),d.useEffect(()=>{function i(a){r(a.matches?"dark":"light")}function l(a){r(a.matches?"light":"dark")}return t==="system"&&(window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",i),window.matchMedia("(prefers-color-scheme: light)").addEventListener("change",l)),()=>{window.matchMedia("(prefers-color-scheme: dark)").removeEventListener("change",i),window.matchMedia("(prefers-color-scheme: light)").removeEventListener("change",l)}},[t]);const n=i=>{r(i),s(i),i&&T.size&&T.forEach(l=>{l(i)})};return{theme:t,setTheme:n}},Dt=d.createContext(null),w0=({children:t})=>{const{theme:o,setTheme:r}=Ft();return e.jsx(Dt.Provider,{value:{theme:o,setTheme:r},children:t})};export{T1 as Accordion,V1 as AccordionItem,$0 as ActionButton,j0 as ActionButtonGroup,so as AlertDialog,R0 as AssetItem,S0 as Badge,Z1 as BezierCurveEditor,I0 as Bold,k0 as BreadcrumbItem,M0 as Breadcrumbs,P0 as Button,F1 as Callout,L0 as CascadeSlider,T0 as Checkbox,V0 as Collapsible,E0 as ColorPicker,A1 as ContextMenu,m0 as Dialog,p0 as DialogCloseTrigger,g0 as DialogTrigger,Z0 as DragContext,H0 as DragDropContextProvider,h0 as DragPreview,B1 as DropdownMenu,a0 as EditableText,F0 as EyeDropperIcon,fe as Flex,_t as GalaceanLogo,D0 as GradientSlider,A0 as HDRSlider,B0 as HoverCard,Gt as IconAnimationControllerFile,Wt as IconAnimatorClipFile,Ut as IconCodeFile,Kt as IconFontFile,Qt as IconLottieFile,z0 as IconPendingFile,Xt as IconPrefabFile,N0 as IconRightBottomCorner,Yt as IconSceneFile,qt as IconShaderFile,e0 as IconSpineFile,Jt as IconSpineSkeletonFile,o0 as IconSpriteAltasFile,t0 as IconSpriteFile,n0 as IconUnknownFile,r0 as IconVrReferenceImageFile,he as Input,O0 as InputNumber,f0 as InsertionIndicator,z1 as Kbd,N1 as KbdGroup,_0 as Link,O1 as MenuCheckboxItem,_1 as MenuGroup,U1 as MenuItem,G1 as MenuRadioGroup,W1 as MenuSeparator,K1 as Menubar,Q1 as MenubarItem,X1 as MouseDoubleDownIcon,Y1 as MouseLeftDownIcon,q1 as MouseRightDownIcon,u0 as Pagination,U0 as ParticleSlider,G0 as Popover,W0 as PopoverCloseTrigger,s0 as Progress,x0 as ResizablePanel,J1 as ScrollArea,K0 as SegmentControl,Q0 as SegmentControlItem,X0 as Select,Y0 as SelectItem,q0 as Separator,J0 as Slider,e1 as Spin,eo as SubMenuItem,c0 as Table,ue as Text,t1 as Textarea,Dt as ThemeContext,w0 as ThemeProvider,o1 as Title,d0 as Toaster,n1 as ToggleGroup,r1 as ToggleGroupItem,oo as Tooltip,i1 as TreeGroup,s1 as TreeItemContent,l1 as TreeItemIcon,a1 as TreeItemPreview,d1 as TreeItemRoot,l0 as Triangle,v0 as addThemeChangeListener,c1 as animations,h1 as blendParticleStops,k as clamp,f1 as createDisplayColorSpaceToggle,u1 as createTheme,Y as css,$e as darkTheme,H as defaultThemes,p1 as denormalizeColor,g1 as generateHDR,m1 as generateLinearGradient,x1 as generatePreviewColor,v1 as getCssText,C1 as globalCss,w1 as isEqual,b1 as keyframes,ye as lightTheme,y1 as linearColorToSRGB,_ as mergeRefs,$1 as normalizeColor,j1 as recipes,C0 as removeThemeChangeListener,R1 as resetStyle,lo as showAlert,S1 as srgbColorToLinear,m as styled,I1 as theme,k1 as toNormalizeHexStr,ro as toast,M1 as useColorSpaceConversion,P1 as useDrag,pe as useDrop,Ft as useTheme};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var G=Object.defineProperty;var Y=(n,t,e)=>t in n?G(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var X=(n,t,e)=>(Y(n,typeof t!="symbol"?t+"":t,e),e);import{aT as x,aD as f,aY as $,E as b,bU as K,bT as F,u as Z,p as ee,e as p,bA as P,S as w,eo as re,dQ as te,aU as j,b9 as ne,cw as oe,aH as D,bz as ae,n as ie,cH as se,ep as q,C as m,t as B}from"./index-0a8702e2.js";import{a as d,b as O,c as E,d as z,e as L,f as V,g as W}from"./module-5c85b07e.js";import"./InstanceEditorAsset-a70e73fe.js";import"./ThumbnailMixin-35997457.js";import"./AssetPreviewer-24e31d97.js";import"./CanvasRenderer-9dd98cb3.js";import"./postmen-45d4c238.js";import{F as H}from"./FormItemArray-66be8701.js";import{c as ce,a as pe}from"./scriptPropertyActions-d3a583d2.js";import{n as le}from"./index-be6bc38a.js";const ue=x(function(t){const{model:e}=t,o=ce(e.properties,e.root);return f.jsx($.List,{fullWidth:!0,model:o,configs:e.propertiesConfig,onModelChange:(r,a)=>{a!==void 0&&pe(e.root,e.id,r,a)}})});var fe=Object.defineProperty,ge=Object.getOwnPropertyDescriptor,J=(n,t,e,o)=>{for(var r=o>1?void 0:o?ge(t,e):t,a=n.length-1,i;a>=0;a--)(i=n[a])&&(r=(o?i(t,e,r):i(r))||r);return o&&r&&fe(t,e,r),r};class h extends b{constructor(e,o){super(e,o);X(this,"propertiesConfig",[]);X(this,"properties",{})}onInitComplete(){const e=b.getRegisteredImportComponentProperty(this.type),{engineObject:o}=this,r={},a=[];for(let s=0;s<e.length;s++){const l=e[s];r[l.property]=o[l.property],a.push(l)}this.propertiesConfig=a;const{properties:i}=this;for(const[s,l]of Object.entries(r))i[s]=i[s]??l;Object.keys(i).forEach(s=>{K(this,s,{getActualEditorValue:()=>F(i[s]),setActualEditorValue:(l,c,u)=>{l.properties[c]=u}})})}deserialize(e){if(super.deserialize(e),e.props)for(const[o,r]of Object.entries(e.props))o!=="enabled"&&(this.properties[o]=r)}toJSON(){const e=super.toJSON();if(delete e.props.script,this.properties){const o=F(this.properties),r=e.props||{};for(const[a,i]of Object.entries(o))a!=="root"&&(r[a]=i);e.props=r}return e}}J([Z.ref],h.prototype,"propertiesConfig",2);J([ee({label:p("component.script.properties-label"),customComponent:ue})],h.prototype,"properties",2);function S(n,t){return S=Object.setPrototypeOf||function(o,r){return o.__proto__=r,o},S(n,t)}function y(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),t&&S(n,t)}var me=function(n){y(t,n);function t(){var o;return o=n.apply(this,arguments)||this,o.mode=d.AR,o}var e=t.prototype;return e.onEnable=function(){var r=this.engine.xrManager;if(r)switch(this.mode){case d.AR:var a;r.origin=this.origin;var i=(a=this.camera)==null?void 0:a.getComponent(P);if(i)r.cameraManager.attachCamera(O.Camera,i);else throw new Error("XROrigin: The Camera is not included on the Camera Entity");break;case d.VR:var s,l;r.origin=this.origin;var c=(s=this.leftCamera)==null?void 0:s.getComponent(P);if(c)r.cameraManager.attachCamera(O.LeftCamera,c);else throw new Error("XROrigin: The Camera is not included on the Left Camera Entity");var u=(l=this.rightCamera)==null?void 0:l.getComponent(P);if(u)r.cameraManager.attachCamera(O.RightCamera,u);else throw new Error("XROrigin: The Camera is not included on the Right Camera Entity");break}},t}(w);function N(n,t){for(var e=0;e<t.length;e++){var o=t[e];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(n,o.key,o)}}function de(n,t,e){return t&&N(n.prototype,t),e&&N(n,e),n}var he=function(n){y(t,n);function t(){var e;return e=n.apply(this,arguments)||this,e._destroyedOnRemoval=!0,e}return de(t,[{key:"data",get:function(){return this._data},set:function(o){this._data=o}},{key:"destroyedOnRemoval",get:function(){return this._destroyedOnRemoval},set:function(o){this._destroyedOnRemoval=o}}]),t}(w);function U(n,t){return t!=null&&typeof Symbol<"u"&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](n):n instanceof t}var M=function(n){y(t,n);function t(o,r){var a;return a=n.call(this,o)||this,a._trackIdToIndex=[],a._trackedComponents=[],a._feature=r,a._onTrackedChanged=a._onTrackedChanged.bind(a),a._onSessionChanged=a._onSessionChanged.bind(a),a}var e=t.prototype;return e.getTrackedComponentByTrackId=function(r){var a=this._trackIdToIndex[r];return a!==void 0?this._trackedComponents[a]:void 0},e.onEnable=function(){var r;(r=this.engine.xrManager)==null||r.sessionManager.addStateChangedListener(this._onSessionChanged)},e.onDisable=function(){var r,a=this.engine.xrManager;a&&((r=a.getFeature(this._feature))==null||r.removeChangedListener(this._onTrackedChanged),a.sessionManager.removeStateChangedListener(this._onSessionChanged))},e._onSessionChanged=function(r){switch(r){case E.Initializing:this._initXRFeature();break;case E.Initialized:var a=this._engine.xrManager.getFeature(this._feature);a?a.addChangedListener(this._onTrackedChanged):console.error("XRTrackedObjectManager: Feature ",this._feature.name," not found");break}},e._onTrackedChanged=function(r,a,i){if(r.length>0)for(var s=0,l=r.length;s<l;s++)this._createOrUpdateTrackedComponents(r[s]);if(a.length>0)for(var c=0,u=a.length;c<u;c++)this._createOrUpdateTrackedComponents(a[c]);if(i.length>0)for(var g=this,I=g._trackIdToIndex,v=g._trackedComponents,k=0,Q=i.length;k<Q;k++){var A=i[k].id,C=I[A];if(C!==void 0){var T=v[C];v.splice(C,1),delete I[A],T.destroyedOnRemoval?T.entity.destroy():T.entity.parent=null}}},e._createOrUpdateTrackedComponents=function(r){var a=this.getTrackedComponentByTrackId(r.id);if(!a){var i=this,s=i._trackIdToIndex,l=i._trackedComponents;a=this._createTrackedComponents(r),s[r.id]=l.length,l.push(a)}a.data=r;var c=a.entity.transform,u=r.pose;return c.position=u.position,c.rotationQuaternion=u.rotation,a},e._createTrackedComponents=function(r){var a=this._engine.xrManager.origin,i=this.prefab,s;return i?(U(i,re)?s=i.instantiateSceneRoot():U(i,te)?s=i.instantiate():s=i.clone(),s.name="TrackedImage"+r.id,a.addChild(s)):s=a.createChild("TrackedImage"+r.id),s.addComponent(he)},t}(w),ye=function(n){y(t,n);function t(o){var r;return r=n.call(this,o,z)||this,r.anchors=[],r}var e=t.prototype;return e._initXRFeature=function(){var r=this.anchors,a=this.engine.xrManager;try{for(var i=a.addFeature(z),s=0,l=r.length;s<l;s++){var c=r[s];i.addAnchor(c.position,c.rotation)}}catch(u){console.error("Anchor Tracking is not supported.",u)}},t}(M),be=function(n){y(t,n);function t(o){var r;return r=n.call(this,o,L)||this,r.trackingImages=[],r}var e=t.prototype;return e._initXRFeature=function(){try{this.engine.xrManager.addFeature(L,this.trackingImages)}catch(r){console.error("Image Tracking is not supported.",r)}},t}(M),xe=function(n){y(t,n);function t(o){var r;return r=n.call(this,o,V)||this,r.detectionMode=W.EveryThing,r}var e=t.prototype;return e._initXRFeature=function(){try{this.engine.xrManager.addFeature(V,this.detectionMode)}catch(r){console.error("Plane Tracking is not supported.",r)}},t}(M);const ve=x(({model:n,inspectorConfig:t,onModelChange:e})=>{const o=t.property||"anchors",r=n[o]||[],{t:a}=j();return f.jsx(f.Fragment,{children:f.jsx(H,{defaultValue:[],label:a("xr.anchor.list.label"),items:r.map((i,s)=>({removable:!0,children:f.jsx(_e,{item:i,onChange:l=>{const c=r.map((u,g)=>g!==s?u:l);e==null||e(o,c)}}),id:String(s),name:a("xr.anchor.item",{index:s})})),addable:!0,onAdd:()=>{const i=r.concat({position:{x:0,y:0,z:0},rotation:{x:0,y:0,z:0,w:1}});e==null||e(o,i)},onDelete:i=>{const s=Number(i.id),l=r.filter((c,u)=>u!==s);e==null||e(o,l)}})})}),_e=x(({item:n,onChange:t})=>{const{t:e}=j(),{position:o,rotation:r}=n;return f.jsxs(f.Fragment,{children:[f.jsx(ne,{label:e("xr.anchor.position"),info:e("xr.anchor.position"),value:{x:o.x,y:o.y,z:o.z},onChange:(a,i)=>{const s={...o,[i]:a[i]};t({...n,position:s})}}),f.jsx(oe,{label:e("xr.anchor.rotation"),info:e("xr.anchor.rotation"),value:{x:r.x,y:r.y,z:r.z,w:r.w},onChange:(a,i)=>{const s={...r,[i]:a[i]};t({...n,rotation:s})}})]})}),Re=D("div",{textAlign:"center"}),Ie=D("img",{maxHeight:"200px",maxWidth:"100%",height:"auto",width:"auto"}),ke=x(({model:n,inspectorConfig:t,onModelChange:e})=>{const o=t.property||"trackingImages",r=n[o]||[],{assets:a}=n.root.assetStore,{t:i}=j(),s=r.map((c,u)=>{const g=a[c.refId];return g?{removable:!0,children:f.jsx(Ce,{item:g,model:n}),id:String(u),arrow:!1,name:Te(g.name)}:null}).filter(Boolean),l=[];return Object.values(a).forEach(c=>{const{type:u}=c.getMetaConfig();u==="XRReferenceImage"&&!r.find(g=>g.refId===c.id)&&l.push(c)}),f.jsxs(f.Fragment,{children:[f.jsx(H,{defaultValue:[],label:i("xr.image.list.label"),info:i("xr.image.list.info"),items:s,onDelete:async c=>{const u=Number(c.id),g=r.filter((I,v)=>v!==u);e==null||e(o,g)}}),f.jsx(ae,{assets:l,dropLayer:ie.XRReferenceImage,onSelect:c=>{const u=r.concat(c.getCurrentRef());e==null||e(o,u)},placeholder:i("xr.image.select"),label:i("xr.image.add"),value:null,asset:null})]})}),Ce=x(({item:n,model:t})=>f.jsxs(f.Fragment,{children:[f.jsx(Re,{children:f.jsx(Ie,{src:n.imgUrl})}),f.jsx(se,{label:p("xr.image.width.label"),value:n.physicalWidth,onChange:e=>{t.root.inspectorFacade.assetChange(n.id,"physicalWidth",e,"asset-meta")}})]}));function Te(n,t=30){return n.length>t?n.slice(0,t-3)+"...":n}function R(n,t,e,o){b.registerComponent(n,e),b.registerCustomEngineComponent(n,t),b.registerImportComponentProperty(n,o)}const _={};q.on("ComponentAddToScene",n=>{const{type:t}=n;if(t)switch(t){case"XR Origin":case"XR Anchor Manager":case"XR Image Manager":case"XR Plane Manager":(_[t]=(_[t]||0)+1)>1&&le(p("xr.toast.only-one-effect"));break}});q.on("ComponentDestroyInScene",n=>{const{type:t}=n;!t||!_[t]||(_[t]-=1)});R("XR Origin",me,{class:h,componentsMenu:{label:p("xr.origin.title"),group:"XR"},type:"XR Origin",refMap:new Set,external:!1,unique:!0},[{type:m.SegmentControl,property:"mode",label:p("xr.origin.mode.label"),info:p("xr.origin.mode.info"),options:B(d,void 0,n=>p(`xr.origin.mode.${n.toLowerCase()}`))},{type:m.EntityPicker,property:"origin",label:p("xr.origin.origin.label"),info:p("xr.origin.origin.info"),when:n=>n.mode!==d.None},{type:m.EntityPicker,property:"camera",label:p("xr.origin.camera.label"),info:p("xr.origin.camera.info"),when:n=>n.mode===d.AR},{type:m.EntityPicker,property:"leftCamera",label:p("xr.origin.left-camera.label"),info:p("xr.origin.left-camera.info"),when:n=>n.mode===d.VR},{type:m.EntityPicker,property:"rightCamera",label:p("xr.origin.right-camera.label"),info:p("xr.origin.right-camera.info"),when:n=>n.mode===d.VR}]);R("XR Anchor Manager",ye,{class:h,componentsMenu:{label:p("xr.anchor.title"),group:"XR"},type:"XR Anchor Manager",refMap:new Set,external:!1,unique:!0},[{customComponent:ve,property:"anchors",label:p("xr.anchor.list.label"),info:p("xr.anchor.list.info")},{type:m.AssetPicker,assetType:"Prefab",property:"prefab",label:"Prefab",info:p("xr.prefab")}]);R("XR Image Manager",be,{class:h,componentsMenu:{label:p("xr.image.title"),group:"XR"},type:"XR Image Manager",refMap:new Set,external:!1,unique:!0},[{customComponent:ke,property:"trackingImages",label:p("xr.image.list.label"),info:p("xr.image.list.info")},{type:m.AssetPicker,assetType:"Prefab",property:"prefab",label:"Prefab",info:p("xr.prefab")}]);R("XR Plane Manager",xe,{class:h,componentsMenu:{label:p("xr.plane.title"),group:"XR"},type:"XR Plane Manager",refMap:new Set,external:!1,unique:!0},[{type:m.Select,property:"detectionMode",label:p("xr.plane.detection-mode.label"),info:p("xr.plane.detection-mode.info"),options:B(W)},{type:m.AssetPicker,assetType:"Prefab",property:"prefab",label:"Prefab",info:p("xr.prefab")}]);const Le=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));export{h as I,Le as i};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var w=Object.defineProperty;var O=(p,e,t)=>e in p?w(p,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):p[e]=t;var m=(p,e,t)=>(O(p,typeof e!="symbol"?e+"":e,t),t);import{aT as x,aU as E,aJ as I,aD as d,bS as T,aY as _,E as v,C as h,bT as g,u as S,p as C,e as b,bU as V,bV as j}from"./index-0a8702e2.js";import"./InstanceEditorAsset-a70e73fe.js";import"./ThumbnailMixin-35997457.js";import"./AssetPreviewer-24e31d97.js";import"./CanvasRenderer-9dd98cb3.js";import{c as N}from"./Component-f923abb1.js";import"./postmen-45d4c238.js";import{c as R,a as A,b as B}from"./scriptPropertyActions-d3a583d2.js";import"./TextureAsset-28fedf2a.js";import"./GlTFAsset-9c68f862.js";import"./MaterialAsset-74a15124.js";import"./MeshAsset-73e2cc8e.js";import"./AnimatorControllerAsset-b7424e9c.js";import"./AnimationClipAsset-01f3deb6.js";import"./SpriteAsset-9a31ec24.js";import"./SpriteAtlasAsset-a862db46.js";import"./AmbientLightAsset-f70b95f1.js";import"./LottieAsset-377c1419.js";import"./ShaderChunkAsset-83f923f4.js";import"./SpineSkeletonDataAsset-b64a3ee3.js";import"./FontAsset-abfb9a8a.js";import"./SceneAsset-8917c210.js";import"./ShaderAsset-cb3ff628.js";import"./PrimitiveMesh-3ce6fa2f.js";import"./XRReferenceImageAsset-6a6adb3b.js";import"./PrefabAsset-1a7edfbd.js";import"./PhysicsMaterialAsset-a5ac9f82.js";import"./RenderTargetAsset-33c0d9e7.js";import"./AudioAsset-eae03324.js";import"./index-59732f86.js";import"./MarkdownAsset-7ea387a9.js";import{E as F}from"./ShaderUIScriptAsset-d13fa4e2.js";import"./ThumbnailRegistry-495c18c9.js";import"./IconPlayerPlayFilled-b058c98f.js";import"./enum-58295f88.js";import"./encode-ac4bb64e.js";import"./meshopt_simplifier.module-cd99529d.js";import"./Tooltip-33f770ba.js";import"./AssetViewer-bc198e16.js";import"./ktx2-encoder-1e63c1eb.js";import"./TaskQueue-05c94a4d.js";import"./ktx-parse.modern-6c9f771f.js";import"./glTFIO-45ff9a17.js";import"./index-be6bc38a.js";import"./MaterialInspector-aec1248b.js";import"./IconPointFilled-a304fd34.js";import"./ProxyConfigs-4de3304c.js";import"./index-98982ce2.js";import"./MeshThumbnail-49273f71.js";import"./bundlers-9b0d37fc.js";import"./assetEditorActions-c4e5962f.js";import"./module-6406b050.js";import"./module-107b7430.js";import"./FormItemArray-66be8701.js";import"./Accordion-4897319b.js";import"./utilities-e09052e3.js";import"./module-5c85b07e.js";const D=["Input","Boolean","Switch","Toggle","Slider","Number","Vector2","Vector3","Vector4","Rect","Color","Select","AssetPicker","Textarea","SegmentControl"];function J(p){p=p.replace(/\/\/.*$/gm,"").replace(/,\s*}/gm,"}");const e=/@inspect\(['"](\w+)['"],?\s?(\{[\s\S]*?\})?\)\s*(?:public|private|static)?\s*(\w+)[:\s\w]+?\s*=\s*(?:['"]([^'"]*?)['"]|(-?[\w.]+));?/g,t=[];let o;for(;(o=e.exec(p))!==null;){let[,r,s,a,n,c]=o,l=n??c;if(D.indexOf(r)===-1){console.warn(`Unsupported property type: ${r}`);continue}let i={property:a.toString(),label:a.toString(),type:r};if(s){s=s.trim().replace(/\s+/g," ").replace(/'/g,'"').replace(/(\w+):/g,'"$1":');try{i=JSON.parse(s),i.type=r,i.label=i.label||a,i.property=i.property||a}catch{console.warn(`Failed to parse property options: ${s}`)}}["Number","Slider"].includes(r)&&(l=parseFloat(l)),t.push({propertyType:r,propertyOptions:i,propertyName:a,propertyValue:l})}return t}async function P(p){const e=J(p.code),t={success:!1,model:{},config:[]};for(let o=0;o<e.length;o++){const r=e[o];t.model[r.propertyName]=r.propertyValue,t.config.push(r.propertyOptions)}return t.success=!0,t}var M=Object.defineProperty,$=Object.getOwnPropertyDescriptor,f=(p,e,t,o)=>{for(var r=o>1?void 0:o?$(e,t):e,s=p.length-1,a;s>=0;s--)(a=p[s])&&(r=(o?a(e,t,r):a(r))||r);return o&&r&&M(e,t,r),r};const U=new BroadcastChannel("Galacean_Editor_Channel"),k=x(function(e){const{model:t}=e,{t:o}=E(),r=R(t.properties,t.root),s=n=>{Object.keys(n.properties).forEach(c=>{V(n,c,{getActualEditorValue:()=>g(n.properties[c]),setActualEditorValue:(l,i,y)=>{l.properties[i]=y}})})};async function a(){t.parsed=!1;const n=t.root.assetStore.assets[t.script.refId],c=await j.assets.getAssetInfo(n.serverId),l=await fetch(c.data.url).then(y=>y.text());await B(t.root,n.id,l,c.data.url);const i=await P(n);i.success&&(t.parsed=!0,t.propertiesConfig=i.config,t.properties=i.model,s(t))}return I.useEffect(()=>{t!=null&&t.properties&&s(t)},[t.properties]),t.script?d.jsxs(d.Fragment,{children:[d.jsx(T,{label:" ",async:a,children:o("component.script.parse-properties")}),t.parsed&&t.properties&&d.jsx(_.List,{model:r,configs:t.propertiesConfig,onModelChange:(n,c)=>{U.postMessage({type:"script-inspector-value-change",payload:{instanceId:t.id,property:n,value:c}}),A(t.root,t.id,n,c)}})]}):null});let u=class extends v{constructor(){super(...arguments);m(this,"parsed",!1);m(this,"propertiesConfig",[]);m(this,"isScript",!0);m(this,"script",null);m(this,"properties",{})}onInitComplete(){if(!this.script)return;this.root.assetStore.getAssetByRef(this.script).then(t=>{if(!t)throw new Error(`Cannot find file ${JSON.stringify(this.script)}`);return this.applyBoundPathChange("_scriptRef",h.AssetPicker,this.script).then(()=>P(t))}).then(t=>{this.propertiesConfig=t.config;for(const[o,r]of Object.entries(t.model))this.properties[o]=this.properties[o]??r;this.parsed=!0}).catch(t=>{console.warn(t)})}async applyBoundPathChange(e,t,o){if(e==="_scriptRef"){this.setBoundPathValue(e,h.Input,o);return}await super.applyBoundPathChange(e,t,o)}deserialize(e){if(super.deserialize(e),this.script=e.refId?{refId:e.refId}:null,e.props)for(const[t,o]of Object.entries(e.props))t!=="enabled"&&(this.properties[t]=o)}toJSON(){const e=super.toJSON();if(delete e.props.script,this.properties){const t=g(this.properties),o=e.props||{};for(const[r,s]of Object.entries(t))r!=="root"&&(o[r]=s);e.props=o}return this.script&&this.root.assetStore.assets[this.script.refId]&&(e.refId=this.script.refId),e}};f([S],u.prototype,"parsed",2);f([S.ref],u.prototype,"propertiesConfig",2);f([C({label:b("component.script.script-label"),type:h.AssetPicker,assetType:"script",bindPath:"_scriptRef",customFilter:p=>p.subType===F.Default,onLocate:p=>{p.onDoubleClick()}})],u.prototype,"script",2);f([C({label:b("component.script.properties-label"),customComponent:k})],u.prototype,"properties",2);u=f([N({type:"Script",componentsMenu:{label:"component.script.title"}})],u);export{u as ScriptComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{A as f,a as x}from"./AnimatorStore-fd98c00e.js";import"./index-0a8702e2.js";import"./InstanceEditorAsset-a70e73fe.js";import"./ThumbnailRegistry-495c18c9.js";import"./ThumbnailMixin-35997457.js";import"./CanvasRenderer-9dd98cb3.js";import"./AssetPreviewer-24e31d97.js";import"./IconPlayerPlayFilled-b058c98f.js";import"./Component-f923abb1.js";import"./postmen-45d4c238.js";export{f as AnimatorComponent,x as AnimatorStore};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const st=163,it=166;class q{constructor(){this.vkFormat=0,this.typeSize=1,this.pixelWidth=0,this.pixelHeight=0,this.pixelDepth=0,this.layerCount=0,this.faceCount=1,this.supercompressionScheme=0,this.levels=[],this.dataFormatDescriptor=[{vendorId:0,descriptorType:0,descriptorBlockSize:0,versionNumber:2,colorModel:0,colorPrimaries:1,transferFunction:2,flags:0,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],this.keyValue={},this.globalData=null}}class E{constructor(e,n,f,i){this._dataView=void 0,this._littleEndian=void 0,this._offset=void 0,this._dataView=new DataView(e.buffer,e.byteOffset+n,f),this._littleEndian=i,this._offset=0}_nextUint8(){const e=this._dataView.getUint8(this._offset);return this._offset+=1,e}_nextUint16(){const e=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,e}_nextUint32(){const e=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint64(){const e=this._dataView.getUint32(this._offset,this._littleEndian),n=this._dataView.getUint32(this._offset+4,this._littleEndian),f=e+2**32*n;return this._offset+=8,f}_nextInt32(){const e=this._dataView.getInt32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint8Array(e){const n=new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+this._offset,e);return this._offset+=e,n}_skip(e){return this._offset+=e,this}_scan(e,n=0){const f=this._offset;let i=0;for(;this._dataView.getUint8(this._offset)!==n&&i<e;)i++,this._offset++;return i<e&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+f,i)}}const J="KTX-Parse v0.7.1",K=new Uint8Array([0]),h=[171,75,84,88,32,50,48,187,13,10,26,10],V=68;function C(t){return new TextEncoder().encode(t)}function N(t){return new TextDecoder().decode(t)}function O(t){let e=0;for(const i of t)e+=i.byteLength;const n=new Uint8Array(e);let f=0;for(const i of t)n.set(new Uint8Array(i),f),f+=i.byteLength;return n}function Q(t,e){const n=Math.max(t,e),f=Math.min(t,e);let i=n;for(;i%f!==0;)i+=n;return i}function M(t,e=4){return Math.ceil(t/e)*e-t}function Z(t){return t.levels[0].levelData.byteLength/tt(t,0)}function tt(t,e){let n=1;const f=[t.pixelWidth,t.pixelHeight,t.pixelDepth],i=et(t);for(let u=0;u<3;u++)if(f[u]>0){const _=Math.ceil(Math.floor(f[u]*Math.pow(2,-e))/i[u]);n*=Math.max(1,_)}return t.layerCount>0&&(n*=t.layerCount),t.faceCount>0&&(n*=t.faceCount),n}function et(t){const[e,n,f]=t.dataFormatDescriptor[0].texelBlockDimension;return[e+1,n+1,f+1]}function rt(t){const e=new Uint8Array(t.buffer,t.byteOffset,h.length);if(e[0]!==h[0]||e[1]!==h[1]||e[2]!==h[2]||e[3]!==h[3]||e[4]!==h[4]||e[5]!==h[5]||e[6]!==h[6]||e[7]!==h[7]||e[8]!==h[8]||e[9]!==h[9]||e[10]!==h[10]||e[11]!==h[11])throw new Error("Missing KTX 2.0 identifier.");const n=new q,f=17*Uint32Array.BYTES_PER_ELEMENT,i=new E(t,h.length,f,!0);n.vkFormat=i._nextUint32(),n.typeSize=i._nextUint32(),n.pixelWidth=i._nextUint32(),n.pixelHeight=i._nextUint32(),n.pixelDepth=i._nextUint32(),n.layerCount=i._nextUint32(),n.faceCount=i._nextUint32();const u=i._nextUint32();n.supercompressionScheme=i._nextUint32();const _=i._nextUint32(),x=i._nextUint32(),a=i._nextUint32(),A=i._nextUint32(),B=i._nextUint64(),d=i._nextUint64(),g=u*3*8,D=new E(t,h.length+f,g,!0);for(let U=0;U<u;U++)n.levels.push({levelData:new Uint8Array(t.buffer,t.byteOffset+D._nextUint64(),D._nextUint64()),uncompressedByteLength:D._nextUint64()});const l=new E(t,_,x,!0),m={vendorId:l._skip(4)._nextUint16(),descriptorType:l._nextUint16(),versionNumber:l._nextUint16(),descriptorBlockSize:l._nextUint16(),colorModel:l._nextUint8(),colorPrimaries:l._nextUint8(),transferFunction:l._nextUint8(),flags:l._nextUint8(),texelBlockDimension:[l._nextUint8(),l._nextUint8(),l._nextUint8(),l._nextUint8()],bytesPlane:[l._nextUint8(),l._nextUint8(),l._nextUint8(),l._nextUint8(),l._nextUint8(),l._nextUint8(),l._nextUint8(),l._nextUint8()],samples:[]},w=6,b=4,L=(m.descriptorBlockSize/4-w)/b;for(let U=0;U<L;U++){const p={bitOffset:l._nextUint16(),bitLength:l._nextUint8(),channelType:l._nextUint8(),samplePosition:[l._nextUint8(),l._nextUint8(),l._nextUint8(),l._nextUint8()],sampleLower:-1/0,sampleUpper:1/0};p.channelType&64?(p.sampleLower=l._nextInt32(),p.sampleUpper=l._nextInt32()):(p.sampleLower=l._nextUint32(),p.sampleUpper=l._nextUint32()),m.samples[U]=p}n.dataFormatDescriptor.length=0,n.dataFormatDescriptor.push(m);const c=new E(t,a,A,!0);for(;c._offset<A;){const U=c._nextUint32(),p=c._scan(U),v=N(p);if(n.keyValue[v]=c._nextUint8Array(U-p.byteLength-1),v.match(/^ktx/i)){const H=N(n.keyValue[v]);n.keyValue[v]=H.substring(0,H.lastIndexOf("\0"))}const $=U%4?4-U%4:0;c._skip($)}if(d<=0)return n;const s=new E(t,B,d,!0),r=s._nextUint16(),o=s._nextUint16(),y=s._nextUint32(),R=s._nextUint32(),S=s._nextUint32(),G=s._nextUint32(),F=[];for(let U=0;U<u;U++)F.push({imageFlags:s._nextUint32(),rgbSliceByteOffset:s._nextUint32(),rgbSliceByteLength:s._nextUint32(),alphaSliceByteOffset:s._nextUint32(),alphaSliceByteLength:s._nextUint32()});const I=B+s._offset,k=I+y,P=k+R,z=P+S,W=new Uint8Array(t.buffer,t.byteOffset+I,y),Y=new Uint8Array(t.buffer,t.byteOffset+k,R),X=new Uint8Array(t.buffer,t.byteOffset+P,S),j=new Uint8Array(t.buffer,t.byteOffset+z,G);return n.globalData={endpointCount:r,selectorCount:o,imageDescs:F,endpointsData:W,selectorsData:Y,tablesData:X,extendedData:j},n}function T(){return T=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var f in n)Object.prototype.hasOwnProperty.call(n,f)&&(t[f]=n[f])}return t},T.apply(this,arguments)}const nt={keepWriter:!1};function lt(t,e={}){e=T({},nt,e);let n=new ArrayBuffer(0);if(t.globalData){const s=new ArrayBuffer(20+t.globalData.imageDescs.length*5*4),r=new DataView(s);r.setUint16(0,t.globalData.endpointCount,!0),r.setUint16(2,t.globalData.selectorCount,!0),r.setUint32(4,t.globalData.endpointsData.byteLength,!0),r.setUint32(8,t.globalData.selectorsData.byteLength,!0),r.setUint32(12,t.globalData.tablesData.byteLength,!0),r.setUint32(16,t.globalData.extendedData.byteLength,!0);for(let o=0;o<t.globalData.imageDescs.length;o++){const y=t.globalData.imageDescs[o];r.setUint32(20+o*5*4+0,y.imageFlags,!0),r.setUint32(20+o*5*4+4,y.rgbSliceByteOffset,!0),r.setUint32(20+o*5*4+8,y.rgbSliceByteLength,!0),r.setUint32(20+o*5*4+12,y.alphaSliceByteOffset,!0),r.setUint32(20+o*5*4+16,y.alphaSliceByteLength,!0)}n=O([s,t.globalData.endpointsData,t.globalData.selectorsData,t.globalData.tablesData,t.globalData.extendedData])}const f=[];let i=t.keyValue;e.keepWriter||(i=T({},t.keyValue,{KTXwriter:J}));for(const s in i){const r=i[s],o=C(s),y=typeof r=="string"?O([C(r),K]):r,R=o.byteLength+1+y.byteLength,S=M(R,4);f.push(O([new Uint32Array([R]),o,K,y,new Uint8Array(S).fill(0)]))}const u=O(f);if(t.dataFormatDescriptor.length!==1||t.dataFormatDescriptor[0].descriptorType!==0)throw new Error("Only BASICFORMAT Data Format Descriptor output supported.");const _=t.dataFormatDescriptor[0],x=new ArrayBuffer(28+_.samples.length*16),a=new DataView(x),A=24+_.samples.length*16;if(a.setUint32(0,x.byteLength,!0),a.setUint16(4,_.vendorId,!0),a.setUint16(6,_.descriptorType,!0),a.setUint16(8,_.versionNumber,!0),a.setUint16(10,A,!0),a.setUint8(12,_.colorModel),a.setUint8(13,_.colorPrimaries),a.setUint8(14,_.transferFunction),a.setUint8(15,_.flags),!Array.isArray(_.texelBlockDimension))throw new Error("texelBlockDimension is now an array. For dimensionality `d`, set `d - 1`.");a.setUint8(16,_.texelBlockDimension[0]),a.setUint8(17,_.texelBlockDimension[1]),a.setUint8(18,_.texelBlockDimension[2]),a.setUint8(19,_.texelBlockDimension[3]);for(let s=0;s<8;s++)a.setUint8(20+s,_.bytesPlane[s]);for(let s=0;s<_.samples.length;s++){const r=_.samples[s],o=28+s*16;if(r.channelID)throw new Error("channelID has been renamed to channelType.");a.setUint16(o+0,r.bitOffset,!0),a.setUint8(o+2,r.bitLength),a.setUint8(o+3,r.channelType),a.setUint8(o+4,r.samplePosition[0]),a.setUint8(o+5,r.samplePosition[1]),a.setUint8(o+6,r.samplePosition[2]),a.setUint8(o+7,r.samplePosition[3]),r.channelType&64?(a.setInt32(o+8,r.sampleLower,!0),a.setInt32(o+12,r.sampleUpper,!0)):(a.setUint32(o+8,r.sampleLower,!0),a.setUint32(o+12,r.sampleUpper,!0))}const B=h.length+V+t.levels.length*3*8,d=B+x.byteLength;let g=n.byteLength>0?d+u.byteLength:0;g%8&&(g+=8-g%8);const D=[],l=new DataView(new ArrayBuffer(t.levels.length*3*8)),m=new Uint32Array(t.levels.length);let w=0;t.supercompressionScheme===0&&(w=Q(Z(t),4));let b=(g||d+u.byteLength)+n.byteLength;for(let s=t.levels.length-1;s>=0;s--){if(b%w){const o=M(b,w);D.push(new Uint8Array(o)),b+=o}const r=t.levels[s];D.push(r.levelData),m[s]=b,b+=r.levelData.byteLength}for(let s=0;s<t.levels.length;s++){const r=t.levels[s];l.setBigUint64(s*24+0,BigInt(m[s]),!0),l.setBigUint64(s*24+8,BigInt(r.levelData.byteLength),!0),l.setBigUint64(s*24+16,BigInt(r.uncompressedByteLength),!0)}const L=new ArrayBuffer(V),c=new DataView(L);return c.setUint32(0,t.vkFormat,!0),c.setUint32(4,t.typeSize,!0),c.setUint32(8,t.pixelWidth,!0),c.setUint32(12,t.pixelHeight,!0),c.setUint32(16,t.pixelDepth,!0),c.setUint32(20,t.layerCount,!0),c.setUint32(24,t.faceCount,!0),c.setUint32(28,t.levels.length,!0),c.setUint32(32,t.supercompressionScheme,!0),c.setUint32(36,B,!0),c.setUint32(40,x.byteLength,!0),c.setUint32(44,d,!0),c.setUint32(48,u.byteLength,!0),c.setBigUint64(52,BigInt(n.byteLength>0?g:0),!0),c.setBigUint64(60,BigInt(n.byteLength),!0),new Uint8Array(O([new Uint8Array(h).buffer,L,l.buffer,x,u,g>0?new ArrayBuffer(g-(d+u.byteLength)):new ArrayBuffer(0),n,...D]))}export{st as K,it as a,rt as r,lt as w};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var k=Object.defineProperty;var m=(n,e,r)=>e in n?k(n,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[e]=r;var i=(n,e,r)=>(m(n,typeof e!="symbol"?e+"":e,r),r);import{cf as w,cg as _,ch as d,ci as c,cj as f}from"./index-0a8702e2.js";import{T as g}from"./TaskQueue-05c94a4d.js";import{r as p,w as y}from"./ktx-parse.modern-6c9f771f.js";class T{constructor(e=4,r){i(this,"_taskQueue",[]);i(this,"_workerStatus",0);i(this,"_workerItems");this.limitedCount=e,this._workerCreator=r,this._workerItems=new Array(e)}prepareWorker(){const e=this.limitedCount,r=new Array(e);for(let t=0;t<e;t++)r.push(this._initWorker(t));return Promise.all(r)}postMessage(e){return new Promise((r,t)=>{const s=this._getIdleWorkerId();if(this._workerStatus|=1<<s,s!==-1){const a=this._workerItems;Promise.resolve(a[s]??this._initWorker(s)).then(()=>{const o=a[s];o.resolve=r,o.reject=t,o.worker.postMessage(e)}).catch(o=>{this._workerStatus^=1<<s,t(o)})}else this._taskQueue.push({resolve:r,reject:t,message:e})})}destroy(){const e=this._workerItems;for(let r=0,t=e.length;r<t;r++){const s=e[r];s.worker.terminate(),s.reject=null,s.resolve=null}e.length=0,this._taskQueue.length=0,this._workerStatus=0}_initWorker(e){return Promise.resolve(this._workerCreator()).then(r=>{const t=s=>{const a=this._workerItems[e];a!=null&&a.reject&&(a.reject(s.error||new Error("Worker error")),this._nextTask(e))};return r.addEventListener("message",this._onMessage.bind(this,e)),r.addEventListener("error",t),r.onerror=t,this._workerItems[e]={worker:r,resolve:null,reject:null},r})}_getIdleWorkerId(){for(let e=0,r=this.limitedCount;e<r;e++)if(!(this._workerStatus&1<<e))return e;return-1}_onMessage(e,r){r.data.error?this._workerItems[e].reject(r.data.error):this._workerItems[e].resolve(r),this._nextTask(e)}_nextTask(e){if(this._taskQueue.length){const r=this._taskQueue.shift(),t=this._workerItems[e];t.resolve=r.resolve,t.reject=r.reject,t.worker.postMessage(r.message)}else this._workerStatus^=1<<e}}function x(n,e){const r=p(n);return r.keyValue.GalaceanTextureParams=new Uint8Array([e.wrapModeU,e.wrapModeV,e.filterMode,e.anisoLevel]),y(r)}const P=new g,l=w("ktx2","upload-cache");class S{get(e){return P.enqueue(()=>_(e,l))}set(e,r){return d(e,r,l)}}const u=new S,W=f("ktx2");class I{constructor(){i(this,"encoderWorkerPool");i(this,"initPromise");this.encoderWorkerPool=new T(4,()=>new Worker(new URL("/_static/ktx2-worker-a04f41ea.js",self.location),{type:"module"})),this.initPromise=this.encoderWorkerPool.prepareWorker()}async encode(e,r={isUASTC:!1,enableDebug:!1,qualityLevel:255,generateMipmap:!0,isSetKTX2SRGBTransferFunc:!1}){let t;const s=c.create();if(Array.isArray(e)&&Array.isArray(e[0])){for(const o of e)for(const h of o)s.update(h);t=s.hex()}else if(Array.isArray(e)){for(const o of e)s.update(o);t=s.hex()}else t=c(e);const a=t+JSON.stringify(r);try{const o=await u.get(a);if(o)return o}catch(o){console.error(o)}return this._encode(a,e,r)}setTextureParams(e,r){return x(e,r)}async _encode(e,r,t={isUASTC:!1,enableDebug:!1,qualityLevel:255,generateMipmap:!0,isSetKTX2SRGBTransferFunc:!1}){W.info(`cannot find cache, use worker encoder for ${e}`),await this.initPromise;const{data:s}=await this.encoderWorkerPool.postMessage({buffer:r,options:t});return u.set(e,s),s}}const C=new I;export{C as k};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(){"use strict";class q{constructor(){this.vkFormat=0,this.typeSize=1,this.pixelWidth=0,this.pixelHeight=0,this.pixelDepth=0,this.layerCount=0,this.faceCount=1,this.supercompressionScheme=0,this.levels=[],this.dataFormatDescriptor=[{vendorId:0,descriptorType:0,descriptorBlockSize:0,versionNumber:2,colorModel:0,colorPrimaries:1,transferFunction:2,flags:0,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],this.keyValue={},this.globalData=null}}class R{constructor(t,n,s,i){this._dataView=void 0,this._littleEndian=void 0,this._offset=void 0,this._dataView=new DataView(t.buffer,t.byteOffset+n,s),this._littleEndian=i,this._offset=0}_nextUint8(){const t=this._dataView.getUint8(this._offset);return this._offset+=1,t}_nextUint16(){const t=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,t}_nextUint32(){const t=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,t}_nextUint64(){const t=this._dataView.getUint32(this._offset,this._littleEndian),n=this._dataView.getUint32(this._offset+4,this._littleEndian),s=t+2**32*n;return this._offset+=8,s}_nextInt32(){const t=this._dataView.getInt32(this._offset,this._littleEndian);return this._offset+=4,t}_nextUint8Array(t){const n=new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+this._offset,t);return this._offset+=t,n}_skip(t){return this._offset+=t,this}_scan(t,n=0){const s=this._offset;let i=0;for(;this._dataView.getUint8(this._offset)!==n&&i<t;)i++,this._offset++;return i<t&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+s,i)}}const $="KTX-Parse v0.7.1",H=new Uint8Array([0]),d=[171,75,84,88,32,50,48,187,13,10,26,10],K=68;function V(e){return new TextEncoder().encode(e)}function N(e){return new TextDecoder().decode(e)}function S(e){let t=0;for(const i of e)t+=i.byteLength;const n=new Uint8Array(t);let s=0;for(const i of e)n.set(new Uint8Array(i),s),s+=i.byteLength;return n}function J(e,t){const n=Math.max(e,t),s=Math.min(e,t);let i=n;for(;i%s!==0;)i+=n;return i}function G(e,t=4){return Math.ceil(e/t)*t-e}function Z(e){return e.levels[0].levelData.byteLength/ee(e,0)}function ee(e,t){let n=1;const s=[e.pixelWidth,e.pixelHeight,e.pixelDepth],i=te(e);for(let f=0;f<3;f++)if(s[f]>0){const o=Math.ceil(Math.floor(s[f]*Math.pow(2,-t))/i[f]);n*=Math.max(1,o)}return e.layerCount>0&&(n*=e.layerCount),e.faceCount>0&&(n*=e.faceCount),n}function te(e){const[t,n,s]=e.dataFormatDescriptor[0].texelBlockDimension;return[t+1,n+1,s+1]}function O(e){const t=new Uint8Array(e.buffer,e.byteOffset,d.length);if(t[0]!==d[0]||t[1]!==d[1]||t[2]!==d[2]||t[3]!==d[3]||t[4]!==d[4]||t[5]!==d[5]||t[6]!==d[6]||t[7]!==d[7]||t[8]!==d[8]||t[9]!==d[9]||t[10]!==d[10]||t[11]!==d[11])throw new Error("Missing KTX 2.0 identifier.");const n=new q,s=17*Uint32Array.BYTES_PER_ELEMENT,i=new R(e,d.length,s,!0);n.vkFormat=i._nextUint32(),n.typeSize=i._nextUint32(),n.pixelWidth=i._nextUint32(),n.pixelHeight=i._nextUint32(),n.pixelDepth=i._nextUint32(),n.layerCount=i._nextUint32(),n.faceCount=i._nextUint32();const f=i._nextUint32();n.supercompressionScheme=i._nextUint32();const o=i._nextUint32(),_=i._nextUint32(),a=i._nextUint32(),D=i._nextUint32(),m=i._nextUint64(),y=i._nextUint64(),U=f*3*8,g=new R(e,d.length+s,U,!0);for(let x=0;x<f;x++)n.levels.push({levelData:new Uint8Array(e.buffer,e.byteOffset+g._nextUint64(),g._nextUint64()),uncompressedByteLength:g._nextUint64()});const r=new R(e,o,_,!0),p={vendorId:r._skip(4)._nextUint16(),descriptorType:r._nextUint16(),versionNumber:r._nextUint16(),descriptorBlockSize:r._nextUint16(),colorModel:r._nextUint8(),colorPrimaries:r._nextUint8(),transferFunction:r._nextUint8(),flags:r._nextUint8(),texelBlockDimension:[r._nextUint8(),r._nextUint8(),r._nextUint8(),r._nextUint8()],bytesPlane:[r._nextUint8(),r._nextUint8(),r._nextUint8(),r._nextUint8(),r._nextUint8(),r._nextUint8(),r._nextUint8(),r._nextUint8()],samples:[]},A=6,B=4,L=(p.descriptorBlockSize/4-A)/B;for(let x=0;x<L;x++){const w={bitOffset:r._nextUint16(),bitLength:r._nextUint8(),channelType:r._nextUint8(),samplePosition:[r._nextUint8(),r._nextUint8(),r._nextUint8(),r._nextUint8()],sampleLower:-1/0,sampleUpper:1/0};w.channelType&64?(w.sampleLower=r._nextInt32(),w.sampleUpper=r._nextInt32()):(w.sampleLower=r._nextUint32(),w.sampleUpper=r._nextUint32()),p.samples[x]=w}n.dataFormatDescriptor.length=0,n.dataFormatDescriptor.push(p);const h=new R(e,a,D,!0);for(;h._offset<D;){const x=h._nextUint32(),w=h._scan(x),I=N(w);if(n.keyValue[I]=h._nextUint8Array(x-w.byteLength-1),I.match(/^ktx/i)){const z=N(n.keyValue[I]);n.keyValue[I]=z.substring(0,z.lastIndexOf("\0"))}const ge=x%4?4-x%4:0;h._skip(ge)}if(y<=0)return n;const l=new R(e,m,y,!0),c=l._nextUint16(),u=l._nextUint16(),b=l._nextUint32(),T=l._nextUint32(),F=l._nextUint32(),fe=l._nextUint32(),W=[];for(let x=0;x<f;x++)W.push({imageFlags:l._nextUint32(),rgbSliceByteOffset:l._nextUint32(),rgbSliceByteLength:l._nextUint32(),alphaSliceByteOffset:l._nextUint32(),alphaSliceByteLength:l._nextUint32()});const Y=m+l._offset,j=Y+b,Q=j+T,ue=Q+F,_e=new Uint8Array(e.buffer,e.byteOffset+Y,b),he=new Uint8Array(e.buffer,e.byteOffset+j,T),ye=new Uint8Array(e.buffer,e.byteOffset+Q,F),Ue=new Uint8Array(e.buffer,e.byteOffset+ue,fe);return n.globalData={endpointCount:c,selectorCount:u,imageDescs:W,endpointsData:_e,selectorsData:he,tablesData:ye,extendedData:Ue},n}function v(){return v=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},v.apply(this,arguments)}const ne={keepWriter:!1};function k(e,t={}){t=v({},ne,t);let n=new ArrayBuffer(0);if(e.globalData){const l=new ArrayBuffer(20+e.globalData.imageDescs.length*5*4),c=new DataView(l);c.setUint16(0,e.globalData.endpointCount,!0),c.setUint16(2,e.globalData.selectorCount,!0),c.setUint32(4,e.globalData.endpointsData.byteLength,!0),c.setUint32(8,e.globalData.selectorsData.byteLength,!0),c.setUint32(12,e.globalData.tablesData.byteLength,!0),c.setUint32(16,e.globalData.extendedData.byteLength,!0);for(let u=0;u<e.globalData.imageDescs.length;u++){const b=e.globalData.imageDescs[u];c.setUint32(20+u*5*4+0,b.imageFlags,!0),c.setUint32(20+u*5*4+4,b.rgbSliceByteOffset,!0),c.setUint32(20+u*5*4+8,b.rgbSliceByteLength,!0),c.setUint32(20+u*5*4+12,b.alphaSliceByteOffset,!0),c.setUint32(20+u*5*4+16,b.alphaSliceByteLength,!0)}n=S([l,e.globalData.endpointsData,e.globalData.selectorsData,e.globalData.tablesData,e.globalData.extendedData])}const s=[];let i=e.keyValue;t.keepWriter||(i=v({},e.keyValue,{KTXwriter:$}));for(const l in i){const c=i[l],u=V(l),b=typeof c=="string"?S([V(c),H]):c,T=u.byteLength+1+b.byteLength,F=G(T,4);s.push(S([new Uint32Array([T]),u,H,b,new Uint8Array(F).fill(0)]))}const f=S(s);if(e.dataFormatDescriptor.length!==1||e.dataFormatDescriptor[0].descriptorType!==0)throw new Error("Only BASICFORMAT Data Format Descriptor output supported.");const o=e.dataFormatDescriptor[0],_=new ArrayBuffer(28+o.samples.length*16),a=new DataView(_),D=24+o.samples.length*16;if(a.setUint32(0,_.byteLength,!0),a.setUint16(4,o.vendorId,!0),a.setUint16(6,o.descriptorType,!0),a.setUint16(8,o.versionNumber,!0),a.setUint16(10,D,!0),a.setUint8(12,o.colorModel),a.setUint8(13,o.colorPrimaries),a.setUint8(14,o.transferFunction),a.setUint8(15,o.flags),!Array.isArray(o.texelBlockDimension))throw new Error("texelBlockDimension is now an array. For dimensionality `d`, set `d - 1`.");a.setUint8(16,o.texelBlockDimension[0]),a.setUint8(17,o.texelBlockDimension[1]),a.setUint8(18,o.texelBlockDimension[2]),a.setUint8(19,o.texelBlockDimension[3]);for(let l=0;l<8;l++)a.setUint8(20+l,o.bytesPlane[l]);for(let l=0;l<o.samples.length;l++){const c=o.samples[l],u=28+l*16;if(c.channelID)throw new Error("channelID has been renamed to channelType.");a.setUint16(u+0,c.bitOffset,!0),a.setUint8(u+2,c.bitLength),a.setUint8(u+3,c.channelType),a.setUint8(u+4,c.samplePosition[0]),a.setUint8(u+5,c.samplePosition[1]),a.setUint8(u+6,c.samplePosition[2]),a.setUint8(u+7,c.samplePosition[3]),c.channelType&64?(a.setInt32(u+8,c.sampleLower,!0),a.setInt32(u+12,c.sampleUpper,!0)):(a.setUint32(u+8,c.sampleLower,!0),a.setUint32(u+12,c.sampleUpper,!0))}const m=d.length+K+e.levels.length*3*8,y=m+_.byteLength;let U=n.byteLength>0?y+f.byteLength:0;U%8&&(U+=8-U%8);const g=[],r=new DataView(new ArrayBuffer(e.levels.length*3*8)),p=new Uint32Array(e.levels.length);let A=0;e.supercompressionScheme===0&&(A=J(Z(e),4));let B=(U||y+f.byteLength)+n.byteLength;for(let l=e.levels.length-1;l>=0;l--){if(B%A){const u=G(B,A);g.push(new Uint8Array(u)),B+=u}const c=e.levels[l];g.push(c.levelData),p[l]=B,B+=c.levelData.byteLength}for(let l=0;l<e.levels.length;l++){const c=e.levels[l];r.setBigUint64(l*24+0,BigInt(p[l]),!0),r.setBigUint64(l*24+8,BigInt(c.levelData.byteLength),!0),r.setBigUint64(l*24+16,BigInt(c.uncompressedByteLength),!0)}const L=new ArrayBuffer(K),h=new DataView(L);return h.setUint32(0,e.vkFormat,!0),h.setUint32(4,e.typeSize,!0),h.setUint32(8,e.pixelWidth,!0),h.setUint32(12,e.pixelHeight,!0),h.setUint32(16,e.pixelDepth,!0),h.setUint32(20,e.layerCount,!0),h.setUint32(24,e.faceCount,!0),h.setUint32(28,e.levels.length,!0),h.setUint32(32,e.supercompressionScheme,!0),h.setUint32(36,m,!0),h.setUint32(40,_.byteLength,!0),h.setUint32(44,y,!0),h.setUint32(48,f.byteLength,!0),h.setBigUint64(52,BigInt(n.byteLength>0?U:0),!0),h.setBigUint64(60,BigInt(n.byteLength),!0),new Uint8Array(S([new Uint8Array(d).buffer,L,r.buffer,_,f,U>0?new ArrayBuffer(U-(y+f.byteLength)):new ArrayBuffer(0),n,...g]))}const se={enableDebug:!1,isUASTC:!0,isKTX2File:!0,isInputSRGB:!0,generateMipmap:!0,needSupercompression:!0,isSetKTX2SRGBTransferFunc:!0,isHDR:!1,qualityLevel:150};function X(e={},t){e={...se,...e},e.enableDebug!==void 0&&t.setDebug(e.enableDebug),e.isUASTC!==void 0&&t.setUASTC(e.isUASTC),e.isKTX2File!==void 0&&t.setCreateKTX2File(e.isKTX2File),e.isSetKTX2SRGBTransferFunc!==void 0&&t.setKTX2SRGBTransferFunc(e.isSetKTX2SRGBTransferFunc),e.generateMipmap!==void 0&&t.setMipGen(e.generateMipmap),e.isYFlip!==void 0&&t.setYFlip(e.isYFlip),e.isNormalMap===!0&&t.setNormalMap(),e.qualityLevel!==void 0&&t.setQualityLevel(e.qualityLevel),e.compressionLevel!==void 0&&t.setCompressionLevel(e.compressionLevel),e.needSupercompression!==void 0&&t.setKTX2UASTCSupercompression(e.needSupercompression),e.enableRDO&&t.setRDOUASTC(!0),e.rdoQualityLevel!==void 0&&t.setRDOUASTCQualityScalar(e.rdoQualityLevel),e.uastcLDRQualityLevel!==void 0&&t.setPackUASTCFlags(e.uastcLDRQualityLevel),e.isHDR&&(t.setHDR(e.isHDR),e.hdrQualityLevel&&t.setUASTCHDRQualityLevel(e.hdrQualityLevel)),e.isPerceptual!==void 0&&t.setPerceptual(e.isPerceptual)}var E=(e=>(e[e.cBASISTexType2D=0]="cBASISTexType2D",e[e.cBASISTexType2DArray=1]="cBASISTexType2DArray",e[e.cBASISTexTypeCubemapArray=2]="cBASISTexTypeCubemapArray",e[e.cBASISTexTypeVideoFrames=3]="cBASISTexTypeVideoFrames",e[e.cBASISTexTypeVolume=4]="cBASISTexTypeVolume",e))(E||{}),C=(e=>(e[e.RAW=0]="RAW",e[e.PNG=1]="PNG",e))(C||{}),P=(e=>(e[e.RGBAHalfFloat=0]="RGBAHalfFloat",e[e.RGBAFloat=1]="RGBAFloat",e[e.EXR=3]="EXR",e[e.HDR=4]="HDR",e))(P||{});const ie="https://mdn.alipayobjects.com/rms/afts/file/A*r7D4SKbksYcAAAAAAAAAAAAAARQnAQ/basis_encoder.wasm";let M=null;async function ae(e){return M||(M=(async()=>{const t=(e==null?void 0:e.wasmUrl)??ie,n=(e==null?void 0:e.jsUrl)??"../basis/basis_encoder.js",[{default:s},i]=await Promise.all([fetch(n).then(o=>o.text()).then(o=>{const _=new Blob([o],{type:"application/javascript"});return import(URL.createObjectURL(_))}),t?fetch(t).then(o=>o.arrayBuffer()):void 0]),f=await s({wasmBinary:i});return f.initializeBasis(),f})()),M}async function re(e){const n=(()=>{let D=null;return()=>(D||(D=new OffscreenCanvas(128,128).getContext("webgl2",{premultipliedAlpha:!1})),D)})()(),s=await createImageBitmap(new Blob([e])),i=n.createTexture();n.bindTexture(n.TEXTURE_2D,i),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,s);const f=n.createFramebuffer();n.bindFramebuffer(n.FRAMEBUFFER,f),n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,i,0);const{width:o,height:_}=s,a=new Uint8Array(o*_*4);return n.readPixels(0,0,o,_,n.RGBA,n.UNSIGNED_BYTE,a),n.deleteTexture(i),n.deleteFramebuffer(f),{data:a,width:o,height:_}}class le{async encode(t,n={}){const s=await ae(n);n.imageDecoder??(n.imageDecoder=re);const i=new s.BasisEncoder,f=Array.isArray(t)&&Array.isArray(t[0]),o=f||Array.isArray(t)&&t.length===6;if(f)return i.delete(),this._encodeCubeMipmap(s,t,n);X(n,i),i.setTexType(o?E.cBASISTexTypeCubemapArray:E.cBASISTexType2D);{const m=Array.isArray(t)?t:[t];for(let y=0;y<m.length;y++){const U=m[y];if(n.isHDR){const g=n.imageType,r=g===P.RGBAHalfFloat||g===P.RGBAFloat;i.setSliceSourceImageHDR(y,U,r?n.width:0,r?n.height:0,g,!0)}else{const g=await n.imageDecoder(U);i.setSliceSourceImage(y,new Uint8Array(g.data),g.width,g.height,C.RAW)}}}const _=new Uint8Array(1024*1024*(n.isHDR?24:10)),a=i.encode(_);if(a===0)throw new Error("Encode failed");let D=new Uint8Array(_.buffer,0,a);if(n.kvData){const m=O(D);for(let y in n.kvData)m.keyValue[y]=n.kvData[y];D=k(m,{keepWriter:!0})}return D}async _encodeCubeMipmap(t,n,s){const i={...s,generateMipmap:!1},f=s.width,o=s.height;let _=null;for(let a=0;a<n.length;a++){const D=n[a],m=f>>a,y=o>>a,U=new t.BasisEncoder;X(i,U),U.setTexType(E.cBASISTexTypeCubemapArray);for(let A=0;A<D.length;A++)s.isHDR?U.setSliceSourceImageHDR(A,D[A],m,y,s.imageType,!0):U.setSliceSourceImage(A,D[A],m,y,C.RAW);const g=new Uint8Array(1024*1024*(s.isHDR?24:10)),r=U.encode(g);if(U.delete(),r===0)throw new Error(`Encode failed at mip level ${a}`);const p=O(new Uint8Array(g.buffer,0,r));a===0?_=p:_.levels.push(p.levels[0])}if(s.kvData)for(const a in s.kvData)_.keyValue[a]=s.kvData[a];return k(_,{keepWriter:!0})}setTextureParams(t,n){const s=O(t);return s.keyValue.GalaceanTextureParams=new Uint8Array([n.wrapModeU,n.wrapModeV,n.filterMode,n.anisoLevel]),k(s)}}const oe=new le;function ce(e,t){return globalThis.__KTX2_DEBUG__=t.enableDebug??!1,oe.encode(e,t)}self.onmessage=async e=>{const{buffer:t,options:n}=e.data;try{let s;Array.isArray(t)&&Array.isArray(t[0])?s=t.map(f=>f.map(o=>new Uint8Array(o))):Array.isArray(t)?s=t.map(f=>new Uint8Array(f)):s=new Uint8Array(t);const i=await ce(s,{...n,jsUrl:"/basis_encoder.js",wasmUrl:"/basis_encoder.wasm"});self.postMessage(i)}catch(s){self.postMessage({error:s instanceof Error?s.message:String(s)})}}})();
|