@neurodyn/ar 0.0.12 → 0.0.13
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/ar.chunk.10ee7b81.min.js +61 -0
- package/dist/ar.chunk.1be77774.min.js +1 -0
- package/dist/ar.chunk.43d0d5ab.min.js +983 -0
- package/dist/ar.chunk.697aa011.min.js +77 -0
- package/dist/ar.chunk.a7579ac4.min.js +12 -0
- package/dist/ar.chunk.b5e9f680.min.js +5331 -0
- package/dist/ar.chunk.c84d3d5a.min.js +1 -0
- package/dist/ar.chunk.f08f090e.min.js +6 -0
- package/dist/ar.embed.min.js +1 -1
- package/dist/ar.global.min.js +1 -1
- package/dist/ar.js +150 -20
- package/dist/static/svg/camera-intro.59d57f3d.svg +139 -0
- package/dist/static/svg/gesture-rotate.03dbf61b.svg +100 -0
- package/dist/static/svg/scan-floor.5dee2ec3.svg +66 -0
- package/dist/static/svg/scan-wall.23490063.svg +58 -0
- package/package.json +6 -3
- package/dist/ar.chunk.0152d4cd.min.js +0 -1
- package/dist/ar.chunk.0d9da022.min.js +0 -12
- package/dist/ar.chunk.2c1a21fc.min.js +0 -6
- package/dist/ar.chunk.513ce606.min.js +0 -60
- package/dist/ar.chunk.849c4685.min.js +0 -983
- package/dist/ar.chunk.96249cf8.min.js +0 -1
- package/dist/ar.chunk.c6ed8faf.min.js +0 -13
- package/dist/ar.chunk.c7d1dc6c.min.js +0 -5573
- /package/dist/{ar.chunk.849c4685.min.js.LICENSE.txt → ar.chunk.43d0d5ab.min.js.LICENSE.txt} +0 -0
- /package/dist/{ar.chunk.c6ed8faf.min.js.LICENSE.txt → ar.chunk.697aa011.min.js.LICENSE.txt} +0 -0
- /package/dist/{ar.chunk.2c1a21fc.min.js.LICENSE.txt → ar.chunk.f08f090e.min.js.LICENSE.txt} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_neurodyn_ar=self.webpackChunk_neurodyn_ar||[]).push([["206"],{3761(e,t,n){n.d(t,{f:()=>o});var r=n(2585),i=n(1828);class o{async isSupported(){try{return await this.resolve(),!0}catch{return!1}}async startSession(e){return(await this.resolve()).startSession(e)}resolve(){return this.resolution||(this.resolution=(0,i.U4)(this.options).catch(e=>{throw this.resolution=null,e})),this.resolution}constructor(e={}){(0,r._)(this,"options",void 0),(0,r._)(this,"resolution",void 0),this.options=e,this.resolution=null}}},1828(e,t,n){n.d(t,{Sf:()=>s,U4:()=>l,rZ:()=>a});var r=n(7292),i=n(342),o=n(7734);function a(){return{"8thwall":new i.VU,webxr:new o.c}}async function s(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a(),[t,n]=await Promise.all([e.webxr.isSupported().catch(()=>!1),e["8thwall"].isSupported().catch(()=>!1)]);return{"8thwall":n,webxr:t}}async function l(){let{backend:e,registry:t=a(),userAgent:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=e??(0,r.HE)(n);for(let n of e?[e]:[i,...r.AY.filter(e=>e!==i)]){let e=t[n];if(await e.isSupported().catch(()=>!1))return e}if("u">typeof window&&!window.isSecureContext)throw Error("AR needs a secure connection. Open this page over HTTPS or localhost.");throw Error("AR is not available on this device.")}},7734(e,t,n){n.d(t,{Y:()=>a,c:()=>h});var r=n(2585),i=n(8413),o=n(5807);function a(e){return e}function s(e){return{x:e.x,y:e.y,z:e.z}}function l(e){return{w:e.w,x:e.x,y:e.y,z:e.z}}let u=!1;function c(e,t,n){if(!e.getPose)return null;try{return e.getPose(t(),n)??null}catch(e){return(0,i.Q0)()&&!u&&(u=!0,console.warn("[react-ar] a WebXR space stopped answering; treating it as lost tracking.",e)),null}}class d{setMechanic(e){e!==this.mechanic&&(this.mechanic=e,this.cachedFrame=null)}async attachRenderer(e){e.xr.enabled=!0,e.xr.setReferenceSpaceType("local-floor"),await e.xr.setSession(this.nativeSession)}getCenterHit(e){return this.cachedFrame===e||(this.cachedFrame=e,this.cachedHit=this.readCenterHit(e)),this.cachedHit}readCenterHit(e){let t=null;for(let n of this.readHitTestResults(e)){let e=function(e,t){var n;let r,i=e.getPose(t);if(!i)return null;let{matrix:a,orientation:u,position:c}=i.transform,d=(r=Math.hypot((n={x:a[4]??0,y:a[5]??1,z:a[6]??0}).x,n.y,n.z)||1,{x:n.x/r,y:n.y/r,z:n.z/r}),h={kind:(0,o.Q3)(d),nativeHit:e,normal:d,pose:{orientation:l(u),position:s(c)}};return"wall"!==h.kind||(0,o.aq)(h)?h:null}(n,this.floorSpace);if(e){if(function(e,t){switch(t){case"wall":return(0,o.aq)(e);case"ceiling":return"ceiling"===e.kind;case"floor":return"floor"===e.kind;case"all":return!0}}(e,this.mechanic))return e;t??(t=e)}}return t}readHitTestResults(e){try{return e.getHitTestResults(this.hitTestSource)}catch{return[]}}isTracking(e){return null!==c(e,()=>this.viewerSpace,this.floorSpace)}async createAnchor(e){var t;let n=e.nativeHit;if(!(null==n?void 0:n.createAnchor))throw Error("WebXR anchors are unavailable.");let r=await n.createAnchor();return{delete:()=>{try{null==r||r.delete()}catch{}},getPose:e=>{var t;let n=c(e,()=>r.anchorSpace,this.floorSpace);return n?{orientation:l((t=n.transform).orientation),position:s(t.position)}:null},nativeAnchor:r,pose:{orientation:l((t=e.pose).orientation),position:s(t.position)}}}async end(){this.cachedFrame=null,this.cachedHit=null,this.hitTestSource.cancel(),await this.nativeSession.end()}constructor(e,t,n,i){(0,r._)(this,"nativeSession",void 0),(0,r._)(this,"floorSpace",void 0),(0,r._)(this,"hitTestSource",void 0),(0,r._)(this,"viewerSpace",void 0),(0,r._)(this,"cachedFrame",void 0),(0,r._)(this,"cachedHit",void 0),(0,r._)(this,"mechanic",void 0),this.nativeSession=e,this.floorSpace=t,this.hitTestSource=n,this.viewerSpace=i,this.cachedFrame=null,this.cachedHit=null,this.mechanic="all"}}class h{async isSupported(){var e;return(null==(e=this.xrSystem)?void 0:e.isSessionSupported("immersive-ar"))??!1}async startSession(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.xrSystem)throw Error("WebXR immersive AR is not supported.");let t={optionalFeatures:["dom-overlay","plane-detection"],requiredFeatures:["anchors","hit-test","local-floor"]};e.overlayRoot&&(t.domOverlay={root:e.overlayRoot});let n=await this.xrSystem.requestSession("immersive-ar",t),[r,i]=await Promise.all([n.requestReferenceSpace("viewer"),n.requestReferenceSpace("local-floor")]),o=await n.requestHitTestSource({space:r});if(!o)throw await n.end(),Error("WebXR hit testing is unavailable.");return new d(n,i,o,r)}constructor(e=function(){if("u">typeof navigator)return navigator.xr}()){(0,r._)(this,"xrSystem",void 0),this.xrSystem=e}}},384(e,t,n){n.d(t,{Cm:()=>l,Rl:()=>u,f3:()=>c});var r=n(9081);function i(){}function o(){return"u"<typeof navigator?null:navigator.virtualKeyboard??null}function a(){var e;return Math.round(window.innerHeight||document.documentElement.clientHeight||(null==(e=window.visualViewport)?void 0:e.height)||0)}function s(e){return Number.isFinite(e)?Math.max(0,Math.round(e)):0}function l(e){let t=(0,r.useRef)(null);(0,r.useEffect)(()=>{e||(t.current=null)},[e]);let n=(0,r.useCallback)(t=>{if(!e||"u"<typeof window)return i;let n=window.visualViewport;return null==n||n.addEventListener("resize",t),null==n||n.addEventListener("scroll",t),window.addEventListener("resize",t),window.addEventListener("orientationchange",t),()=>{null==n||n.removeEventListener("resize",t),null==n||n.removeEventListener("scroll",t),window.removeEventListener("resize",t),window.removeEventListener("orientationchange",t)}},[e]),o=(0,r.useCallback)(()=>{var n;let r,i;return!e||"u"<typeof window?null:(r=window.visualViewport,n={height:Math.ceil(Math.max(window.innerHeight||0,document.documentElement.clientHeight||0,(null==r?void 0:r.height)||0)),width:Math.ceil(Math.max(window.innerWidth||0,document.documentElement.clientWidth||0,(null==r?void 0:r.width)||0))},(i=t.current,i&&i.height===n.height&&i.width===n.width)?i:(t.current=n,n))},[e]),a=(0,r.useSyncExternalStore)(n,o,()=>null);return(0,r.useMemo)(()=>{if(a&&!(a.height<=0)&&!(a.width<=0))return{height:`${a.height}px`,width:`${a.width}px`}},[a])}function u(e){let t=(0,r.useRef)(0),n=(0,r.useRef)(null);(0,r.useLayoutEffect)(()=>{if(!e)return i;let t=o();if(!t)return i;let n=t.overlaysContent;try{t.overlaysContent=!0}catch{return i}return()=>{try{t.overlaysContent=n}catch{}}},[e]);let l=(0,r.useCallback)(()=>{t.current=Math.max(t.current,a())},[]);(0,r.useEffect)(()=>{if(!e){t.current=0,n.current=null;return}l()},[e,l]);let u=(0,r.useCallback)(n=>{if(!e||"u"<typeof window)return i;let r=()=>{t.current=0,l(),n()},a=()=>{l(),n()},s=window.visualViewport,u=o();return null==s||s.addEventListener("resize",a),null==s||s.addEventListener("scroll",a),null==u||u.addEventListener("geometrychange",a),window.addEventListener("resize",a),window.addEventListener("orientationchange",r),()=>{null==s||s.removeEventListener("resize",a),null==s||s.removeEventListener("scroll",a),null==u||u.removeEventListener("geometrychange",a),window.removeEventListener("resize",a),window.removeEventListener("orientationchange",r)}},[e,l]),c=(0,r.useCallback)(()=>{var r;let i;return!e||"u"<typeof window?null:(r=function(e){let t=o(),n=null==t?void 0:t.boundingRect;if(n&&n.height>0)return{bottom:s(e-n.top),height:e,top:0};let r=window.visualViewport;if(!r)return{bottom:0,height:e,top:0};let i=s(r.offsetTop);return{bottom:s(e-r.height-r.offsetTop),height:e,top:i}}(t.current||a()),(i=n.current,i&&i.bottom===r.bottom&&i.height===r.height&&i.top===r.top)?i:(n.current=r,r))},[e]),d=(0,r.useSyncExternalStore)(u,c,()=>null);return(0,r.useMemo)(()=>{if(d)return{"--ar-catalog-keyboard-bottom":`${d.bottom}px`,height:`${d.height}px`,paddingTop:`${d.top}px`}},[d])}function c(e){let t=(0,r.useCallback)(t=>{if(!e||"u"<typeof window)return i;let n=window.visualViewport,r=o();return null==n||n.addEventListener("resize",t),null==r||r.addEventListener("geometrychange",t),window.addEventListener("resize",t),()=>{null==n||n.removeEventListener("resize",t),null==r||r.removeEventListener("geometrychange",t),window.removeEventListener("resize",t)}},[e]),n=(0,r.useCallback)(()=>{var t;if(!e||"u"<typeof window)return!1;let n=null==(t=o())?void 0:t.boundingRect;if(n)return n.height>0;let r=window.visualViewport;return!!r&&a()-r.height-r.offsetTop>0},[e]);return(0,r.useSyncExternalStore)(t,n,()=>!1)}},8413(e,t,n){n.d(t,{Bo:()=>a,Q0:()=>i,R5:()=>o}),n(7292);let r={forcesInPageSession:!1};function i(){return!1}function o(){return arguments.length>0&&void 0!==arguments[0]?arguments[0]:"u"<typeof window||window.location.search,!1}function a(){return arguments.length>0&&void 0!==arguments[0]?arguments[0]:"u"<typeof window||window.location.search,r}},7218(e,t,n){n.d(t,{$:()=>l});var r=n(8525),i=n(6218),o=n(6642),a=n(5445);n(9081);let s=(0,a.F)("cursor-pointer inline-flex items-center justify-center gap-1.5 whitespace-nowrap rounded-xl transition-all disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg:not([class*=size-])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-2 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary--hover active:bg-primary--pressed disabled:bg-primary--disabled disabled:opacity-20",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary--hover active:bg-secondary--pressed disabled:bg-secondary--disabled disabled:opacity-20",outline:"border border-button-outline bg-transparent text-foreground hover:border-button-outline-hover active:bg-button-outline-pressed disabled:border-border-dark disabled:opacity-20",ghost:"hover:bg-accent hover:text-accent-foreground active:bg-accent--pressed",contrast:"bg-contrast text-contrast-foreground hover:bg-contrast--hover active:bg-contrast--pressed disabled:bg-contrast--disabled disabled:opacity-30"},size:{default:"h-9 px-3.5 typo-button-normal [&_svg]:size-5",sm:"h-8 px-3 typo-button-small [&_svg]:size-4",lg:"h-11 px-4 typo-button-big [&_svg]:size-6",icon:"size-9 rounded-full [&_svg]:size-5","icon-sm":"size-8 rounded-full [&_svg]:size-4","icon-lg":"size-11 rounded-full [&_svg]:size-6"}},defaultVariants:{variant:"default",size:"default"}});function l(e){let{className:t,variant:n,size:a,asChild:l=!1,...u}=e,c=l?i.DX:"button";return(0,r.jsx)(c,{"data-slot":"button",className:(0,o.cn)(s({variant:n,size:a,className:t})),...u})}},6486(e,t,n){n.d(t,{Cf:()=>d,HM:()=>u,L3:()=>h,lG:()=>s,rr:()=>v});var r=n(8525),i=n(3285);n(7218);var o=n(6642),a=n(2838);function s(e){let{...t}=e;return(0,r.jsx)(i.bL,{"data-slot":"dialog",...t})}function l(e){let{...t}=e;return(0,r.jsx)(i.ZL,{"data-slot":"dialog-portal",...t})}function u(e){let{...t}=e;return(0,r.jsx)(i.bm,{"data-slot":"dialog-close",...t})}function c(e){let{className:t,...n}=e;return(0,r.jsx)(i.hJ,{"data-slot":"dialog-overlay",className:(0,o.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...n})}function d(e){let{className:t,children:n,contentInsideOverlay:s=!1,showCloseButton:u=!0,portalContainer:d,...h}=e,v=(0,r.jsxs)(i.UC,{"data-slot":"dialog-content",className:(0,o.cn)("bg-background-containers data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-6 rounded-3xl border-0 p-6 shadow-[var(--shadow-login)] duration-200 outline-none sm:max-w-120 sm:p-10",t),...h,children:[n,u&&(0,r.jsxs)(i.bm,{"data-slot":"dialog-close",className:"focus-visible:ring-ring/30 absolute top-4 right-4 inline-flex size-6 cursor-pointer items-center justify-center rounded-full text-icons-light transition-colors hover:text-icons-normal focus-visible:text-icons-dark focus-visible:ring-2 focus-visible:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0",children:[(0,r.jsx)(a.A,{className:"size-6"}),(0,r.jsx)("span",{className:"sr-only",children:"Close"})]})]});return(0,r.jsx)(l,{"data-slot":"dialog-portal",container:d,children:s?(0,r.jsx)(c,{children:v}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c,{}),v]})})}function h(e){let{className:t,...n}=e;return(0,r.jsx)(i.hE,{"data-slot":"dialog-title",className:(0,o.cn)("typo-base-18 text-text-dark",t),...n})}function v(e){let{className:t,...n}=e;return(0,r.jsx)(i.VY,{"data-slot":"dialog-description",className:(0,o.cn)("typo-base-16 text-text-light",t),...n})}n(9081)},6642(e,t,n){n.d(t,{cn:()=>o});var r=n(851),i=n(1137);function o(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,i.QP)((0,r.$)(t))}}}]);
|