bimplus-webclient 0.1.47 → 0.1.49

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.
@@ -1 +1,2166 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.add=t():e.add=t()}(self,(()=>(()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,o(r.key),r)}}function o(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}e.r(t),e.d(t,{BimExplorer:()=>C,BimFilesIsoSelect:()=>Ze,BimFilesOverlaySelect:()=>Ce,BimFilesSelect:()=>Pe,BimModelsIsoSelect:()=>lt,BimModelsSelect:()=>ze,BimObjectProperties:()=>le,BimPortal:()=>P,BimTaskList:()=>z,BimTaskProperties:()=>Z,ExportManager:()=>ve,ExternalClient:()=>c,ModelViewer:()=>ft,getUrlParameter:()=>dt});var i,c=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._messageHandlers={},this._errorHandler=null,this._clientName=t},(t=[{key:"initialize",value:function(){var e=this;console.log("ExternalClient initialized"),window.addEventListener("message",(function(t){var n=t.data;if(""===n)e.errorReceived({error:"External client got an empty message !"});else{var r;try{r=JSON.parse(n)}catch(t){return void e.errorReceived({error:"External client got an invalid message json payload !"})}e.messageReceived(r)}}))}},{key:"addMessageHandler",value:function(e,t){this._messageHandlers[e]=t}},{key:"removeMessageHandler",value:function(e){delete this._messageHandlers[e]}},{key:"messageReceived",value:function(e){var t=this._messageHandlers[e.message];t&&t(e.data)}},{key:"addErrorHandler",value:function(e){this._errorHandler=e}},{key:"removeErrorHandler",value:function(){this._errorHandler=null}},{key:"errorReceived",value:function(e){var t=this._errorHandler;t&&t(e)}},{key:"sendMessage",value:function(e,t,n){var r=document.getElementById(e);return!(null==r||!r.contentWindow||(r.contentWindow.postMessage(JSON.stringify({messageType:"bimplusMessageIn",message:t,data:n}),"*"),0))}},{key:"getClientName",value:function(){return this._clientName}}])&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}();function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,f(r.key),r)}}function a(e,t,n){return t&&u(e.prototype,t),n&&u(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e,t,n){return(t=f(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f(e){var t=function(e,t){if("object"!=l(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=l(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==l(t)?t:t+""}var d=a((function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}));function p(e){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p(e)}function y(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,b(r.key),r)}}function b(e){var t=function(e,t){if("object"!=p(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=p(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==p(t)?t:t+""}i=d,s(d,"embedded","?embedded=1"),s(d,"url",(function(e){var t="https://portal";return e&&("dev"===e&&(t+="-dev"),"stage"===e&&(t+="-stage")),t+=".bimplus.net/"})),s(d,"token",(function(e){return"&token="+e})),s(d,"client",(function(e){return e?"&external_client=PostMessage:"+e.getClientName():""})),s(d,"source",(function(e){return e&&"string"==typeof e?"&source="+e:""})),s(d,"teamId",(function(e){return e?"&team_id="+e:""})),s(d,"projectId",(function(e){return e?"&project_id="+e:""})),s(d,"addParameter",(function(e,t,n){return t&&n?e?e+"&".concat(t,"=").concat(n):"?".concat(t,"=").concat(n):e})),s(d,"addParameters",(function(e,t){var n=e;for(var r in t)n=i.addParameter(n,r,t[r]);return n}));var v=function(){return e=function e(t,n,r,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._client=n,this._domId=t,this._env=r,this._token=o},(t=[{key:"sendMessage",value:function(e,t){if(!this._client){var n="Error for SendMessage. Client not defined.";throw console.error(n),ReferenceError(n)}this._client.sendMessage(this._domId,e,t)}},{key:"getDOMElementId",value:function(){return this._domId}},{key:"initMessageHandlers",value:function(){}},{key:"loadIFrame",value:function(e){var t=document.getElementById(this._domId);if(!t){var n="DOM element not found: "+this._domId;throw console.error(n),ReferenceError(n)}t.src=e}}])&&y(e.prototype,t),n&&y(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}();function h(e){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},h(e)}function m(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,g(r.key),r)}}function g(e){var t=function(e,t){if("object"!=h(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=h(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==h(t)?t:t+""}function O(e,t,n){return t=w(t),function(e,t){if(t&&("object"===h(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,S()?Reflect.construct(t,n||[],w(e).constructor):t.apply(e,n))}function S(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(S=function(){return!!e})()}function j(){return j="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=w(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}},j.apply(this,arguments)}function w(e){return w=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},w(e)}function _(e,t){return _=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},_(e,t)}var P=function(e){function t(e,n,r,o){var i;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(i=O(this,t,[e,r,o,n])).onTeamChanged=null,i.onProjectSelected=null,i.onAttachmentSelected=null,i.onAttachmentSelectedDetails=null,i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_(e,t)}(t,e),n=t,(r=[{key:"getUrl",value:function(){return d.url(this._env)+d.embedded+d.token(this._token)+d.client(this._client)}},{key:"load",value:function(){var e=this.getUrl();this.loadIFrame(e),this.initMessageHandlers()}},{key:"initMessageHandlers",value:function(){var e=this;j(w(t.prototype),"initMessageHandlers",this).call(this),this._client.addMessageHandler("TeamChanged",(function(t){e.onTeamChanged&&e.onTeamChanged(t.id)})),this._client.addMessageHandler("ProjectSelected",(function(t){e.onProjectSelected&&e.onProjectSelected(t.id)})),this._client.addMessageHandler("AttachmentSelected",(function(t){e.onAttachmentSelected&&e.onAttachmentSelected(null!=t&&t.id?t.id:t)})),this._client.addMessageHandler("AttachmentSelectedDetails",(function(t){e.onAttachmentSelectedDetails&&e.onAttachmentSelectedDetails(null!=t&&t.id?t.id:t)}))}}])&&m(n.prototype,r),o&&m(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(v);function k(e){return k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},k(e)}function M(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,E(r.key),r)}}function E(e){var t=function(e,t){if("object"!=k(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=k(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==k(t)?t:t+""}function H(e,t,n){return t=T(t),function(e,t){if(t&&("object"===k(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,R()?Reflect.construct(t,n||[],T(e).constructor):t.apply(e,n))}function R(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(R=function(){return!!e})()}function D(){return D="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=T(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}},D.apply(this,arguments)}function T(e){return T=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},T(e)}function A(e,t){return A=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},A(e,t)}var C=function(e){function t(e,n,r,o){var i;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(i=H(this,t,[e,r,o,n])).onObjectSelected=null,i.onObjectsSelected=null,i.onIssueSelected=null,i.onPinSelected=null,i.onCheckAlive=null,i.onDataLoaded=null,i.onClickedHyperlink=null,i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&A(e,t)}(t,e),n=t,(r=[{key:"getUrl",value:function(e,t){return(this._env&&"localhost"===this._env?"http://127.0.0.1:4200/":d.url(this._env))+"#/viewer"+d.embedded+d.token(this._token)+d.client(this._client)+"&project_id="+t+"&team_id="+e}},{key:"load",value:function(e,t){var n=this.getUrl(e,t);this.loadIFrame(n),this.initMessageHandlers()}},{key:"initMessageHandlers",value:function(){var e=this;D(T(t.prototype),"initMessageHandlers",this).call(this),this._client.addMessageHandler("PinSelected",(function(t){e.onPinSelected&&e.onPinSelected(t.id)})),this._client.addMessageHandler("ObjectSelected",(function(t){e.onObjectSelected&&e.onObjectSelected(t.Id,t.multiSelect,t.selected)})),this._client.addMessageHandler("ObjectsSelected",(function(t){e.onObjectsSelected&&e.onObjectsSelected(t.ids,t.multiSelect,t.selected)})),this._client.addMessageHandler("IssueSelected",(function(t){e.onIssueSelected&&e.onIssueSelected(t.id)})),this._client.addMessageHandler("CheckAlive",(function(t){e.onCheckAlive&&e.onCheckAlive(t.client)})),this._client.addMessageHandler("DataLoaded",(function(){e.onDataLoaded&&e.onDataLoaded()})),this._client.addMessageHandler("ClickedHyperlink",(function(t){e.onClickedHyperlink&&e.onClickedHyperlink(t.url)}))}},{key:"resetView",value:function(){this.sendMessage("ResetView")}},{key:"centerObject",value:function(e,t){this.sendMessage("CenterObject",{id:e,flyTo:t})}},{key:"selectPin",value:function(e){this.sendMessage("PinSelected",{id:e})}},{key:"selectObjects",value:function(e,t,n,r){this.sendMessage("ObjectsSelected",{ids:e,multiSelect:t,isolate:n,blockProperties:r})}},{key:"isolateObjects",value:function(e){this.sendMessage("ObjectsIsolated",{ids:e})}},{key:"checkAlive",value:function(){this.sendMessage("CheckAlive",{})}},{key:"selectStructure",value:function(e,t,n,r,o,i){this.sendMessage("StructureSelected",{id:e,visibleNodes:t,showAll:n,expandAll:r,hideUnreferencedTopology:o,isolate:i})}},{key:"selectIssue",value:function(e){this.sendMessage("IssueSelected",{id:e})}},{key:"colorizeObjects",value:function(e,t){this.sendMessage("ColorizeObjects",{ids:e,color:t})}}])&&M(n.prototype,r),o&&M(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(v);function I(e){return I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},I(e)}function B(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,U(r.key),r)}}function U(e){var t=function(e,t){if("object"!=I(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=I(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==I(t)?t:t+""}function x(e,t,n){return t=F(t),function(e,t){if(t&&("object"===I(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,N()?Reflect.construct(t,n||[],F(e).constructor):t.apply(e,n))}function N(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(N=function(){return!!e})()}function L(){return L="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=F(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}},L.apply(this,arguments)}function F(e){return F=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},F(e)}function W(e,t){return W=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},W(e,t)}var z=function(e){function t(e,n,r,o){var i;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(i=x(this,t,[e,r,o,n])).onObjectSelected=null,i.onObjectsSelected=null,i.onIssueSelected=null,i.onCheckAlive=null,i.onDataLoaded=null,i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&W(e,t)}(t,e),n=t,(r=[{key:"getUrl",value:function(e,t,n){return d.url(this._env)+"viewer/"+d.embedded+"&destination=EMBEDDED_ISSUE_LIST"+d.source(n)+d.token(this._token)+d.client(this._client)+"/#/embeddedissuelist?project_id="+t+"&team_id="+e}},{key:"load",value:function(e,t,n){var r=this.getUrl(e,t,n);this.loadIFrame(r),this.initMessageHandlers()}},{key:"initMessageHandlers",value:function(){var e=this;L(F(t.prototype),"initMessageHandlers",this).call(this),this._client.addMessageHandler("ObjectSelected",(function(t){e.onObjectSelected&&e.onObjectSelected(t.Id,t.multiSelect,t.selected)})),this._client.addMessageHandler("ObjectsSelected",(function(t){e.onObjectsSelected&&e.onObjectsSelected(t.ids,t.multiSelect,t.selected)})),this._client.addMessageHandler("IssueSelected",(function(t){e.onIssueSelected&&e.onIssueSelected(t.id)})),this._client.addMessageHandler("CheckAlive",(function(t){e.onCheckAlive&&e.onCheckAlive(t.client)})),this._client.addMessageHandler("DataLoaded",(function(){e.onDataLoaded&&e.onDataLoaded()}))}},{key:"selectObjects",value:function(e,t,n,r){this.sendMessage("ObjectsSelected",{ids:e,multiSelect:t,isolate:n,blockProperties:r})}},{key:"checkAlive",value:function(){this.sendMessage("CheckAlive",{})}},{key:"selectIssue",value:function(e){this.sendMessage("IssueSelected",{id:e})}}])&&B(n.prototype,r),o&&B(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(v);function V(e){return V="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},V(e)}function J(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,q(r.key),r)}}function q(e){var t=function(e,t){if("object"!=V(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=V(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==V(t)?t:t+""}function G(e,t,n){return t=X(t),function(e,t){if(t&&("object"===V(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,K()?Reflect.construct(t,n||[],X(e).constructor):t.apply(e,n))}function K(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(K=function(){return!!e})()}function Q(){return Q="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=X(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}},Q.apply(this,arguments)}function X(e){return X=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},X(e)}function Y(e,t){return Y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Y(e,t)}var Z=function(e){function t(e,n,r,o){var i;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(i=G(this,t,[e,r,o,n])).onObjectSelected=null,i.onObjectsSelected=null,i.onIssueSelected=null,i.onPinSelected=null,i.onCheckAlive=null,i.onDataLoaded=null,i.onClickedHyperlink=null,i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Y(e,t)}(t,e),n=t,(r=[{key:"getUrl",value:function(e,t,n,r){return d.url(this._env)+"viewer/"+d.embedded+"&destination=EMBEDDED_ISSUE"+d.source(r)+d.token(this._token)+d.client(this._client)+"/#/embeddedissue?project_id="+t+"&issue_id="+n+"&team_id="+e}},{key:"load",value:function(e,t,n,r){var o=this.getUrl(e,t,n,r);this.loadIFrame(o),this.initMessageHandlers()}},{key:"initMessageHandlers",value:function(){var e=this;Q(X(t.prototype),"initMessageHandlers",this).call(this),this._client.addMessageHandler("PinSelected",(function(t){e.onPinSelected&&e.onPinSelected(t.id)})),this._client.addMessageHandler("ObjectSelected",(function(t){e.onObjectSelected&&e.onObjectSelected(t.Id,t.multiSelect,t.selected)})),this._client.addMessageHandler("ObjectsSelected",(function(t){e.onObjectsSelected&&e.onObjectsSelected(t.ids,t.multiSelect,t.selected)})),this._client.addMessageHandler("IssueSelected",(function(t){e.onIssueSelected&&e.onIssueSelected(t.id)})),this._client.addMessageHandler("CheckAlive",(function(t){e.onCheckAlive&&e.onCheckAlive(t.client)})),this._client.addMessageHandler("DataLoaded",(function(){e.onDataLoaded&&e.onDataLoaded()})),this._client.addMessageHandler("ClickedHyperlink",(function(t){e.onClickedHyperlink&&e.onClickedHyperlink(t.url)}))}},{key:"selectPin",value:function(e){this.sendMessage("PinSelected",{id:e})}},{key:"selectObjects",value:function(e,t,n,r){this.sendMessage("ObjectsSelected",{ids:e,multiSelect:t,isolate:n,blockProperties:r})}},{key:"checkAlive",value:function(){this.sendMessage("CheckAlive",{})}},{key:"selectIssue",value:function(e){this.sendMessage("IssueSelected",{id:e})}}])&&J(n.prototype,r),o&&J(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(v);function $(e){return $="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},$(e)}function ee(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ce(r.key),r)}}function te(e,t,n){return t=oe(t),function(e,t){if(t&&("object"===$(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,ne()?Reflect.construct(t,n||[],oe(e).constructor):t.apply(e,n))}function ne(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ne=function(){return!!e})()}function re(){return re="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=oe(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}},re.apply(this,arguments)}function oe(e){return oe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},oe(e)}function ie(e,t){return ie=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ie(e,t)}function ce(e){var t=function(e,t){if("object"!=$(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=$(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==$(t)?t:t+""}var le=function(e){function t(e,n,r,o){var i,c,l,u;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i=te(this,t,[e,r,o,n]),c=i,u=function(e,t,n){var r=d.url(this._env);return r+="viewer/#/objproperties"+d.embedded+d.token(this._token)+d.client(this._client)+"&project_id="+t+"&team_id="+e+"&object_id="+n},(l=ce(l="getUrl"))in c?Object.defineProperty(c,l,{value:u,enumerable:!0,configurable:!0,writable:!0}):c[l]=u,i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ie(e,t)}(t,e),n=t,(r=[{key:"load",value:function(e,t,n){var r=this.getUrl(e,t,n);this.loadIFrame(r),this.initMessageHandlers()}},{key:"initMessageHandlers",value:function(){re(oe(t.prototype),"initMessageHandlers",this).call(this)}}])&&ee(n.prototype,r),o&&ee(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(v);function ue(e){return ue="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ue(e)}function ae(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,se(r.key),r)}}function se(e){var t=function(e,t){if("object"!=ue(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=ue(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ue(t)?t:t+""}function fe(e,t,n){return t=ye(t),function(e,t){if(t&&("object"===ue(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,de()?Reflect.construct(t,n||[],ye(e).constructor):t.apply(e,n))}function de(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(de=function(){return!!e})()}function pe(){return pe="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=ye(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}},pe.apply(this,arguments)}function ye(e){return ye=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ye(e)}function be(e,t){return be=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},be(e,t)}var ve=function(e){function t(e,n,r,o){var i;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(i=fe(this,t,[e,n,r,o])).onExportStarted=null,i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&be(e,t)}(t,e),n=t,(r=[{key:"getUrl",value:function(e,t){var n=this._env&&"localhost"===this._env?"http://127.0.0.1:4200/":d.url(this._env)+"export-manager/";return n+="#/viewer"+d.embedded+d.token(this._token)+d.client(this._client)+"&project_id="+t+"&team_id="+e}},{key:"initMessageHandlers",value:function(){var e=this;pe(ye(t.prototype),"initMessageHandlers",this).call(this),this._client.addMessageHandler("ExportStarted",(function(t){e.onExportStarted&&e.onExportStarted(t.id)}))}}])&&ae(n.prototype,r),o&&ae(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(C);function he(e){return he="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},he(e)}function me(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ge(r.key),r)}}function ge(e){var t=function(e,t){if("object"!=he(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=he(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==he(t)?t:t+""}function Oe(e,t,n){return t=we(t),function(e,t){if(t&&("object"===he(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Se()?Reflect.construct(t,n||[],we(e).constructor):t.apply(e,n))}function Se(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Se=function(){return!!e})()}function je(){return je="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=we(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}},je.apply(this,arguments)}function we(e){return we=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},we(e)}function _e(e,t){return _e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},_e(e,t)}var Pe=function(e){function t(e,n,r,o){var i;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(i=Oe(this,t,[e,r,o,n])).onAttachmentSelected=null,i.onAttachmentSelectedDetails=null,i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_e(e,t)}(t,e),n=t,(r=[{key:"getUrl",value:function(e,t){var n=d.url(this._env);return n+=d.embedded+d.token(this._token)+d.client(this._client)+"/#/project/"+e+"/"+t+"/files/select"}},{key:"load",value:function(e,t){var n=this.getUrl(e,t);this.loadIFrame(n),this.initMessageHandlers()}},{key:"initMessageHandlers",value:function(){var e=this;je(we(t.prototype),"initMessageHandlers",this).call(this),this._client.addMessageHandler("AttachmentSelected",(function(t){e.onAttachmentSelected&&e.onAttachmentSelected(null!=t&&t.id?t.id:t)})),this._client.addMessageHandler("AttachmentSelectedDetails",(function(t){e.onAttachmentSelectedDetails&&e.onAttachmentSelectedDetails(null!=t&&t.id?t.id:t)}))}}])&&me(n.prototype,r),o&&me(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(v);function ke(e){return ke="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ke(e)}function Me(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Ee(r.key),r)}}function Ee(e){var t=function(e,t){if("object"!=ke(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=ke(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ke(t)?t:t+""}function He(e,t,n){return t=Te(t),function(e,t){if(t&&("object"===ke(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Re()?Reflect.construct(t,n||[],Te(e).constructor):t.apply(e,n))}function Re(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Re=function(){return!!e})()}function De(){return De="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Te(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}},De.apply(this,arguments)}function Te(e){return Te=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Te(e)}function Ae(e,t){return Ae=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ae(e,t)}var Ce=function(e){function t(e,n,r,o){var i;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(i=He(this,t,[e,r,o,n])).onAttachmentSelected=null,i.onAttachmentSelectedDetails=null,i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ae(e,t)}(t,e),n=t,(r=[{key:"getUrl",value:function(e,t){var n=d.url(this._env);return n+=d.embedded+d.token(this._token)+d.client(this._client)+"/#/project/"+e+"/"+t+"/files/overlayselect"}},{key:"load",value:function(e,t){var n=this.getUrl(e,t);this.loadIFrame(n),this.initMessageHandlers()}},{key:"initMessageHandlers",value:function(){var e=this;De(Te(t.prototype),"initMessageHandlers",this).call(this),this._client.addMessageHandler("AttachmentSelected",(function(t){e.onAttachmentSelected&&e.onAttachmentSelected(null!=t&&t.id?t.id:t)})),this._client.addMessageHandler("AttachmentSelectedDetails",(function(t){e.onAttachmentSelectedDetails&&e.onAttachmentSelectedDetails(null!=t&&t.id?t.id:t)}))}}])&&Me(n.prototype,r),o&&Me(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(v);function Ie(e){return Ie="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ie(e)}function Be(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Ue(r.key),r)}}function Ue(e){var t=function(e,t){if("object"!=Ie(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Ie(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Ie(t)?t:t+""}function xe(e,t,n){return t=Fe(t),function(e,t){if(t&&("object"===Ie(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Ne()?Reflect.construct(t,n||[],Fe(e).constructor):t.apply(e,n))}function Ne(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ne=function(){return!!e})()}function Le(){return Le="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Fe(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}},Le.apply(this,arguments)}function Fe(e){return Fe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Fe(e)}function We(e,t){return We=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},We(e,t)}var ze=function(e){function t(e,n,r,o){var i;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(i=xe(this,t,[e,r,o,n])).onModelSelected=null,i.onModelSelectedDetails=null,i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&We(e,t)}(t,e),n=t,(r=[{key:"getUrl",value:function(e,t){var n=d.url(this._env);return n+=d.embedded+d.token(this._token)+d.client(this._client)+"/#/project/"+e+"/"+t+"/models/select"}},{key:"load",value:function(e,t){var n=this.getUrl(e,t);this.loadIFrame(n),this.initMessageHandlers()}},{key:"initMessageHandlers",value:function(){var e=this;Le(Fe(t.prototype),"initMessageHandlers",this).call(this),this._client.addMessageHandler("ModelSelected",(function(t){e.onModelSelected&&e.onModelSelected(null!=t&&t.id?t.id:t)})),this._client.addMessageHandler("ModelSelectedDetails",(function(t){e.onModelSelectedDetails&&e.onModelSelectedDetails(null!=t&&t.id?t.id:t)}))}}])&&Be(n.prototype,r),o&&Be(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(v);function Ve(e){return Ve="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ve(e)}function Je(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,qe(r.key),r)}}function qe(e){var t=function(e,t){if("object"!=Ve(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Ve(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Ve(t)?t:t+""}function Ge(e,t,n){return t=Xe(t),function(e,t){if(t&&("object"===Ve(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Ke()?Reflect.construct(t,n||[],Xe(e).constructor):t.apply(e,n))}function Ke(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ke=function(){return!!e})()}function Qe(){return Qe="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Xe(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}},Qe.apply(this,arguments)}function Xe(e){return Xe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Xe(e)}function Ye(e,t){return Ye=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ye(e,t)}var Ze=function(e){function t(e,n,r,o){var i;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(i=Ge(this,t,[e,r,o,n])).onAttachmentSelected=null,i.onAttachmentSelectedDetails=null,i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ye(e,t)}(t,e),n=t,(r=[{key:"getUrl",value:function(e,t,n){var r=n||d.url(this._env);return r+=d.embedded+d.token(this._token)+d.client(this._client)+"/#/project/"+e+"/"+t+"/files/isoselect"}},{key:"load",value:function(e,t,n){var r=this.getUrl(e,t,n);this.loadIFrame(r),this.initMessageHandlers()}},{key:"initMessageHandlers",value:function(){var e=this;Qe(Xe(t.prototype),"initMessageHandlers",this).call(this),this._client.addMessageHandler("AttachmentSelected",(function(t){e.onAttachmentSelected&&e.onAttachmentSelected(null!=t&&t.id?t.id:t)})),this._client.addMessageHandler("AttachmentSelectedDetails",(function(t){e.onAttachmentSelectedDetails&&e.onAttachmentSelectedDetails(null!=t&&t.id?t.id:t)}))}}])&&Je(n.prototype,r),o&&Je(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(v);function $e(e){return $e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},$e(e)}function et(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,tt(r.key),r)}}function tt(e){var t=function(e,t){if("object"!=$e(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=$e(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==$e(t)?t:t+""}function nt(e,t,n){return t=it(t),function(e,t){if(t&&("object"===$e(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,rt()?Reflect.construct(t,n||[],it(e).constructor):t.apply(e,n))}function rt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(rt=function(){return!!e})()}function ot(){return ot="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=it(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}},ot.apply(this,arguments)}function it(e){return it=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},it(e)}function ct(e,t){return ct=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ct(e,t)}var lt=function(e){function t(e,n,r,o){var i;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(i=nt(this,t,[e,r,o,n])).onModelSelected=null,i.onModelSelectedDetails=null,i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ct(e,t)}(t,e),n=t,(r=[{key:"getUrl",value:function(e,t,n){var r=n||d.url(this._env);return r+=d.embedded+d.token(this._token)+d.client(this._client)+"/#/project/"+e+"/"+t+"/models/isoselect"}},{key:"load",value:function(e,t,n){var r=this.getUrl(e,t,n);this.loadIFrame(r),this.initMessageHandlers()}},{key:"initMessageHandlers",value:function(){var e=this;ot(it(t.prototype),"initMessageHandlers",this).call(this),this._client.addMessageHandler("ModelSelected",(function(t){e.onModelSelected&&e.onModelSelected(null!=t&&t.id?t.id:t)})),this._client.addMessageHandler("ModelSelectedDetails",(function(t){e.onModelSelectedDetails&&e.onModelSelectedDetails(null!=t&&t.id?t.id:t)}))}}])&&et(n.prototype,r),o&&et(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(v);function ut(e){return ut="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ut(e)}function at(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,st(r.key),r)}}function st(e){var t=function(e,t){if("object"!=ut(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=ut(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ut(t)?t:t+""}var ft=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.viewerUri=t&&"dev"!==t&&"stage"!==t&&"prod"!==t?t:d.url(t)+"/viewer/#/modelviewer"},(t=[{key:"openFileUriWindow",value:function(e,t,n,r){var o="";o=d.addParameters(o,{fileUri:encodeURIComponent(e),team_id:n,project_id:r});var i=this.viewerUri+o;return window.open(i,t)}},{key:"openBufferDataWindow",value:function(e,t,n,r){var o="";o=d.addParameters(o,{awaitDataMessage:"true",team_id:n,project_id:r});var i=this.viewerUri+o,c=window.open(i,t);if(c)return window.addEventListener("message",(function t(n){"WatingForData"===n.data&&c&&window&&(c.postMessage(e,"*",[e]),window.removeEventListener("message",t))}),!1),c;alert("Could not open preview window. Please enable popups in your browser to use this feature")}}])&&at(e.prototype,t),n&&at(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}(),dt=function(e){var t,n,r=decodeURIComponent(window.location.search.substring(1)).split("&");for(n=0;n<r.length;n++)if((t=r[n].split("="))[0]===e)return void 0===t[1]||t[1]};return t})()));
1
+ (function webpackUniversalModuleDefinition(root, factory) {
2
+ if(typeof exports === 'object' && typeof module === 'object')
3
+ module.exports = factory();
4
+ else if(typeof define === 'function' && define.amd)
5
+ define([], factory);
6
+ else if(typeof exports === 'object')
7
+ exports["add"] = factory();
8
+ else
9
+ root["add"] = factory();
10
+ })(self, () => {
11
+ return /******/ (() => { // webpackBootstrap
12
+ /******/ "use strict";
13
+ /******/ var __webpack_modules__ = ({
14
+
15
+ /***/ "./src/BimExplorer.js":
16
+ /*!****************************!*\
17
+ !*** ./src/BimExplorer.js ***!
18
+ \****************************/
19
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
20
+
21
+ __webpack_require__.r(__webpack_exports__);
22
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
23
+ /* harmony export */ BimExplorer: () => (/* binding */ BimExplorer)
24
+ /* harmony export */ });
25
+ /* harmony import */ var _UrlBuilder__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./UrlBuilder */ "./src/UrlBuilder.js");
26
+ /* harmony import */ var _WebControl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./WebControl */ "./src/WebControl.js");
27
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
28
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
29
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
30
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
31
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
32
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
33
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
34
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
35
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
36
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
37
+ function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
38
+ function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
39
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
40
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
41
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
42
+
43
+
44
+
45
+ /**
46
+ * @namespace BimExplorer
47
+ * @param {string} domId DOM Element Id of the containing iframe
48
+ * @param {string} token a valid bimplus accesstoken
49
+ * @param {Object} client The external client to connect with
50
+ * @param {string} env environment to use: dev, stage or prod
51
+ */
52
+ var BimExplorer = /*#__PURE__*/function (_WebControl) {
53
+ function BimExplorer(domId, token, client, env) {
54
+ var _this;
55
+ _classCallCheck(this, BimExplorer);
56
+ _this = _callSuper(this, BimExplorer, [domId, client, env, token]);
57
+
58
+ /**
59
+ * Callback for object selected
60
+ * @memberof BimExplorer
61
+ */
62
+ _this.onObjectSelected = null;
63
+
64
+ /**
65
+ * Callback for multiple objects selected
66
+ * @memberof BimExplorer
67
+ */
68
+ _this.onObjectsSelected = null;
69
+
70
+ /**
71
+ * Callback for issue selected
72
+ * @memberof BimExplorer
73
+ */
74
+ _this.onIssueSelected = null;
75
+
76
+ /**
77
+ * Callback for issue pin selected
78
+ * @memberof BimExplorer
79
+ */
80
+ _this.onPinSelected = null;
81
+
82
+ /**
83
+ * Callback for check alive message response
84
+ * @memberof BimExplorer
85
+ */
86
+ _this.onCheckAlive = null;
87
+
88
+ /**
89
+ * Callback for data loading finished
90
+ * @memberof BimExplorer
91
+ */
92
+ _this.onDataLoaded = null;
93
+
94
+ /**
95
+ * Callback for clicked hyperlink
96
+ * @memberof BimExplorer
97
+ */
98
+ _this.onClickedHyperlink = null;
99
+ return _this;
100
+ }
101
+
102
+ /**
103
+ * get the remote url of the Bim Portal
104
+ * @memberof BimExplorer
105
+ * @param {string} teamId Team id
106
+ * @param {string} projectId Project id
107
+ * @return {string} url to embedded bim explorer
108
+ */
109
+ _inherits(BimExplorer, _WebControl);
110
+ return _createClass(BimExplorer, [{
111
+ key: "getUrl",
112
+ value: function getUrl(teamId, projectId) {
113
+ var url = (this._env && this._env === "localhost" ? "http://127.0.0.1:4200/" : _UrlBuilder__WEBPACK_IMPORTED_MODULE_0__.UrlBuilder.url(this._env)) + "#/viewer" + _UrlBuilder__WEBPACK_IMPORTED_MODULE_0__.UrlBuilder.embedded + _UrlBuilder__WEBPACK_IMPORTED_MODULE_0__.UrlBuilder.token(this._token) + _UrlBuilder__WEBPACK_IMPORTED_MODULE_0__.UrlBuilder.client(this._client) + "&project_id=" + projectId + "&team_id=" + teamId;
114
+ return url;
115
+ }
116
+
117
+ /**
118
+ * Load the Bim Explorer into the bound iframe, loading the passed project
119
+ * @memberof BimExplorer
120
+ * @param {string} teamId Team id
121
+ * @param {string} projectId Project id
122
+ */
123
+ }, {
124
+ key: "load",
125
+ value: function load(teamId, projectId) {
126
+ var explorerUrl = this.getUrl(teamId, projectId);
127
+ this.loadIFrame(explorerUrl);
128
+ this.initMessageHandlers();
129
+ }
130
+
131
+ /**
132
+ * Registration of the message handlers - used internally
133
+ * @memberof BimExplorer
134
+ */
135
+ }, {
136
+ key: "initMessageHandlers",
137
+ value: function initMessageHandlers() {
138
+ var _this2 = this;
139
+ _get(_getPrototypeOf(BimExplorer.prototype), "initMessageHandlers", this).call(this);
140
+ this._client.addMessageHandler("PinSelected", function (msg) {
141
+ if (_this2.onPinSelected) {
142
+ _this2.onPinSelected(msg.id);
143
+ }
144
+ });
145
+ this._client.addMessageHandler("ObjectSelected", function (msg) {
146
+ if (_this2.onObjectSelected) {
147
+ _this2.onObjectSelected(msg.Id, msg.multiSelect, msg.selected);
148
+ }
149
+ });
150
+ this._client.addMessageHandler("ObjectsSelected", function (msg) {
151
+ if (_this2.onObjectsSelected) {
152
+ _this2.onObjectsSelected(msg.ids, msg.multiSelect, msg.selected);
153
+ }
154
+ });
155
+ this._client.addMessageHandler("IssueSelected", function (msg) {
156
+ if (_this2.onIssueSelected) {
157
+ _this2.onIssueSelected(msg.id);
158
+ }
159
+ });
160
+ this._client.addMessageHandler("CheckAlive", function (msg) {
161
+ if (_this2.onCheckAlive) {
162
+ _this2.onCheckAlive(msg.client);
163
+ }
164
+ });
165
+ this._client.addMessageHandler("DataLoaded", function () {
166
+ if (_this2.onDataLoaded) {
167
+ _this2.onDataLoaded();
168
+ }
169
+ });
170
+ this._client.addMessageHandler("ClickedHyperlink", function (msg) {
171
+ if (_this2.onClickedHyperlink) {
172
+ _this2.onClickedHyperlink(msg.url);
173
+ }
174
+ });
175
+ }
176
+
177
+ /**
178
+ * Reset the view
179
+ * @memberof BimExplorer
180
+ */
181
+ }, {
182
+ key: "resetView",
183
+ value: function resetView() {
184
+ this.sendMessage('ResetView');
185
+ }
186
+
187
+ /**
188
+ * Zoom to a given object
189
+ * @memberof BimExplorer
190
+ * @param {string} objectId Object to zoom to
191
+ * @param {boolean} flyTo Animated zoom or jump to object
192
+ */
193
+ }, {
194
+ key: "centerObject",
195
+ value: function centerObject(objectId, flyTo) {
196
+ this.sendMessage('CenterObject', {
197
+ id: objectId,
198
+ flyTo: flyTo
199
+ });
200
+ }
201
+
202
+ /**
203
+ * Select an issue pin
204
+ * @memberof BimExplorer
205
+ * @param {string} id Pin to select
206
+ */
207
+ }, {
208
+ key: "selectPin",
209
+ value: function selectPin(id) {
210
+ this.sendMessage('PinSelected', {
211
+ id: id
212
+ });
213
+ }
214
+
215
+ /**
216
+ * Select objects
217
+ * @memberof BimExplorer
218
+ * @param {Array} ids Ids of the objects to select
219
+ * @param {boolean} multiSelect Switch on/off multiselect mode (simulate ctrl-key)
220
+ * @param {boolean} isolate Isolate the selected objects
221
+ * @param {boolean} blockProperties Disable the opening of the object properties panel
222
+ */
223
+ }, {
224
+ key: "selectObjects",
225
+ value: function selectObjects(ids, multiSelect, isolate, blockProperties) {
226
+ this.sendMessage('ObjectsSelected', {
227
+ ids: ids,
228
+ multiSelect: multiSelect,
229
+ isolate: isolate,
230
+ blockProperties: blockProperties
231
+ });
232
+ }
233
+
234
+ /**
235
+ * Isolate objects
236
+ * @memberof BimExplorer
237
+ * @param {Array} ids Ids of the objects to isolate
238
+ */
239
+ }, {
240
+ key: "isolateObjects",
241
+ value: function isolateObjects(ids) {
242
+ this.sendMessage('ObjectsIsolated', {
243
+ ids: ids
244
+ });
245
+ }
246
+
247
+ /**
248
+ * Check if Explorer is connected and alive
249
+ * @memberof BimExplorer
250
+ */
251
+ }, {
252
+ key: "checkAlive",
253
+ value: function checkAlive() {
254
+ this.sendMessage('CheckAlive', {});
255
+ }
256
+
257
+ /**
258
+ * Select an exsisting structure
259
+ * @memberof BimExplorer
260
+ * @param {string} id Id of the structure
261
+ * @param {Array} visibleNodes Array of the visible node ids
262
+ * @param {boolean} showAll Set all nodes to visible
263
+ * @param {boolean} expandAll Expand the entire structure tree
264
+ * @param {boolean} hideUnreferencedTopology Hide all objects which are not assigned to the structure
265
+ * @param {boolean} isolate Switch on isolation mode for the visible assigned structure objects
266
+ */
267
+ }, {
268
+ key: "selectStructure",
269
+ value: function selectStructure(id, visibleNodes, showAll, expandAll, hideUnreferencedTopology, isolate) {
270
+ this.sendMessage('StructureSelected', {
271
+ id: id,
272
+ visibleNodes: visibleNodes,
273
+ showAll: showAll,
274
+ expandAll: expandAll,
275
+ hideUnreferencedTopology: hideUnreferencedTopology,
276
+ isolate: isolate
277
+ });
278
+ }
279
+
280
+ /**
281
+ * Select issue
282
+ * @memberof BimExplorer
283
+ * @param {string} id Id of the issue to select
284
+ */
285
+ }, {
286
+ key: "selectIssue",
287
+ value: function selectIssue(id) {
288
+ this.sendMessage('IssueSelected', {
289
+ id: id
290
+ });
291
+ }
292
+
293
+ /**
294
+ * Colorize objects
295
+ * @memberof BimExplorer
296
+ * @param {Array} ids Ids of the objects to isolate
297
+ * @param {string} color RGB css color code string
298
+ */
299
+ }, {
300
+ key: "colorizeObjects",
301
+ value: function colorizeObjects(ids, color) {
302
+ this.sendMessage('ColorizeObjects', {
303
+ ids: ids,
304
+ color: color
305
+ });
306
+ }
307
+ }]);
308
+ }(_WebControl__WEBPACK_IMPORTED_MODULE_1__.WebControl);
309
+
310
+ /***/ }),
311
+
312
+ /***/ "./src/BimFilesIsoSelect.js":
313
+ /*!**********************************!*\
314
+ !*** ./src/BimFilesIsoSelect.js ***!
315
+ \**********************************/
316
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
317
+
318
+ __webpack_require__.r(__webpack_exports__);
319
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
320
+ /* harmony export */ BimFilesIsoSelect: () => (/* binding */ BimFilesIsoSelect)
321
+ /* harmony export */ });
322
+ /* harmony import */ var _UrlBuilder__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./UrlBuilder */ "./src/UrlBuilder.js");
323
+ /* harmony import */ var _WebControl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./WebControl */ "./src/WebControl.js");
324
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
325
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
326
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
327
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
328
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
329
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
330
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
331
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
332
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
333
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
334
+ function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
335
+ function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
336
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
337
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
338
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
339
+
340
+
341
+
342
+ /**
343
+ * @namespace BimFilesIsoSelect
344
+ * @param {string} domId DOM Element Id of the containing iframe
345
+ * @param {string} token a valid bimplus accesstoken
346
+ * @param {Object} client The external client to connect with
347
+ * @param {string} env environment to use: dev, stage or prod
348
+ */
349
+ var BimFilesIsoSelect = /*#__PURE__*/function (_WebControl) {
350
+ function BimFilesIsoSelect(domId, token, client, env) {
351
+ var _this;
352
+ _classCallCheck(this, BimFilesIsoSelect);
353
+ _this = _callSuper(this, BimFilesIsoSelect, [domId, client, env, token]);
354
+
355
+ /**
356
+ * Callback for attachment selected
357
+ * @memberof BimFilesIsoSelect
358
+ */
359
+ _this.onAttachmentSelected = null;
360
+
361
+ /**
362
+ * Callback for attachment selected with all details
363
+ * @memberof BimFilesIsoSelect
364
+ */
365
+ _this.onAttachmentSelectedDetails = null;
366
+ return _this;
367
+ }
368
+
369
+ /**
370
+ * get the remote url of the Documents module
371
+ * @memberof BimFilesIsoSelect
372
+ * @param {string} teamSlug Team slug
373
+ * @param {string} projectId Project id
374
+ * @param {string} baseUrl url which will be used instead of url computed by internal logic
375
+ * @return {string} url to documents module
376
+ */
377
+ _inherits(BimFilesIsoSelect, _WebControl);
378
+ return _createClass(BimFilesIsoSelect, [{
379
+ key: "getUrl",
380
+ value: function getUrl(teamSlug, projectId, baseUrl) {
381
+ var url = baseUrl || _UrlBuilder__WEBPACK_IMPORTED_MODULE_0__.UrlBuilder.url(this._env);
382
+ url += _UrlBuilder__WEBPACK_IMPORTED_MODULE_0__.UrlBuilder.embedded + _UrlBuilder__WEBPACK_IMPORTED_MODULE_0__.UrlBuilder.token(this._token) + _UrlBuilder__WEBPACK_IMPORTED_MODULE_0__.UrlBuilder.client(this._client) + "/#/project/" + teamSlug + "/" + projectId + "/files/isoselect";
383
+ return url;
384
+ }
385
+
386
+ /**
387
+ * Load the Documents module into the bound iframe, loading the passed project
388
+ * @memberof BimFilesIsoSelect
389
+ * @param {string} teamSlug Team slug
390
+ * @param {string} projectId Project id
391
+ */
392
+ }, {
393
+ key: "load",
394
+ value: function load(teamSlug, projectId, baseUrl) {
395
+ var iframeUrl = this.getUrl(teamSlug, projectId, baseUrl);
396
+ this.loadIFrame(iframeUrl);
397
+ this.initMessageHandlers();
398
+ }
399
+ }, {
400
+ key: "initMessageHandlers",
401
+ value: function initMessageHandlers() {
402
+ var _this2 = this;
403
+ _get(_getPrototypeOf(BimFilesIsoSelect.prototype), "initMessageHandlers", this).call(this);
404
+
405
+ // Add message handler for attachment selected event
406
+ this._client.addMessageHandler("AttachmentSelected", function (msg) {
407
+ if (_this2.onAttachmentSelected) {
408
+ _this2.onAttachmentSelected(msg !== null && msg !== void 0 && msg.id ? msg.id : msg);
409
+ }
410
+ });
411
+
412
+ // Add message handler for attachment selected details event
413
+ this._client.addMessageHandler("AttachmentSelectedDetails", function (msg) {
414
+ if (_this2.onAttachmentSelectedDetails) {
415
+ _this2.onAttachmentSelectedDetails(msg !== null && msg !== void 0 && msg.id ? msg.id : msg);
416
+ }
417
+ });
418
+ }
419
+ }]);
420
+ }(_WebControl__WEBPACK_IMPORTED_MODULE_1__.WebControl);
421
+
422
+ /***/ }),
423
+
424
+ /***/ "./src/BimFilesOverlaySelect.js":
425
+ /*!**************************************!*\
426
+ !*** ./src/BimFilesOverlaySelect.js ***!
427
+ \**************************************/
428
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
429
+
430
+ __webpack_require__.r(__webpack_exports__);
431
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
432
+ /* harmony export */ BimFilesOverlaySelect: () => (/* binding */ BimFilesOverlaySelect)
433
+ /* harmony export */ });
434
+ /* harmony import */ var _UrlBuilder__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./UrlBuilder */ "./src/UrlBuilder.js");
435
+ /* harmony import */ var _WebControl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./WebControl */ "./src/WebControl.js");
436
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
437
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
438
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
439
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
440
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
441
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
442
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
443
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
444
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
445
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
446
+ function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
447
+ function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
448
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
449
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
450
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
451
+
452
+
453
+
454
+ /**
455
+ * @namespace BimFilesOverlaySelect
456
+ * @param {string} domId DOM Element Id of the containing iframe
457
+ * @param {string} token a valid bimplus accesstoken
458
+ * @param {Object} client The external client to connect with
459
+ * @param {string} env environment to use: dev, stage or prod
460
+ */
461
+ var BimFilesOverlaySelect = /*#__PURE__*/function (_WebControl) {
462
+ function BimFilesOverlaySelect(domId, token, client, env) {
463
+ var _this;
464
+ _classCallCheck(this, BimFilesOverlaySelect);
465
+ _this = _callSuper(this, BimFilesOverlaySelect, [domId, client, env, token]);
466
+
467
+ /**
468
+ * Callback for attachment selected
469
+ * @memberof BimFilesOverlaySelect
470
+ */
471
+ _this.onAttachmentSelected = null;
472
+
473
+ /**
474
+ * Callback for attachment selected with all details
475
+ * @memberof BimFilesOverlaySelect
476
+ */
477
+ _this.onAttachmentSelectedDetails = null;
478
+ return _this;
479
+ }
480
+
481
+ /**
482
+ * get the remote url of the Documents module
483
+ * @memberof BimFilesOverlaySelect
484
+ * @param {string} teamSlug Team slug
485
+ * @param {string} projectId Project id
486
+ * @return {string} url to documents module
487
+ */
488
+ _inherits(BimFilesOverlaySelect, _WebControl);
489
+ return _createClass(BimFilesOverlaySelect, [{
490
+ key: "getUrl",
491
+ value: function getUrl(teamSlug, projectId) {
492
+ var url = _UrlBuilder__WEBPACK_IMPORTED_MODULE_0__.UrlBuilder.url(this._env);
493
+ url += _UrlBuilder__WEBPACK_IMPORTED_MODULE_0__.UrlBuilder.embedded + _UrlBuilder__WEBPACK_IMPORTED_MODULE_0__.UrlBuilder.token(this._token) + _UrlBuilder__WEBPACK_IMPORTED_MODULE_0__.UrlBuilder.client(this._client) + "/#/project/" + teamSlug + "/" + projectId + "/files/overlayselect";
494
+ return url;
495
+ }
496
+
497
+ /**
498
+ * Load the Documents module into the bound iframe, loading the passed project
499
+ * @memberof BimFilesOverlaySelect
500
+ * @param {string} teamSlug Team slug
501
+ * @param {string} projectId Project id
502
+ */
503
+ }, {
504
+ key: "load",
505
+ value: function load(teamSlug, projectId) {
506
+ var iframeUrl = this.getUrl(teamSlug, projectId);
507
+ this.loadIFrame(iframeUrl);
508
+ this.initMessageHandlers();
509
+ }
510
+ }, {
511
+ key: "initMessageHandlers",
512
+ value: function initMessageHandlers() {
513
+ var _this2 = this;
514
+ _get(_getPrototypeOf(BimFilesOverlaySelect.prototype), "initMessageHandlers", this).call(this);
515
+
516
+ // Add message handler for attachment selected event
517
+ this._client.addMessageHandler("AttachmentSelected", function (msg) {
518
+ if (_this2.onAttachmentSelected) {
519
+ _this2.onAttachmentSelected(msg !== null && msg !== void 0 && msg.id ? msg.id : msg);
520
+ }
521
+ });
522
+
523
+ // Add message handler for attachment selected details event
524
+ this._client.addMessageHandler("AttachmentSelectedDetails", function (msg) {
525
+ if (_this2.onAttachmentSelectedDetails) {
526
+ _this2.onAttachmentSelectedDetails(msg !== null && msg !== void 0 && msg.id ? msg.id : msg);
527
+ }
528
+ });
529
+ }
530
+ }]);
531
+ }(_WebControl__WEBPACK_IMPORTED_MODULE_1__.WebControl);
532
+
533
+ /***/ }),
534
+
535
+ /***/ "./src/BimFilesSelect.js":
536
+ /*!*******************************!*\
537
+ !*** ./src/BimFilesSelect.js ***!
538
+ \*******************************/
539
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
540
+
541
+ __webpack_require__.r(__webpack_exports__);
542
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
543
+ /* harmony export */ BimFilesSelect: () => (/* binding */ BimFilesSelect)
544
+ /* harmony export */ });
545
+ /* harmony import */ var _UrlBuilder__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./UrlBuilder */ "./src/UrlBuilder.js");
546
+ /* harmony import */ var _WebControl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./WebControl */ "./src/WebControl.js");
547
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
548
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
549
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
550
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
551
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
552
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
553
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
554
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
555
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
556
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
557
+ function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
558
+ function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
559
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
560
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
561
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
562
+
563
+
564
+
565
+ /**
566
+ * @namespace BimFilesSelect
567
+ * @param {string} domId DOM Element Id of the containing iframe
568
+ * @param {string} token a valid bimplus accesstoken
569
+ * @param {Object} client The external client to connect with
570
+ * @param {string} env environment to use: dev, stage or prod
571
+ */
572
+ var BimFilesSelect = /*#__PURE__*/function (_WebControl) {
573
+ function BimFilesSelect(domId, token, client, env) {
574
+ var _this;
575
+ _classCallCheck(this, BimFilesSelect);
576
+ _this = _callSuper(this, BimFilesSelect, [domId, client, env, token]);
577
+
578
+ /**
579
+ * Callback for attachment selected
580
+ * @memberof BimFilesSelect
581
+ */
582
+ _this.onAttachmentSelected = null;
583
+
584
+ /**
585
+ * Callback for attachment selected with all details
586
+ * @memberof BimFilesSelect
587
+ */
588
+ _this.onAttachmentSelectedDetails = null;
589
+ return _this;
590
+ }
591
+
592
+ /**
593
+ * get the remote url of the Documents module
594
+ * @memberof BimFilesSelect
595
+ * @param {string} teamSlug Team slug
596
+ * @param {string} projectId Project id
597
+ * @return {string} url to documents module
598
+ */
599
+ _inherits(BimFilesSelect, _WebControl);
600
+ return _createClass(BimFilesSelect, [{
601
+ key: "getUrl",
602
+ value: function getUrl(teamSlug, projectId) {
603
+ var url = _UrlBuilder__WEBPACK_IMPORTED_MODULE_0__.UrlBuilder.url(this._env);
604
+ url += _UrlBuilder__WEBPACK_IMPORTED_MODULE_0__.UrlBuilder.embedded + _UrlBuilder__WEBPACK_IMPORTED_MODULE_0__.UrlBuilder.token(this._token) + _UrlBuilder__WEBPACK_IMPORTED_MODULE_0__.UrlBuilder.client(this._client) + "/#/project/" + teamSlug + "/" + projectId + "/files/select";
605
+ return url;
606
+ }
607
+
608
+ /**
609
+ * Load the Documents module into the bound iframe, loading the passed project
610
+ * @memberof BimFilesSelect
611
+ * @param {string} teamSlug Team slug
612
+ * @param {string} projectId Project id
613
+ */
614
+ }, {
615
+ key: "load",
616
+ value: function load(teamSlug, projectId) {
617
+ var iframeUrl = this.getUrl(teamSlug, projectId);
618
+ this.loadIFrame(iframeUrl);
619
+ this.initMessageHandlers();
620
+ }
621
+ }, {
622
+ key: "initMessageHandlers",
623
+ value: function initMessageHandlers() {
624
+ var _this2 = this;
625
+ _get(_getPrototypeOf(BimFilesSelect.prototype), "initMessageHandlers", this).call(this);
626
+
627
+ // Add message handler for attachment selected event
628
+ this._client.addMessageHandler("AttachmentSelected", function (msg) {
629
+ if (_this2.onAttachmentSelected) {
630
+ _this2.onAttachmentSelected(msg !== null && msg !== void 0 && msg.id ? msg.id : msg);
631
+ }
632
+ });
633
+
634
+ // Add message handler for attachment selected details event
635
+ this._client.addMessageHandler("AttachmentSelectedDetails", function (msg) {
636
+ if (_this2.onAttachmentSelectedDetails) {
637
+ _this2.onAttachmentSelectedDetails(msg !== null && msg !== void 0 && msg.id ? msg.id : msg);
638
+ }
639
+ });
640
+ }
641
+ }]);
642
+ }(_WebControl__WEBPACK_IMPORTED_MODULE_1__.WebControl);
643
+
644
+ /***/ }),
645
+
646
+ /***/ "./src/BimModelsIsoSelect.js":
647
+ /*!***********************************!*\
648
+ !*** ./src/BimModelsIsoSelect.js ***!
649
+ \***********************************/
650
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
651
+
652
+ __webpack_require__.r(__webpack_exports__);
653
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
654
+ /* harmony export */ BimModelsIsoSelect: () => (/* binding */ BimModelsIsoSelect)
655
+ /* harmony export */ });
656
+ /* harmony import */ var _UrlBuilder__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./UrlBuilder */ "./src/UrlBuilder.js");
657
+ /* harmony import */ var _WebControl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./WebControl */ "./src/WebControl.js");
658
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
659
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
660
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
661
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
662
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
663
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
664
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
665
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
666
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
667
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
668
+ function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
669
+ function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
670
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
671
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
672
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
673
+
674
+
675
+
676
+ /**
677
+ * @namespace BimModelsIsoSelect
678
+ * @param {string} domId DOM Element Id of the containing iframe
679
+ * @param {string} token a valid bimplus accesstoken
680
+ * @param {Object} client The external client to connect with
681
+ * @param {string} env environment to use: dev, stage or prod
682
+ */
683
+ var BimModelsIsoSelect = /*#__PURE__*/function (_WebControl) {
684
+ function BimModelsIsoSelect(domId, token, client, env) {
685
+ var _this;
686
+ _classCallCheck(this, BimModelsIsoSelect);
687
+ _this = _callSuper(this, BimModelsIsoSelect, [domId, client, env, token]);
688
+
689
+ /**
690
+ * Callback for model selected
691
+ * @memberof BimModelsIsoSelect
692
+ */
693
+ _this.onModelSelected = null;
694
+
695
+ /**
696
+ * Callback for model selected with all details
697
+ * @memberof BimModelsIsoSelect
698
+ */
699
+ _this.onModelSelectedDetails = null;
700
+ return _this;
701
+ }
702
+
703
+ /**
704
+ * get the remote url of the Models module
705
+ * @memberof BimModelsIsoSelect
706
+ * @param {string} teamSlug Team slug
707
+ * @param {string} projectId Project id
708
+ * @param {string} baseUrl url which will be used instead of url computed by internal logic
709
+ * @return {string} url to models module
710
+ */
711
+ _inherits(BimModelsIsoSelect, _WebControl);
712
+ return _createClass(BimModelsIsoSelect, [{
713
+ key: "getUrl",
714
+ value: function getUrl(teamSlug, projectId, baseUrl) {
715
+ var url = baseUrl || _UrlBuilder__WEBPACK_IMPORTED_MODULE_0__.UrlBuilder.url(this._env);
716
+ url += _UrlBuilder__WEBPACK_IMPORTED_MODULE_0__.UrlBuilder.embedded + _UrlBuilder__WEBPACK_IMPORTED_MODULE_0__.UrlBuilder.token(this._token) + _UrlBuilder__WEBPACK_IMPORTED_MODULE_0__.UrlBuilder.client(this._client) + "/#/project/" + teamSlug + "/" + projectId + "/models/isoselect";
717
+ return url;
718
+ }
719
+
720
+ /**
721
+ * Load the Models module into the bound iframe, loading the passed project
722
+ * @memberof BimModelsIsoSelect
723
+ * @param {string} teamSlug Team slug
724
+ * @param {string} projectId Project id
725
+ */
726
+ }, {
727
+ key: "load",
728
+ value: function load(teamSlug, projectId, baseUrl) {
729
+ var iframeUrl = this.getUrl(teamSlug, projectId, baseUrl);
730
+ this.loadIFrame(iframeUrl);
731
+ this.initMessageHandlers();
732
+ }
733
+ }, {
734
+ key: "initMessageHandlers",
735
+ value: function initMessageHandlers() {
736
+ var _this2 = this;
737
+ _get(_getPrototypeOf(BimModelsIsoSelect.prototype), "initMessageHandlers", this).call(this);
738
+
739
+ // Add message handler for model selected event
740
+ this._client.addMessageHandler("ModelSelected", function (msg) {
741
+ if (_this2.onModelSelected) {
742
+ _this2.onModelSelected(msg !== null && msg !== void 0 && msg.id ? msg.id : msg);
743
+ }
744
+ });
745
+
746
+ // Add message handler for model selected details event
747
+ this._client.addMessageHandler("ModelSelectedDetails", function (msg) {
748
+ if (_this2.onModelSelectedDetails) {
749
+ _this2.onModelSelectedDetails(msg !== null && msg !== void 0 && msg.id ? msg.id : msg);
750
+ }
751
+ });
752
+ }
753
+ }]);
754
+ }(_WebControl__WEBPACK_IMPORTED_MODULE_1__.WebControl);
755
+
756
+ /***/ }),
757
+
758
+ /***/ "./src/BimModelsSelect.js":
759
+ /*!********************************!*\
760
+ !*** ./src/BimModelsSelect.js ***!
761
+ \********************************/
762
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
763
+
764
+ __webpack_require__.r(__webpack_exports__);
765
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
766
+ /* harmony export */ BimModelsSelect: () => (/* binding */ BimModelsSelect)
767
+ /* harmony export */ });
768
+ /* harmony import */ var _UrlBuilder__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./UrlBuilder */ "./src/UrlBuilder.js");
769
+ /* harmony import */ var _WebControl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./WebControl */ "./src/WebControl.js");
770
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
771
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
772
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
773
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
774
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
775
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
776
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
777
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
778
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
779
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
780
+ function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
781
+ function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
782
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
783
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
784
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
785
+
786
+
787
+
788
+ /**
789
+ * @namespace BimModelsSelect
790
+ * @param {string} domId DOM Element Id of the containing iframe
791
+ * @param {string} token a valid bimplus accesstoken
792
+ * @param {Object} client The external client to connect with
793
+ * @param {string} env environment to use: dev, stage or prod
794
+ */
795
+ var BimModelsSelect = /*#__PURE__*/function (_WebControl) {
796
+ function BimModelsSelect(domId, token, client, env) {
797
+ var _this;
798
+ _classCallCheck(this, BimModelsSelect);
799
+ _this = _callSuper(this, BimModelsSelect, [domId, client, env, token]);
800
+
801
+ /**
802
+ * Callback for model selected
803
+ * @memberof BimModelsSelect
804
+ */
805
+ _this.onModelSelected = null;
806
+
807
+ /**
808
+ * Callback for model selected with all details
809
+ * @memberof BimModelsSelect
810
+ */
811
+ _this.onModelSelectedDetails = null;
812
+ return _this;
813
+ }
814
+
815
+ /**
816
+ * get the remote url of the Models module
817
+ * @memberof BimModelsSelect
818
+ * @param {string} teamSlug Team slug
819
+ * @param {string} projectId Project id
820
+ * @return {string} url to models module
821
+ */
822
+ _inherits(BimModelsSelect, _WebControl);
823
+ return _createClass(BimModelsSelect, [{
824
+ key: "getUrl",
825
+ value: function getUrl(teamSlug, projectId) {
826
+ var url = _UrlBuilder__WEBPACK_IMPORTED_MODULE_0__.UrlBuilder.url(this._env);
827
+ url += _UrlBuilder__WEBPACK_IMPORTED_MODULE_0__.UrlBuilder.embedded + _UrlBuilder__WEBPACK_IMPORTED_MODULE_0__.UrlBuilder.token(this._token) + _UrlBuilder__WEBPACK_IMPORTED_MODULE_0__.UrlBuilder.client(this._client) + "/#/project/" + teamSlug + "/" + projectId + "/models/select";
828
+ return url;
829
+ }
830
+
831
+ /**
832
+ * Load the Models module into the bound iframe, loading the passed project
833
+ * @memberof BimModelsSelect
834
+ * @param {string} teamSlug Team slug
835
+ * @param {string} projectId Project id
836
+ */
837
+ }, {
838
+ key: "load",
839
+ value: function load(teamSlug, projectId) {
840
+ var iframeUrl = this.getUrl(teamSlug, projectId);
841
+ this.loadIFrame(iframeUrl);
842
+ this.initMessageHandlers();
843
+ }
844
+ }, {
845
+ key: "initMessageHandlers",
846
+ value: function initMessageHandlers() {
847
+ var _this2 = this;
848
+ _get(_getPrototypeOf(BimModelsSelect.prototype), "initMessageHandlers", this).call(this);
849
+
850
+ // Add message handler for model selected event
851
+ this._client.addMessageHandler("ModelSelected", function (msg) {
852
+ if (_this2.onModelSelected) {
853
+ _this2.onModelSelected(msg !== null && msg !== void 0 && msg.id ? msg.id : msg);
854
+ }
855
+ });
856
+
857
+ // Add message handler for model selected details event
858
+ this._client.addMessageHandler("ModelSelectedDetails", function (msg) {
859
+ if (_this2.onModelSelectedDetails) {
860
+ _this2.onModelSelectedDetails(msg !== null && msg !== void 0 && msg.id ? msg.id : msg);
861
+ }
862
+ });
863
+ }
864
+ }]);
865
+ }(_WebControl__WEBPACK_IMPORTED_MODULE_1__.WebControl);
866
+
867
+ /***/ }),
868
+
869
+ /***/ "./src/BimObjectProperties.js":
870
+ /*!************************************!*\
871
+ !*** ./src/BimObjectProperties.js ***!
872
+ \************************************/
873
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
874
+
875
+ __webpack_require__.r(__webpack_exports__);
876
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
877
+ /* harmony export */ BimObjectProperties: () => (/* binding */ BimObjectProperties)
878
+ /* harmony export */ });
879
+ /* harmony import */ var _UrlBuilder__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./UrlBuilder */ "./src/UrlBuilder.js");
880
+ /* harmony import */ var _WebControl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./WebControl */ "./src/WebControl.js");
881
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
882
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
883
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
884
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
885
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
886
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
887
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
888
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
889
+ function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
890
+ function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
891
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
892
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
893
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
894
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
895
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
896
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
897
+
898
+
899
+
900
+ /**
901
+ * @namespace BimExplorer
902
+ * @param {string} domId DOM Element Id of the containing iframe
903
+ * @param {string} token a valid bimplus accesstoken
904
+ * @param {Object} client The external client to connect with
905
+ * @param {string} env environment to use: dev, stage or prod
906
+ */
907
+ var BimObjectProperties = /*#__PURE__*/function (_WebControl) {
908
+ function BimObjectProperties(domId, token, client, env) {
909
+ var _this;
910
+ _classCallCheck(this, BimObjectProperties);
911
+ _this = _callSuper(this, BimObjectProperties, [domId, client, env, token]);
912
+ /**
913
+ * get the remote url of the Bim Portal
914
+ * @memberof BimExplorer
915
+ * @param {string} teamId Team id
916
+ * @param {string} projectId Project id
917
+ * @return {string} url to embedded bim explorer
918
+ */
919
+ _defineProperty(_this, "getUrl", function (teamId, projectId, objectId) {
920
+ var url = _UrlBuilder__WEBPACK_IMPORTED_MODULE_0__.UrlBuilder.url(this._env);
921
+ url += "viewer/#/objproperties" + _UrlBuilder__WEBPACK_IMPORTED_MODULE_0__.UrlBuilder.embedded + _UrlBuilder__WEBPACK_IMPORTED_MODULE_0__.UrlBuilder.token(this._token) + _UrlBuilder__WEBPACK_IMPORTED_MODULE_0__.UrlBuilder.client(this._client) + "&project_id=" + projectId + "&team_id=" + teamId + "&object_id=" + objectId;
922
+ return url;
923
+ });
924
+ return _this;
925
+ }
926
+ _inherits(BimObjectProperties, _WebControl);
927
+ return _createClass(BimObjectProperties, [{
928
+ key: "load",
929
+ value:
930
+ /**
931
+ * Load the Object Properties into the bound iframe
932
+ * @memberof BimExplorer
933
+ * @param {string} teamId Team id
934
+ * @param {string} projectId Project id
935
+ * @param {string} objectId Object id
936
+ */
937
+ function load(teamId, projectId, objectId) {
938
+ var explorerUrl = this.getUrl(teamId, projectId, objectId);
939
+ this.loadIFrame(explorerUrl);
940
+ this.initMessageHandlers();
941
+ }
942
+ }, {
943
+ key: "initMessageHandlers",
944
+ value: function initMessageHandlers() {
945
+ _get(_getPrototypeOf(BimObjectProperties.prototype), "initMessageHandlers", this).call(this);
946
+ }
947
+ }]);
948
+ }(_WebControl__WEBPACK_IMPORTED_MODULE_1__.WebControl);
949
+
950
+ /***/ }),
951
+
952
+ /***/ "./src/BimPortal.js":
953
+ /*!**************************!*\
954
+ !*** ./src/BimPortal.js ***!
955
+ \**************************/
956
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
957
+
958
+ __webpack_require__.r(__webpack_exports__);
959
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
960
+ /* harmony export */ BimPortal: () => (/* binding */ BimPortal)
961
+ /* harmony export */ });
962
+ /* harmony import */ var _UrlBuilder__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./UrlBuilder */ "./src/UrlBuilder.js");
963
+ /* harmony import */ var _WebControl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./WebControl */ "./src/WebControl.js");
964
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
965
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
966
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
967
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
968
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
969
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
970
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
971
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
972
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
973
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
974
+ function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
975
+ function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
976
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
977
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
978
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
979
+
980
+
981
+
982
+ /**
983
+ * @namespace BimPortal
984
+ * @param {string} domId DOM Element Id of the containing iframe
985
+ * @param {string} token a valid bimplus accesstoken
986
+ * @param {Object} client The external client to connect with
987
+ * @param {string} env environment to use: dev, stage or prod
988
+ */
989
+ var BimPortal = /*#__PURE__*/function (_WebControl) {
990
+ function BimPortal(domId, token, client, env) {
991
+ var _this;
992
+ _classCallCheck(this, BimPortal);
993
+ _this = _callSuper(this, BimPortal, [domId, client, env, token]);
994
+
995
+ /**
996
+ * Callback for changed team
997
+ * @memberof BimPortal
998
+ */
999
+ _this.onTeamChanged = null;
1000
+
1001
+ /**
1002
+ * Callback for changed project
1003
+ * @memberof BimPortal
1004
+ */
1005
+ _this.onProjectSelected = null;
1006
+
1007
+ /**
1008
+ * Callback for attachment selected
1009
+ * @memberof BimPortal
1010
+ */
1011
+ _this.onAttachmentSelected = null;
1012
+
1013
+ /**
1014
+ * Callback for attachment selected with all details
1015
+ * @memberof BimPortal
1016
+ */
1017
+ _this.onAttachmentSelectedDetails = null;
1018
+ return _this;
1019
+ }
1020
+
1021
+ /**
1022
+ * get the remote url of the Bim Portal
1023
+ * @memberof BimPortal
1024
+ * @return {string} url to embedded bim portal
1025
+ */
1026
+ _inherits(BimPortal, _WebControl);
1027
+ return _createClass(BimPortal, [{
1028
+ key: "getUrl",
1029
+ value: function getUrl() {
1030
+ return _UrlBuilder__WEBPACK_IMPORTED_MODULE_0__.UrlBuilder.url(this._env) + _UrlBuilder__WEBPACK_IMPORTED_MODULE_0__.UrlBuilder.embedded + _UrlBuilder__WEBPACK_IMPORTED_MODULE_0__.UrlBuilder.token(this._token) + _UrlBuilder__WEBPACK_IMPORTED_MODULE_0__.UrlBuilder.client(this._client);
1031
+ }
1032
+
1033
+ /**
1034
+ * Load the Bim Portal into the bound iframe
1035
+ * @memberof BimPortal
1036
+ */
1037
+ }, {
1038
+ key: "load",
1039
+ value: function load() {
1040
+ var url = this.getUrl();
1041
+ this.loadIFrame(url);
1042
+ this.initMessageHandlers();
1043
+ }
1044
+ }, {
1045
+ key: "initMessageHandlers",
1046
+ value: function initMessageHandlers() {
1047
+ var _this2 = this;
1048
+ _get(_getPrototypeOf(BimPortal.prototype), "initMessageHandlers", this).call(this);
1049
+
1050
+ // Add message handler for team changed event
1051
+ this._client.addMessageHandler("TeamChanged", function (msg) {
1052
+ if (_this2.onTeamChanged) {
1053
+ _this2.onTeamChanged(msg.id);
1054
+ }
1055
+ });
1056
+
1057
+ // Add message handler for project selected event
1058
+ this._client.addMessageHandler("ProjectSelected", function (msg) {
1059
+ if (_this2.onProjectSelected) {
1060
+ _this2.onProjectSelected(msg.id);
1061
+ }
1062
+ });
1063
+
1064
+ // Add message handler for attachment selected event
1065
+ this._client.addMessageHandler("AttachmentSelected", function (msg) {
1066
+ if (_this2.onAttachmentSelected) {
1067
+ _this2.onAttachmentSelected(msg !== null && msg !== void 0 && msg.id ? msg.id : msg);
1068
+ }
1069
+ });
1070
+
1071
+ // Add message handler for attachment selected details event
1072
+ this._client.addMessageHandler("AttachmentSelectedDetails", function (msg) {
1073
+ if (_this2.onAttachmentSelectedDetails) {
1074
+ _this2.onAttachmentSelectedDetails(msg !== null && msg !== void 0 && msg.id ? msg.id : msg);
1075
+ }
1076
+ });
1077
+ }
1078
+ }]);
1079
+ }(_WebControl__WEBPACK_IMPORTED_MODULE_1__.WebControl);
1080
+
1081
+ /***/ }),
1082
+
1083
+ /***/ "./src/BimTaskList.js":
1084
+ /*!****************************!*\
1085
+ !*** ./src/BimTaskList.js ***!
1086
+ \****************************/
1087
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1088
+
1089
+ __webpack_require__.r(__webpack_exports__);
1090
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1091
+ /* harmony export */ BimTaskList: () => (/* binding */ BimTaskList)
1092
+ /* harmony export */ });
1093
+ /* harmony import */ var _UrlBuilder__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./UrlBuilder */ "./src/UrlBuilder.js");
1094
+ /* harmony import */ var _WebControl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./WebControl */ "./src/WebControl.js");
1095
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
1096
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1097
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
1098
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
1099
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
1100
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
1101
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
1102
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
1103
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
1104
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
1105
+ function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
1106
+ function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
1107
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
1108
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
1109
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
1110
+
1111
+
1112
+
1113
+ /**
1114
+ * @namespace BimTaskList
1115
+ * @param {string} domId DOM Element Id of the containing iframe
1116
+ * @param {string} token a valid bimplus accesstoken
1117
+ * @param {Object} client The external client to connect with
1118
+ * @param {string} env environment to use: dev, stage or prod
1119
+ */
1120
+ var BimTaskList = /*#__PURE__*/function (_WebControl) {
1121
+ function BimTaskList(domId, token, client, env) {
1122
+ var _this;
1123
+ _classCallCheck(this, BimTaskList);
1124
+ _this = _callSuper(this, BimTaskList, [domId, client, env, token]);
1125
+
1126
+ /**
1127
+ * Callback for object selected
1128
+ * @memberof BimTaskList
1129
+ */
1130
+ _this.onObjectSelected = null;
1131
+
1132
+ /**
1133
+ * Callback for multiple objects selected
1134
+ * @memberof BimTaskList
1135
+ */
1136
+ _this.onObjectsSelected = null;
1137
+
1138
+ /**
1139
+ * Callback for issue selected
1140
+ * @memberof BimTaskList
1141
+ */
1142
+ _this.onIssueSelected = null;
1143
+
1144
+ /**
1145
+ * Callback for check alive message response
1146
+ * @memberof BimTaskList
1147
+ */
1148
+ _this.onCheckAlive = null;
1149
+
1150
+ /**
1151
+ * Callback for data loading finished
1152
+ * @memberof BimTaskList
1153
+ */
1154
+ _this.onDataLoaded = null;
1155
+ return _this;
1156
+ }
1157
+
1158
+ /**
1159
+ * get the remote url of the task list control
1160
+ * @memberof BimTaskList
1161
+ * @param {string} teamId Team id
1162
+ * @param {string} projectId Project id
1163
+ * @param {string} source source identification / application id + version info
1164
+ * @return {string} url to embedded task list
1165
+ */
1166
+ _inherits(BimTaskList, _WebControl);
1167
+ return _createClass(BimTaskList, [{
1168
+ key: "getUrl",
1169
+ value: function getUrl(teamId, projectId, source) {
1170
+ var url = _UrlBuilder__WEBPACK_IMPORTED_MODULE_0__.UrlBuilder.url(this._env) + "viewer/" + _UrlBuilder__WEBPACK_IMPORTED_MODULE_0__.UrlBuilder.embedded + "&destination=EMBEDDED_ISSUE_LIST" + _UrlBuilder__WEBPACK_IMPORTED_MODULE_0__.UrlBuilder.source(source) + _UrlBuilder__WEBPACK_IMPORTED_MODULE_0__.UrlBuilder.token(this._token) + _UrlBuilder__WEBPACK_IMPORTED_MODULE_0__.UrlBuilder.client(this._client) + "/#/embeddedissuelist?project_id=" + projectId + "&team_id=" + teamId;
1171
+ return url;
1172
+ }
1173
+
1174
+ /**
1175
+ * Load the Bim TaskList into the bound iframe, loading the passed project
1176
+ * @memberof BimTaskList
1177
+ * @param {string} teamId Team id
1178
+ * @param {string} projectId Project id
1179
+ * @param {string} source source identification / application id + version info
1180
+ */
1181
+ }, {
1182
+ key: "load",
1183
+ value: function load(teamId, projectId, source) {
1184
+ var iframeUrl = this.getUrl(teamId, projectId, source);
1185
+ this.loadIFrame(iframeUrl);
1186
+ this.initMessageHandlers();
1187
+ }
1188
+ }, {
1189
+ key: "initMessageHandlers",
1190
+ value: function initMessageHandlers() {
1191
+ var _this2 = this;
1192
+ _get(_getPrototypeOf(BimTaskList.prototype), "initMessageHandlers", this).call(this);
1193
+ this._client.addMessageHandler("ObjectSelected", function (msg) {
1194
+ if (_this2.onObjectSelected) {
1195
+ _this2.onObjectSelected(msg.Id, msg.multiSelect, msg.selected);
1196
+ }
1197
+ });
1198
+ this._client.addMessageHandler("ObjectsSelected", function (msg) {
1199
+ if (_this2.onObjectsSelected) {
1200
+ _this2.onObjectsSelected(msg.ids, msg.multiSelect, msg.selected);
1201
+ }
1202
+ });
1203
+ this._client.addMessageHandler("IssueSelected", function (msg) {
1204
+ if (_this2.onIssueSelected) {
1205
+ _this2.onIssueSelected(msg.id);
1206
+ }
1207
+ });
1208
+ this._client.addMessageHandler("CheckAlive", function (msg) {
1209
+ if (_this2.onCheckAlive) {
1210
+ _this2.onCheckAlive(msg.client);
1211
+ }
1212
+ });
1213
+ this._client.addMessageHandler("DataLoaded", function () {
1214
+ if (_this2.onDataLoaded) {
1215
+ _this2.onDataLoaded();
1216
+ }
1217
+ });
1218
+ }
1219
+
1220
+ /**
1221
+ * Select objects
1222
+ * @memberof BimTaskList
1223
+ * @param {Array} ids Ids of the objects to select
1224
+ * @param {boolean} multiSelect Switch on/off multiselect mode (simulate ctrl-key)
1225
+ * @param {boolean} isolate Isolate the selected objects
1226
+ * @param {boolean} blockProperties Disable the opening of the object properties panel
1227
+ */
1228
+ }, {
1229
+ key: "selectObjects",
1230
+ value: function selectObjects(ids, multiSelect, isolate, blockProperties) {
1231
+ this.sendMessage('ObjectsSelected', {
1232
+ ids: ids,
1233
+ multiSelect: multiSelect,
1234
+ isolate: isolate,
1235
+ blockProperties: blockProperties
1236
+ });
1237
+ }
1238
+
1239
+ /**
1240
+ * Check if BimTaskList is connected and alive
1241
+ * @memberof BimTaskList
1242
+ */
1243
+ }, {
1244
+ key: "checkAlive",
1245
+ value: function checkAlive() {
1246
+ this.sendMessage('CheckAlive', {});
1247
+ }
1248
+
1249
+ /**
1250
+ * Select issue
1251
+ * @memberof BimTaskList
1252
+ * @param {string} id Id of the issue to select
1253
+ */
1254
+ }, {
1255
+ key: "selectIssue",
1256
+ value: function selectIssue(id) {
1257
+ this.sendMessage('IssueSelected', {
1258
+ id: id
1259
+ });
1260
+ }
1261
+ }]);
1262
+ }(_WebControl__WEBPACK_IMPORTED_MODULE_1__.WebControl);
1263
+
1264
+ /***/ }),
1265
+
1266
+ /***/ "./src/BimTaskProperties.js":
1267
+ /*!**********************************!*\
1268
+ !*** ./src/BimTaskProperties.js ***!
1269
+ \**********************************/
1270
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1271
+
1272
+ __webpack_require__.r(__webpack_exports__);
1273
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1274
+ /* harmony export */ BimTaskProperties: () => (/* binding */ BimTaskProperties)
1275
+ /* harmony export */ });
1276
+ /* harmony import */ var _UrlBuilder__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./UrlBuilder */ "./src/UrlBuilder.js");
1277
+ /* harmony import */ var _WebControl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./WebControl */ "./src/WebControl.js");
1278
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
1279
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1280
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
1281
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
1282
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
1283
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
1284
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
1285
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
1286
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
1287
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
1288
+ function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
1289
+ function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
1290
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
1291
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
1292
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
1293
+
1294
+
1295
+
1296
+ /**
1297
+ * @namespace BimTaskProperties
1298
+ * @param {string} domId DOM Element Id of the containing iframe
1299
+ * @param {string} token a valid bimplus accesstoken
1300
+ * @param {Object} client The external client to connect with
1301
+ * @param {string} env environment to use: dev, stage or prod
1302
+ */
1303
+ var BimTaskProperties = /*#__PURE__*/function (_WebControl) {
1304
+ function BimTaskProperties(domId, token, client, env) {
1305
+ var _this;
1306
+ _classCallCheck(this, BimTaskProperties);
1307
+ _this = _callSuper(this, BimTaskProperties, [domId, client, env, token]);
1308
+
1309
+ /**
1310
+ * Callback for object selected
1311
+ * @memberof BimTaskProperties
1312
+ */
1313
+ _this.onObjectSelected = null;
1314
+
1315
+ /**
1316
+ * Callback for multiple objects selected
1317
+ * @memberof BimTaskProperties
1318
+ */
1319
+ _this.onObjectsSelected = null;
1320
+
1321
+ /**
1322
+ * Callback for issue selected
1323
+ * @memberof BimTaskProperties
1324
+ */
1325
+ _this.onIssueSelected = null;
1326
+
1327
+ /**
1328
+ * Callback for issue pin selected
1329
+ * @memberof BimTaskProperties
1330
+ */
1331
+ _this.onPinSelected = null;
1332
+
1333
+ /**
1334
+ * Callback for check alive message response
1335
+ * @memberof BimTaskProperties
1336
+ */
1337
+ _this.onCheckAlive = null;
1338
+
1339
+ /**
1340
+ * Callback for data loading finished
1341
+ * @memberof BimTaskProperties
1342
+ */
1343
+ _this.onDataLoaded = null;
1344
+
1345
+ /**
1346
+ * Callback for clicked hyperlink
1347
+ * @memberof BimTaskProperties
1348
+ */
1349
+ _this.onClickedHyperlink = null;
1350
+ return _this;
1351
+ }
1352
+
1353
+ /**
1354
+ * get the remote url of the task properties control
1355
+ * @memberof BimTaskProperties
1356
+ * @param {string} teamId Team id
1357
+ * @param {string} projectId Project id
1358
+ * @param {string} issueId Task id
1359
+ * @param {string} source source identification / application id + version info
1360
+ * @return {string} url to embedded task properties
1361
+ */
1362
+ _inherits(BimTaskProperties, _WebControl);
1363
+ return _createClass(BimTaskProperties, [{
1364
+ key: "getUrl",
1365
+ value: function getUrl(teamId, projectId, issueId, source) {
1366
+ var url = _UrlBuilder__WEBPACK_IMPORTED_MODULE_0__.UrlBuilder.url(this._env) + "viewer/" + _UrlBuilder__WEBPACK_IMPORTED_MODULE_0__.UrlBuilder.embedded + "&destination=EMBEDDED_ISSUE" + _UrlBuilder__WEBPACK_IMPORTED_MODULE_0__.UrlBuilder.source(source) + _UrlBuilder__WEBPACK_IMPORTED_MODULE_0__.UrlBuilder.token(this._token) + _UrlBuilder__WEBPACK_IMPORTED_MODULE_0__.UrlBuilder.client(this._client) + "/#/embeddedissue?project_id=" + projectId + "&issue_id=" + issueId + "&team_id=" + teamId;
1367
+ return url;
1368
+ }
1369
+
1370
+ /**
1371
+ * Load the Bim TaskProperties into the bound iframe, loading the passed project
1372
+ * @memberof BimTaskProperties
1373
+ * @param {string} teamId Team id
1374
+ * @param {string} projectId Project id
1375
+ * @param {string} issueId Task id
1376
+ * @param {string} source source identification / application id + version info
1377
+ */
1378
+ }, {
1379
+ key: "load",
1380
+ value: function load(teamId, projectId, issueId, source) {
1381
+ var iframeUrl = this.getUrl(teamId, projectId, issueId, source);
1382
+ this.loadIFrame(iframeUrl);
1383
+ this.initMessageHandlers();
1384
+ }
1385
+ }, {
1386
+ key: "initMessageHandlers",
1387
+ value: function initMessageHandlers() {
1388
+ var _this2 = this;
1389
+ _get(_getPrototypeOf(BimTaskProperties.prototype), "initMessageHandlers", this).call(this);
1390
+ this._client.addMessageHandler("PinSelected", function (msg) {
1391
+ if (_this2.onPinSelected) {
1392
+ _this2.onPinSelected(msg.id);
1393
+ }
1394
+ });
1395
+ this._client.addMessageHandler("ObjectSelected", function (msg) {
1396
+ if (_this2.onObjectSelected) {
1397
+ _this2.onObjectSelected(msg.Id, msg.multiSelect, msg.selected);
1398
+ }
1399
+ });
1400
+ this._client.addMessageHandler("ObjectsSelected", function (msg) {
1401
+ if (_this2.onObjectsSelected) {
1402
+ _this2.onObjectsSelected(msg.ids, msg.multiSelect, msg.selected);
1403
+ }
1404
+ });
1405
+ this._client.addMessageHandler("IssueSelected", function (msg) {
1406
+ if (_this2.onIssueSelected) {
1407
+ _this2.onIssueSelected(msg.id);
1408
+ }
1409
+ });
1410
+ this._client.addMessageHandler("CheckAlive", function (msg) {
1411
+ if (_this2.onCheckAlive) {
1412
+ _this2.onCheckAlive(msg.client);
1413
+ }
1414
+ });
1415
+ this._client.addMessageHandler("DataLoaded", function () {
1416
+ if (_this2.onDataLoaded) {
1417
+ _this2.onDataLoaded();
1418
+ }
1419
+ });
1420
+ this._client.addMessageHandler("ClickedHyperlink", function (msg) {
1421
+ if (_this2.onClickedHyperlink) {
1422
+ _this2.onClickedHyperlink(msg.url);
1423
+ }
1424
+ });
1425
+ }
1426
+
1427
+ /**
1428
+ * Select an issue pin
1429
+ * @memberof BimTaskProperties
1430
+ * @param {string} id Pin to select
1431
+ */
1432
+ }, {
1433
+ key: "selectPin",
1434
+ value: function selectPin(id) {
1435
+ this.sendMessage('PinSelected', {
1436
+ id: id
1437
+ });
1438
+ }
1439
+
1440
+ /**
1441
+ * Select objects
1442
+ * @memberof BimTaskProperties
1443
+ * @param {Array} ids Ids of the objects to select
1444
+ * @param {boolean} multiSelect Switch on/off multiselect mode (simulate ctrl-key)
1445
+ * @param {boolean} isolate Isolate the selected objects
1446
+ * @param {boolean} blockProperties Disable the opening of the object properties panel
1447
+ */
1448
+ }, {
1449
+ key: "selectObjects",
1450
+ value: function selectObjects(ids, multiSelect, isolate, blockProperties) {
1451
+ this.sendMessage('ObjectsSelected', {
1452
+ ids: ids,
1453
+ multiSelect: multiSelect,
1454
+ isolate: isolate,
1455
+ blockProperties: blockProperties
1456
+ });
1457
+ }
1458
+
1459
+ /**
1460
+ * Check if BimTaskProperties is connected and alive
1461
+ * @memberof BimTaskProperties
1462
+ */
1463
+ }, {
1464
+ key: "checkAlive",
1465
+ value: function checkAlive() {
1466
+ this.sendMessage('CheckAlive', {});
1467
+ }
1468
+
1469
+ /**
1470
+ * Select issue
1471
+ * @memberof BimTaskProperties
1472
+ * @param {string} id Id of the issue to select
1473
+ */
1474
+ }, {
1475
+ key: "selectIssue",
1476
+ value: function selectIssue(id) {
1477
+ this.sendMessage('IssueSelected', {
1478
+ id: id
1479
+ });
1480
+ }
1481
+ }]);
1482
+ }(_WebControl__WEBPACK_IMPORTED_MODULE_1__.WebControl);
1483
+
1484
+ /***/ }),
1485
+
1486
+ /***/ "./src/ExportManager.js":
1487
+ /*!******************************!*\
1488
+ !*** ./src/ExportManager.js ***!
1489
+ \******************************/
1490
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1491
+
1492
+ __webpack_require__.r(__webpack_exports__);
1493
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1494
+ /* harmony export */ ExportManager: () => (/* binding */ ExportManager)
1495
+ /* harmony export */ });
1496
+ /* harmony import */ var _UrlBuilder__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./UrlBuilder */ "./src/UrlBuilder.js");
1497
+ /* harmony import */ var _BimExplorer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./BimExplorer */ "./src/BimExplorer.js");
1498
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
1499
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1500
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
1501
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
1502
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
1503
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
1504
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
1505
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
1506
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
1507
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
1508
+ function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
1509
+ function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
1510
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
1511
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
1512
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
1513
+
1514
+
1515
+
1516
+ /**
1517
+ * @namespace ExportManager
1518
+ * @param {string} domId DOM Element Id of the containing iframe
1519
+ * @param {string} token a valid bimplus accesstoken
1520
+ * @param {Object} client The external client to connect with
1521
+ * @param {string} env environment to use: dev, stage or prod
1522
+ */
1523
+ var ExportManager = /*#__PURE__*/function (_BimExplorer) {
1524
+ function ExportManager(domId, token, client, env) {
1525
+ var _this;
1526
+ _classCallCheck(this, ExportManager);
1527
+ _this = _callSuper(this, ExportManager, [domId, token, client, env]);
1528
+
1529
+ /**
1530
+ * Callback for started export
1531
+ * @memberof ExportManager
1532
+ */
1533
+ _this.onExportStarted = null;
1534
+ return _this;
1535
+ }
1536
+
1537
+ /**
1538
+ * get the remote url of the Export Manager
1539
+ * @memberof ExportManager
1540
+ * @param {string} teamId Team id
1541
+ * @param {string} projectId Project id
1542
+ * @return {string} url to embedded bim explorer
1543
+ */
1544
+ _inherits(ExportManager, _BimExplorer);
1545
+ return _createClass(ExportManager, [{
1546
+ key: "getUrl",
1547
+ value: function getUrl(teamId, projectId) {
1548
+ var url = this._env && this._env === "localhost" ? "http://127.0.0.1:4200/" : _UrlBuilder__WEBPACK_IMPORTED_MODULE_0__.UrlBuilder.url(this._env) + "export-manager/";
1549
+ url += "#/viewer" + _UrlBuilder__WEBPACK_IMPORTED_MODULE_0__.UrlBuilder.embedded + _UrlBuilder__WEBPACK_IMPORTED_MODULE_0__.UrlBuilder.token(this._token) + _UrlBuilder__WEBPACK_IMPORTED_MODULE_0__.UrlBuilder.client(this._client) + "&project_id=" + projectId + "&team_id=" + teamId;
1550
+ return url;
1551
+ }
1552
+ }, {
1553
+ key: "initMessageHandlers",
1554
+ value: function initMessageHandlers() {
1555
+ var _this2 = this;
1556
+ _get(_getPrototypeOf(ExportManager.prototype), "initMessageHandlers", this).call(this);
1557
+
1558
+ // Add message handler for object selected event
1559
+ this._client.addMessageHandler("ExportStarted", function (msg) {
1560
+ if (_this2.onExportStarted) {
1561
+ _this2.onExportStarted(msg.id);
1562
+ }
1563
+ });
1564
+ }
1565
+ }]);
1566
+ }(_BimExplorer__WEBPACK_IMPORTED_MODULE_1__.BimExplorer);
1567
+
1568
+ /***/ }),
1569
+
1570
+ /***/ "./src/ExternalClient.js":
1571
+ /*!*******************************!*\
1572
+ !*** ./src/ExternalClient.js ***!
1573
+ \*******************************/
1574
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1575
+
1576
+ __webpack_require__.r(__webpack_exports__);
1577
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1578
+ /* harmony export */ ExternalClient: () => (/* binding */ ExternalClient)
1579
+ /* harmony export */ });
1580
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
1581
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1582
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
1583
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
1584
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
1585
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
1586
+ /**
1587
+ * @namespace ExternalClient
1588
+ * @param {string} clientName client id
1589
+ */
1590
+ var ExternalClient = /*#__PURE__*/function () {
1591
+ function ExternalClient(clientName) {
1592
+ _classCallCheck(this, ExternalClient);
1593
+ this._messageHandlers = {};
1594
+ this._errorHandler = null;
1595
+ this._clientName = clientName;
1596
+ }
1597
+
1598
+ /**
1599
+ * initialize and start listening to incomming messages
1600
+ * @memberof ExternalClient
1601
+ */
1602
+ return _createClass(ExternalClient, [{
1603
+ key: "initialize",
1604
+ value: function initialize() {
1605
+ var self = this;
1606
+ console.log("ExternalClient initialized");
1607
+ window.addEventListener('message', function (e) {
1608
+ // Print info of message send by Renderer/Explorer
1609
+ // console.log(`ExternalClient received a message from origin: ${e.origin}\n data: ${e.data}`, e);
1610
+
1611
+ var data = e.data;
1612
+ if (data === "") {
1613
+ self.errorReceived({
1614
+ error: "External client got an empty message !"
1615
+ });
1616
+ } else {
1617
+ var parsed;
1618
+ try {
1619
+ parsed = JSON.parse(data);
1620
+ } catch (ex /* eslint-disable-line no-unused-vars */) {
1621
+ // This catch is called when Angular dev tool addon is used in browser
1622
+ // See ALBP-24692
1623
+ self.errorReceived({
1624
+ error: "External client got an invalid message json payload !"
1625
+ });
1626
+ return;
1627
+ }
1628
+ self.messageReceived(parsed);
1629
+ }
1630
+ });
1631
+ }
1632
+
1633
+ /**
1634
+ * add a message handler
1635
+ * @memberof ExternalClient
1636
+ * @param {string} message message id
1637
+ * @param {function} handler handler function
1638
+ */
1639
+ }, {
1640
+ key: "addMessageHandler",
1641
+ value: function addMessageHandler(message, handler) {
1642
+ this._messageHandlers[message] = handler;
1643
+ }
1644
+
1645
+ /**
1646
+ * remove a message handler
1647
+ * @memberof ExternalClient
1648
+ * @param {string} message message id
1649
+ */
1650
+ }, {
1651
+ key: "removeMessageHandler",
1652
+ value: function removeMessageHandler(message) {
1653
+ delete this._messageHandlers[message];
1654
+ }
1655
+
1656
+ /**
1657
+ * Handle a received messages
1658
+ * @memberof ExternalClient
1659
+ * @param {Object} message message object
1660
+ */
1661
+ }, {
1662
+ key: "messageReceived",
1663
+ value: function messageReceived(message) {
1664
+ var handler = this._messageHandlers[message.message];
1665
+ if (handler) {
1666
+ handler(message.data);
1667
+ }
1668
+ }
1669
+
1670
+ /**
1671
+ * add an error handler
1672
+ * @memberof ExternalClient
1673
+ * @param {function} handler handler function
1674
+ */
1675
+ }, {
1676
+ key: "addErrorHandler",
1677
+ value: function addErrorHandler(handler) {
1678
+ this._errorHandler = handler;
1679
+ }
1680
+
1681
+ /**
1682
+ * remove error handler
1683
+ * @memberof ExternalClient
1684
+ */
1685
+ }, {
1686
+ key: "removeErrorHandler",
1687
+ value: function removeErrorHandler() {
1688
+ this._errorHandler = null;
1689
+ }
1690
+
1691
+ /**
1692
+ * Handle a received messages
1693
+ * @memberof ExternalClient
1694
+ * @param {Object} error error object
1695
+ */
1696
+ }, {
1697
+ key: "errorReceived",
1698
+ value: function errorReceived(error) {
1699
+ var handler = this._errorHandler;
1700
+ if (handler) {
1701
+ handler(error);
1702
+ }
1703
+ }
1704
+
1705
+ /**
1706
+ * Send a message to bimplus web application
1707
+ * @memberof ExternalClient
1708
+ * @param {string} elemId DOM Element Id of the containing iframe
1709
+ * @param {string} message Message name
1710
+ * @param {Object} data message data
1711
+ */
1712
+ }, {
1713
+ key: "sendMessage",
1714
+ value: function sendMessage(elemId, message, data) {
1715
+ var elem = document.getElementById(elemId);
1716
+ if (elem !== null && elem !== void 0 && elem.contentWindow) {
1717
+ // SendMessage called for origin
1718
+ // console.log (`ExternalClient post message:${message} origin: ${window.location.origin}`);
1719
+
1720
+ elem.contentWindow.postMessage(JSON.stringify({
1721
+ messageType: 'bimplusMessageIn',
1722
+ message: message,
1723
+ data: data
1724
+ }), "*");
1725
+ return true;
1726
+ }
1727
+ return false;
1728
+ }
1729
+
1730
+ /**
1731
+ * get the client id
1732
+ * @memberof ExternalClient
1733
+ * @return {string} connected client id
1734
+ */
1735
+ }, {
1736
+ key: "getClientName",
1737
+ value: function getClientName() {
1738
+ return this._clientName;
1739
+ }
1740
+ }]);
1741
+ }();
1742
+
1743
+ /***/ }),
1744
+
1745
+ /***/ "./src/ModelViewer.js":
1746
+ /*!****************************!*\
1747
+ !*** ./src/ModelViewer.js ***!
1748
+ \****************************/
1749
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1750
+
1751
+ __webpack_require__.r(__webpack_exports__);
1752
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1753
+ /* harmony export */ ModelViewer: () => (/* binding */ ModelViewer)
1754
+ /* harmony export */ });
1755
+ /* harmony import */ var _UrlBuilder__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./UrlBuilder */ "./src/UrlBuilder.js");
1756
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
1757
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1758
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
1759
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
1760
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
1761
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
1762
+
1763
+ var modelViewerPath = '/viewer/#/modelviewer';
1764
+
1765
+ /**
1766
+ * @namespace ModelViewer
1767
+ * @param {string} env environment to use: dev, stage or prod. Default points to prod. If another string is detected it is interpreted as url for the model viewer
1768
+ */
1769
+ var ModelViewer = /*#__PURE__*/function () {
1770
+ function ModelViewer(env) {
1771
+ _classCallCheck(this, ModelViewer);
1772
+ if (!env || env === 'dev' || env === 'stage' || env === 'prod') {
1773
+ this.viewerUri = _UrlBuilder__WEBPACK_IMPORTED_MODULE_0__.UrlBuilder.url(env) + modelViewerPath;
1774
+ } else {
1775
+ this.viewerUri = env;
1776
+ }
1777
+ }
1778
+
1779
+ /**
1780
+ * Opens an model preview window for a file defined by an accessible URI
1781
+ *
1782
+ * @param {string} fileUri Uri of the ifc file
1783
+ * @param {string} target browser tab target
1784
+ * @param {string} teamId Optional Bimplus team id
1785
+ * @param {string} projectId Optional Bimplus project id
1786
+ * @returns {window} Preview window
1787
+ */
1788
+ return _createClass(ModelViewer, [{
1789
+ key: "openFileUriWindow",
1790
+ value: function openFileUriWindow(fileUri, target, teamId, projectId) {
1791
+ var params = '';
1792
+ params = _UrlBuilder__WEBPACK_IMPORTED_MODULE_0__.UrlBuilder.addParameters(params, {
1793
+ 'fileUri': encodeURIComponent(fileUri),
1794
+ 'team_id': teamId,
1795
+ 'project_id': projectId
1796
+ });
1797
+ var url = this.viewerUri + params;
1798
+ return window.open(url, target);
1799
+ }
1800
+
1801
+ /**
1802
+ * Opens an model preview window for a file loaded into a buffer
1803
+ *
1804
+ * @param {*} bufferData Buffer data
1805
+ * @param {string} target browser tab target
1806
+ * @param {string} teamId Optional Bimplus team id
1807
+ * @param {string} projectId Optional Bimplus project id
1808
+ * @returns {window} Preview window
1809
+ */
1810
+ }, {
1811
+ key: "openBufferDataWindow",
1812
+ value: function openBufferDataWindow(bufferData, target, teamId, projectId) {
1813
+ var params = '';
1814
+ params = _UrlBuilder__WEBPACK_IMPORTED_MODULE_0__.UrlBuilder.addParameters(params, {
1815
+ 'awaitDataMessage': 'true',
1816
+ 'team_id': teamId,
1817
+ 'project_id': projectId
1818
+ });
1819
+ var url = this.viewerUri + params;
1820
+ var previewWindow = window.open(url, target);
1821
+ if (!previewWindow) {
1822
+ alert('Could not open preview window. Please enable popups in your browser to use this feature');
1823
+ return;
1824
+ }
1825
+ var transferData = function transferData(e) {
1826
+ /**
1827
+ if(e.origin !== "http://localhost:4200"){
1828
+ return;
1829
+ }
1830
+ */
1831
+
1832
+ if (e.data === 'WatingForData' && previewWindow && window) {
1833
+ previewWindow.postMessage(bufferData, "*", [bufferData]);
1834
+ window.removeEventListener("message", transferData);
1835
+ }
1836
+ };
1837
+ window.addEventListener('message', transferData, false);
1838
+ return previewWindow;
1839
+ }
1840
+ }]);
1841
+ }();
1842
+
1843
+ /***/ }),
1844
+
1845
+ /***/ "./src/UrlBuilder.js":
1846
+ /*!***************************!*\
1847
+ !*** ./src/UrlBuilder.js ***!
1848
+ \***************************/
1849
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1850
+
1851
+ __webpack_require__.r(__webpack_exports__);
1852
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1853
+ /* harmony export */ UrlBuilder: () => (/* binding */ UrlBuilder)
1854
+ /* harmony export */ });
1855
+ var _UrlBuilder;
1856
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
1857
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
1858
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
1859
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1860
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
1861
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
1862
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
1863
+ /**
1864
+ * @namespace UrlBuilder
1865
+ */
1866
+ var UrlBuilder = /*#__PURE__*/_createClass(function UrlBuilder() {
1867
+ _classCallCheck(this, UrlBuilder);
1868
+ });
1869
+ _UrlBuilder = UrlBuilder;
1870
+ /**
1871
+ * Create embedded query parameter
1872
+ * @memberof UrlBuilder
1873
+ * @return {string} embedded query parameter
1874
+ */
1875
+ _defineProperty(UrlBuilder, "embedded", "?embedded=1");
1876
+ /**
1877
+ * Create portal URL depending on environment (DEV/STAGE/PROD)
1878
+ * @memberof UrlBuilder
1879
+ * @param {string} env Current environment
1880
+ * @return {string} url to portal
1881
+ */
1882
+ _defineProperty(UrlBuilder, "url", function (env) {
1883
+ var url = "https://portal";
1884
+ if (env) {
1885
+ if (env === "dev") {
1886
+ url += "-dev";
1887
+ }
1888
+ if (env === "stage") {
1889
+ url += "-stage";
1890
+ }
1891
+ }
1892
+ url += ".bimplus.net/";
1893
+ return url;
1894
+ });
1895
+ /**
1896
+ * Create token
1897
+ * @memberof UrlBuilder
1898
+ * @param {string} token Token
1899
+ * @return {string} token string
1900
+ */
1901
+ _defineProperty(UrlBuilder, "token", function (token) {
1902
+ return "&token=" + token;
1903
+ });
1904
+ /**
1905
+ * Create external client
1906
+ * @memberof UrlBuilder
1907
+ * @param {string} client Client
1908
+ * @return {string} client string
1909
+ */
1910
+ _defineProperty(UrlBuilder, "client", function (client) {
1911
+ return client ? "&external_client=PostMessage:" + client.getClientName() : "";
1912
+ });
1913
+ /**
1914
+ * Create source
1915
+ * @memberof UrlBuilder
1916
+ * @param {string} source Source
1917
+ * @return {string} source string
1918
+ */
1919
+ _defineProperty(UrlBuilder, "source", function (source) {
1920
+ return source && typeof source === "string" ? "&source=" + source : "";
1921
+ });
1922
+ /**
1923
+ * Create team id
1924
+ * @memberof UrlBuilder
1925
+ * @param {string} teamId Team Id
1926
+ * @return {string} teamId query parameter string
1927
+ */
1928
+ _defineProperty(UrlBuilder, "teamId", function (teamId) {
1929
+ return teamId ? "&team_id=" + teamId : "";
1930
+ });
1931
+ /**
1932
+ * Create project id
1933
+ * @memberof UrlBuilder
1934
+ * @param {string} projectId Project id
1935
+ * @return {string} projectId query parameter string
1936
+ */
1937
+ _defineProperty(UrlBuilder, "projectId", function (projectId) {
1938
+ return projectId ? "&project_id=" + projectId : "";
1939
+ });
1940
+ /**
1941
+ * Create parameter
1942
+ * @memberof UrlBuilder
1943
+ * @param {string} params_string query parameters string
1944
+ * @param {string} name parameter name
1945
+ * @param {string} value parameter value
1946
+ * @return {string} query parameter string
1947
+ */
1948
+ _defineProperty(UrlBuilder, "addParameter", function (params_string, name, value) {
1949
+ if (!name || !value) {
1950
+ return params_string;
1951
+ }
1952
+ if (!params_string) {
1953
+ return "?".concat(name, "=").concat(value);
1954
+ }
1955
+ return params_string + "&".concat(name, "=").concat(value);
1956
+ });
1957
+ /**
1958
+ * Create parameters
1959
+ * @memberof UrlBuilder
1960
+ * @param {string} params_string query parameters string
1961
+ * @param {string} params parametes
1962
+ * @return {string} query parameters string
1963
+ */
1964
+ _defineProperty(UrlBuilder, "addParameters", function (params_string, params) {
1965
+ var _params_string = params_string;
1966
+ for (var key in params) {
1967
+ _params_string = _UrlBuilder.addParameter(_params_string, key, params[key]);
1968
+ }
1969
+ return _params_string;
1970
+ });
1971
+
1972
+ /***/ }),
1973
+
1974
+ /***/ "./src/WebControl.js":
1975
+ /*!***************************!*\
1976
+ !*** ./src/WebControl.js ***!
1977
+ \***************************/
1978
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1979
+
1980
+ __webpack_require__.r(__webpack_exports__);
1981
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1982
+ /* harmony export */ WebControl: () => (/* binding */ WebControl)
1983
+ /* harmony export */ });
1984
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
1985
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1986
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
1987
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
1988
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
1989
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
1990
+ var WebControl = /*#__PURE__*/function () {
1991
+ function WebControl(domId, client, env, token) {
1992
+ _classCallCheck(this, WebControl);
1993
+ this._client = client;
1994
+ this._domId = domId;
1995
+ this._env = env;
1996
+ this._token = token;
1997
+ }
1998
+ return _createClass(WebControl, [{
1999
+ key: "sendMessage",
2000
+ value: function sendMessage(message, data) {
2001
+ if (this._client) {
2002
+ this._client.sendMessage(this._domId, message, data);
2003
+ } else {
2004
+ var errorMsg = "Error for SendMessage. Client not defined.";
2005
+ console.error(errorMsg);
2006
+ throw ReferenceError(errorMsg);
2007
+ }
2008
+ }
2009
+ }, {
2010
+ key: "getDOMElementId",
2011
+ value: function getDOMElementId() {
2012
+ return this._domId;
2013
+ }
2014
+ }, {
2015
+ key: "initMessageHandlers",
2016
+ value: function initMessageHandlers() {
2017
+ return; // must be implemented in derived class
2018
+ }
2019
+ }, {
2020
+ key: "loadIFrame",
2021
+ value: function loadIFrame(url) {
2022
+ var iframe = document.getElementById(this._domId);
2023
+ if (iframe) {
2024
+ iframe.src = url;
2025
+ } else {
2026
+ var errorMsg = "DOM element not found: " + this._domId;
2027
+ console.error(errorMsg);
2028
+ throw ReferenceError(errorMsg);
2029
+ }
2030
+ }
2031
+ }]);
2032
+ }();
2033
+
2034
+ /***/ })
2035
+
2036
+ /******/ });
2037
+ /************************************************************************/
2038
+ /******/ // The module cache
2039
+ /******/ var __webpack_module_cache__ = {};
2040
+ /******/
2041
+ /******/ // The require function
2042
+ /******/ function __webpack_require__(moduleId) {
2043
+ /******/ // Check if module is in cache
2044
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
2045
+ /******/ if (cachedModule !== undefined) {
2046
+ /******/ return cachedModule.exports;
2047
+ /******/ }
2048
+ /******/ // Create a new module (and put it into the cache)
2049
+ /******/ var module = __webpack_module_cache__[moduleId] = {
2050
+ /******/ // no module.id needed
2051
+ /******/ // no module.loaded needed
2052
+ /******/ exports: {}
2053
+ /******/ };
2054
+ /******/
2055
+ /******/ // Execute the module function
2056
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
2057
+ /******/
2058
+ /******/ // Return the exports of the module
2059
+ /******/ return module.exports;
2060
+ /******/ }
2061
+ /******/
2062
+ /************************************************************************/
2063
+ /******/ /* webpack/runtime/define property getters */
2064
+ /******/ (() => {
2065
+ /******/ // define getter functions for harmony exports
2066
+ /******/ __webpack_require__.d = (exports, definition) => {
2067
+ /******/ for(var key in definition) {
2068
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
2069
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
2070
+ /******/ }
2071
+ /******/ }
2072
+ /******/ };
2073
+ /******/ })();
2074
+ /******/
2075
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
2076
+ /******/ (() => {
2077
+ /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
2078
+ /******/ })();
2079
+ /******/
2080
+ /******/ /* webpack/runtime/make namespace object */
2081
+ /******/ (() => {
2082
+ /******/ // define __esModule on exports
2083
+ /******/ __webpack_require__.r = (exports) => {
2084
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
2085
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2086
+ /******/ }
2087
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
2088
+ /******/ };
2089
+ /******/ })();
2090
+ /******/
2091
+ /************************************************************************/
2092
+ var __webpack_exports__ = {};
2093
+ // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
2094
+ (() => {
2095
+ /*!**************************!*\
2096
+ !*** ./src/WebClient.js ***!
2097
+ \**************************/
2098
+ __webpack_require__.r(__webpack_exports__);
2099
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2100
+ /* harmony export */ BimExplorer: () => (/* reexport safe */ _BimExplorer__WEBPACK_IMPORTED_MODULE_2__.BimExplorer),
2101
+ /* harmony export */ BimFilesIsoSelect: () => (/* reexport safe */ _BimFilesIsoSelect__WEBPACK_IMPORTED_MODULE_10__.BimFilesIsoSelect),
2102
+ /* harmony export */ BimFilesOverlaySelect: () => (/* reexport safe */ _BimFilesOverlaySelect__WEBPACK_IMPORTED_MODULE_8__.BimFilesOverlaySelect),
2103
+ /* harmony export */ BimFilesSelect: () => (/* reexport safe */ _BimFilesSelect__WEBPACK_IMPORTED_MODULE_7__.BimFilesSelect),
2104
+ /* harmony export */ BimModelsIsoSelect: () => (/* reexport safe */ _BimModelsIsoSelect__WEBPACK_IMPORTED_MODULE_11__.BimModelsIsoSelect),
2105
+ /* harmony export */ BimModelsSelect: () => (/* reexport safe */ _BimModelsSelect__WEBPACK_IMPORTED_MODULE_9__.BimModelsSelect),
2106
+ /* harmony export */ BimObjectProperties: () => (/* reexport safe */ _BimObjectProperties__WEBPACK_IMPORTED_MODULE_5__.BimObjectProperties),
2107
+ /* harmony export */ BimPortal: () => (/* reexport safe */ _BimPortal__WEBPACK_IMPORTED_MODULE_1__.BimPortal),
2108
+ /* harmony export */ BimTaskList: () => (/* reexport safe */ _BimTaskList__WEBPACK_IMPORTED_MODULE_3__.BimTaskList),
2109
+ /* harmony export */ BimTaskProperties: () => (/* reexport safe */ _BimTaskProperties__WEBPACK_IMPORTED_MODULE_4__.BimTaskProperties),
2110
+ /* harmony export */ ExportManager: () => (/* reexport safe */ _ExportManager__WEBPACK_IMPORTED_MODULE_6__.ExportManager),
2111
+ /* harmony export */ ExternalClient: () => (/* reexport safe */ _ExternalClient__WEBPACK_IMPORTED_MODULE_0__.ExternalClient),
2112
+ /* harmony export */ ModelViewer: () => (/* reexport safe */ _ModelViewer__WEBPACK_IMPORTED_MODULE_12__.ModelViewer),
2113
+ /* harmony export */ getUrlParameter: () => (/* binding */ getUrlParameter)
2114
+ /* harmony export */ });
2115
+ /* harmony import */ var _ExternalClient__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ExternalClient */ "./src/ExternalClient.js");
2116
+ /* harmony import */ var _BimPortal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./BimPortal */ "./src/BimPortal.js");
2117
+ /* harmony import */ var _BimExplorer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./BimExplorer */ "./src/BimExplorer.js");
2118
+ /* harmony import */ var _BimTaskList__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./BimTaskList */ "./src/BimTaskList.js");
2119
+ /* harmony import */ var _BimTaskProperties__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./BimTaskProperties */ "./src/BimTaskProperties.js");
2120
+ /* harmony import */ var _BimObjectProperties__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./BimObjectProperties */ "./src/BimObjectProperties.js");
2121
+ /* harmony import */ var _ExportManager__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./ExportManager */ "./src/ExportManager.js");
2122
+ /* harmony import */ var _BimFilesSelect__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./BimFilesSelect */ "./src/BimFilesSelect.js");
2123
+ /* harmony import */ var _BimFilesOverlaySelect__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./BimFilesOverlaySelect */ "./src/BimFilesOverlaySelect.js");
2124
+ /* harmony import */ var _BimModelsSelect__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./BimModelsSelect */ "./src/BimModelsSelect.js");
2125
+ /* harmony import */ var _BimFilesIsoSelect__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./BimFilesIsoSelect */ "./src/BimFilesIsoSelect.js");
2126
+ /* harmony import */ var _BimModelsIsoSelect__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./BimModelsIsoSelect */ "./src/BimModelsIsoSelect.js");
2127
+ /* harmony import */ var _ModelViewer__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./ModelViewer */ "./src/ModelViewer.js");
2128
+
2129
+
2130
+
2131
+
2132
+
2133
+
2134
+
2135
+
2136
+
2137
+
2138
+
2139
+
2140
+
2141
+
2142
+ /**
2143
+ * get the current page url parameter
2144
+ * @param {string} sParam Paramter name
2145
+ * @return {string} Paramter value
2146
+ */
2147
+ var getUrlParameter = function getUrlParameter(sParam) {
2148
+ var sPageURL = decodeURIComponent(window.location.search.substring(1)),
2149
+ sURLVariables = sPageURL.split('&'),
2150
+ sParameterName,
2151
+ i;
2152
+ for (i = 0; i < sURLVariables.length; i++) {
2153
+ sParameterName = sURLVariables[i].split('=');
2154
+ if (sParameterName[0] === sParam) {
2155
+ return sParameterName[1] === undefined ? true : sParameterName[1];
2156
+ }
2157
+ }
2158
+ };
2159
+
2160
+ })();
2161
+
2162
+ /******/ return __webpack_exports__;
2163
+ /******/ })()
2164
+ ;
2165
+ });
2166
+ //# sourceMappingURL=bimplus-webclient.js.map