@realsee/five 6.5.3 → 6.6.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/docs/assets/navigation.js +1 -1
  2. package/docs/assets/search.js +1 -1
  3. package/docs/classes/five.Fetcher.html +2 -2
  4. package/docs/classes/five.Five.html +57 -58
  5. package/docs/classes/five.Model.html +31 -31
  6. package/docs/classes/five.ModelScene.html +7 -7
  7. package/docs/classes/five.NetworkAbortError.html +2 -2
  8. package/docs/classes/five.NetworkFirbiddenError.html +2 -2
  9. package/docs/classes/five.NetworkProxyError.html +2 -2
  10. package/docs/classes/five.NetworkResponseError.html +2 -2
  11. package/docs/classes/five.NetworkSubscribe.html +1 -1
  12. package/docs/classes/five.NetworkTimeoutError.html +2 -2
  13. package/docs/classes/five.Parameter.html +22 -20
  14. package/docs/classes/five.TextureLoader.html +2 -2
  15. package/docs/classes/five.Tile3DModel.html +26 -26
  16. package/docs/classes/five.Work.html +23 -19
  17. package/docs/classes/five.WorkResolvedObserver.html +40 -0
  18. package/docs/classes/sticker.Sticker.html +1 -1
  19. package/docs/functions/five.createWorks.html +1 -1
  20. package/docs/functions/five.loadPbm.html +1 -1
  21. package/docs/functions/five.parseWork.html +2 -2
  22. package/docs/functions/five.workToJson.html +1 -0
  23. package/docs/functions/react.useFiveCurrentObserver.html +2 -2
  24. package/docs/functions/react.useFiveModelReadyState.html +2 -2
  25. package/docs/hierarchy.html +1 -1
  26. package/docs/interfaces/five.AjaxOptions.html +6 -8
  27. package/docs/interfaces/five.FloorplanControllerCustomInitArgs.html +9 -9
  28. package/docs/interfaces/five.LoosePanoWork.html +3 -2
  29. package/docs/interfaces/five.MapviewControllerCustomInitArgs.html +9 -9
  30. package/docs/interfaces/five.ModelControllerCustomInitArgs.html +1 -1
  31. package/docs/interfaces/five.NetworkOptions.html +5 -7
  32. package/docs/interfaces/five.PanoramaControllerCustomInitArgs.html +9 -9
  33. package/docs/interfaces/five.ParameterMaterialValue.html +5 -3
  34. package/docs/interfaces/five.ParameterTilesetValue.html +15 -15
  35. package/docs/interfaces/five.ParameterValue.html +19 -17
  36. package/docs/interfaces/five.ResolvedParameterValue.html +21 -18
  37. package/docs/interfaces/five.Tile3DModelLoaderOptions.html +2 -2
  38. package/docs/interfaces/five.TopviewControllerCustomInitArgs.html +4 -4
  39. package/docs/interfaces/five.VRPanoramaControllerCustomInitArgs.html +8 -8
  40. package/docs/interfaces/five.ViewLayer.html +26 -26
  41. package/docs/interfaces/five.WorkCubeImage.html +8 -7
  42. package/docs/interfaces/five.WorkImage.html +12 -11
  43. package/docs/interfaces/five.WorkInitial.html +8 -8
  44. package/docs/interfaces/five.WorkInitialJson.html +8 -0
  45. package/docs/interfaces/five.WorkJson.html +12 -0
  46. package/docs/interfaces/five.WorkModel.html +6 -6
  47. package/docs/interfaces/five.WorkModelJson.html +5 -0
  48. package/docs/interfaces/five.WorkModelLayer.html +3 -2
  49. package/docs/interfaces/five.WorkModelLayerJson.html +5 -0
  50. package/docs/interfaces/five.WorkObserver.html +18 -34
  51. package/docs/interfaces/five.WorkObserverJson.html +8 -0
  52. package/docs/interfaces/five.WorkPanoramaJson.html +14 -0
  53. package/docs/interfaces/five.WorkPanoramasJson.html +3 -0
  54. package/docs/interfaces/five.WorkTile.html +11 -10
  55. package/docs/interfaces/five.WorkVideo.html +5 -4
  56. package/docs/interfaces/five.XRPanoramaControllerCustomInitArgs.html +9 -9
  57. package/docs/modules/five.html +10 -5
  58. package/docs/types/five.AjaxResponseType.html +1 -1
  59. package/docs/types/five.AjaxResponseTypeMapping.html +1 -1
  60. package/docs/types/five.LooseWork.html +1 -1
  61. package/docs/types/five.LooseWorkInitial.html +1 -1
  62. package/docs/types/five.LooseWorkModel.html +1 -1
  63. package/docs/types/five.LooseWorkObserver.html +1 -1
  64. package/docs/types/five.LooseWorkWithExtrinsics.html +2 -2
  65. package/docs/types/five.NetWorkMeta.html +1 -1
  66. package/docs/types/five.NetworkError.html +1 -1
  67. package/docs/types/five.NetworkErrorCallback.html +1 -1
  68. package/docs/types/five.NetworkProgressCallback.html +1 -1
  69. package/docs/types/five.NetworkResponse.html +1 -1
  70. package/docs/types/five.NetworkState.html +1 -1
  71. package/docs/types/five.NetworkSuccessCallback.html +1 -1
  72. package/docs/types/five.NetworkType.html +1 -1
  73. package/docs/types/five.ParseOptions.html +6 -0
  74. package/docs/types/five.PostProcessingType.html +1 -1
  75. package/docs/types/five.Works.html +1 -1
  76. package/five/index.d.ts +169 -80
  77. package/five/index.js +65 -65
  78. package/five/index.mjs +6688 -6415
  79. package/gltf-loader/index.js +3 -3
  80. package/gltf-loader/index.mjs +146 -146
  81. package/line/index.js +3 -3
  82. package/line/index.mjs +10 -10
  83. package/package.json +1 -1
  84. package/plugins/index.js +2 -2
  85. package/plugins/index.mjs +2 -2
  86. package/react/index.d.ts +3 -3
  87. package/react/index.js +3 -3
  88. package/react/index.mjs +4 -4
  89. package/shader-lib/index.js +2 -2
  90. package/shader-lib/index.mjs +2 -2
  91. package/sticker/index.js +3 -3
  92. package/sticker/index.mjs +7 -7
  93. package/umd/five-gltf-loader.js +3 -3
  94. package/umd/five-line.js +3 -3
  95. package/umd/five-plugins.js +2 -2
  96. package/umd/five-react.js +3 -3
  97. package/umd/five-shader-lib.js +2 -2
  98. package/umd/five-sticker.js +3 -3
  99. package/umd/five-vfx.js +2 -2
  100. package/umd/five-vue.js +3 -3
  101. package/umd/five.js +65 -65
  102. package/vfx/index.js +2 -2
  103. package/vfx/index.mjs +2 -2
  104. package/vue/index.js +3 -3
  105. package/vue/index.mjs +4 -4
  106. package/work-downloader/index.js +3 -3
  107. package/work-downloader/index.mjs +234 -225
  108. package/docs/functions/five.getFetcher.html +0 -1
  109. package/docs/functions/five.registerFetcher.html +0 -1
  110. package/docs/interfaces/five.WorkResolvedObserver.html +0 -42
  111. package/docs/types/five.ParseWorkOptions.html +0 -6
  112. package/docs/variables/five.workRawMapping.html +0 -1
package/vfx/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five
4
- * Generated: 2025/8/12
5
- * Version: 6.5.3
4
+ * Generated: 8/14/2025
5
+ * Version: 6.6.0-alpha.0
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
package/vfx/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five
4
- * Generated: 2025/8/12
5
- * Version: 6.5.3
4
+ * Generated: 8/14/2025
5
+ * Version: 6.6.0-alpha.0
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
package/vue/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five
4
- * Generated: 2025/8/12
5
- * Version: 6.5.3
4
+ * Generated: 8/14/2025
5
+ * Version: 6.6.0-alpha.0
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -252,4 +252,4 @@
252
252
  * No amendment to or modification of this Agreement will be binding unless in
253
253
  * writing and signed by Realsee. You and Realsee hereto confirm that this
254
254
  * Agreement and all related documents shall be drafted in English.
255
- */"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),F=require("@realsee/five"),B=require("three");function O(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return r.default=e,Object.freeze(r)}const c=O(B);var g=function(){return g=Object.assign||function(r){for(var n,o=1,a=arguments.length;o<a;o++){n=arguments[o];for(var u in n)Object.prototype.hasOwnProperty.call(n,u)&&(r[u]=n[u])}return r},g.apply(this,arguments)};var j=!1;function P(e){j=e}var E=Symbol();function l(){var e=t.inject(E);if(!e)throw new Error("Inject five error!");return e}var x={display:"inline-block",overflow:"hidden"},U=t.defineComponent({props:{width:{type:Number,required:!0},height:{type:Number,required:!0}},setup:function(e){var r=t.toRef(e,"width"),n=t.toRef(e,"height"),o=l(),a=t.ref(null);return t.watch([r,n,a],function(){if(o.renderer&&a.value){if(o.renderer.domElement.parentNode!==null&&o.renderer.domElement.parentNode!==a.value)throw new Error("There are more than 2 fiveCanvas in this context.");o.renderer.domElement.parentNode!==a.value&&a.value.appendChild(o.renderer.domElement),o.camera.aspect=r.value/n.value,o.camera.updateProjectionMatrix(),o.renderer.setSize(r.value,n.value),o.refresh({width:r.value,height:n.value}),o.needsRender=!0}}),function(){return t.h("div",{id:"five",style:g({width:"".concat(r.value,"px"),height:"".concat(n.value,"px")},x),ref:a})}}}),h=[],w=[];function W(e){var r=e===void 0?{}:e,n=r.backgroundColor,o=n===void 0?1579548:n,a=r.backgroundAlpha,u=a===void 0?1:a,i=r.preserveDrawingBuffer,v=i===void 0?!0:i,f=r.pixelRatio,d=f===void 0?1:f,m=r.webgl2,p=m===void 0?!1:m;if(typeof window!="undefined"){var s=null;if(p?s=h.shift():s=w.shift(),!s){if(p){var b=document.createElement("canvas"),C=b.getContext("webgl2");C?s=new c.WebGLRenderer({preserveDrawingBuffer:v,antialias:!0,alpha:!0,stencil:!0,canvas:b,context:C}):(console.error("error occurred when getting webgl2 canvas context, mybe webgl2 not support, fallback to webgl."),s=new c.WebGLRenderer({preserveDrawingBuffer:v,antialias:!1,alpha:!0,stencil:!0}))}else s=new c.WebGLRenderer({preserveDrawingBuffer:v,antialias:!1,alpha:!0,stencil:!0});s.outputEncoding=c.sRGBEncoding}return s.setPixelRatio(d),s.setClearColor(o,u),s.autoClear=!0,s}}function _(e){if(e){var r=e.capabilities.isWebGL2;r?w.indexOf(e)===-1&&w.push(e):h.indexOf(e)===-1&&h.push(e)}}function A(e,r){var n=Array.isArray(e)?e:[e],o=Array.isArray(r)?r:[r];if(n.length!==o.length)return!1;for(var a=0;a<n.length;a++)if(n[a]!==o[a])return!1;return!0}var D=t.defineComponent({props:{works:Object,initialWorks:Object,initialState:Object,initialUserAction:Boolean,onWorksChange:Function,onStateChange:Function,onCurrentStateChange:Function,onError:Function,fiveInitArgs:{type:Object,default:function(){return{}}},style:Object},setup:function(e){var r,n=t.toRefs(e).works,o=F.getViewportScale(),a=o===1?window.devicePixelRatio:1,u=W({pixelRatio:a}),i=new F.Five(g({renderer:u},e.fiveInitArgs)),v=e.works||e.initialWorks;return v&&i.load(v,e.initialState,void 0,(r=e.initialUserAction)!==null&&r!==void 0?r:!0),P(!!e.works),n&&t.watch(n,function(f,d){f&&!A(f,i.works)&&i.load(f,e.initialState)}),t.onBeforeUnmount(function(){i&&(i.dispose(),_(i.renderer))}),i.on("load",function(){e.onWorksChange&&i.works&&e.onWorksChange(i==null?void 0:i.works)}),i.on("stateChange",function(f,d){e.onStateChange&&e.onStateChange(f,d)}),i.on("currentStateChange",function(f,d){e.onCurrentStateChange&&e.onCurrentStateChange(f,d)}),i.on("error",function(f){e.onError?e.onError(f):console.warn(f.message)}),t.provide(E,i),{five:t.shallowReadonly(i)}},render:function(){return t.h("div",{style:this.$props.style},this.$slots)}});function L(){var e=l(),r=t.ref(e.works),n=t.readonly(r),o=function(u,i,v,f){if(j)throw new Error("props 'work' is set in fiveProvider, if you need modify work internal, use 'initialWork' instead.");return e.load(u,i,v,f)},a=e.on("load",function(){r.value=e.works});return t.onBeforeUnmount(function(){a()}),[n,o]}function I(){var e=l(),r=t.ref(g({},e.state)),n=e.on("stateChange",function(a){Object.assign(r.value,g({},a))});t.onBeforeUnmount(function(){n()});var o=function(a,u,i){u===void 0&&(u=!1),i===void 0&&(i=!0);var v=typeof a=="function"?a(e.getCurrentState()):a;e.setState(v,u,i)};return[r,o]}function V(){var e=l(),r=t.ref(e.getCurrentState()),n=e.on("currentStateChange",function(){Object.assign(r.value,e.getCurrentState())});t.onBeforeUnmount(function(){n()});var o=function(a,u,i){var v=typeof a=="function"?a(e.getCurrentState()):a;e.setState(v,u,i)};return[r,o]}function H(){var e=l(),r=t.reactive(e.getCurrentState()),n=t.ref(e.works.getResolvedObserver(e.pano)),o=e.on("currentStateChange",function(){Object.assign(r,e.getCurrentState()),n.value=e.works.getResolvedObserver({workCode:r.workCode,panoIndex:r.panoIndex})});return t.onBeforeUnmount(function(){o()}),n}function M(e,r){var n=l(),o=n.on(e,r);t.onBeforeUnmount(function(){o()})}function q(){var e=l(),r=function(v,f){return e.updateCamera(v,f)},n=e.getPixels.bind(e),o=function(v){return e.render(v)},a=function(){return e.needsRender=!0},u=function(v,f){return e.preloadPano(v,f)},i=function(v,f){return f===void 0&&(f=!1),e.project2d(v,f)};return{updateCamera:r,getPixels:n,render:o,needsRender:a,preloadPano:u,project2d:i}}function N(e,r){r===void 0&&(r=!1);var n=l(),o=t.ref(Symbol()),a=t.shallowRef(e?n.project2d(t.isRef(e)?e.value:e,r):null),u=n.on("cameraUpdate",function(){o.value=Symbol()});return t.onBeforeUnmount(function(){u()}),t.watch([o,e],function(){a.value=n.project2d(t.isRef(e)?e.value:e,r)}),a}function G(){return N}function y(e){var r=e.camera.getWorldDirection(new c.Vector3),n=new c.Raycaster(e.camera.position,r);return n}function T(){var e=l(),r=t.shallowRef(y(e)),n=e.on("cameraUpdate",function(){r.value=y(e)});return t.onBeforeUnmount(function(){n()}),r}function S(e){return e.camera.getWorldDirection(new c.Vector3)}function $(){var e=l(),r=t.shallowRef(S(e)),n=e.on("cameraUpdate",function(){r.value=S(e)});return t.onBeforeUnmount(function(){n()}),r}function z(e){var r=l(),n=t.shallowRef([]);return t.watch(e,function(){n.value=r.model.intersectRaycaster(t.isRef(e)?e.value:e)}),n}function K(){return z}function R(e){return e.model.empty?"Empty":"Loaded"}function J(){var e=l(),r=t.ref(R(e)),n=e.on("modelLoaded",function(){r.value=R(e)});return t.onBeforeUnmount(function(){n()}),r}function Q(){var e=l(),r=t.ref(e.model.shownFloor),n=t.ref(e.model.floorLength),o=function(u){typeof u=="number"?e.model.show(u):e.model.show()},a=[];return a.push(e.on("modelShownFloorChange",function(){r.value=e.model.shownFloor})),a.push(e.on("modelLoaded",function(){n.value=e.model.floorLength})),t.onBeforeUnmount(function(){for(var u;u=a.shift();)u()}),[r,n,o]}function X(){var e=l(),r=t.ref(e.helperVisible),n=function(a){e.helperVisible=a},o=e.on("helpersVisibleChange",function(a){r.value=a});return t.onBeforeUnmount(function(){o()}),[r,n]}function Y(){return l()}function k(e){return e.model.bounding.clone()}function Z(){var e=l(),r=t.shallowRef(k(e)),n=e.on("modelLoaded",function(){r.value=k(e)});return t.onBeforeUnmount(function(){n()}),r}function ee(){var e=l();return e.scene}function re(){var e=l(),r=t.shallowRef(e.model),n=e.on("modelLoaded",function(){r.value=e.model});return t.onBeforeUnmount(function(){n()}),r}exports.FiveCanvas=U;exports.FiveProvider=D;exports.unsafe__useFiveInject=Y;exports.useFiveAction=q;exports.useFiveCameraDirection=$;exports.useFiveCameraRaycaster=T;exports.useFiveCurrentObserver=H;exports.useFiveCurrentState=V;exports.useFiveEventCallback=M;exports.useFiveFloor=Q;exports.useFiveHelper=X;exports.useFiveModel=re;exports.useFiveModelBounding=Z;exports.useFiveModelIntersectRaycaster=K;exports.useFiveModelReadyState=J;exports.useFiveProject2d=G;exports.useFiveScene=ee;exports.useFiveState=I;exports.useFiveWorks=L;
255
+ */"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),F=require("@realsee/five"),B=require("three");function O(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return r.default=e,Object.freeze(r)}const c=O(B);var g=function(){return g=Object.assign||function(r){for(var n,o=1,a=arguments.length;o<a;o++){n=arguments[o];for(var u in n)Object.prototype.hasOwnProperty.call(n,u)&&(r[u]=n[u])}return r},g.apply(this,arguments)};var j=!1;function P(e){j=e}var E=Symbol();function l(){var e=t.inject(E);if(!e)throw new Error("Inject five error!");return e}var x={display:"inline-block",overflow:"hidden"},U=t.defineComponent({props:{width:{type:Number,required:!0},height:{type:Number,required:!0}},setup:function(e){var r=t.toRef(e,"width"),n=t.toRef(e,"height"),o=l(),a=t.ref(null);return t.watch([r,n,a],function(){if(o.renderer&&a.value){if(o.renderer.domElement.parentNode!==null&&o.renderer.domElement.parentNode!==a.value)throw new Error("There are more than 2 fiveCanvas in this context.");o.renderer.domElement.parentNode!==a.value&&a.value.appendChild(o.renderer.domElement),o.camera.aspect=r.value/n.value,o.camera.updateProjectionMatrix(),o.renderer.setSize(r.value,n.value),o.refresh({width:r.value,height:n.value}),o.needsRender=!0}}),function(){return t.h("div",{id:"five",style:g({width:"".concat(r.value,"px"),height:"".concat(n.value,"px")},x),ref:a})}}}),h=[],w=[];function W(e){var r=e===void 0?{}:e,n=r.backgroundColor,o=n===void 0?1579548:n,a=r.backgroundAlpha,u=a===void 0?1:a,i=r.preserveDrawingBuffer,v=i===void 0?!0:i,f=r.pixelRatio,d=f===void 0?1:f,m=r.webgl2,p=m===void 0?!1:m;if(typeof window!="undefined"){var s=null;if(p?s=h.shift():s=w.shift(),!s){if(p){var b=document.createElement("canvas"),C=b.getContext("webgl2");C?s=new c.WebGLRenderer({preserveDrawingBuffer:v,antialias:!0,alpha:!0,stencil:!0,canvas:b,context:C}):(console.error("error occurred when getting webgl2 canvas context, mybe webgl2 not support, fallback to webgl."),s=new c.WebGLRenderer({preserveDrawingBuffer:v,antialias:!1,alpha:!0,stencil:!0}))}else s=new c.WebGLRenderer({preserveDrawingBuffer:v,antialias:!1,alpha:!0,stencil:!0});s.outputEncoding=c.sRGBEncoding}return s.setPixelRatio(d),s.setClearColor(o,u),s.autoClear=!0,s}}function _(e){if(e){var r=e.capabilities.isWebGL2;r?w.indexOf(e)===-1&&w.push(e):h.indexOf(e)===-1&&h.push(e)}}function A(e,r){var n=Array.isArray(e)?e:[e],o=Array.isArray(r)?r:[r];if(n.length!==o.length)return!1;for(var a=0;a<n.length;a++)if(n[a]!==o[a])return!1;return!0}var D=t.defineComponent({props:{works:Object,initialWorks:Object,initialState:Object,initialUserAction:Boolean,onWorksChange:Function,onStateChange:Function,onCurrentStateChange:Function,onError:Function,fiveInitArgs:{type:Object,default:function(){return{}}},style:Object},setup:function(e){var r,n=t.toRefs(e).works,o=F.getViewportScale(),a=o===1?window.devicePixelRatio:1,u=W({pixelRatio:a}),i=new F.Five(g({renderer:u},e.fiveInitArgs)),v=e.works||e.initialWorks;return v&&i.load(v,e.initialState,void 0,(r=e.initialUserAction)!==null&&r!==void 0?r:!0),P(!!e.works),n&&t.watch(n,function(f,d){f&&!A(f,i.works)&&i.load(f,e.initialState)}),t.onBeforeUnmount(function(){i&&(i.dispose(),_(i.renderer))}),i.on("load",function(){e.onWorksChange&&i.works&&e.onWorksChange(i==null?void 0:i.works)}),i.on("stateChange",function(f,d){e.onStateChange&&e.onStateChange(f,d)}),i.on("currentStateChange",function(f,d){e.onCurrentStateChange&&e.onCurrentStateChange(f,d)}),i.on("error",function(f){e.onError?e.onError(f):console.warn(f.message)}),t.provide(E,i),{five:t.shallowReadonly(i)}},render:function(){return t.h("div",{style:this.$props.style},this.$slots)}});function L(){var e=l(),r=t.ref(e.works),n=t.readonly(r),o=function(u,i,v,f){if(j)throw new Error("props 'work' is set in fiveProvider, if you need modify work internal, use 'initialWork' instead.");return e.load(u,i,v,f)},a=e.on("load",function(){r.value=e.works});return t.onBeforeUnmount(function(){a()}),[n,o]}function I(){var e=l(),r=t.ref(g({},e.state)),n=e.on("stateChange",function(a){Object.assign(r.value,g({},a))});t.onBeforeUnmount(function(){n()});var o=function(a,u,i){u===void 0&&(u=!1),i===void 0&&(i=!0);var v=typeof a=="function"?a(e.getCurrentState()):a;e.setState(v,u,i)};return[r,o]}function V(){var e=l(),r=t.ref(e.getCurrentState()),n=e.on("currentStateChange",function(){Object.assign(r.value,e.getCurrentState())});t.onBeforeUnmount(function(){n()});var o=function(a,u,i){var v=typeof a=="function"?a(e.getCurrentState()):a;e.setState(v,u,i)};return[r,o]}function H(){var e=l(),r=t.reactive(e.getCurrentState()),n=t.ref(e.works.getObserver(e.pano)),o=e.on("currentStateChange",function(){Object.assign(r,e.getCurrentState()),n.value=e.works.getObserver({workCode:r.workCode,panoIndex:r.panoIndex})});return t.onBeforeUnmount(function(){o()}),n}function M(e,r){var n=l(),o=n.on(e,r);t.onBeforeUnmount(function(){o()})}function q(){var e=l(),r=function(v,f){return e.updateCamera(v,f)},n=e.getPixels.bind(e),o=function(v){return e.render(v)},a=function(){return e.needsRender=!0},u=function(v,f){return e.preloadPano(v,f)},i=function(v,f){return f===void 0&&(f=!1),e.project2d(v,f)};return{updateCamera:r,getPixels:n,render:o,needsRender:a,preloadPano:u,project2d:i}}function N(e,r){r===void 0&&(r=!1);var n=l(),o=t.ref(Symbol()),a=t.shallowRef(e?n.project2d(t.isRef(e)?e.value:e,r):null),u=n.on("cameraUpdate",function(){o.value=Symbol()});return t.onBeforeUnmount(function(){u()}),t.watch([o,e],function(){a.value=n.project2d(t.isRef(e)?e.value:e,r)}),a}function G(){return N}function y(e){var r=e.camera.getWorldDirection(new c.Vector3),n=new c.Raycaster(e.camera.position,r);return n}function T(){var e=l(),r=t.shallowRef(y(e)),n=e.on("cameraUpdate",function(){r.value=y(e)});return t.onBeforeUnmount(function(){n()}),r}function S(e){return e.camera.getWorldDirection(new c.Vector3)}function $(){var e=l(),r=t.shallowRef(S(e)),n=e.on("cameraUpdate",function(){r.value=S(e)});return t.onBeforeUnmount(function(){n()}),r}function z(e){var r=l(),n=t.shallowRef([]);return t.watch(e,function(){n.value=r.model.intersectRaycaster(t.isRef(e)?e.value:e)}),n}function K(){return z}function R(e){return e.model.empty?"Empty":"Loaded"}function J(){var e=l(),r=t.ref(R(e)),n=e.on("modelLoaded",function(){r.value=R(e)});return t.onBeforeUnmount(function(){n()}),r}function Q(){var e=l(),r=t.ref(e.model.shownFloor),n=t.ref(e.model.floorLength),o=function(u){typeof u=="number"?e.model.show(u):e.model.show()},a=[];return a.push(e.on("modelShownFloorChange",function(){r.value=e.model.shownFloor})),a.push(e.on("modelLoaded",function(){n.value=e.model.floorLength})),t.onBeforeUnmount(function(){for(var u;u=a.shift();)u()}),[r,n,o]}function X(){var e=l(),r=t.ref(e.helperVisible),n=function(a){e.helperVisible=a},o=e.on("helpersVisibleChange",function(a){r.value=a});return t.onBeforeUnmount(function(){o()}),[r,n]}function Y(){return l()}function k(e){return e.model.bounding.clone()}function Z(){var e=l(),r=t.shallowRef(k(e)),n=e.on("modelLoaded",function(){r.value=k(e)});return t.onBeforeUnmount(function(){n()}),r}function ee(){var e=l();return e.scene}function re(){var e=l(),r=t.shallowRef(e.model),n=e.on("modelLoaded",function(){r.value=e.model});return t.onBeforeUnmount(function(){n()}),r}exports.FiveCanvas=U;exports.FiveProvider=D;exports.unsafe__useFiveInject=Y;exports.useFiveAction=q;exports.useFiveCameraDirection=$;exports.useFiveCameraRaycaster=T;exports.useFiveCurrentObserver=H;exports.useFiveCurrentState=V;exports.useFiveEventCallback=M;exports.useFiveFloor=Q;exports.useFiveHelper=X;exports.useFiveModel=re;exports.useFiveModelBounding=Z;exports.useFiveModelIntersectRaycaster=K;exports.useFiveModelReadyState=J;exports.useFiveProject2d=G;exports.useFiveScene=ee;exports.useFiveState=I;exports.useFiveWorks=L;
package/vue/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five
4
- * Generated: 2025/8/12
5
- * Version: 6.5.3
4
+ * Generated: 8/14/2025
5
+ * Version: 6.6.0-alpha.0
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -416,8 +416,8 @@ function re() {
416
416
  return [r, o];
417
417
  }
418
418
  function ne() {
419
- var e = v(), r = U(e.getCurrentState()), n = s(e.works.getResolvedObserver(e.pano)), o = e.on("currentStateChange", function() {
420
- Object.assign(r, e.getCurrentState()), n.value = e.works.getResolvedObserver({
419
+ var e = v(), r = U(e.getCurrentState()), n = s(e.works.getObserver(e.pano)), o = e.on("currentStateChange", function() {
420
+ Object.assign(r, e.getCurrentState()), n.value = e.works.getObserver({
421
421
  workCode: r.workCode,
422
422
  panoIndex: r.panoIndex
423
423
  });
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five
4
- * Generated: 2025/8/12
5
- * Version: 6.5.3
4
+ * Generated: 8/14/2025
5
+ * Version: 6.6.0-alpha.0
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -252,4 +252,4 @@
252
252
  * No amendment to or modification of this Agreement will be binding unless in
253
253
  * writing and signed by Realsee. You and Realsee hereto confirm that this
254
254
  * Agreement and all related documents shall be drafted in English.
255
- */"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("node:fs"),$=require("node:fs/promises"),y=require("node:path"),A=require("node:stream"),G=require("sharp");function z(t,e,r,i){function s(n){return n instanceof r?n:new r(function(o){o(n)})}return new(r||(r=Promise))(function(n,o){function u(c){try{a(i.next(c))}catch(f){o(f)}}function l(c){try{a(i.throw(c))}catch(f){o(f)}}function a(c){c.done?n(c.value):s(c.value).then(u,l)}a((i=i.apply(t,e||[])).next())})}function P(t,e){var r={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},i,s,n,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=u(0),o.throw=u(1),o.return=u(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(a){return function(c){return l([a,c])}}function l(a){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(r=0)),r;)try{if(i=1,s&&(n=a[0]&2?s.return:a[0]?s.throw||((n=s.return)&&n.call(s),0):s.next)&&!(n=n.call(s,a[1])).done)return n;switch(s=0,n&&(a=[a[0]&2,n.value]),a[0]){case 0:case 1:n=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,s=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(n=r.trys,!(n=n.length>0&&n[n.length-1])&&(a[0]===6||a[0]===2)){r=0;continue}if(a[0]===3&&(!n||a[1]>n[0]&&a[1]<n[3])){r.label=a[1];break}if(a[0]===6&&r.label<n[1]){r.label=n[1],n=a;break}if(n&&r.label<n[2]){r.label=n[2],r.ops.push(a);break}n[2]&&r.ops.pop(),r.trys.pop();continue}a=e.call(t,r)}catch(c){a=[6,c],s=0}finally{i=n=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}}function O(t,e){if(e&&e[e.length-1]!=="/"&&(e+="/"),t.length>e.length&&t.startsWith(e))return t.slice(e.length);throw new Error("".concat(t," is not starting with ").concat(e))}var X=1024*1024*5;function S(t,e,r){return z(this,void 0,void 0,function(){var i,s,n,o;return P(this,function(u){switch(u.label){case 0:return q.existsSync(e)?[2,e]:[4,r(t)];case 1:return i=u.sent(),i.ok&&i.body?[4,$.mkdir(y.dirname(e),{recursive:!0})]:[3,6];case 2:return u.sent(),s=Number((o=i.headers.get("content-length"))!==null&&o!==void 0?o:"Infinity"),s>X?[2,new Promise(function(l,a){var c=A.Readable.fromWeb(i.body),f=q.createWriteStream(e);c.pipe(f),c.on("error",a),f.on("finish",function(){return l(e)})})]:[3,3];case 3:return[4,i.arrayBuffer()];case 4:return n=u.sent(),[4,$.writeFile(e,Buffer.from(n))];case 5:return u.sent(),[2,e];case 6:throw new Error("url: ".concat(t,"(").concat(i.statusText,")"))}})})}function D(t,e){return z(this,void 0,void 0,function(){var r,i,s,n,o,u,l,a,c,f;return P(this,function(h){return r=y.extname(t).slice(1)||"jpg",i=e.cut,s=e.size,n=e.format,o=n===void 0?r:n,u=G(t),i&&(u=u.extract({left:i[0],top:i[1],width:i[2],height:i[3]})),s&&(u=u.resize(s)),o&&(u=u.toFormat(o)),l="",e.toFilename?l=e.toFilename(t,{cut:e.cut,size:e.size,format:e.format}):(a="",c="",f=o,i&&(a=i.join("x")),s&&(c="".concat(s,"x")),f===r&&!c&&!a&&(f=""),l=[t,a,c,f].filter(function(v){return v.length>0}).join(".")),l!==t&&!q.existsSync(l)?[2,u.toFile(l).then(function(){return l})]:[2,l]})})}function W(t){var e=[];if(t.content&&(t.content.uri?e.push(t.content.uri):t.content.url&&e.push(t.content.url)),t.children)for(var r=0,i=t.children;r<i.length;r++){var s=i[r],n=W(s);n.length>0&&e.push.apply(e,n)}return e}function H(t,e,r){return z(this,void 0,void 0,function(){var i,s,n;return P(this,function(o){switch(o.label){case 0:return i=new URL(t,e).href,s=y.join(r.distPath,O(i,r.baseURL)),n=S(i,s,r.fetch),r.log(function(u){return"download: ".concat(i," -> ").concat(u)},n),[4,n];case 1:return o.sent(),/\.json$/.test(t)?[4,J(i,r)]:[3,3];case 2:o.sent(),o.label=3;case 3:return[2]}})})}function J(t,e){return z(this,void 0,void 0,function(){var r,i,s,n,o,u,l,a,c,f,h,v,w,m,d,p,k,j;return P(this,function(g){switch(g.label){case 0:return r=y.join(e.distPath,O(t,e.baseURL)),i=S(t,r,e.fetch),e.log(function(b){return"download: ".concat(t," -> ").concat(b)},i),[4,i];case 1:return g.sent(),o=(n=JSON).parse,[4,$.readFile(r,"utf8")];case 2:return s=o.apply(n,[g.sent()]),s.asset.overview?(u=new URL(s.asset.overview.imageFile,t).href,l=y.join(e.distPath,O(u,e.baseURL)),a=S(u,l,e.fetch),e.log(function(b){return"download: ".concat(u," -> ").concat(b)},a),[4,a]):[3,4];case 3:g.sent(),g.label=4;case 4:if(!s.asset.trajectories)return[3,8];c=function(b){var F,_,R;return P(this,function(I){switch(I.label){case 0:return F=new URL(b.file,t).href,_=y.join(e.distPath,O(F,e.baseURL)),R=S(F,_,e.fetch),e.log(function(T){return"download: ".concat(F," -> ").concat(T)},R),[4,R];case 1:return I.sent(),[2]}})},f=0,h=s.asset.trajectories.list,g.label=5;case 5:return f<h.length?(v=h[f],[5,c(v)]):[3,8];case 6:g.sent(),g.label=7;case 7:return f++,[3,5];case 8:for(w=W(s.root),m=[],d=0,p=w;d<p.length;d++)k=p[d],j=H(k,t,e),m.push(j);return[4,Promise.all(m)];case 9:return g.sent(),[2]}})})}function K(t,e){return z(this,void 0,void 0,function(){var r,i,s,n,o,u,l,a,c,f,h,v,w,m;return P(this,function(d){switch(d.label){case 0:return e.log("process model"),t.model?(r=t.model,i=r.textures,s=r.layers,n=r.file,n?(e.log("process model file"),o=y.join(e.distPath,O(n,e.baseURL)),u=S(n,o,e.fetch),e.log(function(p){return"download: ".concat(n," -> ").concat(p)},u),[4,u]):[3,5]):[3,9];case 1:if(d.sent(),!i)return[3,5];l=function(p){var k,j,g,b,F,_,R,I,T,N,M,C;return P(this,function(U){switch(U.label){case 0:return k=y.join(e.distPath,O(p,e.baseURL)),j=S(p,k,e.fetch),e.log(function(B){return"download: ".concat(p," -> ").concat(B)},j),[4,j];case 1:for(U.sent(),g=e.imageOptions.format,g.length===0&&g.push(void 0),b=e.imageOptions.size,b.length===0&&b.push(void 0),F=[],_=0,R=g;_<R.length;_++)for(I=R[_],T=0,N=b;T<N.length;T++)M=N[T],C=D(k,{format:I,size:M,toFilename:e.imageProcessingFilename}),e.log(function(B){return"imageProcessing: ".concat(k," -> ").concat(B)},C),F.push(C);return[4,Promise.all(F)];case 2:return U.sent(),[2]}})},a=0,c=i,d.label=2;case 2:return a<c.length?(f=c[a],[5,l(f)]):[3,5];case 3:d.sent(),d.label=4;case 4:return a++,[3,2];case 5:if(!s)return[3,9];h=0,v=s,d.label=6;case 6:return h<v.length?(w=v[h],m=w.tileset,e.log("process model layer"),[4,J(m,e)]):[3,9];case 7:d.sent(),d.label=8;case 8:return h++,[3,6];case 9:return[2]}})})}function E(t,e,r){return z(this,void 0,void 0,function(){var i,s,n,o,u,l,a,c,f,h,v,w,m;return P(this,function(d){switch(d.label){case 0:return i=y.join(r.distPath,O(t,r.baseURL)),s=S(t,i,r.fetch),r.log(function(p){return"download: ".concat(t," -> ").concat(p)},s),[4,s];case 1:if(d.sent(),n=Math.pow(2,e.level),o=r.imageOptions.format,o.length===0&&o.push(void 0),u=[],n>1)for(l=0;l<n;l++)for(a=0;a<n;a++)for(c=0,f=o;c<f.length;c++)h=f[c],v=[e.size/n*a,e.size/n*l,e.size/n,e.size/n],w=e.scale>=1?void 0:e.scale*e.size/n,e.level===1&&e.scale>=.5&&(h==="jpg"||/\.jpg$/.test(i))&&(w=void 0),m=D(i,{format:h,size:w,cut:v,toFilename:r.imageProcessingFilename}),r.log(function(p){return"imageProcessing: ".concat(i," -> ").concat(p)},m),u.push(m);return[4,Promise.all(u)];case 2:return d.sent(),[2]}})})}function Q(t,e){return z(this,void 0,void 0,function(){return P(this,function(r){switch(r.label){case 0:return[4,Promise.all([E(t.front,t,e),E(t.back,t,e),E(t.left,t,e),E(t.right,t,e),E(t.up,t,e),E(t.down,t,e)])];case 1:return r.sent(),[2]}})})}function L(t,e){return z(this,void 0,void 0,function(){var r,i,s,n,o,u,l,a,c,f,h,v;return P(this,function(w){switch(w.label){case 0:return r=y.join(e.distPath,O(t,e.baseURL)),i=S(t,r,e.fetch),e.log(function(m){return"download: ".concat(t," -> ").concat(m)},i),[4,i];case 1:for(w.sent(),s=e.imageOptions.format,s.length===0&&s.push(void 0),n=e.imageOptions.size,n.length===0&&n.push(void 0),o=[],u=0,l=s;u<l.length;u++)for(a=l[u],c=0,f=n;c<f.length;c++)h=f[c],v=D(r,{format:a,size:h,toFilename:e.imageProcessingFilename}),e.log(function(m){return"imageProcessing: ".concat(r," -> ").concat(m)},v),o.push(v);return[4,Promise.all(o)];case 2:return w.sent(),[2]}})})}function V(t,e){return z(this,void 0,void 0,function(){var r;return P(this,function(i){switch(i.label){case 0:return r=t.images,[4,Promise.all([L(r.front,e),L(r.back,e),L(r.left,e),L(r.right,e),L(r.up,e),L(r.down,e)])];case 1:return i.sent(),r.tiles?[4,Promise.all(r.tiles.map(function(s){return Q(s,e)}))]:[3,3];case 2:i.sent(),i.label=3;case 3:return[2]}})})}function Y(t,e){return z(this,void 0,void 0,function(){var r,i,s,n,o;return P(this,function(u){switch(u.label){case 0:r=t.observers,i=0,s=r,u.label=1;case 1:return i<s.length?(n=s[i],o=V(n,e),e.log("process observer #".concat(n.index," derived: ").concat(n.derivedIdStr),o),[4,o]):[3,4];case 2:u.sent(),u.label=3;case 3:return i++,[3,1];case 4:return[2]}})})}function Z(t,e){if(e){var r=Date.now();e.then(function(s){var n=Date.now()-r,o=typeof t=="function"?t(s):t;console.log(o+"(".concat(n,"ms)"))}).catch(function(){})}else{var i=typeof t=="function"?t(null):t;console.log(i)}}function x(t){return z(this,arguments,void 0,function(e,r){var i,s,n,o,u,l,a,c,f,h,v,w,m,d,p,k,j,g;return r===void 0&&(r={}),P(this,function(b){switch(b.label){case 0:if(i=e.baseURL,s="",r.distPath)s=y.resolve(process.cwd(),r.distPath);else for(s=y.resolve(process.cwd(),(f=e.workCode)!==null&&f!==void 0?f:"work-".concat(Date.now()));q.existsSync(s);)/.-(\d+)$/.test(s)?s=s.replace(/.-(\d+)$/,function(F,_){return"-"+(Number(_)+1)}):s=s+"-1";return n={baseURL:i,distPath:s,fetch:(h=r.fetch)!==null&&h!==void 0?h:fetch,imageOptions:{size:(w=(v=r.imageOptions)===null||v===void 0?void 0:v.size)!==null&&w!==void 0?w:[],format:(d=(m=r.imageOptions)===null||m===void 0?void 0:m.format)!==null&&d!==void 0?d:[]},textureOptions:{size:(k=(p=r.textureOptions)===null||p===void 0?void 0:p.size)!==null&&k!==void 0?k:[],format:(g=(j=r.textureOptions)===null||j===void 0?void 0:j.format)!==null&&g!==void 0?g:[]},log:r.log?Z:function(){return Promise.resolve()},imageProcessingFilename:r.imageProcessingFilename},n.log(JSON.stringify(n,null," ")),[4,$.mkdir(s,{recursive:!0})];case 1:b.sent(),o=0,b.label=2;case 2:return o<e.raw.works.length?(u=e.raw.works[o],l=o>0?"-".concat(o):"",a="work".concat(l,".json"),c=y.resolve(s,a),[4,$.writeFile(c,u)]):[3,5];case 3:b.sent(),b.label=4;case 4:return o++,[3,2];case 5:return[4,Y(e,n)];case 6:return b.sent(),[4,K(e,n)];case 7:return b.sent(),[2]}})})}exports.download=x;
255
+ */"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("node:fs"),$=require("node:fs/promises"),y=require("node:path"),H=require("node:stream"),K=require("sharp");function P(n,e,r,i){function a(t){return t instanceof r?t:new r(function(o){o(t)})}return new(r||(r=Promise))(function(t,o){function u(c){try{s(i.next(c))}catch(f){o(f)}}function l(c){try{s(i.throw(c))}catch(f){o(f)}}function s(c){c.done?t(c.value):a(c.value).then(u,l)}s((i=i.apply(n,e||[])).next())})}function k(n,e){var r={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},i,a,t,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=u(0),o.throw=u(1),o.return=u(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(s){return function(c){return l([s,c])}}function l(s){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(r=0)),r;)try{if(i=1,a&&(t=s[0]&2?a.return:s[0]?a.throw||((t=a.return)&&t.call(a),0):a.next)&&!(t=t.call(a,s[1])).done)return t;switch(a=0,t&&(s=[s[0]&2,t.value]),s[0]){case 0:case 1:t=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,a=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(t=r.trys,!(t=t.length>0&&t[t.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!t||s[1]>t[0]&&s[1]<t[3])){r.label=s[1];break}if(s[0]===6&&r.label<t[1]){r.label=t[1],t=s;break}if(t&&r.label<t[2]){r.label=t[2],r.ops.push(s);break}t[2]&&r.ops.pop(),r.trys.pop();continue}s=e.call(n,r)}catch(c){s=[6,c],a=0}finally{i=t=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}function L(n,e){if(e&&e[e.length-1]!=="/"&&(e+="/"),n.length>e.length&&n.startsWith(e))return n.slice(e.length);throw new Error("".concat(n," is not starting with ").concat(e))}function Q(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var r=[];n=n.map(function(u){return(u!=null?u:"").trim()}).filter(function(u){return u.length>0&&!/^\/+$/.test(u)});for(var i=0;i<n.length;i++){var a=i===0,t=i===n.length-1,o=n[i];a||(o=o.replace(/^\.\//,"").replace(/^\/+/,"")),t||(o=o.replace(/\/+$/,"")),r.push(o)}return r.join("/")}var V=1024*1024*5;function F(n,e,r){return P(this,void 0,void 0,function(){var i,a,t,o;return k(this,function(u){switch(u.label){case 0:return I.existsSync(e)?[2,e]:[4,r(n)];case 1:return i=u.sent(),i.ok&&i.body?[4,$.mkdir(y.dirname(e),{recursive:!0})]:[3,6];case 2:return u.sent(),a=Number((o=i.headers.get("content-length"))!==null&&o!==void 0?o:"Infinity"),a>V?[2,new Promise(function(l,s){var c=H.Readable.fromWeb(i.body),f=I.createWriteStream(e);c.pipe(f),c.on("error",s),f.on("finish",function(){return l(e)})})]:[3,3];case 3:return[4,i.arrayBuffer()];case 4:return t=u.sent(),[4,$.writeFile(e,Buffer.from(t))];case 5:return u.sent(),[2,e];case 6:throw new Error("url: ".concat(n,"(").concat(i.statusText,")"))}})})}function M(n,e){return P(this,void 0,void 0,function(){var r,i,a,t,o,u,l,s,c,f;return k(this,function(d){return r=y.extname(n).slice(1)||"jpg",i=e.cut,a=e.size,t=e.format,o=t===void 0?r:t,u=K(n),i&&(u=u.extract({left:i[0],top:i[1],width:i[2],height:i[3]})),a&&(u=u.resize(a)),o&&(u=u.toFormat(o)),l="",e.toFilename?l=e.toFilename(n,{cut:e.cut,size:e.size,format:e.format}):(s="",c="",f=o,i&&(s=i.join("x")),a&&(c="".concat(a,"x")),f===r&&!c&&!s&&(f=""),l=[n,s,c,f].filter(function(h){return h.length>0}).join(".")),l!==n&&!I.existsSync(l)?[2,u.toFile(l).then(function(){return l})]:[2,l]})})}function G(n){var e=[];if(n.content&&(n.content.uri?e.push(n.content.uri):n.content.url&&e.push(n.content.url)),n.children)for(var r=0,i=n.children;r<i.length;r++){var a=i[r],t=G(a);t.length>0&&e.push.apply(e,t)}return e}function Y(n,e,r){return P(this,void 0,void 0,function(){var i,a,t;return k(this,function(o){switch(o.label){case 0:return i=new URL(n,e).href,a=y.join(r.distPath,L(i,r.baseURL)),t=F(i,a,r.fetch),r.log(function(u){return"download: ".concat(i," -> ").concat(u)},t),[4,t];case 1:return o.sent(),/\.json$/.test(n)?[4,X(i,r)]:[3,3];case 2:o.sent(),o.label=3;case 3:return[2]}})})}function X(n,e){return P(this,void 0,void 0,function(){var r,i,a,t,o,u,l,s,c,f,d,h,g,v,p,m,w,U;return k(this,function(b){switch(b.label){case 0:return r=y.join(e.distPath,L(n,e.baseURL)),i=F(n,r,e.fetch),e.log(function(j){return"download: ".concat(n," -> ").concat(j)},i),[4,i];case 1:return b.sent(),o=(t=JSON).parse,[4,$.readFile(r,"utf8")];case 2:return a=o.apply(t,[b.sent()]),a.asset.overview?(u=new URL(a.asset.overview.imageFile,n).href,l=y.join(e.distPath,L(u,e.baseURL)),s=F(u,l,e.fetch),e.log(function(j){return"download: ".concat(u," -> ").concat(j)},s),[4,s]):[3,4];case 3:b.sent(),b.label=4;case 4:if(!a.asset.trajectories)return[3,8];c=function(j){var R,O,z;return k(this,function(S){switch(S.label){case 0:return R=new URL(j.file,n).href,O=y.join(e.distPath,L(R,e.baseURL)),z=F(R,O,e.fetch),e.log(function(_){return"download: ".concat(R," -> ").concat(_)},z),[4,z];case 1:return S.sent(),[2]}})},f=0,d=a.asset.trajectories.list,b.label=5;case 5:return f<d.length?(h=d[f],[5,c(h)]):[3,8];case 6:b.sent(),b.label=7;case 7:return f++,[3,5];case 8:for(g=G(a.root),v=[],p=0,m=g;p<m.length;p++)w=m[p],U=Y(w,n,e),v.push(U);return[4,Promise.all(v)];case 9:return b.sent(),[2]}})})}function Z(n,e){return P(this,void 0,void 0,function(){var r,i,a,t,o,m,u,l,s,c,f,d,h,g,v,p,m;return k(this,function(w){switch(w.label){case 0:return e.log("process model"),n.model?(r=n.model,i=r.textures,a=r.layers,t=r.file,o=r.textureBase,t?(e.log("process model file"),m=n.getURL(t),u=y.join(e.distPath,L(m,e.baseURL)),l=F(m,u,e.fetch),e.log(function(U){return"download: ".concat(t," -> ").concat(U)},l),[4,l]):[3,5]):[3,9];case 1:if(w.sent(),!i)return[3,5];s=function(U){var b,j,R,O,z,S,_,q,W,N,B,A,J;return k(this,function(C){switch(C.label){case 0:return b=Q(n.getURL(o!=null?o:""),U),j=y.join(e.distPath,L(b,e.baseURL)),R=F(b,j,e.fetch),e.log(function(D){return"download: ".concat(b," -> ").concat(D)},R),[4,R];case 1:for(C.sent(),O=e.imageOptions.format,O.length===0&&O.push(void 0),z=e.imageOptions.size,z.length===0&&z.push(void 0),S=[],_=0,q=O;_<q.length;_++)for(W=q[_],N=0,B=z;N<B.length;N++)A=B[N],J=M(j,{format:W,size:A,toFilename:e.imageProcessingFilename}),e.log(function(D){return"imageProcessing: ".concat(j," -> ").concat(D)},J),S.push(J);return[4,Promise.all(S)];case 2:return C.sent(),[2]}})},c=0,f=i,w.label=2;case 2:return c<f.length?(d=f[c],[5,s(d)]):[3,5];case 3:w.sent(),w.label=4;case 4:return c++,[3,2];case 5:if(!a)return[3,9];h=0,g=a,w.label=6;case 6:return h<g.length?(v=g[h],p=v.tileset,e.log("process model layer"),m=n.getURL(p),[4,X(m,e)]):[3,9];case 7:w.sent(),w.label=8;case 8:return h++,[3,6];case 9:return[2]}})})}function T(n,e,r){return P(this,void 0,void 0,function(){var i,a,t,o,u,l,s,c,f,d,h,g,v;return k(this,function(p){switch(p.label){case 0:return i=y.join(r.distPath,L(n,r.baseURL)),a=F(n,i,r.fetch),r.log(function(m){return"download: ".concat(n," -> ").concat(m)},a),[4,a];case 1:if(p.sent(),t=Math.pow(2,e.level),o=r.imageOptions.format,o.length===0&&o.push(void 0),u=[],t>1)for(l=0;l<t;l++)for(s=0;s<t;s++)for(c=0,f=o;c<f.length;c++)d=f[c],h=[e.size/t*s,e.size/t*l,e.size/t,e.size/t],g=e.scale>=1?void 0:e.scale*e.size/t,e.level===1&&e.scale>=.5&&(d==="jpg"||/\.jpg$/.test(i))&&(g=void 0),v=M(i,{format:d,size:g,cut:h,toFilename:r.imageProcessingFilename}),r.log(function(m){return"imageProcessing: ".concat(i," -> ").concat(m)},v),u.push(v);return[4,Promise.all(u)];case 2:return p.sent(),[2]}})})}function x(n,e){return P(this,void 0,void 0,function(){return k(this,function(r){switch(r.label){case 0:return[4,Promise.all([T(n.work.getURL(n.front),n,e),T(n.work.getURL(n.back),n,e),T(n.work.getURL(n.left),n,e),T(n.work.getURL(n.right),n,e),T(n.work.getURL(n.up),n,e),T(n.work.getURL(n.down),n,e)])];case 1:return r.sent(),[2]}})})}function E(n,e){return P(this,void 0,void 0,function(){var r,i,a,t,o,u,l,s,c,f,d,h;return k(this,function(g){switch(g.label){case 0:return r=y.join(e.distPath,L(n,e.baseURL)),i=F(n,r,e.fetch),e.log(function(v){return"download: ".concat(n," -> ").concat(v)},i),[4,i];case 1:for(g.sent(),a=e.imageOptions.format,a.length===0&&a.push(void 0),t=e.imageOptions.size,t.length===0&&t.push(void 0),o=[],u=0,l=a;u<l.length;u++)for(s=l[u],c=0,f=t;c<f.length;c++)d=f[c],h=M(r,{format:s,size:d,toFilename:e.imageProcessingFilename}),e.log(function(v){return"imageProcessing: ".concat(r," -> ").concat(v)},h),o.push(h);return[4,Promise.all(o)];case 2:return g.sent(),[2]}})})}function ee(n,e){return P(this,void 0,void 0,function(){var r;return k(this,function(i){switch(i.label){case 0:return r=n.images,[4,Promise.all([E(r.work.getURL(r.front),e),E(r.work.getURL(r.back),e),E(r.work.getURL(r.left),e),E(r.work.getURL(r.right),e),E(r.work.getURL(r.up),e),E(r.work.getURL(r.down),e)])];case 1:return i.sent(),r.tiles?[4,Promise.all(r.tiles.map(function(a){return x(a,e)}))]:[3,3];case 2:i.sent(),i.label=3;case 3:return[2]}})})}function re(n,e){return P(this,void 0,void 0,function(){var r,i,a,t,o;return k(this,function(u){switch(u.label){case 0:r=n.observers,i=0,a=r,u.label=1;case 1:return i<a.length?(t=a[i],o=ee(t,e),e.log("process observer #".concat(t.index," derived: ").concat(t.derivedIdStr),o),[4,o]):[3,4];case 2:u.sent(),u.label=3;case 3:return i++,[3,1];case 4:return[2]}})})}function ne(n,e){if(e){var r=Date.now();e.then(function(a){var t=Date.now()-r,o=typeof n=="function"?n(a):n;console.log(o+"(".concat(t,"ms)"))}).catch(function(){})}else{var i=typeof n=="function"?n(null):n;console.log(i)}}function te(n){return P(this,arguments,void 0,function(e,r){var i,a,t,o,u,l,s,c,f,d,h,g,v,p,m;return r===void 0&&(r={}),k(this,function(w){switch(w.label){case 0:if(i=e.baseURL,a="",r.distPath)a=y.resolve(process.cwd(),r.distPath);else for(a=y.resolve(process.cwd(),(l=e.workCode)!==null&&l!==void 0?l:"work-".concat(Date.now()));I.existsSync(a);)/.-(\d+)$/.test(a)?a=a.replace(/.-(\d+)$/,function(U,b){return"-"+(Number(b)+1)}):a=a+"-1";return t={baseURL:i,distPath:a,fetch:(s=r.fetch)!==null&&s!==void 0?s:fetch,imageOptions:{size:(f=(c=r.imageOptions)===null||c===void 0?void 0:c.size)!==null&&f!==void 0?f:[],format:(h=(d=r.imageOptions)===null||d===void 0?void 0:d.format)!==null&&h!==void 0?h:[]},textureOptions:{size:(v=(g=r.textureOptions)===null||g===void 0?void 0:g.size)!==null&&v!==void 0?v:[],format:(m=(p=r.textureOptions)===null||p===void 0?void 0:p.format)!==null&&m!==void 0?m:[]},log:r.log?ne:function(){return Promise.resolve()},imageProcessingFilename:r.imageProcessingFilename},t.log(JSON.stringify(t,null," ")),[4,$.mkdir(a,{recursive:!0})];case 1:return w.sent(),o="work.json",u=y.resolve(a,o),[4,$.writeFile(u,JSON.stringify(e.toJSON(),null," "))];case 2:return w.sent(),[4,re(e,t)];case 3:return w.sent(),[4,Z(e,t)];case 4:return w.sent(),[2]}})})}exports.download=te;