@roomle/embedding-lib 5.26.0-alpha.2 → 5.26.0-alpha.4
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/docs/md/web/embedding/CHANGELOG.md +10 -5
- package/{drag-in-DuufO5eB.mjs → drag-in-BEjBh6zz.mjs} +2 -2
- package/{drag-in-DTA1FCDc.mjs → drag-in-BmoiEqfA.mjs} +1 -1
- package/{from-custom-view-BdnViEhf.mjs → from-custom-view-CobBUshK.mjs} +3 -3
- package/from-custom-view-fYea37BE.mjs +1 -0
- package/{from-website-CktA6Icy.mjs → from-website-C2cG-X9g.mjs} +1 -1
- package/{from-website-CcDHgCCy.mjs → from-website-CDEUbvDF.mjs} +1 -1
- package/package.json +1 -1
- package/packages/embedding-lib/src/examples/utils/homag-intelligence/nobilia-api-options.d.ts +45 -0
- package/packages/embedding-lib/src/examples/utils/homag-intelligence/state.d.ts +11 -5
- package/packages/embedding-lib/src/plugins/strategy/from-custom-view.d.ts +1 -1
- package/packages/web-sdk/packages/common-core/mock/mock-draco-loader.d.ts +1 -1
- package/packages/web-sdk/packages/common-core/mock/mock-idb-manager.d.ts +2 -2
- package/packages/web-sdk/packages/common-core/mock/mock-image-renderer.d.ts +2 -2
- package/packages/web-sdk/packages/common-core/mock/mock-input-event-dispatcher.d.ts +1 -1
- package/packages/web-sdk/packages/common-core/src/configurator-kernel-access.d.ts +2 -2
- package/packages/web-sdk/packages/common-core/src/main.d.ts +1 -2
- package/packages/web-sdk/packages/common-core/src/rapi-access.d.ts +6 -5
- package/packages/web-sdk/packages/common-core/src/services/hdr-environment-loader.d.ts +1 -1
- package/packages/web-sdk/packages/common-core/src/utils/enumerable.d.ts +1 -1
- package/packages/web-sdk/packages/common-core/src/utils/threejs-utils.d.ts +1 -1
- package/packages/web-sdk/packages/common-core/src/utils/ui-callback.d.ts +1 -1
- package/packages/web-sdk/packages/common-core/src/view-model/configurator-view-model.d.ts +1 -1
- package/packages/web-sdk/packages/common-core/src/webgl/renderer/pass/ao-pass.d.ts +1 -1
- package/packages/web-sdk/packages/common-core/src/webgl/renderer/render-pass-manager.d.ts +1 -1
- package/packages/web-sdk/packages/common-core/src/webgl/scene-manager.d.ts +1 -1
- package/packages/web-sdk/packages/configurator-core/src/roomle-configurator.d.ts +10 -10
- package/packages/web-sdk/packages/homag-intelligence/src/emulator.d.ts +2 -2
- package/packages/web-sdk/packages/homag-intelligence/src/model/oc-scripts-domain.model.d.ts +3 -3
- package/packages/web-sdk/packages/homag-intelligence/src/orders.d.ts +1 -1
- package/packages/web-sdk/packages/material-viewer/src/roomle-material-viewer.d.ts +1 -1
- package/packages/web-sdk/packages/planner-core/src/roomle-planner.d.ts +2 -2
- package/packages/web-sdk/packages/planner-core/src/services/planner-kernel-access.d.ts +4 -4
- package/packages/web-sdk/packages/planner-core/src/webgl/planner-scene-manager.d.ts +2 -2
- package/packages/web-sdk/packages/typings/kernel.d.ts +1 -0
- package/packages/web-sdk/packages/typings/rapi-types.d.ts +11 -10
- package/roomle-embedding-lib.es.js +80 -79
- package/roomle-embedding-lib.es.min.js +1 -1
- package/roomle-embedding-lib.umd.js +2 -2
- package/roomle-embedding-lib.umd.min.js +1 -1
- package/src/common/components/overlays/part-list/partlist-setup.d.ts +2 -1
- package/src/common/utils/helper.d.ts +2 -2
- package/src/common/utils/ui-actions.d.ts +2 -1
- package/src/configurator/business-logic/sdk-connector-configurator.d.ts +2 -1
- package/src/configurator/business-logic/sdk-connector.d.ts +2 -2
- package/src/configurator/components/grid-view/-utils/CollapsedView.vue.d.ts +14 -14
- package/src/configurator/embedding/exposed-api.d.ts +1 -1
- package/src/configurator/embedding/exposed-callbacks.d.ts +1 -1
- package/src/configurator/embedding/types.d.ts +1 -0
- package/src/planner/business-logic/sdk-connector-planner.d.ts +2 -2
- package/src/planner/components/catalog/CatalogBreadcrumb.vue.d.ts +18 -0
- package/src/planner/components/catalog/CatalogEmptyState.vue.d.ts +10 -0
- package/src/planner/components/catalog/CatalogLevels.vue.d.ts +20 -0
- package/src/planner/components/catalog/CatalogNavigation.vue.d.ts +42 -0
- package/src/planner/components/catalog/CatalogProducts.vue.d.ts +24 -0
- package/src/planner/components/catalog/ProductCard.vue.d.ts +14 -0
- package/src/planner/components/catalog/ProductGrid.vue.d.ts +14 -0
- package/src/planner/components/overlays/RoomSidebar.vue.d.ts +2 -0
- package/src/planner/components/overlays/rooms/DoorParametersSetting.vue.d.ts +2 -0
- package/src/planner/components/overlays/rooms/WindowParametersSetting.vue.d.ts +2 -0
- package/from-custom-view-DIYHP31u.mjs +0 -1
- package/packages/web-sdk/packages/configurator-core/src/utils/test-helpers/async-test-helper.d.ts +0 -1
- package/src/common/store/common-ui-state.d.ts +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(m,p){typeof exports=="object"&&typeof module<"u"?module.exports=p():typeof define=="function"&&define.amd?define(p):(m=typeof globalThis<"u"?globalThis:m||self,m["roomle-embedding-lib"]=m["roomle-embedding-lib"]||{},m["roomle-embedding-lib"].umd=m["roomle-embedding-lib"].umd||{},m["roomle-embedding-lib"].umd.js=p())})(this,function(){"use strict";class m{_side;_incomingMessageBus=null;_outgoingMessageBus=null;_execMessage=null;constructor(t,e,s,n){this._side=t,this._incomingMessageBus=e,this._outgoingMessageBus=s,this._execMessage=n,this._incomingMessageBus&&this._incomingMessageBus.addEventListener("message",this._handleMessage.bind(this))}setOutgoingMessageBus(t){this._outgoingMessageBus=t}setMessageExecution(t){this._execMessage=t}sendMessage(t,e=[]){return new Promise((s,n)=>{if(this._incomingMessageBus===this._outgoingMessageBus)return s(void 0);const i=new MessageChannel;i.port1.onmessage=a=>{if(!a||!a.data)return i.port1.close(),i.port2.close(),n(new Error(this._side+" received message but response can not be interpreted"));let c;try{c=JSON.parse(a.data)}catch(l){return i.port1.close(),i.port2.close(),this._prepareError(l),n(l)}c.error?n(c.error):c.result!==void 0?s(c.result):s(void 0),i.port1.close(),i.port2.close()};let o="";try{o=JSON.stringify({message:t,args:e})}catch{return n(new Error(this._side+": can not create command because it is not JSON.stringify able"))}if(!this._outgoingMessageBus)return n(new Error(this._side+": outgoing bus not set yet"));this._outgoingMessageBus.postMessage(o,"*",[i.port2])})}_handleMessage(t){const e=t.ports&&Array.isArray(t.ports)&&t.ports.length>0?t.ports[0]:null;if(t.data&&e)try{const s=JSON.parse(t.data);if(!this._execMessage)return e.postMessage(JSON.stringify({error:this._side+" is not ready to handle messages"}));Array.isArray(s.args)||(s.args=[s.args]);const n=this._execMessage(s,t);if(n===void 0)return;n.then((i={})=>{let o,a;typeof i=="object"&&i!==null&&(o=i.error,a=i.result),o?e.postMessage(JSON.stringify({error:o})):a!==void 0?e.postMessage(JSON.stringify({result:a})):e.postMessage(JSON.stringify({result:i}))},i=>{e.postMessage(JSON.stringify({error:this._prepareError(i)}))})}catch(s){e.postMessage(JSON.stringify({error:this._prepareError(s)}))}}_prepareError(t){if(typeof t=="string"){const e=this._side+": "+t;return console.error(e),e}return t.message=this._side+": "+t.message,console.error(t),t.message}}const p=".",R={REQUEST_BOOT:"requestBoot",SETUP:"setup",WEBSITE_READY:"websiteReady"},S={GET_METHODS:"getMethods",RETURN_METHODS:"returnMethods",REGISTER_CUSTOM_VIEW:"registerCustomView",REGISTER_CUSTOM_VIEW_DONE:"registerCustomViewDone"},mt=async(r,t)=>{if(typeof r!="string")throw new Error('Configurator ID is not a string type: "'+typeof r+'"');const e=t.customApiUrl?t.customApiUrl:"https://api.roomle.com/v2",s=t.overrideTenant||9,n=e+"/configurators/"+r,i="roomle_portal_v2",o="03-"+window.btoa(new Date().toISOString()+";anonymous;"+i),a=()=>{const d={apiKey:i,currentTenant:s,locale:"en",language:"en",device:1,token:o,platform:"web"};return new Headers(d)},c=new Request(n,{method:"GET",headers:a(),mode:"cors",cache:"default"}),l=await fetch(c),{configurator:h}=await l.json();return h},ft=()=>{try{return window.self!==window.top}catch{return!0}},pt=["127.0.0.1","localhost","0.0.0.0"],yt=()=>{const r=ft();let t=window.location.href;if(r){if(!document.referrer)return null;t=document.referrer}const{hostname:e}=new URL(t);return e},Dt=r=>!!(pt.includes(r)||r.endsWith("roomle.com")||r.endsWith("gitlab.io")||r.endsWith("gitlab.com")),W=["language","browserLanguage","userLanguage","systemLanguage"],Et=(r=null)=>{const t=window.navigator;if(r)return r.substr(0,2);if(Array.isArray(t.languages)&&t.languages.length>0)return t.languages[0].substr(0,2);for(let e=0,s=W.length;e<s;e++){const n=t[W[e]];if(n)return n.substr(0,2)}return"en"},Tt=(r,t)=>{const e=JSON.parse(JSON.stringify(r));return M(e,t)},M=(r,t)=>{for(const e in t)try{t[e].constructor===Object?r[e]=M(r[e],t[e]):r[e]=t[e]}catch{r[e]=t[e]}return r};var $=(r=>(r.BOTTOM_BAR="bottom_bar",r.PARTLIST_BOUNDS="partlist_bounds",r.INTERACTION_NOTES="interaction_notes",r.PARAMETER_GROUPS="parameter_groups",r))($||{});const St=r=>JSON.parse(JSON.stringify(r)),It={mobileLandscape:!0,floorMaterialRootTag:"materials_root",buttons:{renderimage:!0,requestproduct:!0,requestplan:!0,load_product:!0,partlist_print:!0},elements:{[$.INTERACTION_NOTES]:!0},helpcenter:{roomdesigner:!0,configurator:!1,disable:!1},firstPersonView:!0,saveToIdb:!0,featureFlags:{mocAr:!0,wallAutoHeight:!1,openCloseAnimation:!1},rotationSnapDegrees:10,interactionsCollapsed:!1},wt="(idle)",At=r=>(C(r),r?.customApiUrl&&(r.customApiUrl=decodeURIComponent(r.customApiUrl)),r.shareUrl&&(r.deeplink=r.shareUrl.replace(vt,Rt)),r),C=r=>{if(!r)return;const t=Object.keys(r);for(const e of t){const s=r[e];if(!Array.isArray(s)&&typeof s=="object"&&s!==null&&C(s),Array.isArray(s))for(const n of s)C(n);(s==="true"||s==="false")&&(r[e]=s==="true")}},bt=(r,t)=>{t.configuratorId=r.id;const e=r.settings||{};return!t.overrideTenant&&r.tenant&&(t.overrideTenant=r.tenant),Tt(e,t)},Ot=()=>{const r=St(It);r.locale||(r.locale=Et()),r.id===wt&&delete r.id;const t=yt();return t&&Dt(t)&&(r.configuratorId="demoConfigurator"),r.customApiUrl=void 0,r.emails=!1,r},vt="<CONF_ID>",Rt="#CONFIGURATIONID#",Mt=r=>{r.featureFlags||(r.featureFlags={}),typeof r.featureFlags.realPartList!="boolean"&&(r.featureFlags.realPartList=!0),typeof r.featureFlags.globalCallbacks!="boolean"&&(r.featureFlags.globalCallbacks=!0),typeof r.featureFlags.mocAr!="boolean"&&(r.featureFlags.mocAr=!1)},k=()=>/(android)/i.test(navigator.userAgent);class z{_messageHandler=null;isSetupDone=!1;viewName="main";plugins={};pluginsLoaded=[];ui={callbacks:null};extended={callbacks:null};configurator={callbacks:null};analytics={callbacks:{}};rapi={callbacks:{}};global={callbacks:{}};setMessageHandler(t){this._messageHandler=t}handleSetup(t){const{methods:e,callbacks:s}=t;e.forEach(n=>{const i=n.split(p),o=i[0],a=i[1];this[o]||(this[o]={}),this[o][a]=(function(){if(!this._messageHandler){console.error("MessageHandler not set");return}return this._messageHandler.sendMessage(n,[...arguments])}).bind(this)}),s.forEach(n=>{const i=n.split(p),o=i[0],a=i[1],c=i[2];this[o]||(this[o]={}),this[o][a]||(this[o][a]={}),this[o][a][c]=()=>{}}),this.isSetupDone=!0}executeMessage({message:t,args:e}){const s=t.split(p),n=s[0],i=s[1],o=s.length===3?s[2]:null;if(o&&this[n][i][o]){const a=this[n][i][o](...e);return a instanceof Promise?a.then(c=>({result:c})):a!==void 0?Promise.resolve({result:a}):Promise.resolve({result:null})}return Promise.reject('Message "'+t+'" is unkown')}setupPlugins(t,e,s="website"){for(const n of t)typeof n=="string"&&n==="dragIn"?this.pluginsLoaded.push(new Promise((i,o)=>{try{Promise.resolve().then(()=>Gt).then(({DragIn:a})=>{const c=new a(this.ui,e,s,this.viewName);c.init().then(()=>{this.plugins.dragIn=c,i()},o)})}catch(a){o(a)}})):n.name&&n.loader&&this.pluginsLoaded.push(new Promise((i,o)=>{try{n.loader().then(a=>{const c=new a(this.ui,e,s,this.viewName);c.init().then(()=>{this.plugins[n.name]=c,i()},o)})}catch(a){o(a)}}))}}const V=()=>{let r,t;return{promise:new Promise((s,n)=>{r=s,t=n}),resolve:r,reject:t}},q=(r,t,e)=>{let s=null;Object.defineProperty(r,t,{get(){return s||e},set(n){n?.mute?s=n.value:(console.warn("You override Roomle defined behaviour. To disalbe this warning pass in an object with the following properties"),console.warn("{ mute: true, value: () => void }"),s=n)}})},K=()=>window.innerHeight*.01+"px",J=r=>{r&&setTimeout(()=>r.style.setProperty(L,K()),0)},j="rml-styles",Ct=450,L="--rml-full-height",g={CONTAINER:"rml-container",FILL:"rml-fill",POSITION:"rml-pos",TRANSITION:"rml-transition",ANDROID_HEIGHT:"rml-android-height",OVERFLOW_HIDDEN:"rml-overflow-hidden"},N=new Map;class Lt extends z{static createPlanner(t,e,s,n=[]){return this._create(t,e,s,n)}static async connect(t,e=[]){const s=new z;s.viewName=t;const{resolve:n,promise:i}=V(),{resolve:o,promise:a}=V(),c=({message:d,args:u})=>{switch(d){case S.REGISTER_CUSTOM_VIEW_DONE:n();break;case S.RETURN_METHODS:s.handleSetup(u[0]),o();break;default:if(s.isSetupDone)return s.executeMessage({message:d,args:u})}},l=new m("custom-view-"+t,window,window.parent,c);s.setMessageHandler(l);const h=[t];return l.sendMessage(S.REGISTER_CUSTOM_VIEW,h),await i,l.sendMessage(S.GET_METHODS,h),await a,s.setupPlugins(e,document.body,"custom-view"),await Promise.allSettled(s.pluginsLoaded),s}static createConfigurator(t,e,s,n=[]){return this._create(t,e,s,n)}static create(t,e,s,n){return this._create(t,e,s,n)}static createViewer(t,e,s,n=[]){return this._create(t,e,s,n)}static async _create(t,e,s,n){return new Promise(async(i,o)=>{try{const a=M(Ot(),At(s));Mt(a);const c=await mt(t,a);s=bt(c,a);const l=new this(c,e,s,n,i);return await Promise.allSettled(l.pluginsLoaded),l}catch(a){return o(a)}})}_waitForIframe;_container;_configuratorSettings;_initData={};_iframe;constructor(t,e,s,n,i){if(super(),!t||typeof t.id!="string")throw new Error("Please provide a correct configuratorId, you get the correct ID from your Roomle Contact Person");if(N.has(e))throw new Error("There is already an instance on this DOM element");if(!!!document.getElementById(j)){const l=s.zIndex||9999999,h=document.createElement("style");h.type="text/css",h.id=j;const d="transition:all ease-in-out "+Ct+"ms;",u=["-webkit-","-o-"].reduce((D,f)=>D+=f+d,"")+d,_=K();h.innerHTML=`
|
|
1
|
+
(function(m,p){typeof exports=="object"&&typeof module<"u"?module.exports=p():typeof define=="function"&&define.amd?define(p):(m=typeof globalThis<"u"?globalThis:m||self,m["roomle-embedding-lib"]=m["roomle-embedding-lib"]||{},m["roomle-embedding-lib"].umd=m["roomle-embedding-lib"].umd||{},m["roomle-embedding-lib"].umd.js=p())})(this,function(){"use strict";class m{_side;_incomingMessageBus=null;_outgoingMessageBus=null;_execMessage=null;constructor(t,e,s,n){this._side=t,this._incomingMessageBus=e,this._outgoingMessageBus=s,this._execMessage=n,this._incomingMessageBus&&this._incomingMessageBus.addEventListener("message",this._handleMessage.bind(this))}setOutgoingMessageBus(t){this._outgoingMessageBus=t}setMessageExecution(t){this._execMessage=t}sendMessage(t,e=[]){return new Promise((s,n)=>{if(this._incomingMessageBus===this._outgoingMessageBus)return s(void 0);const i=new MessageChannel;i.port1.onmessage=a=>{if(!a||!a.data)return i.port1.close(),i.port2.close(),n(new Error(this._side+" received message but response can not be interpreted"));let c;try{c=JSON.parse(a.data)}catch(l){return i.port1.close(),i.port2.close(),this._prepareError(l),n(l)}c.error?n(c.error):c.result!==void 0?s(c.result):s(void 0),i.port1.close(),i.port2.close()};let o="";try{o=JSON.stringify({message:t,args:e})}catch{return n(new Error(this._side+": can not create command because it is not JSON.stringify able"))}if(!this._outgoingMessageBus)return n(new Error(this._side+": outgoing bus not set yet"));this._outgoingMessageBus.postMessage(o,"*",[i.port2])})}_handleMessage(t){const e=t.ports&&Array.isArray(t.ports)&&t.ports.length>0?t.ports[0]:null;if(t.data&&e)try{const s=JSON.parse(t.data);if(!this._execMessage)return e.postMessage(JSON.stringify({error:this._side+" is not ready to handle messages"}));Array.isArray(s.args)||(s.args=[s.args]);const n=this._execMessage(s,t);if(n===void 0)return;n.then((i={})=>{let o,a;typeof i=="object"&&i!==null&&(o=i.error,a=i.result),o?e.postMessage(JSON.stringify({error:o})):a!==void 0?e.postMessage(JSON.stringify({result:a})):e.postMessage(JSON.stringify({result:i}))},i=>{e.postMessage(JSON.stringify({error:this._prepareError(i)}))})}catch(s){e.postMessage(JSON.stringify({error:this._prepareError(s)}))}}_prepareError(t){if(typeof t=="string"){const e=this._side+": "+t;return console.error(e),e}return t.message=this._side+": "+t.message,console.error(t),t.message}}const p=".",R={REQUEST_BOOT:"requestBoot",SETUP:"setup",WEBSITE_READY:"websiteReady"},S={GET_METHODS:"getMethods",RETURN_METHODS:"returnMethods",REGISTER_CUSTOM_VIEW:"registerCustomView",REGISTER_CUSTOM_VIEW_DONE:"registerCustomViewDone"},mt=async(r,t)=>{if(typeof r!="string")throw new Error('Configurator ID is not a string type: "'+typeof r+'"');const e=t.customApiUrl?t.customApiUrl:"https://api.roomle.com/v2",s=t.overrideTenant||9,n=e+"/configurators/"+r,i="roomle_portal_v2",o="03-"+window.btoa(new Date().toISOString()+";anonymous;"+i),a=()=>{const d={apiKey:i,currentTenant:s,locale:"en",language:"en",device:1,token:o,platform:"web"};return new Headers(d)},c=new Request(n,{method:"GET",headers:a(),mode:"cors",cache:"default"}),l=await fetch(c),{configurator:h}=await l.json();return h},ft=()=>{try{return window.self!==window.top}catch{return!0}},pt=["127.0.0.1","localhost","0.0.0.0"],yt=()=>{const r=ft();let t=window.location.href;if(r){if(!document.referrer)return null;t=document.referrer}const{hostname:e}=new URL(t);return e},Dt=r=>!!(pt.includes(r)||r.endsWith("roomle.com")||r.endsWith("gitlab.io")||r.endsWith("gitlab.com")),W=["language","browserLanguage","userLanguage","systemLanguage"],Et=(r=null)=>{const t=window.navigator;if(r)return r.substr(0,2);if(Array.isArray(t.languages)&&t.languages.length>0)return t.languages[0].substr(0,2);for(let e=0,s=W.length;e<s;e++){const n=t[W[e]];if(n)return n.substr(0,2)}return"en"},Tt=(r,t)=>{const e=JSON.parse(JSON.stringify(r));return M(e,t)},M=(r,t)=>{for(const e in t)try{t[e].constructor===Object?r[e]=M(r[e],t[e]):r[e]=t[e]}catch{r[e]=t[e]}return r};var $=(r=>(r.BOTTOM_BAR="bottom_bar",r.PARTLIST_BOUNDS="partlist_bounds",r.INTERACTION_NOTES="interaction_notes",r.PARAMETER_GROUPS="parameter_groups",r))($||{});const St=r=>JSON.parse(JSON.stringify(r)),It={mobileLandscape:!0,floorMaterialRootTag:"materials_root",buttons:{renderimage:!0,requestproduct:!0,requestplan:!0,load_product:!0,partlist_print:!0},elements:{[$.INTERACTION_NOTES]:!0},helpcenter:{roomdesigner:!0,configurator:!1,disable:!1},firstPersonView:!0,saveToIdb:!0,featureFlags:{mocAr:!0,wallAutoHeight:!1,openCloseAnimation:!1,enableTwoLevelCatalog:!1},rotationSnapDegrees:10,interactionsCollapsed:!1},wt="(idle)",At=r=>(C(r),r?.customApiUrl&&(r.customApiUrl=decodeURIComponent(r.customApiUrl)),r.shareUrl&&(r.deeplink=r.shareUrl.replace(vt,Rt)),r),C=r=>{if(!r)return;const t=Object.keys(r);for(const e of t){const s=r[e];if(!Array.isArray(s)&&typeof s=="object"&&s!==null&&C(s),Array.isArray(s))for(const n of s)C(n);(s==="true"||s==="false")&&(r[e]=s==="true")}},bt=(r,t)=>{t.configuratorId=r.id;const e=r.settings||{};return!t.overrideTenant&&r.tenant&&(t.overrideTenant=r.tenant),Tt(e,t)},Ot=()=>{const r=St(It);r.locale||(r.locale=Et()),r.id===wt&&delete r.id;const t=yt();return t&&Dt(t)&&(r.configuratorId="demoConfigurator"),r.customApiUrl=void 0,r.emails=!1,r},vt="<CONF_ID>",Rt="#CONFIGURATIONID#",Mt=r=>{r.featureFlags||(r.featureFlags={}),typeof r.featureFlags.realPartList!="boolean"&&(r.featureFlags.realPartList=!0),typeof r.featureFlags.globalCallbacks!="boolean"&&(r.featureFlags.globalCallbacks=!0),typeof r.featureFlags.mocAr!="boolean"&&(r.featureFlags.mocAr=!1)},k=()=>/(android)/i.test(navigator.userAgent);class z{_messageHandler=null;isSetupDone=!1;viewName="main";plugins={};pluginsLoaded=[];ui={callbacks:null};extended={callbacks:null};configurator={callbacks:null};analytics={callbacks:{}};rapi={callbacks:{}};global={callbacks:{}};setMessageHandler(t){this._messageHandler=t}handleSetup(t){const{methods:e,callbacks:s}=t;e.forEach(n=>{const i=n.split(p),o=i[0],a=i[1];this[o]||(this[o]={}),this[o][a]=(function(){if(!this._messageHandler){console.error("MessageHandler not set");return}return this._messageHandler.sendMessage(n,[...arguments])}).bind(this)}),s.forEach(n=>{const i=n.split(p),o=i[0],a=i[1],c=i[2];this[o]||(this[o]={}),this[o][a]||(this[o][a]={}),this[o][a][c]=()=>{}}),this.isSetupDone=!0}executeMessage({message:t,args:e}){const s=t.split(p),n=s[0],i=s[1],o=s.length===3?s[2]:null;if(o&&this[n][i][o]){const a=this[n][i][o](...e);return a instanceof Promise?a.then(c=>({result:c})):a!==void 0?Promise.resolve({result:a}):Promise.resolve({result:null})}return Promise.reject('Message "'+t+'" is unkown')}setupPlugins(t,e,s="website"){for(const n of t)typeof n=="string"&&n==="dragIn"?this.pluginsLoaded.push(new Promise((i,o)=>{try{Promise.resolve().then(()=>Gt).then(({DragIn:a})=>{const c=new a(this.ui,e,s,this.viewName);c.init().then(()=>{this.plugins.dragIn=c,i()},o)})}catch(a){o(a)}})):n.name&&n.loader&&this.pluginsLoaded.push(new Promise((i,o)=>{try{n.loader().then(a=>{const c=new a(this.ui,e,s,this.viewName);c.init().then(()=>{this.plugins[n.name]=c,i()},o)})}catch(a){o(a)}}))}}const V=()=>{let r,t;return{promise:new Promise((s,n)=>{r=s,t=n}),resolve:r,reject:t}},q=(r,t,e)=>{let s=null;Object.defineProperty(r,t,{get(){return s||e},set(n){n?.mute?s=n.value:(console.warn("You override Roomle defined behaviour. To disalbe this warning pass in an object with the following properties"),console.warn("{ mute: true, value: () => void }"),s=n)}})},K=()=>window.innerHeight*.01+"px",J=r=>{r&&setTimeout(()=>r.style.setProperty(L,K()),0)},j="rml-styles",Ct=450,L="--rml-full-height",g={CONTAINER:"rml-container",FILL:"rml-fill",POSITION:"rml-pos",TRANSITION:"rml-transition",ANDROID_HEIGHT:"rml-android-height",OVERFLOW_HIDDEN:"rml-overflow-hidden"},N=new Map;class Lt extends z{static createPlanner(t,e,s,n=[]){return this._create(t,e,s,n)}static async connect(t,e=[]){const s=new z;s.viewName=t;const{resolve:n,promise:i}=V(),{resolve:o,promise:a}=V(),c=({message:d,args:u})=>{switch(d){case S.REGISTER_CUSTOM_VIEW_DONE:n();break;case S.RETURN_METHODS:s.handleSetup(u[0]),o();break;default:if(s.isSetupDone)return s.executeMessage({message:d,args:u})}},l=new m("custom-view-"+t,window,window.parent,c);s.setMessageHandler(l);const h=[t];return l.sendMessage(S.REGISTER_CUSTOM_VIEW,h),await i,l.sendMessage(S.GET_METHODS,h),await a,s.setupPlugins(e,document.body,"custom-view"),await Promise.allSettled(s.pluginsLoaded),s}static createConfigurator(t,e,s,n=[]){return this._create(t,e,s,n)}static create(t,e,s,n){return this._create(t,e,s,n)}static createViewer(t,e,s,n=[]){return this._create(t,e,s,n)}static async _create(t,e,s,n){return new Promise(async(i,o)=>{try{const a=M(Ot(),At(s));Mt(a);const c=await mt(t,a);s=bt(c,a);const l=new this(c,e,s,n,i);return await Promise.allSettled(l.pluginsLoaded),l}catch(a){return o(a)}})}_waitForIframe;_container;_configuratorSettings;_initData={};_iframe;constructor(t,e,s,n,i){if(super(),!t||typeof t.id!="string")throw new Error("Please provide a correct configuratorId, you get the correct ID from your Roomle Contact Person");if(N.has(e))throw new Error("There is already an instance on this DOM element");if(!!!document.getElementById(j)){const l=s.zIndex||9999999,h=document.createElement("style");h.type="text/css",h.id=j;const d="transition:all ease-in-out "+Ct+"ms;",u=["-webkit-","-o-"].reduce((D,f)=>D+=f+d,"")+d,_=K();h.innerHTML=`
|
|
2
2
|
.${g.CONTAINER}{${L}:${_};}
|
|
3
3
|
.${g.POSITION}{position:fixed;top:0;left:0;z-index:${l};opacity:0}
|
|
4
4
|
.${g.TRANSITION}{${u}}
|
|
@@ -14,4 +14,4 @@
|
|
|
14
14
|
`,document.head.appendChild(e)}}_initializeDragGhost(){const t=this._mainDomElement.parentNode;let e=t.querySelector("."+b);e||(e=document.createElement("div"),e.classList.add(b),e.innerText=" ",t.appendChild(e))}constructor(t,e,s,n){super(t,e,s,n),this._mainDomElement=e,this._injectStyles(),this._initializeDragGhost()}async init(){if(await super.init(),this._mode==="website")try{const{DragInFromWebsiteStrategy:t}=await Promise.resolve().then(()=>$t);this._strategy=new t(this._instance,this._mainDomElement,{settings:this.options,mode:"website"})}catch(t){throw console.error('Could not load Dragin strategy "FromWebsite"'),t}else if(this._mode==="custom-view")try{const{DragInFromCustomViewStrategy:t}=await Promise.resolve().then(()=>jt);this._strategy=new t(this._instance,this._mainDomElement,this.options,this._viewName)}catch(t){throw console.error('Could not load Dragin strategy "FromCustomView"'),t}else throw new Error("Unsupported mode")}get isDragging(){return this._strategy.isDragging}dragStart(t,e,s="rml_id"){this._strategy.dragStart(t,e,s)}dragUpdate(t){this._strategy.dragUpdate(t)}dragEnd(){this._strategy.dragEnd()}touchStart(t,e,s="rml_id"){this._strategy.touchStart(t,e,s)}touchMove(t){this._strategy.touchMove(t)}touchEnd(){this._strategy.touchEnd()}dispose(){this._strategy.dispose()}beforeUpdateGhost(t){this._strategy.beforeUpdateGhost(t)}registerCustomDrag({customDragStart:t,customDragEnd:e,customDragUpdate:s,beforeUpdateGhost:n}){n&&this._strategy.beforeUpdateGhost(n);const i=this._customDragSignal.signal,o=l=>{l.target.getAttribute("data-rml-draggable")==="true"&&t(l)},a=l=>{this._strategy.releaseInput(l),this._strategy.isDragging&&e(l)},c=l=>{s(l)};document.querySelectorAll('[data-rml-draggable="true"]').forEach(l=>{l.draggable=!1}),document.addEventListener("mousedown",o,{signal:i}),document.addEventListener("mouseup",a,{signal:i}),document.addEventListener("mousemove",c,{signal:i}),document.addEventListener("mouseleave",a,{signal:i}),document.addEventListener("touchstart",o,{signal:i}),document.addEventListener("touchend",a,{signal:i}),document.addEventListener("touchmove",c,{signal:i})}unregisterCustomDrag(){this._customDragSignal.abort(),this._customDragSignal=new AbortController}releaseInput(t){this._strategy.releaseInput(t)}}const Gt=Object.freeze(Object.defineProperty({__proto__:null,DragIn:xt},Symbol.toStringTag,{value:"Module"}));class Ft{_computedStyleCache=new Map;_maxLifetime=16;_cacheCleanInterval=null;constructor(t=16){this._maxLifetime=t}get(t){const e=this._computedStyleCache.get(t),s=Date.now();if(e&&s-e.updated<this._maxLifetime)return e.style;const n=getComputedStyle(t);return this._computedStyleCache.set(t,{style:n,updated:s}),this._cacheCleanInterval||(this._cacheCleanInterval=setInterval(()=>this._cleanUpCache,Math.max(this._maxLifetime*1e3,5e3))),n}_cleanUpCache(){const t=Date.now();for(const[e,{updated:s}]of this._computedStyleCache.entries())t-s>=this._maxLifetime&&this._computedStyleCache.delete(e);this._computedStyleCache.size===0&&this._cacheCleanInterval&&(clearInterval(this._cacheCleanInterval),this._cacheCleanInterval=null)}}const y=r=>window.TouchEvent&&r instanceof window.TouchEvent;let P;const v=r=>(P||(P=new Ft),P.get(r)),at=(r,t,e)=>{const s=parseFloat(r),n=window.devicePixelRatio||1;if(t==="px")return s;if(t==="%"){const o=e===document.documentElement?window.innerWidth:e.offsetWidth;return s/100*o}if(t==="rem"){const o=parseFloat(v(document.documentElement).fontSize);return s*o}if(t==="em"){const o=parseFloat(v(e).fontSize);return s*o}if(t==="vh"||t==="vw"||t==="vmin"||t==="vmax"){const o={vh:window.innerHeight,vw:window.innerWidth,vmin:Math.min(window.innerWidth,window.innerHeight),vmax:Math.max(window.innerWidth,window.innerHeight)};return s/100*o[t]}const i={cm:37.7952755906,mm:3.77952755906,in:96};return t in i?s*i[t]*n:(console.warn("Unable to determine coordinates for drag-in. Therefore drag-in is not possible. Check the CSS that positions the iframe of Roomle"),0)},ct=(r,t,e={x:0,y:0})=>{const s=r.getBoundingClientRect(),i=v(r).transform;let o=0,a=0;if(i!=="none"){const u=/translate\(\s*([-+]?\d*\.?\d+|\d+)(px|%)?,?\s*([-+]?\d*\.?\d+|\d+)?(px|%)?\s*\)/,_=i.match(u);_&&(o=at(_[1],_[2],r),a=at(_[3],_[4],r))}const{clientX:c,clientY:l}=E(t,e),h=c-s.left-o+r.scrollLeft,d=l-s.top-a+r.scrollTop;return{x:h,y:d}},E=(r,t=null)=>{const{clientX:e,clientY:s}=y(r)?Pt(r):r,n=e>0?e:t?t.x:e,i=s>0?s:t?t.y:s;return{clientX:n,clientY:i}},Pt=r=>{if(r.touches.length){let{clientX:e,clientY:s}=r.touches[0];if(r.touches.length>1){const n=r.touches[1],i=n.clientX,o=n.clientY;e=(e+i)/2,s=(s+o)/2}return{clientX:e,clientY:s}}const t=r.changedTouches[0];return{clientX:t.clientX,clientY:t.clientY}},H=500,U=10,Ht=100,lt=15,B=(r,t=0)=>y(r)?{clientX:r.touches[t].clientX,clientY:r.touches[t].clientY}:{clientX:r.clientX,clientY:r.clientY},ht=r=>r&&y(r)?r.touches.length>0:!0;class dt{_touchDragTimeOut;_onTouchDragStart;_payload=null;_delay=H;_firstTouch=null;_lastTouch=null;_epsilon=U;constructor(t,{onTouchDragStart:e},s={}){this._payload=t,this._onTouchDragStart=e,this._delay=typeof s.delay=="number"?s.delay:H,this._epsilon=typeof s.epsilon=="number"?s.epsilon:U}onStart(t){ht(t)&&(this._touchDragTimeOut||(this._firstTouch=B(t,y(t)?t.touches.length-1:0),this._touchDragTimeOut=setTimeout(()=>{this._clearTimeout(),this._lastTouch||(this._lastTouch=B(t)),this._checkXDistance(t)()},this._delay)))}onEnd(){this._resetTouches()}onMove(t){ht(t)&&(this._lastTouch=B(t))}_clearTimeout(){this._touchDragTimeOut&&(clearTimeout(this._touchDragTimeOut),this._touchDragTimeOut=null)}_resetTouches(){this._clearTimeout(),this._lastTouch=null,this._firstTouch=null,this._payload=null}_checkXDistance(t){return()=>{if(!this._firstTouch||!this._lastTouch)return;let e=!1;e=Math.abs(this._firstTouch.clientX-this._lastTouch.clientX)<this._epsilon,e&&(this._onTouchDragStart(this._payload,t),this._resetTouches())}}}const ut=(r,t,e=0,s=0)=>{const n=t.x+t.width+e,i=t.x-e,o=t.y+t.height+s,a=t.y-s,{x:c,y:l}=r;return c>=i&&c<=n&&l>=a&&l<=o},gt=(r,t,e,s=0,n=0)=>{if(!(!e||!e.hiddenIn&&!e.visibleIn))return e.visibleIn?ut({x:r,y:t},e.visibleIn,s,n):e.hiddenIn?!ut({x:r,y:t},e.hiddenIn,-s,-n):!1},Ut=()=>{if(!!!document.getElementById(I)){const t=document.createElement("style");t.type="text/css",t.id=I,t.innerHTML=`
|
|
15
15
|
${rt}
|
|
16
16
|
${nt}
|
|
17
|
-
`,document.head.appendChild(t)}},Bt=({x:r,y:t},e)=>{let s=document.getElementById(w);if(!s){if(s=document.createElement("div"),e.ghost?.element)s.appendChild(e.ghost.element);else{const n=document.createElement("img");n.src=e.ghost?.url||O,n.width=e.ghost?.width||G,n.height=e.ghost?.height||F,s.appendChild(n)}s.id=w,s.style.position="fixed",s.style.top="0",s.style.left="0",s.style.willChange="transform",s.style.transform="translate3d(0, 0, 0)",s.style.zIndex="9999",s.style.opacity="0.5",gt(r,t,e.ghost||{},e.settings?.dragInOverlapX,e.settings?.dragInOverlapY)||(s.style.display="none"),s.style.pointerEvents="none",document.body.appendChild(s)}},Yt=({x:r,y:t},e)=>{const s=document.getElementById(w);if(!s)return;let n=e.ghost?.width,i=e.ghost?.height;typeof n>"u"&&(n=s.getBoundingClientRect().width||G),typeof i>"u"&&(i=s.getBoundingClientRect().height||F);const o=r-n/2,a=t-i/2;s.style.transform=`translate3d(${o}px, ${a}px, 0)`,e.ghost&&(gt(r,t,e.ghost,e.settings?.dragInOverlapX,e.settings?.dragInOverlapY)?s.style.animation!=it&&(s.style.animation=it):s.style.animation!=ot&&(s.style.animation=ot))};class Xt{_dragGhostAnimationFrameId=null;_dragGhostRemoveAnimationFrameId=null;_dragGhostElement=null;constructor(t=null){this._dragGhostElement=t}updateDragGhost(t,e,s){this._dragGhostRemoveAnimationFrameId&&(cancelAnimationFrame(this._dragGhostRemoveAnimationFrameId),this._dragGhostRemoveAnimationFrameId=null),!s.ghost?.external&&s.ghost&&(this._dragGhostAnimationFrameId||(this._dragGhostAnimationFrameId=requestAnimationFrame(()=>{Ut();const n={x:t,y:e};!s.ghost&&this._dragGhostElement&&(s.ghost={}),s.ghost&&!s.ghost.element&&this._dragGhostElement&&(s.ghost.element=this._dragGhostElement),Bt(n,s),Yt(n,s),this._dragGhostAnimationFrameId=null})))}removeDragGhost(){this._dragGhostAnimationFrameId&&(cancelAnimationFrame(this._dragGhostAnimationFrameId),this._dragGhostAnimationFrameId=null),this._dragGhostRemoveAnimationFrameId||(this._dragGhostRemoveAnimationFrameId=requestAnimationFrame(()=>{const t=document.getElementById(w);t&&document.body.removeChild(t),this._dragGhostRemoveAnimationFrameId=null}))}}class Wt{_options={};_instance;_mainDomElement;_currentDrag={};_currentTouch=null;_firefoxDragPosition={x:0,y:0};_onBeforeUpdateDrag=()=>({});isDragging=!1;_firefoxFallback=t=>{if(!this._currentDrag.event)return;t.preventDefault();const e=t||window.event;this._firefoxDragPosition.x=e.pageX||0,this._firefoxDragPosition.y=e.pageY||0};constructor(t,e,s){this._instance=t,this._mainDomElement=e,this._options=s||{},this._firefoxFallback=this._firefoxFallback.bind(this),document.addEventListener("dragover",this._firefoxFallback),this._mainDomElement.parentElement?.addEventListener("dragleave",()=>{this._instance.cancelDragIn()})}beforeUpdateGhost(t){this._onBeforeUpdateDrag=t}dragStart(t,e,s="rml_id"){const n=this._mainDomElement.parentNode;if(v(n).position!=="relative"){console.warn("Parent of iframe should have position relative, otherwise drag-in can not detect the x/y coordinates correctly");return}this._mainDomElement.style.pointerEvents="none";let o=n.querySelector("."+A);o||(o=document.createElement("div"),o.classList.add(A),n.appendChild(o)),o.classList.remove(x.DISPLAY_NONE),e.target.getAttribute("draggable")||console.warn(`Draggable not detected correctly! Did you add draggable="true" to the element? In Sarafi only 'draggable' is too less`);const c=n.querySelector("."+b);this._currentDrag.event=e;const l=e.target,h=l.cloneNode(!0),d=l.getBoundingClientRect();h.style.width=`${d.width}px`,h.style.height=`${d.height}px`,this._currentDrag.ghost=new Xt(h),this._currentDrag.offset||(this._currentDrag.offset={x:0,y:0});const{clientX:u,clientY:_}=E(e,this._firefoxDragPosition);this._currentDrag.offset.x=u-d.left,this._currentDrag.offset.y=_-d.top,e instanceof DragEvent&&e.dataTransfer&&e.dataTransfer.setDragImage&&e.dataTransfer.setDragImage(c,0,0);const{x:D,y:f}=ct(n,this._currentDrag.event||e,this._firefoxDragPosition),T=Math.max(1,D),Qt=Math.max(1,f);this.isDragging=!0,this._instance.dragInObject(t,T,Qt,s)}dragUpdate(t){const e=this._mainDomElement.parentNode,{x:s,y:n}=ct(e,t,this._firefoxDragPosition);if(s===0&&n===0)return;const i=Math.max(1,s),o=Math.max(1,n);if(i===1&&o===1)return;let a=i,c=o;if(y(t)){const f=this._options.settings?.fingerSize||0;a=Math.max(2,i+f),c=Math.max(2,o-f)}const{x:l,y:h,options:d}=this._onBeforeUpdateDrag(a,c,{}),u=d||{settings:{},ghost:{}};u.ghost||(u.ghost={}),u.ghost.visibleIn&&u.ghost.hiddenIn||(u.ghost.hiddenIn=this._mainDomElement.getBoundingClientRect());const _=typeof l=="number"?l:a,D=typeof h=="number"?h:c;if(this._currentDrag.ghost){const{clientX:f,clientY:T}=E(t,this._firefoxDragPosition);this._currentDrag.ghost.updateDragGhost(f,T,u)}this._instance.updateDrag(_,D,{})}dragEnd(){this._mainDomElement.style.pointerEvents="all";const t=this._mainDomElement.parentNode;this.isDragging=!1,this._instance.dragInObjectEnd(),this._currentDrag.ghost&&(this._currentDrag.ghost.removeDragGhost(),this._currentDrag.ghost=null),this._currentDrag={},this._firefoxDragPosition={x:0,y:0};const e=t.querySelector("."+A);e&&e.classList.add(x.DISPLAY_NONE)}touchStart(t,e,s="rml_id"){e.preventDefault();const n=(o,a)=>{this.dragStart(t,a,s)},i={};typeof this._options?.settings?.touchDragDelay=="number"&&(i.delay=this._options.settings.touchDragDelay),this._options?.settings?.touchDragEpsilon&&(i.epsilon=this._options.settings.touchDragEpsilon),this._currentTouch=new dt(void 0,{onTouchDragStart:n},i),this._currentTouch.onStart(e)}touchMove(t){this._currentTouch&&this._currentTouch.onMove(t),this._currentDrag.event&&this.dragUpdate(t)}touchEnd(){this._currentTouch&&this._currentTouch.onEnd(),this._currentTouch=null,this.dragEnd()}dispose(){document.removeEventListener("dragover",this._firefoxFallback)}releaseInput(t){}}const $t=Object.freeze(Object.defineProperty({__proto__:null,DragInFromWebsiteStrategy:Wt},Symbol.toStringTag,{value:"Module"})),kt=r=>`[data-rml-custom-view="${r}"]`,Y=r=>{r.preventDefault(),r.stopPropagation()},zt=(r,t,e,s)=>{const n=e-r,i=s-t;return Math.sqrt(n*n+i*i)};class Vt{_startX=0;_startY=0;_lastX=0;_lastY=0;_epsilon;_isWaiting=!1;_onCustomDragStart;constructor({onCustomDragStart:t},e={}){this._epsilon=typeof e.epsilon=="number"?e.epsilon:lt,this._onCustomDragStart=t}onMove(t){this._lastX=t.clientX,this._lastY=t.clientY,this._isWaiting&&zt(this._startX,this._startY,this._lastX,this._lastY)>this._epsilon&&(this._onCustomDragStart(t),this._isWaiting=!1)}onStart(t){this._startX=t.clientX,this._startY=t.clientY,this.onMove(t),this._isWaiting=!0}onEnd(){this._reset()}_reset(){this._startX=0,this._startY=0,this._lastX=0,this._lastY=0,this._isWaiting=!1}}const X="data-rml-old-draggable",qt=void 0,_t=(r,t)=>{const e=y(r),s={delay:e?H:Ht,epsilon:e?U:lt};if(!t)return s;if(!e&&!(r instanceof MouseEvent))return console.warn("Unsupported event! It is not TouchEvent and also not MouseEvent"),s;const{delayKey:n,epsilonKey:i}=e?{delayKey:"touchDragDelay",epsilonKey:"touchDragEpsilon"}:{delayKey:"customDragDelay",epsilonKey:"customDragEpsilon"};return typeof t[n]=="number"&&(s.delay=t.touchDragDelay),typeof t[i]=="number"&&(s.epsilon=t.touchDragEpsilon),s},Kt=r=>{let t="",e=G,s=F;if(!r)return{url:O,width:e,height:s};const n=r;if(n instanceof HTMLElement){const i=n.getBoundingClientRect(),o=n.getAttribute("data-rml-ghost-url"),a=n.getAttribute("data-rml-ghost-width"),c=n.getAttribute("data-rml-ghost-height");o?t=o:!o&&n instanceof HTMLImageElement&&n.src&&(t=n.src),t?(e=i.width,s=i.height):t=O,e=a?parseInt(a,10):e,s=c?parseInt(c,10):s}return{url:t||O,width:e,height:s}};class Jt{_options={};_instance;_mainDomElement;_viewName;_currentCustomDrag=null;_currentBb=null;_startTarget=null;_onBeforeUpdateDrag=()=>({});isDragging=!1;constructor(t,e,s){this._instance=t,this._options=e||{},this._viewName=s,this._mainDomElement=mainDomElement,this._mainDomElement.parentElement?.addEventListener("dragleave",()=>{this._instance.cancelDragIn()})}beforeUpdateGhost(t){this._onBeforeUpdateDrag=t}async _dragStart(t,e,s="rml_id"){this._startTarget&&(this._startTarget.style.pointerEvents="none",this._startTarget.style.userSelect="none",this._startTarget.setAttribute(X,this._startTarget.draggable.toString()),this._startTarget.draggable=!1,this._startTarget.removeEventListener("dragstart",Y),this._startTarget.addEventListener("dragstart",Y)),this._currentBb=await this._instance.getBoundingClientRect(kt(this._viewName));const{clientX:n,clientY:i}=E(e),o=this._currentBb.x+n,a=this._currentBb.y+i;this.isDragging=!0,this._instance.dragInObject(t,o,a,s)}_dragUpdate(t){if(document.body.focus(),this._currentCustomDrag&&this._currentCustomDrag.onMove(t),!this._currentBb||!this.isDragging)return;const{clientX:e,clientY:s}=E(t),{url:n,width:i,height:o}=Kt(this._startTarget),a=this._currentBb.x+e,c=this._currentBb.y+s,l=this._options||{},h={ghost:{visibleIn:{x:this._currentBb.x-(l.dragInOverlapX||0),y:this._currentBb.y+(l.dragInOverlapY||0),width:this._currentBb.width+(l.dragInOverlapX||0),height:this._currentBb.height+(l.dragInOverlapY||0)},url:n,width:i,height:o},mode:"custom-view"},{x:d,y:u,options:_}=this._onBeforeUpdateDrag(a,c,h),D=typeof d=="number"?d:a,f=typeof u=="number"?u:c,T=_||h;this._instance.updateDrag(D,f,T)}_dragEnd(){this._currentCustomDrag&&this._currentCustomDrag.onEnd(),this._currentCustomDrag=null,this.isDragging=!1,this._currentBb=null,this._resetStartTarget(),this._instance.enableEvents(),this._instance.dragInObjectEnd()}dragStart(t,e,s){this._instance.disableEvents(),this._startTarget=e.target;const n=(i,o)=>{this._dragStart(t,o,s)};this._currentCustomDrag=y(e)?new dt(qt,{onTouchDragStart:n},_t(e,this._options)):new Vt({onCustomDragStart:i=>this._dragStart(t,i,s)},_t(e,this._options)),this._currentCustomDrag.onStart(e)}dragEnd(){this._dragEnd()}dragUpdate(t){this._dragUpdate(t)}touchStart(t,e,s="rml_id"){this.dragStart(t,e,s)}touchMove(t){this.dragUpdate(t)}touchEnd(){this.dragEnd()}dispose(){}_resetStartTarget(){this._startTarget&&(this._startTarget.style.pointerEvents="",this._startTarget.style.userSelect="",this._startTarget.draggable=this._startTarget.getAttribute(X)==="true",this._startTarget.removeAttribute(X),this._startTarget.removeEventListener("dragstart",Y))}releaseInput(t){this._currentCustomDrag&&this._currentCustomDrag.onEnd(),this._resetStartTarget()}}const jt=Object.freeze(Object.defineProperty({__proto__:null,DragInFromCustomViewStrategy:Jt},Symbol.toStringTag,{value:"Module"}));return Lt});
|
|
17
|
+
`,document.head.appendChild(t)}},Bt=({x:r,y:t},e)=>{let s=document.getElementById(w);if(!s){if(s=document.createElement("div"),e.ghost?.element)s.appendChild(e.ghost.element);else{const n=document.createElement("img");n.src=e.ghost?.url||O,n.width=e.ghost?.width||G,n.height=e.ghost?.height||F,s.appendChild(n)}s.id=w,s.style.position="fixed",s.style.top="0",s.style.left="0",s.style.willChange="transform",s.style.transform="translate3d(0, 0, 0)",s.style.zIndex="9999",s.style.opacity="0.5",gt(r,t,e.ghost||{},e.settings?.dragInOverlapX,e.settings?.dragInOverlapY)||(s.style.display="none"),s.style.pointerEvents="none",document.body.appendChild(s)}},Yt=({x:r,y:t},e)=>{const s=document.getElementById(w);if(!s)return;let n=e.ghost?.width,i=e.ghost?.height;typeof n>"u"&&(n=s.getBoundingClientRect().width||G),typeof i>"u"&&(i=s.getBoundingClientRect().height||F);const o=r-n/2,a=t-i/2;s.style.transform=`translate3d(${o}px, ${a}px, 0)`,e.ghost&&(gt(r,t,e.ghost,e.settings?.dragInOverlapX,e.settings?.dragInOverlapY)?s.style.animation!=it&&(s.style.animation=it):s.style.animation!=ot&&(s.style.animation=ot))};class Xt{_dragGhostAnimationFrameId=null;_dragGhostRemoveAnimationFrameId=null;_dragGhostElement=null;constructor(t=null){this._dragGhostElement=t}updateDragGhost(t,e,s){this._dragGhostRemoveAnimationFrameId&&(cancelAnimationFrame(this._dragGhostRemoveAnimationFrameId),this._dragGhostRemoveAnimationFrameId=null),!s.ghost?.external&&s.ghost&&(this._dragGhostAnimationFrameId||(this._dragGhostAnimationFrameId=requestAnimationFrame(()=>{Ut();const n={x:t,y:e};!s.ghost&&this._dragGhostElement&&(s.ghost={}),s.ghost&&!s.ghost.element&&this._dragGhostElement&&(s.ghost.element=this._dragGhostElement),Bt(n,s),Yt(n,s),this._dragGhostAnimationFrameId=null})))}removeDragGhost(){this._dragGhostAnimationFrameId&&(cancelAnimationFrame(this._dragGhostAnimationFrameId),this._dragGhostAnimationFrameId=null),this._dragGhostRemoveAnimationFrameId||(this._dragGhostRemoveAnimationFrameId=requestAnimationFrame(()=>{const t=document.getElementById(w);t&&document.body.removeChild(t),this._dragGhostRemoveAnimationFrameId=null}))}}class Wt{_options={};_instance;_mainDomElement;_currentDrag={};_currentTouch=null;_firefoxDragPosition={x:0,y:0};_onBeforeUpdateDrag=()=>({});isDragging=!1;_firefoxFallback=t=>{if(!this._currentDrag.event)return;t.preventDefault();const e=t||window.event;this._firefoxDragPosition.x=e.pageX||0,this._firefoxDragPosition.y=e.pageY||0};constructor(t,e,s){this._instance=t,this._mainDomElement=e,this._options=s||{},this._firefoxFallback=this._firefoxFallback.bind(this),document.addEventListener("dragover",this._firefoxFallback),this._mainDomElement.parentElement?.addEventListener("dragleave",()=>{this._instance.cancelDragIn()})}beforeUpdateGhost(t){this._onBeforeUpdateDrag=t}dragStart(t,e,s="rml_id"){const n=this._mainDomElement.parentNode;if(v(n).position!=="relative"){console.warn("Parent of iframe should have position relative, otherwise drag-in can not detect the x/y coordinates correctly");return}this._mainDomElement.style.pointerEvents="none";let o=n.querySelector("."+A);o||(o=document.createElement("div"),o.classList.add(A),n.appendChild(o)),o.classList.remove(x.DISPLAY_NONE),e.target.getAttribute("draggable")||console.warn(`Draggable not detected correctly! Did you add draggable="true" to the element? In Sarafi only 'draggable' is too less`);const c=n.querySelector("."+b);this._currentDrag.event=e;const l=e.target,h=l.cloneNode(!0),d=l.getBoundingClientRect();h.style.width=`${d.width}px`,h.style.height=`${d.height}px`,this._currentDrag.ghost=new Xt(h),this._currentDrag.offset||(this._currentDrag.offset={x:0,y:0});const{clientX:u,clientY:_}=E(e,this._firefoxDragPosition);this._currentDrag.offset.x=u-d.left,this._currentDrag.offset.y=_-d.top,e instanceof DragEvent&&e.dataTransfer&&e.dataTransfer.setDragImage&&e.dataTransfer.setDragImage(c,0,0);const{x:D,y:f}=ct(n,this._currentDrag.event||e,this._firefoxDragPosition),T=Math.max(1,D),Qt=Math.max(1,f);this.isDragging=!0,this._instance.dragInObject(t,T,Qt,s)}dragUpdate(t){const e=this._mainDomElement.parentNode,{x:s,y:n}=ct(e,t,this._firefoxDragPosition);if(s===0&&n===0)return;const i=Math.max(1,s),o=Math.max(1,n);if(i===1&&o===1)return;let a=i,c=o;if(y(t)){const f=this._options.settings?.fingerSize||0;a=Math.max(2,i+f),c=Math.max(2,o-f)}const{x:l,y:h,options:d}=this._onBeforeUpdateDrag(a,c,{}),u=d||{settings:{},ghost:{}};u.ghost||(u.ghost={}),u.ghost.visibleIn&&u.ghost.hiddenIn||(u.ghost.hiddenIn=this._mainDomElement.getBoundingClientRect());const _=typeof l=="number"?l:a,D=typeof h=="number"?h:c;if(this._currentDrag.ghost){const{clientX:f,clientY:T}=E(t,this._firefoxDragPosition);this._currentDrag.ghost.updateDragGhost(f,T,u)}this._instance.updateDrag(_,D,{})}dragEnd(){this._mainDomElement.style.pointerEvents="all";const t=this._mainDomElement.parentNode;this.isDragging=!1,this._instance.dragInObjectEnd(),this._currentDrag.ghost&&(this._currentDrag.ghost.removeDragGhost(),this._currentDrag.ghost=null),this._currentDrag={},this._firefoxDragPosition={x:0,y:0};const e=t.querySelector("."+A);e&&e.classList.add(x.DISPLAY_NONE)}touchStart(t,e,s="rml_id"){e.preventDefault();const n=(o,a)=>{this.dragStart(t,a,s)},i={};typeof this._options?.settings?.touchDragDelay=="number"&&(i.delay=this._options.settings.touchDragDelay),this._options?.settings?.touchDragEpsilon&&(i.epsilon=this._options.settings.touchDragEpsilon),this._currentTouch=new dt(void 0,{onTouchDragStart:n},i),this._currentTouch.onStart(e)}touchMove(t){this._currentTouch&&this._currentTouch.onMove(t),this._currentDrag.event&&this.dragUpdate(t)}touchEnd(){this._currentTouch&&this._currentTouch.onEnd(),this._currentTouch=null,this.dragEnd()}dispose(){document.removeEventListener("dragover",this._firefoxFallback)}releaseInput(t){}}const $t=Object.freeze(Object.defineProperty({__proto__:null,DragInFromWebsiteStrategy:Wt},Symbol.toStringTag,{value:"Module"})),kt=r=>`[data-rml-custom-view="${r}"]`,Y=r=>{r.preventDefault(),r.stopPropagation()},zt=(r,t,e,s)=>{const n=e-r,i=s-t;return Math.sqrt(n*n+i*i)};class Vt{_startX=0;_startY=0;_lastX=0;_lastY=0;_epsilon;_isWaiting=!1;_onCustomDragStart;constructor({onCustomDragStart:t},e={}){this._epsilon=typeof e.epsilon=="number"?e.epsilon:lt,this._onCustomDragStart=t}onMove(t){this._lastX=t.clientX,this._lastY=t.clientY,this._isWaiting&&zt(this._startX,this._startY,this._lastX,this._lastY)>this._epsilon&&(this._onCustomDragStart(t),this._isWaiting=!1)}onStart(t){this._startX=t.clientX,this._startY=t.clientY,this.onMove(t),this._isWaiting=!0}onEnd(){this._reset()}_reset(){this._startX=0,this._startY=0,this._lastX=0,this._lastY=0,this._isWaiting=!1}}const X="data-rml-old-draggable",qt=void 0,_t=(r,t)=>{const e=y(r),s={delay:e?H:Ht,epsilon:e?U:lt};if(!t)return s;if(!e&&!(r instanceof MouseEvent))return console.warn("Unsupported event! It is not TouchEvent and also not MouseEvent"),s;const{delayKey:n,epsilonKey:i}=e?{delayKey:"touchDragDelay",epsilonKey:"touchDragEpsilon"}:{delayKey:"customDragDelay",epsilonKey:"customDragEpsilon"};return typeof t[n]=="number"&&(s.delay=t.touchDragDelay),typeof t[i]=="number"&&(s.epsilon=t.touchDragEpsilon),s},Kt=r=>{let t="",e=G,s=F;if(!r)return{url:O,width:e,height:s};const n=r;if(n instanceof HTMLElement){const i=n.getBoundingClientRect(),o=n.getAttribute("data-rml-ghost-url"),a=n.getAttribute("data-rml-ghost-width"),c=n.getAttribute("data-rml-ghost-height");o?t=o:!o&&n instanceof HTMLImageElement&&n.src&&(t=n.src),t?(e=i.width,s=i.height):t=O,e=a?parseInt(a,10):e,s=c?parseInt(c,10):s}return{url:t||O,width:e,height:s}};class Jt{_options={};_instance;_mainDomElement;_viewName;_currentCustomDrag=null;_currentBb=null;_startTarget=null;_onBeforeUpdateDrag=()=>({});isDragging=!1;constructor(t,e,s,n){this._instance=t,this._options=s||{},this._viewName=n,this._mainDomElement=e,this._mainDomElement.parentElement?.addEventListener("dragleave",()=>{this._instance.cancelDragIn()})}beforeUpdateGhost(t){this._onBeforeUpdateDrag=t}async _dragStart(t,e,s="rml_id"){this._startTarget&&(this._startTarget.style.pointerEvents="none",this._startTarget.style.userSelect="none",this._startTarget.setAttribute(X,this._startTarget.draggable.toString()),this._startTarget.draggable=!1,this._startTarget.removeEventListener("dragstart",Y),this._startTarget.addEventListener("dragstart",Y)),this._currentBb=await this._instance.getBoundingClientRect(kt(this._viewName));const{clientX:n,clientY:i}=E(e),o=this._currentBb.x+n,a=this._currentBb.y+i;this.isDragging=!0,this._instance.dragInObject(t,o,a,s)}_dragUpdate(t){if(document.body.focus(),this._currentCustomDrag&&this._currentCustomDrag.onMove(t),!this._currentBb||!this.isDragging)return;const{clientX:e,clientY:s}=E(t),{url:n,width:i,height:o}=Kt(this._startTarget),a=this._currentBb.x+e,c=this._currentBb.y+s,l=this._options||{},h={ghost:{visibleIn:{x:this._currentBb.x-(l.dragInOverlapX||0),y:this._currentBb.y+(l.dragInOverlapY||0),width:this._currentBb.width+(l.dragInOverlapX||0),height:this._currentBb.height+(l.dragInOverlapY||0)},url:n,width:i,height:o},mode:"custom-view"},{x:d,y:u,options:_}=this._onBeforeUpdateDrag(a,c,h),D=typeof d=="number"?d:a,f=typeof u=="number"?u:c,T=_||h;this._instance.updateDrag(D,f,T)}_dragEnd(){this._currentCustomDrag&&this._currentCustomDrag.onEnd(),this._currentCustomDrag=null,this.isDragging=!1,this._currentBb=null,this._resetStartTarget(),this._instance.enableEvents(),this._instance.dragInObjectEnd()}dragStart(t,e,s){this._instance.disableEvents(),this._startTarget=e.target;const n=(i,o)=>{this._dragStart(t,o,s)};this._currentCustomDrag=y(e)?new dt(qt,{onTouchDragStart:n},_t(e,this._options)):new Vt({onCustomDragStart:i=>this._dragStart(t,i,s)},_t(e,this._options)),this._currentCustomDrag.onStart(e)}dragEnd(){this._dragEnd()}dragUpdate(t){this._dragUpdate(t)}touchStart(t,e,s="rml_id"){this.dragStart(t,e,s)}touchMove(t){this.dragUpdate(t)}touchEnd(){this.dragEnd()}dispose(){}_resetStartTarget(){this._startTarget&&(this._startTarget.style.pointerEvents="",this._startTarget.style.userSelect="",this._startTarget.draggable=this._startTarget.getAttribute(X)==="true",this._startTarget.removeAttribute(X),this._startTarget.removeEventListener("dragstart",Y))}releaseInput(t){this._currentCustomDrag&&this._currentCustomDrag.onEnd(),this._resetStartTarget()}}const jt=Object.freeze(Object.defineProperty({__proto__:null,DragInFromCustomViewStrategy:Jt},Symbol.toStringTag,{value:"Module"}));return Lt});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var t,e;t=this,e=function(){"use strict";class t{_side;_incomingMessageBus=null;_outgoingMessageBus=null;_execMessage=null;constructor(t,e,s,n){this._side=t,this._incomingMessageBus=e,this._outgoingMessageBus=s,this._execMessage=n,this._incomingMessageBus&&this._incomingMessageBus.addEventListener("message",this._handleMessage.bind(this))}setOutgoingMessageBus(t){this._outgoingMessageBus=t}setMessageExecution(t){this._execMessage=t}sendMessage(t,e=[]){return new Promise((s,n)=>{if(this._incomingMessageBus===this._outgoingMessageBus)return s(void 0);const i=new MessageChannel;i.port1.onmessage=t=>{if(!t||!t.data)return i.port1.close(),i.port2.close(),n(new Error(this._side+" received message but response can not be interpreted"));let e;try{e=JSON.parse(t.data)}catch(t){return i.port1.close(),i.port2.close(),this._prepareError(t),n(t)}e.error?n(e.error):void 0!==e.result?s(e.result):s(void 0),i.port1.close(),i.port2.close()};let r="";try{r=JSON.stringify({message:t,args:e})}catch{return n(new Error(this._side+": can not create command because it is not JSON.stringify able"))}if(!this._outgoingMessageBus)return n(new Error(this._side+": outgoing bus not set yet"));this._outgoingMessageBus.postMessage(r,"*",[i.port2])})}_handleMessage(t){const e=t.ports&&Array.isArray(t.ports)&&t.ports.length>0?t.ports[0]:null;if(t.data&&e)try{const s=JSON.parse(t.data);if(!this._execMessage)return e.postMessage(JSON.stringify({error:this._side+" is not ready to handle messages"}));Array.isArray(s.args)||(s.args=[s.args]);const n=this._execMessage(s,t);if(void 0===n)return;n.then((t={})=>{let s,n;"object"==typeof t&&null!==t&&(s=t.error,n=t.result),s?e.postMessage(JSON.stringify({error:s})):void 0!==n?e.postMessage(JSON.stringify({result:n})):e.postMessage(JSON.stringify({result:t}))},t=>{e.postMessage(JSON.stringify({error:this._prepareError(t)}))})}catch(t){e.postMessage(JSON.stringify({error:this._prepareError(t)}))}}_prepareError(t){return"string"==typeof t?this._side+": "+t:(t.message=this._side+": "+t.message,t.message)}}const e=["127.0.0.1","localhost","0.0.0.0"],s=["language","browserLanguage","userLanguage","systemLanguage"],n=(t,e)=>{for(const s in e)try{e[s].constructor===Object?t[s]=n(t[s],e[s]):t[s]=e[s]}catch{t[s]=e[s]}return t};var i,r=((i=r||{}).BOTTOM_BAR="bottom_bar",i.PARTLIST_BOUNDS="partlist_bounds",i.INTERACTION_NOTES="interaction_notes",i.PARAMETER_GROUPS="parameter_groups",i);const a={mobileLandscape:!0,floorMaterialRootTag:"materials_root",buttons:{renderimage:!0,requestproduct:!0,requestplan:!0,load_product:!0,partlist_print:!0},elements:{[r.INTERACTION_NOTES]:!0},helpcenter:{roomdesigner:!0,configurator:!1,disable:!1},firstPersonView:!0,saveToIdb:!0,featureFlags:{mocAr:!0,wallAutoHeight:!1,openCloseAnimation:!1},rotationSnapDegrees:10,interactionsCollapsed:!1},o=t=>{if(!t)return;const e=Object.keys(t);for(const s of e){const e=t[s];if(!Array.isArray(e)&&"object"==typeof e&&null!==e&&o(e),Array.isArray(e))for(const t of e)o(t);("true"===e||"false"===e)&&(t[s]="true"===e)}},l=()=>/(android)/i.test(navigator.userAgent);class h{_messageHandler=null;isSetupDone=!1;viewName="main";plugins={};pluginsLoaded=[];ui={callbacks:null};extended={callbacks:null};configurator={callbacks:null};analytics={callbacks:{}};rapi={callbacks:{}};global={callbacks:{}};setMessageHandler(t){this._messageHandler=t}handleSetup(t){const{methods:e,callbacks:s}=t;e.forEach(t=>{const e=t.split("."),s=e[0],n=e[1];this[s]||(this[s]={}),this[s][n]=function(){if(this._messageHandler)return this._messageHandler.sendMessage(t,[...arguments])}.bind(this)}),s.forEach(t=>{const e=t.split("."),s=e[0],n=e[1],i=e[2];this[s]||(this[s]={}),this[s][n]||(this[s][n]={}),this[s][n][i]=()=>{}}),this.isSetupDone=!0}executeMessage({message:t,args:e}){const s=t.split("."),n=s[0],i=s[1],r=3===s.length?s[2]:null;if(r&&this[n][i][r]){const t=this[n][i][r](...e);return t instanceof Promise?t.then(t=>({result:t})):void 0!==t?Promise.resolve({result:t}):Promise.resolve({result:null})}return Promise.reject('Message "'+t+'" is unkown')}setupPlugins(t,e,s="website"){for(const n of t)"string"==typeof n&&"dragIn"===n?this.pluginsLoaded.push(new Promise((t,n)=>{try{Promise.resolve().then(()=>N).then(({DragIn:i})=>{const r=new i(this.ui,e,s,this.viewName);r.init().then(()=>{this.plugins.dragIn=r,t()},n)})}catch(t){n(t)}})):n.name&&n.loader&&this.pluginsLoaded.push(new Promise((t,i)=>{try{n.loader().then(r=>{const a=new r(this.ui,e,s,this.viewName);a.init().then(()=>{this.plugins[n.name]=a,t()},i)})}catch(t){i(t)}}))}}const c=()=>{let t,e;return{promise:new Promise((s,n)=>{t=s,e=n}),resolve:t,reject:e}},g=(t,e,s)=>{let n=null;Object.defineProperty(t,e,{get:()=>n||s,set(t){n=t?.mute?t.value:t}})},d=()=>.01*window.innerHeight+"px",u=t=>{t&&setTimeout(()=>t.style.setProperty(_,d()),0)},m="rml-styles",_="--rml-full-height",p="rml-container",f="rml-fill",y="rml-pos",v="rml-android-height",b="rml-overflow-hidden",w=new Map;class D{_mainDomElement;_instance;_mode="website";_viewName="main";constructor(t,e,s,n){this._instance=t,this._mainDomElement=e,this._mode=s,this._viewName=n}async init(){return Promise.resolve()}}const E="rml-drag-in-styles",T="rml-drag-in-drag-element",S="rml-drag-in-overlay",x="rml-drag-in-drag-ghost",I="rml-drag-in-fade-in",M="rml-drag-in-fade-out",C="rml-display-none",A="250ms",L="forwards",O=`@keyframes ${I} {from{opacity: 0;}to {opacity: 0.5;}}`,B=`@keyframes ${M} {from{opacity: 0.5;}to {opacity: 0;}}`,P=`${I} ${A} ${L}`,F=`${M} ${A} ${L}`,U="https://res.cloudinary.com/roomle/image/upload/v1729679975/fallback_afpyqr.jpg",N=Object.freeze(Object.defineProperty({__proto__:null,DragIn:class extends D{options={};_customDragSignal=new AbortController;_injectStyles(){if(!document.getElementById(E)){const t=document.createElement("style");t.type="text/css",t.id=E,t.innerHTML=`\n .${C}{display:none}\n .${S}{position:absolute;top:0;left:0;width:100%;height:100%;z-index:999;}\n .${x}{position:absolute;top:0;left:0;width:1px;height:1px;z-index:999;pointer-events:none;background-color:transparent;}\n ${O}\n ${B}\n `,document.head.appendChild(t)}}_initializeDragGhost(){const t=this._mainDomElement.parentNode;let e=t.querySelector("."+x);e||(e=document.createElement("div"),e.classList.add(x),e.innerText=" ",t.appendChild(e))}constructor(t,e,s,n){super(t,e,s,n),this._mainDomElement=e,this._injectStyles(),this._initializeDragGhost()}async init(){if(await super.init(),"website"===this._mode)try{const{DragInFromWebsiteStrategy:t}=await Promise.resolve().then(()=>Q);this._strategy=new t(this._instance,this._mainDomElement,{settings:this.options,mode:"website"})}catch(t){throw t}else{if("custom-view"!==this._mode)throw new Error("Unsupported mode");try{const{DragInFromCustomViewStrategy:t}=await Promise.resolve().then(()=>nt);this._strategy=new t(this._instance,this._mainDomElement,this.options,this._viewName)}catch(t){throw t}}}get isDragging(){return this._strategy.isDragging}dragStart(t,e,s="rml_id"){this._strategy.dragStart(t,e,s)}dragUpdate(t){this._strategy.dragUpdate(t)}dragEnd(){this._strategy.dragEnd()}touchStart(t,e,s="rml_id"){this._strategy.touchStart(t,e,s)}touchMove(t){this._strategy.touchMove(t)}touchEnd(){this._strategy.touchEnd()}dispose(){this._strategy.dispose()}beforeUpdateGhost(t){this._strategy.beforeUpdateGhost(t)}registerCustomDrag({customDragStart:t,customDragEnd:e,customDragUpdate:s,beforeUpdateGhost:n}){n&&this._strategy.beforeUpdateGhost(n);const i=this._customDragSignal.signal,r=e=>{"true"===e.target.getAttribute("data-rml-draggable")&&t(e)},a=t=>{this._strategy.releaseInput(t),this._strategy.isDragging&&e(t)},o=t=>{s(t)};document.querySelectorAll('[data-rml-draggable="true"]').forEach(t=>{t.draggable=!1}),document.addEventListener("mousedown",r,{signal:i}),document.addEventListener("mouseup",a,{signal:i}),document.addEventListener("mousemove",o,{signal:i}),document.addEventListener("mouseleave",a,{signal:i}),document.addEventListener("touchstart",r,{signal:i}),document.addEventListener("touchend",a,{signal:i}),document.addEventListener("touchmove",o,{signal:i})}unregisterCustomDrag(){this._customDragSignal.abort(),this._customDragSignal=new AbortController}releaseInput(t){this._strategy.releaseInput(t)}}},Symbol.toStringTag,{value:"Module"}));class R{_computedStyleCache=new Map;_maxLifetime=16;_cacheCleanInterval=null;constructor(t=16){this._maxLifetime=t}get(t){const e=this._computedStyleCache.get(t),s=Date.now();if(e&&s-e.updated<this._maxLifetime)return e.style;const n=getComputedStyle(t);return this._computedStyleCache.set(t,{style:n,updated:s}),this._cacheCleanInterval||(this._cacheCleanInterval=setInterval(()=>this._cleanUpCache,Math.max(1e3*this._maxLifetime,5e3))),n}_cleanUpCache(){const t=Date.now();for(const[e,{updated:s}]of this._computedStyleCache.entries())t-s>=this._maxLifetime&&this._computedStyleCache.delete(e);0===this._computedStyleCache.size&&this._cacheCleanInterval&&(clearInterval(this._cacheCleanInterval),this._cacheCleanInterval=null)}}const X=t=>window.TouchEvent&&t instanceof window.TouchEvent;let k;const G=t=>(k||(k=new R),k.get(t)),Y=(t,e,s)=>{const n=parseFloat(t),i=window.devicePixelRatio||1;if("px"===e)return n;if("%"===e)return n/100*(s===document.documentElement?window.innerWidth:s.offsetWidth);if("rem"===e)return n*parseFloat(G(document.documentElement).fontSize);if("em"===e)return n*parseFloat(G(s).fontSize);if("vh"===e||"vw"===e||"vmin"===e||"vmax"===e)return n/100*{vh:window.innerHeight,vw:window.innerWidth,vmin:Math.min(window.innerWidth,window.innerHeight),vmax:Math.max(window.innerWidth,window.innerHeight)}[e];const r={cm:37.7952755906,mm:3.77952755906,in:96};return e in r?n*r[e]*i:0},$=(t,e,s={x:0,y:0})=>{const n=t.getBoundingClientRect(),i=G(t).transform;let r=0,a=0;if("none"!==i){const e=/translate\(\s*([-+]?\d*\.?\d+|\d+)(px|%)?,?\s*([-+]?\d*\.?\d+|\d+)?(px|%)?\s*\)/,s=i.match(e);s&&(r=Y(s[1],s[2],t),a=Y(s[3],s[4],t))}const{clientX:o,clientY:l}=j(e,s);return{x:o-n.left-r+t.scrollLeft,y:l-n.top-a+t.scrollTop}},j=(t,e=null)=>{const{clientX:s,clientY:n}=X(t)?H(t):t;return{clientX:s>0?s:e?e.x:s,clientY:n>0?n:e?e.y:n}},H=t=>{if(t.touches.length){let{clientX:e,clientY:s}=t.touches[0];if(t.touches.length>1){const n=t.touches[1];e=(e+n.clientX)/2,s=(s+n.clientY)/2}return{clientX:e,clientY:s}}const e=t.changedTouches[0];return{clientX:e.clientX,clientY:e.clientY}},z=(t,e=0)=>X(t)?{clientX:t.touches[e].clientX,clientY:t.touches[e].clientY}:{clientX:t.clientX,clientY:t.clientY},W=t=>!t||!X(t)||t.touches.length>0;class q{_touchDragTimeOut;_onTouchDragStart;_payload=null;_delay=500;_firstTouch=null;_lastTouch=null;_epsilon=10;constructor(t,{onTouchDragStart:e},s={}){this._payload=t,this._onTouchDragStart=e,this._delay="number"==typeof s.delay?s.delay:500,this._epsilon="number"==typeof s.epsilon?s.epsilon:10}onStart(t){W(t)&&(this._touchDragTimeOut||(this._firstTouch=z(t,X(t)?t.touches.length-1:0),this._touchDragTimeOut=setTimeout(()=>{this._clearTimeout(),this._lastTouch||(this._lastTouch=z(t)),this._checkXDistance(t)()},this._delay)))}onEnd(){this._resetTouches()}onMove(t){W(t)&&(this._lastTouch=z(t))}_clearTimeout(){this._touchDragTimeOut&&(clearTimeout(this._touchDragTimeOut),this._touchDragTimeOut=null)}_resetTouches(){this._clearTimeout(),this._lastTouch=null,this._firstTouch=null,this._payload=null}_checkXDistance(t){return()=>{if(!this._firstTouch||!this._lastTouch)return;let e=!1;e=Math.abs(this._firstTouch.clientX-this._lastTouch.clientX)<this._epsilon,e&&(this._onTouchDragStart(this._payload,t),this._resetTouches())}}}const J=(t,e,s=0,n=0)=>{const i=e.x+e.width+s,r=e.x-s,a=e.y+e.height+n,o=e.y-n,{x:l,y:h}=t;return l>=r&&l<=i&&h>=o&&h<=a},K=(t,e,s,n=0,i=0)=>{if(s&&(s.hiddenIn||s.visibleIn))return s.visibleIn?J({x:t,y:e},s.visibleIn,n,i):!!s.hiddenIn&&!J({x:t,y:e},s.hiddenIn,-n,-i)};class V{_dragGhostAnimationFrameId=null;_dragGhostRemoveAnimationFrameId=null;_dragGhostElement=null;constructor(t=null){this._dragGhostElement=t}updateDragGhost(t,e,s){this._dragGhostRemoveAnimationFrameId&&(cancelAnimationFrame(this._dragGhostRemoveAnimationFrameId),this._dragGhostRemoveAnimationFrameId=null),!s.ghost?.external&&s.ghost&&(this._dragGhostAnimationFrameId||(this._dragGhostAnimationFrameId=requestAnimationFrame(()=>{(()=>{if(!document.getElementById(E)){const t=document.createElement("style");t.type="text/css",t.id=E,t.innerHTML=`\n ${O}\n ${B}\n `,document.head.appendChild(t)}})();const n={x:t,y:e};!s.ghost&&this._dragGhostElement&&(s.ghost={}),s.ghost&&!s.ghost.element&&this._dragGhostElement&&(s.ghost.element=this._dragGhostElement),(({x:t,y:e},s)=>{let n=document.getElementById(T);if(!n){if(n=document.createElement("div"),s.ghost?.element)n.appendChild(s.ghost.element);else{const t=document.createElement("img");t.src=s.ghost?.url||U,t.width=s.ghost?.width||112,t.height=s.ghost?.height||112,n.appendChild(t)}n.id=T,n.style.position="fixed",n.style.top="0",n.style.left="0",n.style.willChange="transform",n.style.transform="translate3d(0, 0, 0)",n.style.zIndex="9999",n.style.opacity="0.5",K(t,e,s.ghost||{},s.settings?.dragInOverlapX,s.settings?.dragInOverlapY)||(n.style.display="none"),n.style.pointerEvents="none",document.body.appendChild(n)}})(n,s),(({x:t,y:e},s)=>{const n=document.getElementById(T);if(!n)return;let i=s.ghost?.width,r=s.ghost?.height;typeof i>"u"&&(i=n.getBoundingClientRect().width||112),typeof r>"u"&&(r=n.getBoundingClientRect().height||112);const a=t-i/2,o=e-r/2;n.style.transform=`translate3d(${a}px, ${o}px, 0)`,s.ghost&&(K(t,e,s.ghost,s.settings?.dragInOverlapX,s.settings?.dragInOverlapY)?n.style.animation!=P&&(n.style.animation=P):n.style.animation!=F&&(n.style.animation=F))})(n,s),this._dragGhostAnimationFrameId=null})))}removeDragGhost(){this._dragGhostAnimationFrameId&&(cancelAnimationFrame(this._dragGhostAnimationFrameId),this._dragGhostAnimationFrameId=null),this._dragGhostRemoveAnimationFrameId||(this._dragGhostRemoveAnimationFrameId=requestAnimationFrame(()=>{const t=document.getElementById(T);t&&document.body.removeChild(t),this._dragGhostRemoveAnimationFrameId=null}))}}const Q=Object.freeze(Object.defineProperty({__proto__:null,DragInFromWebsiteStrategy:class{_options={};_instance;_mainDomElement;_currentDrag={};_currentTouch=null;_firefoxDragPosition={x:0,y:0};_onBeforeUpdateDrag=()=>({});isDragging=!1;_firefoxFallback=t=>{if(!this._currentDrag.event)return;t.preventDefault();const e=t||window.event;this._firefoxDragPosition.x=e.pageX||0,this._firefoxDragPosition.y=e.pageY||0};constructor(t,e,s){this._instance=t,this._mainDomElement=e,this._options=s||{},this._firefoxFallback=this._firefoxFallback.bind(this),document.addEventListener("dragover",this._firefoxFallback),this._mainDomElement.parentElement?.addEventListener("dragleave",()=>{this._instance.cancelDragIn()})}beforeUpdateGhost(t){this._onBeforeUpdateDrag=t}dragStart(t,e,s="rml_id"){const n=this._mainDomElement.parentNode;if("relative"!==G(n).position)return;this._mainDomElement.style.pointerEvents="none";let i=n.querySelector("."+S);i||(i=document.createElement("div"),i.classList.add(S),n.appendChild(i)),i.classList.remove(C),e.target.getAttribute("draggable");const r=n.querySelector("."+x);this._currentDrag.event=e;const a=e.target,o=a.cloneNode(!0),l=a.getBoundingClientRect();o.style.width=`${l.width}px`,o.style.height=`${l.height}px`,this._currentDrag.ghost=new V(o),this._currentDrag.offset||(this._currentDrag.offset={x:0,y:0});const{clientX:h,clientY:c}=j(e,this._firefoxDragPosition);this._currentDrag.offset.x=h-l.left,this._currentDrag.offset.y=c-l.top,e instanceof DragEvent&&e.dataTransfer&&e.dataTransfer.setDragImage&&e.dataTransfer.setDragImage(r,0,0);const{x:g,y:d}=$(n,this._currentDrag.event||e,this._firefoxDragPosition),u=Math.max(1,g),m=Math.max(1,d);this.isDragging=!0,this._instance.dragInObject(t,u,m,s)}dragUpdate(t){const e=this._mainDomElement.parentNode,{x:s,y:n}=$(e,t,this._firefoxDragPosition);if(0===s&&0===n)return;const i=Math.max(1,s),r=Math.max(1,n);if(1===i&&1===r)return;let a=i,o=r;if(X(t)){const t=this._options.settings?.fingerSize||0;a=Math.max(2,i+t),o=Math.max(2,r-t)}const{x:l,y:h,options:c}=this._onBeforeUpdateDrag(a,o,{}),g=c||{settings:{},ghost:{}};g.ghost||(g.ghost={}),g.ghost.visibleIn&&g.ghost.hiddenIn||(g.ghost.hiddenIn=this._mainDomElement.getBoundingClientRect());const d="number"==typeof l?l:a,u="number"==typeof h?h:o;if(this._currentDrag.ghost){const{clientX:e,clientY:s}=j(t,this._firefoxDragPosition);this._currentDrag.ghost.updateDragGhost(e,s,g)}this._instance.updateDrag(d,u,{})}dragEnd(){this._mainDomElement.style.pointerEvents="all";const t=this._mainDomElement.parentNode;this.isDragging=!1,this._instance.dragInObjectEnd(),this._currentDrag.ghost&&(this._currentDrag.ghost.removeDragGhost(),this._currentDrag.ghost=null),this._currentDrag={},this._firefoxDragPosition={x:0,y:0};const e=t.querySelector("."+S);e&&e.classList.add(C)}touchStart(t,e,s="rml_id"){e.preventDefault();const n={};"number"==typeof this._options?.settings?.touchDragDelay&&(n.delay=this._options.settings.touchDragDelay),this._options?.settings?.touchDragEpsilon&&(n.epsilon=this._options.settings.touchDragEpsilon),this._currentTouch=new q(void 0,{onTouchDragStart:(e,n)=>{this.dragStart(t,n,s)}},n),this._currentTouch.onStart(e)}touchMove(t){this._currentTouch&&this._currentTouch.onMove(t),this._currentDrag.event&&this.dragUpdate(t)}touchEnd(){this._currentTouch&&this._currentTouch.onEnd(),this._currentTouch=null,this.dragEnd()}dispose(){document.removeEventListener("dragover",this._firefoxFallback)}releaseInput(t){}}},Symbol.toStringTag,{value:"Module"})),Z=t=>{t.preventDefault(),t.stopPropagation()};class tt{_startX=0;_startY=0;_lastX=0;_lastY=0;_epsilon;_isWaiting=!1;_onCustomDragStart;constructor({onCustomDragStart:t},e={}){this._epsilon="number"==typeof e.epsilon?e.epsilon:15,this._onCustomDragStart=t}onMove(t){this._lastX=t.clientX,this._lastY=t.clientY,this._isWaiting&&((t,e)=>{const s=this._lastX-t,n=this._lastY-e;return Math.sqrt(s*s+n*n)})(this._startX,this._startY)>this._epsilon&&(this._onCustomDragStart(t),this._isWaiting=!1)}onStart(t){this._startX=t.clientX,this._startY=t.clientY,this.onMove(t),this._isWaiting=!0}onEnd(){this._reset()}_reset(){this._startX=0,this._startY=0,this._lastX=0,this._lastY=0,this._isWaiting=!1}}const et="data-rml-old-draggable",st=(t,e)=>{const s=X(t),n={delay:s?500:100,epsilon:s?10:15};if(!e)return n;if(!(s||t instanceof MouseEvent))return n;const{delayKey:i,epsilonKey:r}=s?{delayKey:"touchDragDelay",epsilonKey:"touchDragEpsilon"}:{delayKey:"customDragDelay",epsilonKey:"customDragEpsilon"};return"number"==typeof e[i]&&(n.delay=e.touchDragDelay),"number"==typeof e[r]&&(n.epsilon=e.touchDragEpsilon),n},nt=Object.freeze(Object.defineProperty({__proto__:null,DragInFromCustomViewStrategy:class{_options={};_instance;_mainDomElement;_viewName;_currentCustomDrag=null;_currentBb=null;_startTarget=null;_onBeforeUpdateDrag=()=>({});isDragging=!1;constructor(t,e,s){this._instance=t,this._options=e||{},this._viewName=s,this._mainDomElement=mainDomElement,this._mainDomElement.parentElement?.addEventListener("dragleave",()=>{this._instance.cancelDragIn()})}beforeUpdateGhost(t){this._onBeforeUpdateDrag=t}async _dragStart(t,e,s="rml_id"){this._startTarget&&(this._startTarget.style.pointerEvents="none",this._startTarget.style.userSelect="none",this._startTarget.setAttribute(et,this._startTarget.draggable.toString()),this._startTarget.draggable=!1,this._startTarget.removeEventListener("dragstart",Z),this._startTarget.addEventListener("dragstart",Z)),this._currentBb=await this._instance.getBoundingClientRect((()=>`[data-rml-custom-view="${this._viewName}"]`)());const{clientX:n,clientY:i}=j(e),r=this._currentBb.x+n,a=this._currentBb.y+i;this.isDragging=!0,this._instance.dragInObject(t,r,a,s)}_dragUpdate(t){if(document.body.focus(),this._currentCustomDrag&&this._currentCustomDrag.onMove(t),!this._currentBb||!this.isDragging)return;const{clientX:e,clientY:s}=j(t),{url:n,width:i,height:r}=(t=>{let e="",s=112,n=112;if(!t)return{url:U,width:s,height:n};const i=t;if(i instanceof HTMLElement){const t=i.getBoundingClientRect(),r=i.getAttribute("data-rml-ghost-url"),a=i.getAttribute("data-rml-ghost-width"),o=i.getAttribute("data-rml-ghost-height");r?e=r:!r&&i instanceof HTMLImageElement&&i.src&&(e=i.src),e?(s=t.width,n=t.height):e=U,s=a?parseInt(a,10):s,n=o?parseInt(o,10):n}return{url:e||U,width:s,height:n}})(this._startTarget),a=this._currentBb.x+e,o=this._currentBb.y+s,l=this._options||{},h={ghost:{visibleIn:{x:this._currentBb.x-(l.dragInOverlapX||0),y:this._currentBb.y+(l.dragInOverlapY||0),width:this._currentBb.width+(l.dragInOverlapX||0),height:this._currentBb.height+(l.dragInOverlapY||0)},url:n,width:i,height:r},mode:"custom-view"},{x:c,y:g,options:d}=this._onBeforeUpdateDrag(a,o,h),u="number"==typeof c?c:a,m="number"==typeof g?g:o,_=d||h;this._instance.updateDrag(u,m,_)}_dragEnd(){this._currentCustomDrag&&this._currentCustomDrag.onEnd(),this._currentCustomDrag=null,this.isDragging=!1,this._currentBb=null,this._resetStartTarget(),this._instance.enableEvents(),this._instance.dragInObjectEnd()}dragStart(t,e,s){this._instance.disableEvents(),this._startTarget=e.target,this._currentCustomDrag=X(e)?new q(void 0,{onTouchDragStart:(e,n)=>{this._dragStart(t,n,s)}},st(e,this._options)):new tt({onCustomDragStart:e=>this._dragStart(t,e,s)},st(e,this._options)),this._currentCustomDrag.onStart(e)}dragEnd(){this._dragEnd()}dragUpdate(t){this._dragUpdate(t)}touchStart(t,e,s="rml_id"){this.dragStart(t,e,s)}touchMove(t){this.dragUpdate(t)}touchEnd(){this.dragEnd()}dispose(){}_resetStartTarget(){this._startTarget&&(this._startTarget.style.pointerEvents="",this._startTarget.style.userSelect="",this._startTarget.draggable="true"===this._startTarget.getAttribute(et),this._startTarget.removeAttribute(et),this._startTarget.removeEventListener("dragstart",Z))}releaseInput(t){this._currentCustomDrag&&this._currentCustomDrag.onEnd(),this._resetStartTarget()}}},Symbol.toStringTag,{value:"Module"}));return class extends h{static createPlanner(t,e,s,n=[]){return this._create(t,e,s,n)}static async connect(e,s=[]){const n=new h;n.viewName=e;const{resolve:i,promise:r}=c(),{resolve:a,promise:o}=c(),l=new t("custom-view-"+e,window,window.parent,({message:t,args:e})=>{switch(t){case"registerCustomViewDone":i();break;case"returnMethods":n.handleSetup(e[0]),a();break;default:if(n.isSetupDone)return n.executeMessage({message:t,args:e})}});n.setMessageHandler(l);const g=[e];return l.sendMessage("registerCustomView",g),await r,l.sendMessage("getMethods",g),await o,n.setupPlugins(s,document.body,"custom-view"),await Promise.allSettled(n.pluginsLoaded),n}static createConfigurator(t,e,s,n=[]){return this._create(t,e,s,n)}static create(t,e,s,n){return this._create(t,e,s,n)}static createViewer(t,e,s,n=[]){return this._create(t,e,s,n)}static async _create(t,i,r,l){return new Promise(async(h,c)=>{try{const c=n((()=>{const t=(t=>JSON.parse(JSON.stringify(t)))(a);t.locale||(t.locale=((t=null)=>{const e=window.navigator;if(t)return t.substr(0,2);if(Array.isArray(e.languages)&&e.languages.length>0)return e.languages[0].substr(0,2);for(let t=0,n=s.length;t<n;t++){const n=e[s[t]];if(n)return n.substr(0,2)}return"en"})()),"(idle)"===t.id&&delete t.id;const n=(()=>{const t=(()=>{try{return window.self!==window.top}catch{return!0}})();let e=window.location.href;if(t){if(!document.referrer)return null;e=document.referrer}const{hostname:s}=new URL(e);return s})();return n&&(t=>!!(e.includes(t)||t.endsWith("roomle.com")||t.endsWith("gitlab.io")||t.endsWith("gitlab.com")))(n)&&(t.configuratorId="demoConfigurator"),t.customApiUrl=void 0,t.emails=!1,t})(),(t=>(o(t),t?.customApiUrl&&(t.customApiUrl=decodeURIComponent(t.customApiUrl)),t.shareUrl&&(t.deeplink=t.shareUrl.replace("<CONF_ID>","#CONFIGURATIONID#")),t))(r));(t=>{t.featureFlags||(t.featureFlags={}),"boolean"!=typeof t.featureFlags.realPartList&&(t.featureFlags.realPartList=!0),"boolean"!=typeof t.featureFlags.globalCallbacks&&(t.featureFlags.globalCallbacks=!0),"boolean"!=typeof t.featureFlags.mocAr&&(t.featureFlags.mocAr=!1)})(c);const g=await(async(t,e)=>{if("string"!=typeof t)throw new Error('Configurator ID is not a string type: "'+typeof t+'"');const s=e.customApiUrl?e.customApiUrl:"https://api.roomle.com/v2",n=e.overrideTenant||9,i=s+"/configurators/"+t,r="roomle_portal_v2",a="03-"+window.btoa((new Date).toISOString()+";anonymous;"+r),o=new Request(i,{method:"GET",headers:new Headers({apiKey:r,currentTenant:n,locale:"en",language:"en",device:1,token:a,platform:"web"}),mode:"cors",cache:"default"}),l=await fetch(o),{configurator:h}=await l.json();return h})(t,c);r=((t,e)=>{e.configuratorId=t.id;const s=t.settings||{};return!e.overrideTenant&&t.tenant&&(e.overrideTenant=t.tenant),((t,e)=>{const s=JSON.parse(JSON.stringify(t));return n(s,e)})(s,e)})(g,c);const d=new this(g,i,r,l,h);return await Promise.allSettled(d.pluginsLoaded),d}catch(t){return c(t)}})}_waitForIframe;_container;_configuratorSettings;_initData={};_iframe;constructor(e,s,n,i,r){if(super(),!e||"string"!=typeof e.id)throw new Error("Please provide a correct configuratorId, you get the correct ID from your Roomle Contact Person");if(w.has(s))throw new Error("There is already an instance on this DOM element");if(!document.getElementById(m)){const t=n.zIndex||9999999,e=document.createElement("style");e.type="text/css",e.id=m;const s="transition:all ease-in-out 450ms;",i=["-webkit-","-o-"].reduce((t,e)=>t+(e+s),"")+s,r=d();e.innerHTML=`\n .${p}{${_}:${r};}\n .${y}{position:fixed;top:0;left:0;z-index:${t};opacity:0}\n .rml-transition{${i}}\n .${f}{width:100%;height:100%;opacity:1}\n .${v}{height:calc(var(${_},1vh)*100)}\n .${b}{overflow:hidden}\n `,document.head.appendChild(e)}this._executeMessage=this._executeMessage.bind(this);const a=new t("website",window,null,this._executeMessage);this.setMessageHandler(a),this._onResize=this._onResize.bind(this),l()&&window.addEventListener("resize",this._onResize),this._container=s,this._initData=n,this._configuratorSettings=e;const o=this._createIframe();this._onUseFullPage=this._onUseFullPage.bind(this),this._onBackToWebsite=this._onBackToWebsite.bind(this),this._waitForIframe=r,this._container.appendChild(o),this._iframe=o,this.setupPlugins(i,this._iframe),w.set(s,!0)}teardown(){this._container&&w.delete(this._container);const t=this._container.querySelector("iframe");t&&this._container.removeChild(t),window.removeEventListener("resize",this._onResize)}_createIframe(){const t=document.createElement("iframe");let e=this._configuratorSettings?.url||"https://www.roomle.com/t/cp/";return this._initData.useLocalRoomle&&(e=location.href.replace("embedding.html","")),location.href.includes("roomle.gitlab.io")&&(e=location.href.replace("embedding.html","index.html")),this._initData.overrideServerUrl&&(e=this._initData.overrideServerUrl),t.src=e,t.classList.add(p),t.classList.add(f),t}_onResize(){u(this._iframe)}_onUseFullPage(){this._iframe.classList.add(y),document.documentElement.classList.add(b),window.document.body.classList.add(b),l()&&(u(this._iframe),this._iframe.classList.add(v))}_onBackToWebsite(){this._iframe.classList.remove(y),this._iframe.classList.remove(v),document.documentElement.classList.remove(b),window.document.body.classList.remove(b)}_executeMessage({message:t,args:e},s){if(s.source&&s.source===this._iframe?.contentWindow)return"requestBoot"===t?this._messageHandler?(this._messageHandler.setOutgoingMessageBus(s.source),Promise.resolve({result:this._initData})):Promise.resolve({error:"MessageHandler not set"}):"setup"===t?(this.handleSetup(e[0]),g(this.ui.callbacks,"onUseFullPage",this._onUseFullPage),g(this.ui.callbacks,"onBackToWebsite",this._onBackToWebsite),this._waitForIframe(this),setTimeout(()=>{this._messageHandler&&this._messageHandler.sendMessage("websiteReady")},0),Promise.resolve({result:null})):this.executeMessage({message:t,args:e})}}},"object"==typeof exports&&typeof module<"u"?module.exports=e():"function"==typeof define&&define.amd?define(e):((t=typeof globalThis<"u"?globalThis:t||self)["roomle-embedding-lib"]=t["roomle-embedding-lib"]||{},t["roomle-embedding-lib"].umd=t["roomle-embedding-lib"].umd||{},t["roomle-embedding-lib"].umd.min=t["roomle-embedding-lib"].umd.min||{},t["roomle-embedding-lib"].umd.min.js=e());
|
|
1
|
+
var t,e;t=this,e=function(){"use strict";class t{_side;_incomingMessageBus=null;_outgoingMessageBus=null;_execMessage=null;constructor(t,e,s,n){this._side=t,this._incomingMessageBus=e,this._outgoingMessageBus=s,this._execMessage=n,this._incomingMessageBus&&this._incomingMessageBus.addEventListener("message",this._handleMessage.bind(this))}setOutgoingMessageBus(t){this._outgoingMessageBus=t}setMessageExecution(t){this._execMessage=t}sendMessage(t,e=[]){return new Promise((s,n)=>{if(this._incomingMessageBus===this._outgoingMessageBus)return s(void 0);const i=new MessageChannel;i.port1.onmessage=t=>{if(!t||!t.data)return i.port1.close(),i.port2.close(),n(new Error(this._side+" received message but response can not be interpreted"));let e;try{e=JSON.parse(t.data)}catch(t){return i.port1.close(),i.port2.close(),this._prepareError(t),n(t)}e.error?n(e.error):void 0!==e.result?s(e.result):s(void 0),i.port1.close(),i.port2.close()};let r="";try{r=JSON.stringify({message:t,args:e})}catch{return n(new Error(this._side+": can not create command because it is not JSON.stringify able"))}if(!this._outgoingMessageBus)return n(new Error(this._side+": outgoing bus not set yet"));this._outgoingMessageBus.postMessage(r,"*",[i.port2])})}_handleMessage(t){const e=t.ports&&Array.isArray(t.ports)&&t.ports.length>0?t.ports[0]:null;if(t.data&&e)try{const s=JSON.parse(t.data);if(!this._execMessage)return e.postMessage(JSON.stringify({error:this._side+" is not ready to handle messages"}));Array.isArray(s.args)||(s.args=[s.args]);const n=this._execMessage(s,t);if(void 0===n)return;n.then((t={})=>{let s,n;"object"==typeof t&&null!==t&&(s=t.error,n=t.result),s?e.postMessage(JSON.stringify({error:s})):void 0!==n?e.postMessage(JSON.stringify({result:n})):e.postMessage(JSON.stringify({result:t}))},t=>{e.postMessage(JSON.stringify({error:this._prepareError(t)}))})}catch(t){e.postMessage(JSON.stringify({error:this._prepareError(t)}))}}_prepareError(t){return"string"==typeof t?this._side+": "+t:(t.message=this._side+": "+t.message,t.message)}}const e=["127.0.0.1","localhost","0.0.0.0"],s=["language","browserLanguage","userLanguage","systemLanguage"],n=(t,e)=>{for(const s in e)try{e[s].constructor===Object?t[s]=n(t[s],e[s]):t[s]=e[s]}catch{t[s]=e[s]}return t};var i,r=((i=r||{}).BOTTOM_BAR="bottom_bar",i.PARTLIST_BOUNDS="partlist_bounds",i.INTERACTION_NOTES="interaction_notes",i.PARAMETER_GROUPS="parameter_groups",i);const a={mobileLandscape:!0,floorMaterialRootTag:"materials_root",buttons:{renderimage:!0,requestproduct:!0,requestplan:!0,load_product:!0,partlist_print:!0},elements:{[r.INTERACTION_NOTES]:!0},helpcenter:{roomdesigner:!0,configurator:!1,disable:!1},firstPersonView:!0,saveToIdb:!0,featureFlags:{mocAr:!0,wallAutoHeight:!1,openCloseAnimation:!1,enableTwoLevelCatalog:!1},rotationSnapDegrees:10,interactionsCollapsed:!1},o=t=>{if(!t)return;const e=Object.keys(t);for(const s of e){const e=t[s];if(!Array.isArray(e)&&"object"==typeof e&&null!==e&&o(e),Array.isArray(e))for(const t of e)o(t);("true"===e||"false"===e)&&(t[s]="true"===e)}},l=()=>/(android)/i.test(navigator.userAgent);class h{_messageHandler=null;isSetupDone=!1;viewName="main";plugins={};pluginsLoaded=[];ui={callbacks:null};extended={callbacks:null};configurator={callbacks:null};analytics={callbacks:{}};rapi={callbacks:{}};global={callbacks:{}};setMessageHandler(t){this._messageHandler=t}handleSetup(t){const{methods:e,callbacks:s}=t;e.forEach(t=>{const e=t.split("."),s=e[0],n=e[1];this[s]||(this[s]={}),this[s][n]=function(){if(this._messageHandler)return this._messageHandler.sendMessage(t,[...arguments])}.bind(this)}),s.forEach(t=>{const e=t.split("."),s=e[0],n=e[1],i=e[2];this[s]||(this[s]={}),this[s][n]||(this[s][n]={}),this[s][n][i]=()=>{}}),this.isSetupDone=!0}executeMessage({message:t,args:e}){const s=t.split("."),n=s[0],i=s[1],r=3===s.length?s[2]:null;if(r&&this[n][i][r]){const t=this[n][i][r](...e);return t instanceof Promise?t.then(t=>({result:t})):void 0!==t?Promise.resolve({result:t}):Promise.resolve({result:null})}return Promise.reject('Message "'+t+'" is unkown')}setupPlugins(t,e,s="website"){for(const n of t)"string"==typeof n&&"dragIn"===n?this.pluginsLoaded.push(new Promise((t,n)=>{try{Promise.resolve().then(()=>N).then(({DragIn:i})=>{const r=new i(this.ui,e,s,this.viewName);r.init().then(()=>{this.plugins.dragIn=r,t()},n)})}catch(t){n(t)}})):n.name&&n.loader&&this.pluginsLoaded.push(new Promise((t,i)=>{try{n.loader().then(r=>{const a=new r(this.ui,e,s,this.viewName);a.init().then(()=>{this.plugins[n.name]=a,t()},i)})}catch(t){i(t)}}))}}const c=()=>{let t,e;return{promise:new Promise((s,n)=>{t=s,e=n}),resolve:t,reject:e}},g=(t,e,s)=>{let n=null;Object.defineProperty(t,e,{get:()=>n||s,set(t){n=t?.mute?t.value:t}})},d=()=>.01*window.innerHeight+"px",u=t=>{t&&setTimeout(()=>t.style.setProperty(_,d()),0)},m="rml-styles",_="--rml-full-height",p="rml-container",f="rml-fill",y="rml-pos",v="rml-android-height",b="rml-overflow-hidden",w=new Map;class D{_mainDomElement;_instance;_mode="website";_viewName="main";constructor(t,e,s,n){this._instance=t,this._mainDomElement=e,this._mode=s,this._viewName=n}async init(){return Promise.resolve()}}const E="rml-drag-in-styles",T="rml-drag-in-drag-element",S="rml-drag-in-overlay",x="rml-drag-in-drag-ghost",I="rml-drag-in-fade-in",M="rml-drag-in-fade-out",C="rml-display-none",A="250ms",L="forwards",O=`@keyframes ${I} {from{opacity: 0;}to {opacity: 0.5;}}`,B=`@keyframes ${M} {from{opacity: 0.5;}to {opacity: 0;}}`,P=`${I} ${A} ${L}`,F=`${M} ${A} ${L}`,U="https://res.cloudinary.com/roomle/image/upload/v1729679975/fallback_afpyqr.jpg",N=Object.freeze(Object.defineProperty({__proto__:null,DragIn:class extends D{options={};_customDragSignal=new AbortController;_injectStyles(){if(!document.getElementById(E)){const t=document.createElement("style");t.type="text/css",t.id=E,t.innerHTML=`\n .${C}{display:none}\n .${S}{position:absolute;top:0;left:0;width:100%;height:100%;z-index:999;}\n .${x}{position:absolute;top:0;left:0;width:1px;height:1px;z-index:999;pointer-events:none;background-color:transparent;}\n ${O}\n ${B}\n `,document.head.appendChild(t)}}_initializeDragGhost(){const t=this._mainDomElement.parentNode;let e=t.querySelector("."+x);e||(e=document.createElement("div"),e.classList.add(x),e.innerText=" ",t.appendChild(e))}constructor(t,e,s,n){super(t,e,s,n),this._mainDomElement=e,this._injectStyles(),this._initializeDragGhost()}async init(){if(await super.init(),"website"===this._mode)try{const{DragInFromWebsiteStrategy:t}=await Promise.resolve().then(()=>Q);this._strategy=new t(this._instance,this._mainDomElement,{settings:this.options,mode:"website"})}catch(t){throw t}else{if("custom-view"!==this._mode)throw new Error("Unsupported mode");try{const{DragInFromCustomViewStrategy:t}=await Promise.resolve().then(()=>nt);this._strategy=new t(this._instance,this._mainDomElement,this.options,this._viewName)}catch(t){throw t}}}get isDragging(){return this._strategy.isDragging}dragStart(t,e,s="rml_id"){this._strategy.dragStart(t,e,s)}dragUpdate(t){this._strategy.dragUpdate(t)}dragEnd(){this._strategy.dragEnd()}touchStart(t,e,s="rml_id"){this._strategy.touchStart(t,e,s)}touchMove(t){this._strategy.touchMove(t)}touchEnd(){this._strategy.touchEnd()}dispose(){this._strategy.dispose()}beforeUpdateGhost(t){this._strategy.beforeUpdateGhost(t)}registerCustomDrag({customDragStart:t,customDragEnd:e,customDragUpdate:s,beforeUpdateGhost:n}){n&&this._strategy.beforeUpdateGhost(n);const i=this._customDragSignal.signal,r=e=>{"true"===e.target.getAttribute("data-rml-draggable")&&t(e)},a=t=>{this._strategy.releaseInput(t),this._strategy.isDragging&&e(t)},o=t=>{s(t)};document.querySelectorAll('[data-rml-draggable="true"]').forEach(t=>{t.draggable=!1}),document.addEventListener("mousedown",r,{signal:i}),document.addEventListener("mouseup",a,{signal:i}),document.addEventListener("mousemove",o,{signal:i}),document.addEventListener("mouseleave",a,{signal:i}),document.addEventListener("touchstart",r,{signal:i}),document.addEventListener("touchend",a,{signal:i}),document.addEventListener("touchmove",o,{signal:i})}unregisterCustomDrag(){this._customDragSignal.abort(),this._customDragSignal=new AbortController}releaseInput(t){this._strategy.releaseInput(t)}}},Symbol.toStringTag,{value:"Module"}));class R{_computedStyleCache=new Map;_maxLifetime=16;_cacheCleanInterval=null;constructor(t=16){this._maxLifetime=t}get(t){const e=this._computedStyleCache.get(t),s=Date.now();if(e&&s-e.updated<this._maxLifetime)return e.style;const n=getComputedStyle(t);return this._computedStyleCache.set(t,{style:n,updated:s}),this._cacheCleanInterval||(this._cacheCleanInterval=setInterval(()=>this._cleanUpCache,Math.max(1e3*this._maxLifetime,5e3))),n}_cleanUpCache(){const t=Date.now();for(const[e,{updated:s}]of this._computedStyleCache.entries())t-s>=this._maxLifetime&&this._computedStyleCache.delete(e);0===this._computedStyleCache.size&&this._cacheCleanInterval&&(clearInterval(this._cacheCleanInterval),this._cacheCleanInterval=null)}}const X=t=>window.TouchEvent&&t instanceof window.TouchEvent;let k;const G=t=>(k||(k=new R),k.get(t)),Y=(t,e,s)=>{const n=parseFloat(t),i=window.devicePixelRatio||1;if("px"===e)return n;if("%"===e)return n/100*(s===document.documentElement?window.innerWidth:s.offsetWidth);if("rem"===e)return n*parseFloat(G(document.documentElement).fontSize);if("em"===e)return n*parseFloat(G(s).fontSize);if("vh"===e||"vw"===e||"vmin"===e||"vmax"===e)return n/100*{vh:window.innerHeight,vw:window.innerWidth,vmin:Math.min(window.innerWidth,window.innerHeight),vmax:Math.max(window.innerWidth,window.innerHeight)}[e];const r={cm:37.7952755906,mm:3.77952755906,in:96};return e in r?n*r[e]*i:0},$=(t,e,s={x:0,y:0})=>{const n=t.getBoundingClientRect(),i=G(t).transform;let r=0,a=0;if("none"!==i){const e=/translate\(\s*([-+]?\d*\.?\d+|\d+)(px|%)?,?\s*([-+]?\d*\.?\d+|\d+)?(px|%)?\s*\)/,s=i.match(e);s&&(r=Y(s[1],s[2],t),a=Y(s[3],s[4],t))}const{clientX:o,clientY:l}=j(e,s);return{x:o-n.left-r+t.scrollLeft,y:l-n.top-a+t.scrollTop}},j=(t,e=null)=>{const{clientX:s,clientY:n}=X(t)?H(t):t;return{clientX:s>0?s:e?e.x:s,clientY:n>0?n:e?e.y:n}},H=t=>{if(t.touches.length){let{clientX:e,clientY:s}=t.touches[0];if(t.touches.length>1){const n=t.touches[1];e=(e+n.clientX)/2,s=(s+n.clientY)/2}return{clientX:e,clientY:s}}const e=t.changedTouches[0];return{clientX:e.clientX,clientY:e.clientY}},z=(t,e=0)=>X(t)?{clientX:t.touches[e].clientX,clientY:t.touches[e].clientY}:{clientX:t.clientX,clientY:t.clientY},W=t=>!t||!X(t)||t.touches.length>0;class q{_touchDragTimeOut;_onTouchDragStart;_payload=null;_delay=500;_firstTouch=null;_lastTouch=null;_epsilon=10;constructor(t,{onTouchDragStart:e},s={}){this._payload=t,this._onTouchDragStart=e,this._delay="number"==typeof s.delay?s.delay:500,this._epsilon="number"==typeof s.epsilon?s.epsilon:10}onStart(t){W(t)&&(this._touchDragTimeOut||(this._firstTouch=z(t,X(t)?t.touches.length-1:0),this._touchDragTimeOut=setTimeout(()=>{this._clearTimeout(),this._lastTouch||(this._lastTouch=z(t)),this._checkXDistance(t)()},this._delay)))}onEnd(){this._resetTouches()}onMove(t){W(t)&&(this._lastTouch=z(t))}_clearTimeout(){this._touchDragTimeOut&&(clearTimeout(this._touchDragTimeOut),this._touchDragTimeOut=null)}_resetTouches(){this._clearTimeout(),this._lastTouch=null,this._firstTouch=null,this._payload=null}_checkXDistance(t){return()=>{if(!this._firstTouch||!this._lastTouch)return;let e=!1;e=Math.abs(this._firstTouch.clientX-this._lastTouch.clientX)<this._epsilon,e&&(this._onTouchDragStart(this._payload,t),this._resetTouches())}}}const J=(t,e,s=0,n=0)=>{const i=e.x+e.width+s,r=e.x-s,a=e.y+e.height+n,o=e.y-n,{x:l,y:h}=t;return l>=r&&l<=i&&h>=o&&h<=a},K=(t,e,s,n=0,i=0)=>{if(s&&(s.hiddenIn||s.visibleIn))return s.visibleIn?J({x:t,y:e},s.visibleIn,n,i):!!s.hiddenIn&&!J({x:t,y:e},s.hiddenIn,-n,-i)};class V{_dragGhostAnimationFrameId=null;_dragGhostRemoveAnimationFrameId=null;_dragGhostElement=null;constructor(t=null){this._dragGhostElement=t}updateDragGhost(t,e,s){this._dragGhostRemoveAnimationFrameId&&(cancelAnimationFrame(this._dragGhostRemoveAnimationFrameId),this._dragGhostRemoveAnimationFrameId=null),!s.ghost?.external&&s.ghost&&(this._dragGhostAnimationFrameId||(this._dragGhostAnimationFrameId=requestAnimationFrame(()=>{(()=>{if(!document.getElementById(E)){const t=document.createElement("style");t.type="text/css",t.id=E,t.innerHTML=`\n ${O}\n ${B}\n `,document.head.appendChild(t)}})();const n={x:t,y:e};!s.ghost&&this._dragGhostElement&&(s.ghost={}),s.ghost&&!s.ghost.element&&this._dragGhostElement&&(s.ghost.element=this._dragGhostElement),(({x:t,y:e},s)=>{let n=document.getElementById(T);if(!n){if(n=document.createElement("div"),s.ghost?.element)n.appendChild(s.ghost.element);else{const t=document.createElement("img");t.src=s.ghost?.url||U,t.width=s.ghost?.width||112,t.height=s.ghost?.height||112,n.appendChild(t)}n.id=T,n.style.position="fixed",n.style.top="0",n.style.left="0",n.style.willChange="transform",n.style.transform="translate3d(0, 0, 0)",n.style.zIndex="9999",n.style.opacity="0.5",K(t,e,s.ghost||{},s.settings?.dragInOverlapX,s.settings?.dragInOverlapY)||(n.style.display="none"),n.style.pointerEvents="none",document.body.appendChild(n)}})(n,s),(({x:t,y:e},s)=>{const n=document.getElementById(T);if(!n)return;let i=s.ghost?.width,r=s.ghost?.height;typeof i>"u"&&(i=n.getBoundingClientRect().width||112),typeof r>"u"&&(r=n.getBoundingClientRect().height||112);const a=t-i/2,o=e-r/2;n.style.transform=`translate3d(${a}px, ${o}px, 0)`,s.ghost&&(K(t,e,s.ghost,s.settings?.dragInOverlapX,s.settings?.dragInOverlapY)?n.style.animation!=P&&(n.style.animation=P):n.style.animation!=F&&(n.style.animation=F))})(n,s),this._dragGhostAnimationFrameId=null})))}removeDragGhost(){this._dragGhostAnimationFrameId&&(cancelAnimationFrame(this._dragGhostAnimationFrameId),this._dragGhostAnimationFrameId=null),this._dragGhostRemoveAnimationFrameId||(this._dragGhostRemoveAnimationFrameId=requestAnimationFrame(()=>{const t=document.getElementById(T);t&&document.body.removeChild(t),this._dragGhostRemoveAnimationFrameId=null}))}}const Q=Object.freeze(Object.defineProperty({__proto__:null,DragInFromWebsiteStrategy:class{_options={};_instance;_mainDomElement;_currentDrag={};_currentTouch=null;_firefoxDragPosition={x:0,y:0};_onBeforeUpdateDrag=()=>({});isDragging=!1;_firefoxFallback=t=>{if(!this._currentDrag.event)return;t.preventDefault();const e=t||window.event;this._firefoxDragPosition.x=e.pageX||0,this._firefoxDragPosition.y=e.pageY||0};constructor(t,e,s){this._instance=t,this._mainDomElement=e,this._options=s||{},this._firefoxFallback=this._firefoxFallback.bind(this),document.addEventListener("dragover",this._firefoxFallback),this._mainDomElement.parentElement?.addEventListener("dragleave",()=>{this._instance.cancelDragIn()})}beforeUpdateGhost(t){this._onBeforeUpdateDrag=t}dragStart(t,e,s="rml_id"){const n=this._mainDomElement.parentNode;if("relative"!==G(n).position)return;this._mainDomElement.style.pointerEvents="none";let i=n.querySelector("."+S);i||(i=document.createElement("div"),i.classList.add(S),n.appendChild(i)),i.classList.remove(C),e.target.getAttribute("draggable");const r=n.querySelector("."+x);this._currentDrag.event=e;const a=e.target,o=a.cloneNode(!0),l=a.getBoundingClientRect();o.style.width=`${l.width}px`,o.style.height=`${l.height}px`,this._currentDrag.ghost=new V(o),this._currentDrag.offset||(this._currentDrag.offset={x:0,y:0});const{clientX:h,clientY:c}=j(e,this._firefoxDragPosition);this._currentDrag.offset.x=h-l.left,this._currentDrag.offset.y=c-l.top,e instanceof DragEvent&&e.dataTransfer&&e.dataTransfer.setDragImage&&e.dataTransfer.setDragImage(r,0,0);const{x:g,y:d}=$(n,this._currentDrag.event||e,this._firefoxDragPosition),u=Math.max(1,g),m=Math.max(1,d);this.isDragging=!0,this._instance.dragInObject(t,u,m,s)}dragUpdate(t){const e=this._mainDomElement.parentNode,{x:s,y:n}=$(e,t,this._firefoxDragPosition);if(0===s&&0===n)return;const i=Math.max(1,s),r=Math.max(1,n);if(1===i&&1===r)return;let a=i,o=r;if(X(t)){const t=this._options.settings?.fingerSize||0;a=Math.max(2,i+t),o=Math.max(2,r-t)}const{x:l,y:h,options:c}=this._onBeforeUpdateDrag(a,o,{}),g=c||{settings:{},ghost:{}};g.ghost||(g.ghost={}),g.ghost.visibleIn&&g.ghost.hiddenIn||(g.ghost.hiddenIn=this._mainDomElement.getBoundingClientRect());const d="number"==typeof l?l:a,u="number"==typeof h?h:o;if(this._currentDrag.ghost){const{clientX:e,clientY:s}=j(t,this._firefoxDragPosition);this._currentDrag.ghost.updateDragGhost(e,s,g)}this._instance.updateDrag(d,u,{})}dragEnd(){this._mainDomElement.style.pointerEvents="all";const t=this._mainDomElement.parentNode;this.isDragging=!1,this._instance.dragInObjectEnd(),this._currentDrag.ghost&&(this._currentDrag.ghost.removeDragGhost(),this._currentDrag.ghost=null),this._currentDrag={},this._firefoxDragPosition={x:0,y:0};const e=t.querySelector("."+S);e&&e.classList.add(C)}touchStart(t,e,s="rml_id"){e.preventDefault();const n={};"number"==typeof this._options?.settings?.touchDragDelay&&(n.delay=this._options.settings.touchDragDelay),this._options?.settings?.touchDragEpsilon&&(n.epsilon=this._options.settings.touchDragEpsilon),this._currentTouch=new q(void 0,{onTouchDragStart:(e,n)=>{this.dragStart(t,n,s)}},n),this._currentTouch.onStart(e)}touchMove(t){this._currentTouch&&this._currentTouch.onMove(t),this._currentDrag.event&&this.dragUpdate(t)}touchEnd(){this._currentTouch&&this._currentTouch.onEnd(),this._currentTouch=null,this.dragEnd()}dispose(){document.removeEventListener("dragover",this._firefoxFallback)}releaseInput(t){}}},Symbol.toStringTag,{value:"Module"})),Z=t=>{t.preventDefault(),t.stopPropagation()};class tt{_startX=0;_startY=0;_lastX=0;_lastY=0;_epsilon;_isWaiting=!1;_onCustomDragStart;constructor({onCustomDragStart:t},e={}){this._epsilon="number"==typeof e.epsilon?e.epsilon:15,this._onCustomDragStart=t}onMove(t){this._lastX=t.clientX,this._lastY=t.clientY,this._isWaiting&&((t,e)=>{const s=this._lastX-t,n=this._lastY-e;return Math.sqrt(s*s+n*n)})(this._startX,this._startY)>this._epsilon&&(this._onCustomDragStart(t),this._isWaiting=!1)}onStart(t){this._startX=t.clientX,this._startY=t.clientY,this.onMove(t),this._isWaiting=!0}onEnd(){this._reset()}_reset(){this._startX=0,this._startY=0,this._lastX=0,this._lastY=0,this._isWaiting=!1}}const et="data-rml-old-draggable",st=(t,e)=>{const s=X(t),n={delay:s?500:100,epsilon:s?10:15};if(!e)return n;if(!(s||t instanceof MouseEvent))return n;const{delayKey:i,epsilonKey:r}=s?{delayKey:"touchDragDelay",epsilonKey:"touchDragEpsilon"}:{delayKey:"customDragDelay",epsilonKey:"customDragEpsilon"};return"number"==typeof e[i]&&(n.delay=e.touchDragDelay),"number"==typeof e[r]&&(n.epsilon=e.touchDragEpsilon),n},nt=Object.freeze(Object.defineProperty({__proto__:null,DragInFromCustomViewStrategy:class{_options={};_instance;_mainDomElement;_viewName;_currentCustomDrag=null;_currentBb=null;_startTarget=null;_onBeforeUpdateDrag=()=>({});isDragging=!1;constructor(t,e,s,n){this._instance=t,this._options=s||{},this._viewName=n,this._mainDomElement=e,this._mainDomElement.parentElement?.addEventListener("dragleave",()=>{this._instance.cancelDragIn()})}beforeUpdateGhost(t){this._onBeforeUpdateDrag=t}async _dragStart(t,e,s="rml_id"){this._startTarget&&(this._startTarget.style.pointerEvents="none",this._startTarget.style.userSelect="none",this._startTarget.setAttribute(et,this._startTarget.draggable.toString()),this._startTarget.draggable=!1,this._startTarget.removeEventListener("dragstart",Z),this._startTarget.addEventListener("dragstart",Z)),this._currentBb=await this._instance.getBoundingClientRect((()=>`[data-rml-custom-view="${this._viewName}"]`)());const{clientX:n,clientY:i}=j(e),r=this._currentBb.x+n,a=this._currentBb.y+i;this.isDragging=!0,this._instance.dragInObject(t,r,a,s)}_dragUpdate(t){if(document.body.focus(),this._currentCustomDrag&&this._currentCustomDrag.onMove(t),!this._currentBb||!this.isDragging)return;const{clientX:e,clientY:s}=j(t),{url:n,width:i,height:r}=(t=>{let e="",s=112,n=112;if(!t)return{url:U,width:s,height:n};const i=t;if(i instanceof HTMLElement){const t=i.getBoundingClientRect(),r=i.getAttribute("data-rml-ghost-url"),a=i.getAttribute("data-rml-ghost-width"),o=i.getAttribute("data-rml-ghost-height");r?e=r:!r&&i instanceof HTMLImageElement&&i.src&&(e=i.src),e?(s=t.width,n=t.height):e=U,s=a?parseInt(a,10):s,n=o?parseInt(o,10):n}return{url:e||U,width:s,height:n}})(this._startTarget),a=this._currentBb.x+e,o=this._currentBb.y+s,l=this._options||{},h={ghost:{visibleIn:{x:this._currentBb.x-(l.dragInOverlapX||0),y:this._currentBb.y+(l.dragInOverlapY||0),width:this._currentBb.width+(l.dragInOverlapX||0),height:this._currentBb.height+(l.dragInOverlapY||0)},url:n,width:i,height:r},mode:"custom-view"},{x:c,y:g,options:d}=this._onBeforeUpdateDrag(a,o,h),u="number"==typeof c?c:a,m="number"==typeof g?g:o,_=d||h;this._instance.updateDrag(u,m,_)}_dragEnd(){this._currentCustomDrag&&this._currentCustomDrag.onEnd(),this._currentCustomDrag=null,this.isDragging=!1,this._currentBb=null,this._resetStartTarget(),this._instance.enableEvents(),this._instance.dragInObjectEnd()}dragStart(t,e,s){this._instance.disableEvents(),this._startTarget=e.target,this._currentCustomDrag=X(e)?new q(void 0,{onTouchDragStart:(e,n)=>{this._dragStart(t,n,s)}},st(e,this._options)):new tt({onCustomDragStart:e=>this._dragStart(t,e,s)},st(e,this._options)),this._currentCustomDrag.onStart(e)}dragEnd(){this._dragEnd()}dragUpdate(t){this._dragUpdate(t)}touchStart(t,e,s="rml_id"){this.dragStart(t,e,s)}touchMove(t){this.dragUpdate(t)}touchEnd(){this.dragEnd()}dispose(){}_resetStartTarget(){this._startTarget&&(this._startTarget.style.pointerEvents="",this._startTarget.style.userSelect="",this._startTarget.draggable="true"===this._startTarget.getAttribute(et),this._startTarget.removeAttribute(et),this._startTarget.removeEventListener("dragstart",Z))}releaseInput(t){this._currentCustomDrag&&this._currentCustomDrag.onEnd(),this._resetStartTarget()}}},Symbol.toStringTag,{value:"Module"}));return class extends h{static createPlanner(t,e,s,n=[]){return this._create(t,e,s,n)}static async connect(e,s=[]){const n=new h;n.viewName=e;const{resolve:i,promise:r}=c(),{resolve:a,promise:o}=c(),l=new t("custom-view-"+e,window,window.parent,({message:t,args:e})=>{switch(t){case"registerCustomViewDone":i();break;case"returnMethods":n.handleSetup(e[0]),a();break;default:if(n.isSetupDone)return n.executeMessage({message:t,args:e})}});n.setMessageHandler(l);const g=[e];return l.sendMessage("registerCustomView",g),await r,l.sendMessage("getMethods",g),await o,n.setupPlugins(s,document.body,"custom-view"),await Promise.allSettled(n.pluginsLoaded),n}static createConfigurator(t,e,s,n=[]){return this._create(t,e,s,n)}static create(t,e,s,n){return this._create(t,e,s,n)}static createViewer(t,e,s,n=[]){return this._create(t,e,s,n)}static async _create(t,i,r,l){return new Promise(async(h,c)=>{try{const c=n((()=>{const t=(t=>JSON.parse(JSON.stringify(t)))(a);t.locale||(t.locale=((t=null)=>{const e=window.navigator;if(t)return t.substr(0,2);if(Array.isArray(e.languages)&&e.languages.length>0)return e.languages[0].substr(0,2);for(let t=0,n=s.length;t<n;t++){const n=e[s[t]];if(n)return n.substr(0,2)}return"en"})()),"(idle)"===t.id&&delete t.id;const n=(()=>{const t=(()=>{try{return window.self!==window.top}catch{return!0}})();let e=window.location.href;if(t){if(!document.referrer)return null;e=document.referrer}const{hostname:s}=new URL(e);return s})();return n&&(t=>!!(e.includes(t)||t.endsWith("roomle.com")||t.endsWith("gitlab.io")||t.endsWith("gitlab.com")))(n)&&(t.configuratorId="demoConfigurator"),t.customApiUrl=void 0,t.emails=!1,t})(),(t=>(o(t),t?.customApiUrl&&(t.customApiUrl=decodeURIComponent(t.customApiUrl)),t.shareUrl&&(t.deeplink=t.shareUrl.replace("<CONF_ID>","#CONFIGURATIONID#")),t))(r));(t=>{t.featureFlags||(t.featureFlags={}),"boolean"!=typeof t.featureFlags.realPartList&&(t.featureFlags.realPartList=!0),"boolean"!=typeof t.featureFlags.globalCallbacks&&(t.featureFlags.globalCallbacks=!0),"boolean"!=typeof t.featureFlags.mocAr&&(t.featureFlags.mocAr=!1)})(c);const g=await(async(t,e)=>{if("string"!=typeof t)throw new Error('Configurator ID is not a string type: "'+typeof t+'"');const s=e.customApiUrl?e.customApiUrl:"https://api.roomle.com/v2",n=e.overrideTenant||9,i=s+"/configurators/"+t,r="roomle_portal_v2",a="03-"+window.btoa((new Date).toISOString()+";anonymous;"+r),o=new Request(i,{method:"GET",headers:new Headers({apiKey:r,currentTenant:n,locale:"en",language:"en",device:1,token:a,platform:"web"}),mode:"cors",cache:"default"}),l=await fetch(o),{configurator:h}=await l.json();return h})(t,c);r=((t,e)=>{e.configuratorId=t.id;const s=t.settings||{};return!e.overrideTenant&&t.tenant&&(e.overrideTenant=t.tenant),((t,e)=>{const s=JSON.parse(JSON.stringify(t));return n(s,e)})(s,e)})(g,c);const d=new this(g,i,r,l,h);return await Promise.allSettled(d.pluginsLoaded),d}catch(t){return c(t)}})}_waitForIframe;_container;_configuratorSettings;_initData={};_iframe;constructor(e,s,n,i,r){if(super(),!e||"string"!=typeof e.id)throw new Error("Please provide a correct configuratorId, you get the correct ID from your Roomle Contact Person");if(w.has(s))throw new Error("There is already an instance on this DOM element");if(!document.getElementById(m)){const t=n.zIndex||9999999,e=document.createElement("style");e.type="text/css",e.id=m;const s="transition:all ease-in-out 450ms;",i=["-webkit-","-o-"].reduce((t,e)=>t+(e+s),"")+s,r=d();e.innerHTML=`\n .${p}{${_}:${r};}\n .${y}{position:fixed;top:0;left:0;z-index:${t};opacity:0}\n .rml-transition{${i}}\n .${f}{width:100%;height:100%;opacity:1}\n .${v}{height:calc(var(${_},1vh)*100)}\n .${b}{overflow:hidden}\n `,document.head.appendChild(e)}this._executeMessage=this._executeMessage.bind(this);const a=new t("website",window,null,this._executeMessage);this.setMessageHandler(a),this._onResize=this._onResize.bind(this),l()&&window.addEventListener("resize",this._onResize),this._container=s,this._initData=n,this._configuratorSettings=e;const o=this._createIframe();this._onUseFullPage=this._onUseFullPage.bind(this),this._onBackToWebsite=this._onBackToWebsite.bind(this),this._waitForIframe=r,this._container.appendChild(o),this._iframe=o,this.setupPlugins(i,this._iframe),w.set(s,!0)}teardown(){this._container&&w.delete(this._container);const t=this._container.querySelector("iframe");t&&this._container.removeChild(t),window.removeEventListener("resize",this._onResize)}_createIframe(){const t=document.createElement("iframe");let e=this._configuratorSettings?.url||"https://www.roomle.com/t/cp/";return this._initData.useLocalRoomle&&(e=location.href.replace("embedding.html","")),location.href.includes("roomle.gitlab.io")&&(e=location.href.replace("embedding.html","index.html")),this._initData.overrideServerUrl&&(e=this._initData.overrideServerUrl),t.src=e,t.classList.add(p),t.classList.add(f),t}_onResize(){u(this._iframe)}_onUseFullPage(){this._iframe.classList.add(y),document.documentElement.classList.add(b),window.document.body.classList.add(b),l()&&(u(this._iframe),this._iframe.classList.add(v))}_onBackToWebsite(){this._iframe.classList.remove(y),this._iframe.classList.remove(v),document.documentElement.classList.remove(b),window.document.body.classList.remove(b)}_executeMessage({message:t,args:e},s){if(s.source&&s.source===this._iframe?.contentWindow)return"requestBoot"===t?this._messageHandler?(this._messageHandler.setOutgoingMessageBus(s.source),Promise.resolve({result:this._initData})):Promise.resolve({error:"MessageHandler not set"}):"setup"===t?(this.handleSetup(e[0]),g(this.ui.callbacks,"onUseFullPage",this._onUseFullPage),g(this.ui.callbacks,"onBackToWebsite",this._onBackToWebsite),this._waitForIframe(this),setTimeout(()=>{this._messageHandler&&this._messageHandler.sendMessage("websiteReady")},0),Promise.resolve({result:null})):this.executeMessage({message:t,args:e})}}},"object"==typeof exports&&typeof module<"u"?module.exports=e():"function"==typeof define&&define.amd?define(e):((t=typeof globalThis<"u"?globalThis:t||self)["roomle-embedding-lib"]=t["roomle-embedding-lib"]||{},t["roomle-embedding-lib"].umd=t["roomle-embedding-lib"].umd||{},t["roomle-embedding-lib"].umd.min=t["roomle-embedding-lib"].umd.min||{},t["roomle-embedding-lib"].umd.min.js=e());
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { KernelPlanObject } from '@roomle/web-sdk/typings/kernel';
|
|
2
2
|
import { Store } from 'vuex';
|
|
3
3
|
import { default as RoomleConfigurator } from '@roomle/web-sdk/configurator-core/src/roomle-configurator';
|
|
4
|
-
import { Nullable
|
|
4
|
+
import { Nullable } from '../../../utils/types';
|
|
5
5
|
import { StoreState } from '../../../store';
|
|
6
|
+
import { RoomlePlannerWithExtObjs } from '@roomle/web-sdk/typings/external-objects';
|
|
6
7
|
|
|
7
8
|
export default function setupPartList(api: Nullable<RoomlePlannerWithExtObjs> | Nullable<RoomleConfigurator>, storeIn?: Store<StoreState>, plannerCoreInstance?: {
|
|
8
9
|
api: Nullable<RoomlePlannerWithExtObjs>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Enumify,
|
|
1
|
+
import { Enumify, CATALOG_INFOS_TYPES, ExtendedKernelVector3, GroupedCollection, Nullable } from './types';
|
|
2
2
|
import { RapiConfiguration, RapiItem, AdditionalInfo, RapiMaterial, RapiComponent, RapiPlanSnapshotGetData } from '@roomle/web-sdk/typings/rapi-types';
|
|
3
3
|
import { StoreState } from '../store';
|
|
4
4
|
import { UiInitData } from '../../configurator/embedding/types';
|
|
5
5
|
import { BUTTON_ACTIONS } from '../../configurator/store/ui-state';
|
|
6
6
|
import { PlannerUiState } from '../../planner/store/planner-ui-state';
|
|
7
|
-
import { ExternalConfiguration } from '@roomle/web-sdk/typings/external-objects';
|
|
7
|
+
import { ExternalConfiguration, RoomleConfiguratorType, RoomlePlannerWithExtObjs } from '@roomle/web-sdk/typings/external-objects';
|
|
8
8
|
import { GridViewElementPossiblePayload } from '../../configurator/components/grid-view/-utils/GridViewHelper';
|
|
9
9
|
|
|
10
10
|
export declare const throttle: <T extends (...args: any[]) => any>(func: T, delay?: number) => (...funcArgs: Parameters<T>) => void;
|
|
@@ -2,10 +2,11 @@ import { SdkConnector } from '../../configurator/business-logic/sdk-connector';
|
|
|
2
2
|
import { StoreState } from '../store';
|
|
3
3
|
import { Store } from 'vuex';
|
|
4
4
|
import { ExposedCallbacks } from '../../configurator/embedding/exposed-callbacks';
|
|
5
|
-
import { Nullable
|
|
5
|
+
import { Nullable } from './types';
|
|
6
6
|
import { default as PlanElementViewModel } from '@roomle/web-sdk/common-core/src/view-model/plan-element-view-model';
|
|
7
7
|
import { SidebarType } from '../composables/use-event-emitter-listener';
|
|
8
8
|
import { default as EventEmitter } from '../business-logic/event-emitter';
|
|
9
|
+
import { RoomlePlannerWithExtObjs } from '@roomle/web-sdk/typings/external-objects';
|
|
9
10
|
|
|
10
11
|
export declare const isConstructionProduct: (selectionElement: PlanElementViewModel) => boolean;
|
|
11
12
|
export default class UiActions {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Nullable
|
|
1
|
+
import { Nullable } from '../../common/utils/types';
|
|
2
2
|
import { UiInitData } from '../embedding/types';
|
|
3
3
|
import { StoreState } from '../../common/store';
|
|
4
4
|
import { KernelParameter } from '@roomle/web-sdk/typings/kernel';
|
|
@@ -8,6 +8,7 @@ import { Analytics } from '../../common/plugins/analytics';
|
|
|
8
8
|
import { UiCallbacks } from './ui-callback';
|
|
9
9
|
import { Connector } from '../../common/business-logic/connector';
|
|
10
10
|
import { default as EventEmitter } from '../../common/business-logic/event-emitter';
|
|
11
|
+
import { RoomleConfiguratorType } from '@roomle/web-sdk/typings/external-objects';
|
|
11
12
|
|
|
12
13
|
export declare class SdkConnectorConfigurator extends Connector {
|
|
13
14
|
private _configurator;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Store } from 'vuex';
|
|
2
2
|
import { StoreState } from '../../common/store';
|
|
3
|
-
import { Nullable
|
|
3
|
+
import { Nullable } from '../../common/utils/types';
|
|
4
4
|
import { KernelParameter, KernelPartList, RuntimeId, UiPossibleChildTag } from '@roomle/web-sdk/typings/kernel';
|
|
5
5
|
import { default as ConfiguratorUiCallbacks } from '@roomle/web-sdk/configurator-core/src/services/configurator-ui-callback';
|
|
6
6
|
import { Analytics } from '../../common/plugins/analytics';
|
|
@@ -21,7 +21,7 @@ import { default as AsyncGuard } from '../../common/utils/async-guard';
|
|
|
21
21
|
import { default as EventEmitter } from '../../common/business-logic/event-emitter';
|
|
22
22
|
import { Translator } from '../../common/composables/use-intl';
|
|
23
23
|
import { Libs } from '../plugins/libs-plugin';
|
|
24
|
-
import { ExternalConfiguration } from '@roomle/web-sdk/typings/external-objects';
|
|
24
|
+
import { ExternalConfiguration, RoomleConfiguratorType, RoomlePlannerWithExtObjs } from '@roomle/web-sdk/typings/external-objects';
|
|
25
25
|
|
|
26
26
|
export declare enum SDK_MODULES {
|
|
27
27
|
VIEWER = 0,
|
|
@@ -2,28 +2,28 @@ import { GridViewElement } from './GridViewHelper';
|
|
|
2
2
|
|
|
3
3
|
declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<{
|
|
4
4
|
elements: GridViewElement<any>[];
|
|
5
|
-
selectedElement
|
|
5
|
+
selectedElement?: GridViewElement<any>;
|
|
6
6
|
onExpand?: (event: MouseEvent) => void;
|
|
7
|
-
onSelect
|
|
8
|
-
onDragStart
|
|
9
|
-
onDragEnd
|
|
10
|
-
onTouchStart
|
|
11
|
-
onTouchEnd
|
|
12
|
-
onTouchMove
|
|
7
|
+
onSelect?: (element: GridViewElement<any>) => void;
|
|
8
|
+
onDragStart?: (element: GridViewElement<any>, event: DragEvent) => void;
|
|
9
|
+
onDragEnd?: (element: GridViewElement<any>, event: DragEvent) => void;
|
|
10
|
+
onTouchStart?: (element: GridViewElement<any>, event: TouchEvent) => void;
|
|
11
|
+
onTouchEnd?: (element: GridViewElement<any>, event: TouchEvent) => void;
|
|
12
|
+
onTouchMove?: (element: GridViewElement<any>, event: TouchEvent) => void;
|
|
13
13
|
showAllElements?: boolean;
|
|
14
14
|
isDraggable?: boolean;
|
|
15
15
|
isScrolling?: boolean;
|
|
16
16
|
searchString?: string;
|
|
17
17
|
}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{
|
|
18
18
|
elements: GridViewElement<any>[];
|
|
19
|
-
selectedElement
|
|
19
|
+
selectedElement?: GridViewElement<any>;
|
|
20
20
|
onExpand?: (event: MouseEvent) => void;
|
|
21
|
-
onSelect
|
|
22
|
-
onDragStart
|
|
23
|
-
onDragEnd
|
|
24
|
-
onTouchStart
|
|
25
|
-
onTouchEnd
|
|
26
|
-
onTouchMove
|
|
21
|
+
onSelect?: (element: GridViewElement<any>) => void;
|
|
22
|
+
onDragStart?: (element: GridViewElement<any>, event: DragEvent) => void;
|
|
23
|
+
onDragEnd?: (element: GridViewElement<any>, event: DragEvent) => void;
|
|
24
|
+
onTouchStart?: (element: GridViewElement<any>, event: TouchEvent) => void;
|
|
25
|
+
onTouchEnd?: (element: GridViewElement<any>, event: TouchEvent) => void;
|
|
26
|
+
onTouchMove?: (element: GridViewElement<any>, event: TouchEvent) => void;
|
|
27
27
|
showAllElements?: boolean;
|
|
28
28
|
isDraggable?: boolean;
|
|
29
29
|
isScrolling?: boolean;
|
|
@@ -4,7 +4,7 @@ import { MessageHandler } from '../../../packages/common/src/utils/message-handl
|
|
|
4
4
|
import { Store } from 'vuex';
|
|
5
5
|
import { StoreState } from '../../common/store';
|
|
6
6
|
import { Nullable } from '../../common/utils/types';
|
|
7
|
-
import {
|
|
7
|
+
import { RoomleConfiguratorType, RoomlePlannerWithExtObjs } from '@roomle/web-sdk/typings/external-objects';
|
|
8
8
|
import { Analytics } from '../../common/plugins/analytics';
|
|
9
9
|
import { default as RoomleGLBViewer } from '@roomle/web-sdk/glb-viewer-core/src/roomle-glb-viewer';
|
|
10
10
|
import { GlobalCallback } from '@roomle/web-sdk/common-core/src/services/global-callback';
|
|
@@ -38,7 +38,7 @@ export declare class ExposedCallbacks {
|
|
|
38
38
|
* Gets called when a button in the UI is clicked
|
|
39
39
|
* @param name
|
|
40
40
|
* @param args - Optional arguments specific to the button that was clicked. This parameter is an object where each key is a UI_BUTTON and the value is the corresponding arguments for that button.
|
|
41
|
-
* @
|
|
41
|
+
* @returns overrideEventBehaviour true if the event has been consumed and it should not trigger default behaviour, undefined or false otherwise
|
|
42
42
|
*/
|
|
43
43
|
onButtonClicked: <K extends keyof ButtonCallbackPayloads>(name: K, args?: ButtonCallbackPayloads[K]) => Promise<boolean> | boolean | void;
|
|
44
44
|
onRequestPlan: (planId: string, image: Base64Image, items: any[], plan: RapiPlanSnapshotGetData | RapiPlan) => void;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Enumify, Nullable,
|
|
1
|
+
import { Enumify, Nullable, PLAN_OBJECT_TYPES } from '../../common/utils/types';
|
|
2
|
+
import { RoomlePlannerWithExtObjs, ExternalConfiguration } from '@roomle/web-sdk/typings/external-objects';
|
|
2
3
|
import { Store } from 'vuex';
|
|
3
4
|
import { StoreState } from '../../common/store';
|
|
4
5
|
import { Analytics } from '../../common/plugins/analytics';
|
|
@@ -12,7 +13,6 @@ import { default as PlanElementViewModel } from '@roomle/web-sdk/common-core/src
|
|
|
12
13
|
import { RuntimeId } from '@roomle/web-sdk/typings/kernel';
|
|
13
14
|
import { default as EventEmitter } from '../../common/business-logic/event-emitter';
|
|
14
15
|
import { SdkConnector } from '../../configurator/business-logic/sdk-connector';
|
|
15
|
-
import { ExternalConfiguration } from '@roomle/web-sdk/typings/external-objects';
|
|
16
16
|
|
|
17
17
|
export declare const getConstructionWallAngle: (selectionElement: PlanElementViewModel) => Nullable<number>;
|
|
18
18
|
export declare class SdkConnectorPlanner extends Connector {
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{
|
|
2
|
+
selectedCategory: any;
|
|
3
|
+
selectedSubCategory: any;
|
|
4
|
+
categories: any[];
|
|
5
|
+
showFilterDropdown: boolean;
|
|
6
|
+
}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
7
|
+
"navigate-back": (...args: any[]) => void;
|
|
8
|
+
"toggle-filter": (...args: any[]) => void;
|
|
9
|
+
}, string, import('vue').PublicProps, Readonly<{
|
|
10
|
+
selectedCategory: any;
|
|
11
|
+
selectedSubCategory: any;
|
|
12
|
+
categories: any[];
|
|
13
|
+
showFilterDropdown: boolean;
|
|
14
|
+
}> & Readonly<{
|
|
15
|
+
"onNavigate-back"?: (...args: any[]) => any;
|
|
16
|
+
"onToggle-filter"?: (...args: any[]) => any;
|
|
17
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
18
|
+
export default _default;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{
|
|
2
|
+
searchString: string;
|
|
3
|
+
hasNoResults: boolean;
|
|
4
|
+
emptyMessage: string;
|
|
5
|
+
}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{
|
|
6
|
+
searchString: string;
|
|
7
|
+
hasNoResults: boolean;
|
|
8
|
+
emptyMessage: string;
|
|
9
|
+
}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ParameterData } from '../../../common/components/side-bar/utils/types';
|
|
2
|
+
|
|
3
|
+
declare const _default: import('vue').DefineComponent<{
|
|
4
|
+
catalogTags: ParameterData<UiPossibleChildTag>[];
|
|
5
|
+
isExpanded?: boolean;
|
|
6
|
+
onExpand: () => void;
|
|
7
|
+
onCollapse: () => void;
|
|
8
|
+
isDesktop: boolean;
|
|
9
|
+
sidebarHeader?: string;
|
|
10
|
+
onClose?: () => void;
|
|
11
|
+
}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{
|
|
12
|
+
catalogTags: ParameterData<UiPossibleChildTag>[];
|
|
13
|
+
isExpanded?: boolean;
|
|
14
|
+
onExpand: () => void;
|
|
15
|
+
onCollapse: () => void;
|
|
16
|
+
isDesktop: boolean;
|
|
17
|
+
sidebarHeader?: string;
|
|
18
|
+
onClose?: () => void;
|
|
19
|
+
}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{
|
|
2
|
+
showBreadcrumb?: boolean;
|
|
3
|
+
selectedCategory: any;
|
|
4
|
+
selectedSubCategory: any;
|
|
5
|
+
categories: any[];
|
|
6
|
+
visibleCategories?: any[];
|
|
7
|
+
expandedCategories: Set<string>;
|
|
8
|
+
showFilterDropdown: boolean;
|
|
9
|
+
showMobileMenu?: boolean;
|
|
10
|
+
showAllCategories?: boolean;
|
|
11
|
+
isFilterMode?: boolean;
|
|
12
|
+
viewMode?: string;
|
|
13
|
+
isDesktop?: boolean;
|
|
14
|
+
}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
15
|
+
"navigate-back": (...args: any[]) => void;
|
|
16
|
+
"select-category": (...args: any[]) => void;
|
|
17
|
+
"select-sub-category": (...args: any[]) => void;
|
|
18
|
+
"toggle-dropdown": (...args: any[]) => void;
|
|
19
|
+
"toggle-filter-dropdown": (...args: any[]) => void;
|
|
20
|
+
"toggle-show-all": (...args: any[]) => void;
|
|
21
|
+
}, string, import('vue').PublicProps, Readonly<{
|
|
22
|
+
showBreadcrumb?: boolean;
|
|
23
|
+
selectedCategory: any;
|
|
24
|
+
selectedSubCategory: any;
|
|
25
|
+
categories: any[];
|
|
26
|
+
visibleCategories?: any[];
|
|
27
|
+
expandedCategories: Set<string>;
|
|
28
|
+
showFilterDropdown: boolean;
|
|
29
|
+
showMobileMenu?: boolean;
|
|
30
|
+
showAllCategories?: boolean;
|
|
31
|
+
isFilterMode?: boolean;
|
|
32
|
+
viewMode?: string;
|
|
33
|
+
isDesktop?: boolean;
|
|
34
|
+
}> & Readonly<{
|
|
35
|
+
"onNavigate-back"?: (...args: any[]) => any;
|
|
36
|
+
"onSelect-category"?: (...args: any[]) => any;
|
|
37
|
+
"onSelect-sub-category"?: (...args: any[]) => any;
|
|
38
|
+
"onToggle-dropdown"?: (...args: any[]) => any;
|
|
39
|
+
"onToggle-filter-dropdown"?: (...args: any[]) => any;
|
|
40
|
+
"onToggle-show-all"?: (...args: any[]) => any;
|
|
41
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
42
|
+
export default _default;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{
|
|
2
|
+
viewMode: string;
|
|
3
|
+
selectedCategory: any;
|
|
4
|
+
selectedSubCategory: any;
|
|
5
|
+
categories: any[];
|
|
6
|
+
viewType: string;
|
|
7
|
+
searchString: string;
|
|
8
|
+
}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
9
|
+
"select-item": (...args: any[]) => void;
|
|
10
|
+
"drag-start": (...args: any[]) => void;
|
|
11
|
+
"drag-end": (...args: any[]) => void;
|
|
12
|
+
}, string, import('vue').PublicProps, Readonly<{
|
|
13
|
+
viewMode: string;
|
|
14
|
+
selectedCategory: any;
|
|
15
|
+
selectedSubCategory: any;
|
|
16
|
+
categories: any[];
|
|
17
|
+
viewType: string;
|
|
18
|
+
searchString: string;
|
|
19
|
+
}> & Readonly<{
|
|
20
|
+
"onSelect-item"?: (...args: any[]) => any;
|
|
21
|
+
"onDrag-start"?: (...args: any[]) => any;
|
|
22
|
+
"onDrag-end"?: (...args: any[]) => any;
|
|
23
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
24
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{
|
|
2
|
+
item: RapiItem;
|
|
3
|
+
onClick?: (item: RapiItem) => void;
|
|
4
|
+
onEdit?: (item: RapiItem) => void;
|
|
5
|
+
onDragStart?: (event: TouchEvent | DragEvent) => void;
|
|
6
|
+
onDragEnd?: () => void;
|
|
7
|
+
}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{
|
|
8
|
+
item: RapiItem;
|
|
9
|
+
onClick?: (item: RapiItem) => void;
|
|
10
|
+
onEdit?: (item: RapiItem) => void;
|
|
11
|
+
onDragStart?: (event: TouchEvent | DragEvent) => void;
|
|
12
|
+
onDragEnd?: () => void;
|
|
13
|
+
}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{
|
|
2
|
+
items: any[];
|
|
3
|
+
viewType: string;
|
|
4
|
+
onSelectItem: (item: any) => void;
|
|
5
|
+
onDragStart: (item: any, event: TouchEvent | DragEvent) => void;
|
|
6
|
+
onDragEnd: () => void;
|
|
7
|
+
}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{
|
|
8
|
+
items: any[];
|
|
9
|
+
viewType: string;
|
|
10
|
+
onSelectItem: (item: any) => void;
|
|
11
|
+
onDragStart: (item: any, event: TouchEvent | DragEvent) => void;
|
|
12
|
+
onDragEnd: () => void;
|
|
13
|
+
}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
14
|
+
export default _default;
|
|
@@ -7,10 +7,12 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
7
7
|
onExpand?: () => void;
|
|
8
8
|
onCollapse?: () => void;
|
|
9
9
|
icToggleEvent: EventBus<ToggleCallback>;
|
|
10
|
+
onToggleExpand?: () => void;
|
|
10
11
|
}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{
|
|
11
12
|
onClose: (_buttonAction: BUTTON_ACTIONS, _reason: CloseReason) => Promise<void>;
|
|
12
13
|
onExpand?: () => void;
|
|
13
14
|
onCollapse?: () => void;
|
|
14
15
|
icToggleEvent: EventBus<ToggleCallback>;
|
|
16
|
+
onToggleExpand?: () => void;
|
|
15
17
|
}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
16
18
|
export default _default;
|