@manycore/custom-sdk 1.10.1 → 1.11.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +1 -1
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -142,4 +142,4 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
142
142
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
143
143
  PERFORMANCE OF THIS SOFTWARE.
144
144
  ***************************************************************************** */
145
- function Nh(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),A=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)A.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return A}function Gh(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Nh(arguments[t]));return e}var Uh="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),jh=new Array(36);var Yh,Vh=function(){function e(){this.data={name:"",displayName:"",type:Fh.FIT,value:""}}return e.prototype.getValue=function(){return this.data.value},e.prototype.setValue=function(e){this.getEditable()&&(this.ref&&"function"==typeof this.ref.__trackUpdateField&&this.ref.__trackUpdateField({type:Mh.STORE,attr:this.data.name},this.getValue(),e),this.data.value=e)},e.prototype.toJSON=function(){return this.data},e.prototype.getMin=function(){return this.data.min},e.prototype.getEditable=function(){return!0===this.data.editable},e.prototype.getMax=function(){return this.data.max},e.prototype.getOptionValues=function(){return this.data.optionValues||[]},e.prototype.getPrimitiveOverride=function(){return this.data.primitiveOverride},e.prototype.getRecommendValues=function(){return this.data.recommendValues||[]},e.prototype.getValueDisplayNames=function(){return this.data.valueDisplayNames||[]},e.prototype.setPrimitiveOverride=function(e){this.getEditable()&&(this.ref&&"function"==typeof this.ref.__trackUpdateField&&this.ref.__trackUpdateField({type:Mh.STORE,attr:this.data.name},this.data.primitiveOverride,e),this.data.primitiveOverride=e)},e.prototype.getStep=function(){return this.data.step},e.prototype.getType=function(){return this.data.type},e.prototype.getParsedValue=function(){return this.getValue()},e.prototype.setParsedValue=function(e){return this.setValue(e)},e}();function Hh(e){var t=new Vh;return t.data=e,t}!function(e){e.SENSE="SENSE",e.BRANDGOOD="BRANDGOOD",e.CATEGORY="CATEGORY",e.TEMPLATE_ID="TEMPLATE_ID"}(Yh||(Yh={}));var Kh,Jh,qh,Wh,zh=function(){function e(){this._changeMap={}}return Object.defineProperty(e.prototype,"rotate",{get:function(){return this.rotation},enumerable:!1,configurable:!0}),e.prototype.getRoot=function(){return this.root},e.prototype.clone=function(){var t=this.toJSON(),r=e.deserialize(JSON.stringify(t));return r._changeMap.cloned=!0,r._changeMap.forceUpdate=!1,r._changeMap.originId||(r._changeMap.originId=r.id),r.id=function(){for(var e=0,t=0;t<36;t++)if(8===t||13===t||18===t||23===t)jh[t]="-";else if(14===t)jh[t]="4";else{e<=2&&(e=33554432+16777216*Math.random()|0);var r=15&e;e>>=4,jh[t]=Uh[19===t?3&r|8:r]}return jh.join("")}(),r},e.prototype.getName=function(){return this.name},e.prototype.setName=function(e){this.__trackUpdateField({type:Mh.ATTRIBUTE,attr:"name"},this.name,e),this.name=e},e.prototype.getRemark=function(){return this.remark},e.prototype.setRemark=function(e){this.__trackUpdateField({type:Mh.ATTRIBUTE,attr:"remark"},this.remark,e),this.remark=e},e.prototype.setRotate=function(e){this.setRotation(e)},e.prototype.getRotate=function(){return this.getRotation()},e.prototype.setRotation=function(e){this.__trackUpdateField({type:Mh.ATTRIBUTE,attr:"rotation"},this.rotation,e),this.rotation=e},e.prototype.getRotation=function(){return this.rotation},e.prototype.setPosition=function(e){this.__trackUpdateField({type:Mh.ATTRIBUTE,attr:"position"},this.position,e),this.position=e},e.prototype.getPosition=function(){return this.position},e.prototype.dispose=function(){this._changeMap.deleted=!0,this._changeMap.forceUpdate=void 0},e.prototype.getChild=function(){return this.children},e.prototype.getAccessory=function(){return this.accessories},e.prototype.appendChild=function(e){if(!this.children.some((function(t){return t.id===e.id}))){e.root=this.root,e._parent=void 0,this.children.push(e);var t=this._changeMap.addNodes;t||(t=[],this._changeMap.addNodes=t),t.push({type:xh.CHILD,linkId:e.id})}},e.prototype.appendAccessory=function(e){if(!this.accessories.some((function(t){return t.id===e.id}))){e.root=this.root,e._parent=void 0,this.accessories.push(e);var t=this._changeMap.addNodes;t||(t=[],this._changeMap.addNodes=t),t.push({type:xh.ACCESSORY,linkId:e.id})}},e.prototype.getParam=function(e){var t=this.params.get(e);return t&&!t.ref&&(t.ref=this),t},e.prototype.hasParam=function(e){return this.params.has(e)},e.prototype.toJSON=function(e){void 0===e&&(e=!0);var t=this.isRoot,r=e&&!t?this.root:this,n={id:r.id,name:r.name,remark:r.remark,position:r.position,rotate:r.rotate,rotation:r.rotation,size:r.size,params:Array.from(r.params).map((function(e){var t=Nh(e,2);return[t[0],t[1].toJSON()]})),productId:r.productId,category:r.category,isRoot:r.isRoot,modelType:r.modelType,isHidden:r.isHidden,toolType:r.toolType,children:r.children.map((function(e){return e.toJSON(!1)})),accessories:r.accessories.map((function(e){return e.toJSON(!1)})),_changeMap:r._changeMap,_origin:r._origin};return e&&!t&&(n._currentId=this.id),n},e.prototype.serialize=function(){return JSON.stringify(this.toJSON())},e.prototype.deserialize=function(t){var r=this,n=JSON.parse(t);return function e(t,r,n,o){void 0===r&&(r=new Map);void 0===o&&(o=function(e,t){return new zh});var i=o(t,n);i.id=t.id,i.name=t.name,i.remark=t.remark,i.position=t.position,i.rotation=t.rotation,i.size=t.size,i.params=new Map(t.params.map((function(e){return[e[0],Hh(e[1])]}))),i.productId=t.productId,i.category=t.category,i.isRoot=t.isRoot,i.modelType=t.modelType,i.isHidden=t.isHidden,i._origin=t._origin,i._changeMap=t._changeMap,!t.isRoot&&n&&(i.root=n);if(r.set(i.id,i),i.children=t.children.map((function(t){return e(t,r,n||i,o)})),i.accessories=t.accessories.map((function(t){return e(t,r,n||i,o)})),!n&&t._currentId&&r.has(t._currentId))return r.get(t._currentId);return i}(n,void 0,void 0,(function(t,o){return void 0!==n._currentId||o?n._currentId===t.id?r:new e:r}))},e.serialize=function(e){return e.serialize()},e.deserialize=function(t){var r=new e;return r.deserialize(t),r},e.prototype.__trackUpdateField=function(e,t,r){var n=this._changeMap.update;n||(n=[],this._changeMap.update=n),n.some((function(t){return t.type===e.type&&t.attr===e.attr}))||t!==r&&n.push(e)},e.prototype.getParent=function(){var e=this;if(this._parent)return this._parent;var t=function(t){return t.id===e.id};if(this.root)for(var r=[this.root],n=void 0;n=r.pop();){var o=n.getChild(),i=n.getAccessory();if(o.some(t)||i.some(t))return this._parent=n,n;r.push.apply(r,Gh(o)),r.push.apply(r,Gh(i))}},e.prototype.forceUpdate=function(e){if(void 0===e&&(e=!0),!this.productId)throw new Error("Can't force-update model without productId");if(this._origin!=Yh.SENSE||!this.isRoot)throw new Error("only the root param models in design support force update!");this._changeMap.forceUpdate=e},e}();!function(e){e[e.SUCCESS=1]="SUCCESS",e[e.FAIL=-1]="FAIL"}(Kh||(Kh={})),function(e){e[e.CABINET=0]="CABINET",e[e.WARDROBE=1]="WARDROBE",e[e.DOOR_WINDOW=2]="DOOR_WINDOW",e[e.CABINET_COPY=4]="CABINET_COPY",e[e.WARDROBE_COPY=5]="WARDROBE_COPY",e[e.DOOR_WINDOW_COPY=6]="DOOR_WINDOW_COPY"}(Jh||(Jh={})),function(e){e[e.ADD=0]="ADD",e[e.UPDATE=1]="UPDATE",e[e.REMOVE=2]="REMOVE",e[e.NONE=3]="NONE"}(qh||(qh={})),function(e){e[e.CROWN=0]="CROWN",e[e.LIGHT=1]="LIGHT",e[e.SKIRT=2]="SKIRT",e[e.COUNTERTOP=3]="COUNTERTOP"}(Wh||(Wh={}));var Xh=r(701),Zh=r.n(Xh);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})(e)}function ed(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function td(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function rd(e,t){return(rd=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function nd(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=id(e);if(t){var o=id(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return od(this,r)}}function od(e,t){return!t||"object"!==$h(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function id(e){return(id=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Ad=function(e){!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}}),t&&rd(e,t)}(i,e);var t,r,n,o=nd(i);function i(){return ed(this,i),o.apply(this,arguments)}return t=i,(r=[{key:"getHidden",value:function(){return this.isHidden}},{key:"setHidden",value:function(e){this.__trackUpdateField({type:Mh.ATTRIBUTE,attr:"isHidden"},this.isHidden,e),this.isHidden=e}}])&&td(t.prototype,r),n&&td(t,n),i}(zh);function ad(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function sd(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ad(Object(r),!0).forEach((function(t){ud(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ad(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function ud(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var cd={x:0,y:0,z:0},ld={x:0,y:0,z:0};function gd(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Map,n=arguments.length>3?arguments[3]:void 0,o=t.category,i=t.origin,A=new Ad,a=!(e instanceof fe)||e.isRoot(),s=n||a?e:e.getRoot(),u=s instanceof fe;A.id=s.id,A.isRoot=!u||s.isRoot(),A.isHidden=!!s.getInvisible();var c=Ph.ASSEMBLY;if(u?c=Ph.COMMON:e.isTemplateAssembly()&&(c=Ph.TEMPLATE_ASSEMBLY),A.modelType=c,A.position=A.isRoot?cd:s.getPosition(),A.rotation=A.isRoot?ld:s.getRotation(),A.size="function"==typeof s.getScaledSize?s.getScaledSize():s.getSize(),A.params=pd(s),A.category=o||s.getCategory().categoryId,u){var l=s.getModel();A.productId=null==l?void 0:l.obsBrandGoodId}return n&&(A.root=n),A.isRoot&&(A._origin=i),A.children=(u?s.getChildren():s.getParamModels()).map((function(e){return gd(e,t,r,n||A)})),A.accessories=(u?s.getAccessories():[]).map((function(e){return gd(e,t,r,n||A)})),r.set(A.id,A),s!==e&&r.has(e.id)?r.get(e.id):A}function fd(e,t){var r=e.isRoot?e:e.root;if(!r)return{};var n=r._changeMap,o=t.getUnSafeParamModelFromParamModelLite(r);if(!o)return{};var i=o.getCustom(),A=n.cloned;return A&&(o=o.clone(!1)),o=function e(t,r,n,o){var i=t._changeMap;if(i.cloned&&i.deleted)return;if(i.deleted)return n.dispose(),n;var A=i.update,a=void 0===A?[]:A,s=i.addNodes,u=void 0===s?[]:s,c=o?sd({},o):{parentModelLite:t,parentModel:n,rootModelLite:t,rootModel:n};a.forEach((function(e){if(e.type===Mh.ATTRIBUTE)switch(e.attr){case"position":n.setPosition(t.getPosition());break;case"rotate":n.setRotation(t.getRotation());break;case"isHidden":n.setInvisible(t.getHidden()),function(e){var t=e.getInvisible();SI().entry.getStateManager().core.fittingDesign.getPlankOutlineHintModels().forEach((function(r){r.linkModel.id===e.id&&r.setVisible(!t)}))}(n)}if(e.type===Mh.STORE){var o=n.getParamStore().getParam(e.attr),i=t.getParam(e.attr);if(o&&i){var A=i.getValue();[Tr.ParamType.MATERIAL,Tr.ParamType.SHAPE].includes(o.getType())&&(A=r.getUnSafeObsBrandGoodToBrandGoodId(A)),A&&o.setValue(A),i.getPrimitiveOverride()!==o.getPrimitiveOverride()&&o.setPrimitiveOverride(i.getPrimitiveOverride())}}})),u.forEach((function(o){var i=o.type,A=o.linkId,a=(i===xh.CHILD?t.getChild():t.getAccessory()).find((function(e){return e.id===A}));if(a){var s=r.getUnSafeParamModelFromParamModelLite(a);s&&((a._changeMap.cloned||a._origin!==Yh.SENSE)&&(s=s.clone(!1)),i===xh.CHILD?(s.setIsAppend(!0),s.setAppendType(Zh.a.CENTER),n.addChild(s)):n.addAccessory(s),e(a,r,s,sd(sd({},c),{},{parentModel:n,parentModelLite:t})),(a._changeMap.cloned||a._origin!==Yh.SENSE)&&s.assignUniqueId())}}));var l=function(o){return function(i){if(!u.some((function(e){return e.type===o&&e.linkId===i.id}))){var A=o===xh.ACCESSORY?n.getAccessories():n.getChildren(),a=i._changeMap.originId||i.id,s=A.find((function(e){return e.id===a}));s&&e(i,r,s,sd(sd({},c),{},{parentModel:n,parentModelLite:t}))}}};return t.getChild().forEach(l(xh.CHILD)),t.getAccessory().forEach(l(xh.ACCESSORY)),n}(r,t,o),A&&o&&o.assignUniqueId(),{create:A,custom:i,model:o}}function pd(e){var t=new Map;return e.getParamStore().forEach((function(e,r){t.set(r,function(e){var t=new Vh;if(t.data={type:e.getType(),displayName:e.getDisplayName(),name:e.getName(),value:e.getValue(),max:e.getMax(),min:e.getMin(),editable:e.getEditable(),optionValues:e.getOptionValues(),recommendValues:e.getRecommendValues(),primitiveOverride:e.getPrimitiveOverride(),step:e.getStep()},[Fh.MATERIAL,Fh.SHAPE].includes(t.getType())){var r=e.getProduct();t.data.value=r?r.obsBrandGoodId:""}return t}(e))})),t}var hd=r(159),dd=r.n(hd),Id={maxAge:6e5,max:20},yd=(Og.SHADING,Og.OUTLINE_WITH_SHADING,Og.TRANSLUCENT,Og.OUTLINE_AND_TRANSLUCENT,[x.ParamModelType.PARAM_ENTITY,x.ParamModelType.PARAM_FURNITURE,x.ParamModelType.PARAM_PRIMITIVE]);function Cd(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ed(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Cd(Object(r),!0).forEach((function(t){Bd(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Cd(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Bd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function vd(e,t,r,n,o,i,A){try{var a=e[i](A),s=a.value}catch(e){return void r(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function md(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function A(e){vd(i,n,o,A,a,"next",e)}function a(e){vd(i,n,o,A,a,"throw",e)}A(void 0)}))}}dd()(function(){var e=md(s.a.mark((function e(t){var r,n;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=ou(),e.next=3,r.gzipPost("/dcs/api/c/products/available",{obsBgIds:t});case 3:return n=e.sent,e.abrupt("return",n.data);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Ed({promise:!0},Id));function Qd(){return(Qd=md(s.a.mark((function e(t){var r,n,o,i,A;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ou().gzipPost("/dcs-resource/api/c/productdata/obsbgid",{obsBgIds:t});case 2:if(r=e.sent,n=r.data,o=n.c,i=n.m,A=n.d,"0"!==o){e.next=11;break}return e.abrupt("return",A);case 11:throw new Error(o+i);case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function bd(){return(bd=md(s.a.mark((function e(t){var r,n,o,i,A;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ou().gzipPost("/dcs-resource/api/c/productdata/bgid",{bgIds:t});case 2:if(r=e.sent,n=r.data,o=n.c,i=n.m,A=n.d,"0"!==o){e.next=11;break}return e.abrupt("return",A);case 11:throw new Error(o+i);case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var _d=dd()((function(e){return Qd.apply(this,arguments)}),Ed(Ed({},Id),{},{promise:!0})),wd=dd()((function(e){return bd.apply(this,arguments)}),Ed(Ed({},Id),{},{promise:!0}));function Sd(e){return function(e){if(Array.isArray(e))return Dd(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Dd(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Dd(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Dd(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Rd(e,t,r,n,o,i,A){try{var a=e[i](A),s=a.value}catch(e){return void r(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function Md(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var xd=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.cached=new Map}var t,r,n,o,i;return t=e,(r=[{key:"setProduct",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"__global__",r=this.cached.get(t);r||(r=new Map,this.cached.set(t,r)),r.set(e.brandGoodId,e.obsBrandGoodId),r.set(e.obsBrandGoodId,e.brandGoodId)}},{key:"getToggledBrandGood",value:function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"__global__";return null===(t=this.cached.get(r))||void 0===t?void 0:t.get(e)}},{key:"removeCachedModel",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"__global__";this.cached.delete(e)}},{key:"safeGetToggleBrandGood",value:(o=s.a.mark((function e(t){var r,n,o,i,A,a,u=this,c=arguments;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=c.length>1&&void 0!==c[1]?c[1]:"__global__",n=Object(_e.castArray)(t),o=[],i=[],A=new Map,n.forEach((function(e){var t=u.getToggledBrandGood(e,r);t?A.set(e,t):/^[0-9]$/.test(e.toString())?i.push(e):o.push(e)})),a=function(e){return[].concat(Sd(e.hardwares||[]),Sd(e.textures||[]),Sd(e.virtualModels||[]),Sd(e.paramModelProducts||[]),Sd(e.moldings||[]))},!o.length){e.next=12;break}return e.next=10,_d(o).then(a);case 10:e.sent.forEach((function(e){u.setProduct(e,r)}));case 12:if(!i.length){e.next=17;break}return e.next=15,wd(i).then(a);case 15:e.sent.forEach((function(e){u.setProduct(e,r)}));case 17:return[].concat(o,i).forEach((function(e){var t=u.getToggledBrandGood(e,r);t&&A.set(e,t)})),e.abrupt("return",A);case 19:case"end":return e.stop()}}),e)})),i=function(){var e=this,t=arguments;return new Promise((function(r,n){var i=o.apply(e,t);function A(e){Rd(i,r,n,A,a,"next",e)}function a(e){Rd(i,r,n,A,a,"throw",e)}A(void 0)}))},function(e){return i.apply(this,arguments)})}])&&Md(t.prototype,r),n&&Md(t,n),e}();function Pd(e,t,r,n,o,i,A){try{var a=e[i](A),s=a.value}catch(e){return void r(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function Fd(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function A(e){Pd(i,n,o,A,a,"next",e)}function a(e){Pd(i,n,o,A,a,"throw",e)}A(void 0)}))}}function Od(e){return function(e){if(Array.isArray(e))return Td(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Td(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Td(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Td(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Ld(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function kd(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var Nd=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new xd;Ld(this,e),this.callback=t,this.brandGoodsTranslate=r,this.cached=new Map,this.models=[]}var t,r,n,o;return t=e,(r=[{key:"getParamModelFromId",value:function(e){if(this.cached.has(e))return this.cached.get(e);var t=this.callback(e);return this.cached.set(e,t),t}},{key:"getUnSafeParamModel",value:function(e){return this.cached.get(e)}},{key:"getUnSafeObsBrandGoodToBrandGoodId",value:function(e){return this.brandGoodsTranslate.getToggledBrandGood(e)}},{key:"addParamModelLite",value:function(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];(e=this.models).push.apply(e,Od(r.map((function(e){return e.root||e}))))}},{key:"getUnSafeParamModelFromParamModelLite",value:function(e){var t,r=e.root||e;switch(e._origin||r._origin){case Yh.BRANDGOOD:case Yh.CATEGORY:break;case Yh.SENSE:var n=r._changeMap.originId||r.id;t=this.getUnSafeParamModel(n)}if(!t||r===e)return t;for(var o,i=e._changeMap.originId||e.id,A=[t];o=A.pop();){if(o.id===i)return o;A.push.apply(A,Od(o.getChildNodes()))}}},{key:"attach",value:(o=Fd(s.a.mark((function e(){var t,r,n,o,i,A,a,u,c=this;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=this.models,r={modelIds:[],category:[],brandGoodIds:[]},n=[];case 3:if(!(o=t.pop())){e.next=18;break}A=(i=o)._changeMap,a=i._origin,e.t0=a,e.next=e.t0===Yh.SENSE?8:e.t0===Yh.CATEGORY||e.t0===Yh.BRANDGOOD||e.t0===Yh.TEMPLATE_ID?11:12;break;case 8:return u=A.originId||o.id,r.modelIds.push(u),e.abrupt("break",12);case 11:return e.abrupt("break",12);case 12:if(!A.deleted){e.next=14;break}return e.abrupt("continue",3);case 14:A.update&&A.update.forEach((function(e){if(o&&e.type===Mh.STORE&&o.hasParam(e.attr)){var t=o.getParam(e.attr);t&&[Fh.MATERIAL,Fh.SHAPE].includes(t.getType())&&t.getValue()&&n.push(t.getValue())}})),t.push.apply(t,Od(o.getChild()).concat(Od(o.getAccessory()))),e.next=3;break;case 18:return e.next=20,Promise.allSettled(Od(Object(_e.uniq)(r.modelIds).map(function(){var e=Fd(s.a.mark((function e(t){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",c.getParamModelFromId(t));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())));case 20:return e.next=22,this.brandGoodsTranslate.safeGetToggleBrandGood(n);case 22:case"end":return e.stop()}}),e,this)}))),function(){return o.apply(this,arguments)})}])&&kd(t.prototype,r),n&&kd(t,n),e}(),Gd=r(715);function Ud(e){return(Ud="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 jd(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Yd(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Vd(e,t,r){return(Vd="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=qd(e)););return e}(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(r):o.value}})(e,t,r||e)}function Hd(e,t){return(Hd=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Kd(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=qd(e);if(t){var o=qd(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Jd(this,r)}}function Jd(e,t){return!t||"object"!==Ud(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function qd(e){return(qd=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Wd=function(e){!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}}),t&&Hd(e,t)}(i,e);var t,r,n,o=Kd(i);function i(){var e;return jd(this,i),(e=o.apply(this,arguments)).$actionInit=e.unitCreator.sync((function(e){e.latest(s.a.mark((function e(t,r){var n;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this.getAxr(of),e.next=3,Object(Lg.take)([n.$actionLoad.done.messageType(),n.$actionAddModelToSense.done.messageType(),n.$actionAddParamModelToSense.done.messageType(),n.$actionAddParamModelAssemblyToSense.done.messageType()]);case 3:if(n.state.state.main!==Dg.SUCCESS){e.next=13;break}return e.next=6,Object(Lg.put)(this.$actionSetCamera.message(!0));case 6:return e.next=9,Object(Lg.take)(this.$actionSyncCamera.messageType());case 9:return e.next=11,Object(Lg.put)(this.$actionSetCamera.message(!1));case 11:e.next=6;break;case 13:case"end":return e.stop()}}),e,this)})))})),e.$actionSyncCamera=e.unitCreator.sync((function(e){})),e.$actionSetCamera=e.unitCreator.sync((function(e){e.latest(s.a.mark((function e(t,r){var n,o,i,A,a,u;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=r.core.design.getCustom(),o=n.getParamModels(),i=n.getParamModelAssemblies(),(A=r.scene3D).updateEnableCameraAnimation(!1),a=o.length?Object(Gd.computeAssemblyBox)(o.map((function(e){return e.getBox3()})),o[0].getMatrix4()):Object(Gd.computeAssemblyBox)(i.map((function(e){return e.getBox3()})),i[0].getMatrix4()),u=If(a),A.updateInitCameraAttributes(u),t?r.scene3D.reset():r.scene3D.resetDistanceAndLookAt();case 9:case"end":return e.stop()}}),e)})))})),e}return t=i,(r=[{key:"init",value:function(){Vd(qd(i.prototype),"init",this).call(this),this.$actionInit.dispatch()}}])&&Yd(t.prototype,r),n&&Yd(t,n),i}(ff);function zd(e){return(zd="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 Xd(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=$d(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,A=!0,a=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return A=e.done,e},e:function(e){a=!0,i=e},f:function(){try{A||null==r.return||r.return()}finally{if(a)throw i}}}}function Zd(e){return function(e){if(Array.isArray(e))return eI(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||$d(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $d(e,t){if(e){if("string"==typeof e)return eI(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?eI(e,t):void 0}}function eI(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function tI(e,t,r,n,o,i,A){try{var a=e[i](A),s=a.value}catch(e){return void r(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function rI(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function A(e){tI(i,n,o,A,a,"next",e)}function a(e){tI(i,n,o,A,a,"throw",e)}A(void 0)}))}}function nI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function oI(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function iI(e,t,r){return(iI="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=uI(e)););return e}(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(r):o.value}})(e,t,r||e)}function AI(e,t){return(AI=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function aI(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=uI(e);if(t){var o=uI(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return sI(this,r)}}function sI(e,t){return!t||"object"!==zd(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function uI(e){return(uI=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var cI=function(e){!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}}),t&&AI(e,t)}(u,e);var t,r,n,o,i,A,a=aI(u);function u(){var e;return nI(this,u),(e=a.apply(this,arguments)).cameraController=e.partialCreator.create(Wd),e.state=e.stateCreator.create({renderMode:xi.RenderMode.SHADING,translucent:!1,selectable:!0}),e.$reducerState=e.reducerCreator.create(e.state),e.$actionMergeState=e.unitCreator.sync((function(t){t.produce(e.$reducerState,(function(e,t){Object.assign(e,t)}))})),e.$actionToggleRenderMode=e.unitCreator.sync((function(e){e.latest(s.a.mark((function e(t){var r,n;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=xi.RenderMode.SHADING,n=!1,e.t0=t.mode,e.next=e.t0===Og.SHADING?5:e.t0===Og.OUTLINE_WITH_SHADING?7:e.t0===Og.TRANSLUCENT?9:e.t0===Og.OUTLINE_AND_TRANSLUCENT?11:14;break;case 5:return r=xi.RenderMode.SHADING,e.abrupt("break",14);case 7:return r=xi.RenderMode.OUTLINE_WITH_SHADING,e.abrupt("break",14);case 9:return n=!0,e.abrupt("break",14);case 11:return r=xi.RenderMode.OUTLINE_WITH_SHADING,n=!0,e.abrupt("break",14);case 14:return e.next=16,Object(Lg.put)(this.$actionMergeState.message({renderMode:r,translucent:n}));case 16:jE().viewer.toggleShowModelOutline(r===xi.RenderMode.OUTLINE_WITH_SHADING),jE().viewer.triggerReducer(),this.emit(Pg.renderModeChange);case 19:case"end":return e.stop()}}),e,this)})))})),e.$actionToggleRenderBorder=e.unitCreator.sync((function(e){e.latest(s.a.mark((function e(t){var r;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t?xi.RenderMode.OUTLINE_WITH_SHADING:xi.RenderMode.SHADING,e.next=3,Object(Lg.put)(this.$actionMergeState.message({renderMode:r}));case 3:jE().viewer.toggleShowModelOutline(r===xi.RenderMode.OUTLINE_WITH_SHADING),this.emit(Pg.renderModeChange);case 5:case"end":return e.stop()}}),e,this)})))})),e.$actionToggleRenderTranslucent=e.unitCreator.sync((function(e){e.latest(s.a.mark((function e(t){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(Lg.put)(this.$actionMergeState.message({translucent:t}));case 2:jE().viewer.triggerReducer(),this.emit(Pg.renderModeChange);case 4:case"end":return e.stop()}}),e,this)})))})),e.$actionToggleSelectModel=e.unitCreator.sync((function(e){e.every(s.a.mark((function e(t){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(Lg.put)(this.$actionMergeState.message({selectable:t}));case 2:case"end":return e.stop()}}),e,this)})))})),e}return t=u,(r=[{key:"module",value:function(){return"scene"}},{key:"init",value:function(){var e=this;iI(uI(u.prototype),"init",this).call(this),jE().viewer.registerReducer((function(t,r,n){n.opacity=e.state.state.translucent?Fg.translucentModel:Fg.opaqueModel})),jE().viewer.registerReducer((function(e,t,r){r.visible=!e.getInvisible()}))}},{key:"getAllParamModels",value:function(){return this.stateManager.core.design.getCustom().getParamModels().filter((function(e){return!e.isAppendHardware}))}},{key:"findParamModelById",value:function(e){return Pr(this.getAllParamModels(),e)}},{key:"getAllCustomModels",value:(A=rI(s.a.mark((function e(){var t;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.getAllParamModels(),e.abrupt("return",t.map((function(e){return gd(e,{origin:Yh.SENSE})})));case 2:case"end":return e.stop()}}),e,this)}))),function(){return A.apply(this,arguments)})},{key:"getCustomModelById",value:(i=rI(s.a.mark((function e(t){var r;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(r=this.findParamModelById(t))){e.next=3;break}return e.abrupt("return",gd(r,{origin:Yh.SENSE}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"save",value:(o=rI(s.a.mark((function e(t){var r,n,o,i,A,a,u,c,l=this;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t,(n=new Nd((function(e){return l.findParamModelById(e)}))).addParamModelLite.apply(n,Zd(r)),e.next=5,n.attach();case 5:return e.next=7,Promise.all(r.map((function(e){return fd(e,n)})));case 7:o=e.sent,i=[],A=[],a=Xd(o);try{for(a.s();!(u=a.n()).done;)(c=u.value).create&&c.custom&&c.model&&i.push(c),!c.create&&c.model&&A.push(c.model)}catch(e){a.e(e)}finally{a.f()}(i.length||A.length)&&i.length&&i.forEach((function(e){var t;null===(t=e.custom)||void 0===t||t.addParamModels(e.model)})),jE().viewer.triggerReducer();case 14:case"end":return e.stop()}}),e)}))),function(e){return o.apply(this,arguments)})}])&&oI(t.prototype,r),n&&oI(t,n),u}(Bn.AXR);function lI(e){return(lI="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 gI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function fI(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?gI(Object(r),!0).forEach((function(t){pI(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gI(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function pI(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function hI(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var A,a=e[Symbol.iterator]();!(n=(A=a.next()).done)&&(r.push(A.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(o)throw i}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return dI(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return dI(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function dI(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function II(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yI(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function CI(e,t,r){return(CI="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=mI(e)););return e}(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(r):o.value}})(e,t,r||e)}function EI(e,t){return(EI=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function BI(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=mI(e);if(t){var o=mI(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return vI(this,r)}}function vI(e,t){return!t||"object"!==lI(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function mI(e){return(mI=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var QI={rawSelected:[],selectedData:[],selectedDataV2:[]},bI=function(e,t){var r=e.entityId+"%%"+e.entityType.toString(),n=t.entityId+"%%"+t.entityType.toString();return r>n?1:r===n?0:-1},_I=function(e){!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}}),t&&EI(e,t)}(i,e);var t,r,n,o=BI(i);function i(){var e;return II(this,i),(e=o.apply(this,arguments)).state=e.stateCreator.create(QI).mutable(),e.onModelsChange=function(){var t=e.selected.map((function(t){return e.stateManager.core.pad.findModel(t.entityId)})).filter((function(e){return!!e})),r=e.state.state.selectedData;t.length===r.length&&Object(_e.unzip)([t,r]).every((function(e){var t=hI(e,2);return t[0]===t[1]}))||(e.state.reduce((function(e){return fI(fI({},e),{},{selectedData:t})})),e.emit(i.EVENT_SELECT_CHANGED))},e.onModelChangeV2=function(){setTimeout((function(){e.onModelsChange()}),0);var t=e.stateManager.core,r=t.pad,n=t.fittingDesign,o=n.getFittings(),A=n.getGrooveFittings(),a=e.rawSelected.map((function(e){switch(e.entityType){case li:return r.findModelEx(e.entityId,ls);case ci:return r.findParamModelAssembly(e.entityId);case kg:return o.find((function(t){return t.id===e.entityId}));case Ng:return A.find((function(t){return t.id===e.entityId}));default:return}})).filter((function(e){return!!e})),s=e.state.state.selectedDataV2;s.length===a.length&&Object(_e.unzip)([s,a]).every((function(e){var t=hI(e,2);return t[0]===t[1]}))||(e.state.reduce((function(e){return fI(fI({},e),{},{selectedDataV2:a})})),e.emit(i.EVENT_SELECT_CHANGED_V2))},e._onSelectionChange=function(){e.onStateChange()},e}return t=i,(r=[{key:"module",value:function(){return"select"}},{key:"select",value:function(e){this.selectionStateManager.select(e)}},{key:"unSelect",value:function(e){this.selectionStateManager.unSelect(e)}},{key:"getSelected",value:function(){return this.state.state.selectedData}},{key:"selectionStateManager",get:function(){return this.stateManager.core.kaf.selection}},{key:"init",value:function(){CI(mI(i.prototype),"init",this).call(this),this.enable()}},{key:"release",value:function(){this.disable(),CI(mI(i.prototype),"release",this).call(this)}},{key:"onEnable",value:function(e){CI(mI(i.prototype),"onEnable",this).call(this,e),this.rawSelected=[],this.selected=[],this.selectionStateManager.on(VA.UPDATE,this._onSelectionChange),this.stateManager.core.pad.on(gs.EVENT_PARAM_MODELS_CHANGED,this.onModelChangeV2),Qe.on(Be.FITTING_MODEL_CHANGE,this.onModelChangeV2),this.onStateChange()}},{key:"onDisable",value:function(e){this.stateManager.core.pad.off(gs.EVENT_PARAM_MODELS_CHANGED,this.onModelChangeV2),Qe.off(Be.FITTING_MODEL_CHANGE,this.onModelChangeV2),this.state.reduce((function(){return QI})),this.selectionStateManager.off(VA.UPDATE,this._onSelectionChange),this.rawSelected=[],this.selected=[],CI(mI(i.prototype),"onDisable",this).call(this,e)}},{key:"onStateChange",value:function(){var e=this.selectionStateManager.state.value;if(e.sort(bI),this.rawSelected!==e){this.rawSelected=e;var t=this.resolveSelected(e)||[];this.selectedIsChanged(this.selected,t)&&(this.selected=t),this.onModelChangeV2()}}},{key:"resolveSelected",value:function(e){return e.filter((function(e){return e.entityType===li}))}},{key:"selectedIsChanged",value:function(e,t){if(e.length!==t.length)return!0;if(0===e.length&&0===t.length)return!1;for(var r=e.map((function(e){return e.entityId+"%%"+e.entityType.toString()})),n=t.map((function(e){return e.entityId+"%%"+e.entityType.toString()})),o=0,i=n.length;o<i;++o)if(r[o]!==n[o])return!0;return!1}}])&&yI(t.prototype,r),n&&yI(t,n),i}(Bn.AXR);_I.EVENT_SELECT_CHANGED="EVENT_SELECT_CHANGED",_I.EVENT_SELECT_CHANGED_V2="EVENT_SELECT_CHANGED_V2";var wI={entry:of,scene:cI,select:_I,fittingDesign:kh,baseDesignInfo:Eg,viewParamModel:Gf};function SI(){return jE().axr.axrs}var DI=Object(ui.getConnector)(),RI=DI.connect,MI=DI.setRootState;function xI(e,t,r){return RI((function(){return e(SI(),jE().getStateManager())}),t,r)}var PI=r(1106),FI=r.n(PI);function OI(e){return(OI="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 TI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function LI(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function kI(e,t,r){return t&&LI(e.prototype,t),r&&LI(e,r),e}function NI(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}}),t&&GI(e,t)}function GI(e,t){return(GI=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function UI(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=YI(e);if(t){var o=YI(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return jI(this,r)}}function jI(e,t){return!t||"object"!==OI(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function YI(e){return(YI=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var VI=Symbol("layout"),HI=xI((function(e){return{status:e.entry.state}}),(function(e){return{status:e.status.main}}),function(e){NI(r,e);var t=UI(r);function r(){return TI(this,r),t.apply(this,arguments)}return kI(r,[{key:"render",value:function(){return this.state.views.map((function(e){return e.content}))}}]),r}(vn.MountPoint)),KI=function(e){NI(r,e);var t=UI(r);function r(){return TI(this,r),t.apply(this,arguments)}return kI(r,[{key:"render",value:function(){return Qn.a.createElement(HI,{mountPointId:VI})}}]),r}(Qn.a.PureComponent);function JI(e){return(JI="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 qI(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function WI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zI(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}}),t&&XI(e,t)}function XI(e,t){return(XI=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ZI(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=ey(e);if(t){var o=ey(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return $I(this,r)}}function $I(e,t){return!t||"object"!==JI(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ey(e){return(ey=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}KI.contextType=vn.AppContext;var ty=xI((function(e,t){return{scene3D:t.scene3D}}),(function(e){var t=e.scene3D;return{cameraType:t.cameraType,cameraAttributes:t.cameraAttributes,initCameraAttributes:t.initCameraAttributes,perspectiveCameraMode:t.perspectiveCameraMode,perspectiveCameraFov:t.perspectiveCameraFov,groundGridConfig:t.groundGridConfig,enableCameraAnimation:t.enableCameraAnimation}}),function(e){zI(r,e);var t=ZI(r);function r(){return WI(this,r),t.apply(this,arguments)}return r}(vn.Scene3D)),ry=xI((function(){return{}}),(function(){return{}}),function(e){zI(i,e);var t,r,n,o=ZI(i);function i(){var e;return WI(this,i),(e=o.apply(this,arguments)).onInit=function(e){var t=e.viewer.config;t.autoInstance.enabled.set(!0),t.popMeshMerge.enabled.set(!0),t.background.active.set(xi.BackgroundMode.SolidColorBackground),t.background.solid.color.set(new xi.Color(xg.sceneBG)),t.ground.enabled.set(!1),t.postEffect.planarShadow.enabled.set(!1),t.postEffect.taa.enabled.set(!1),t.staticFrameCache.enabled.set(!1),t.isExtraCopyBeforeScreenEnabled.set(!1),t.postEffect.ao.enabled.set(!1),jE().viewer.onScene3DInit(e)},e.onGrabStart=function(){e.props.rootState.scene3D.updateEnableCameraAnimation(!1),e.props.rootState.scene3D.updateGrabing(!0)},e.onGrabEnd=function(){e.props.rootState.scene3D.updateGrabing(!1)},e.onZoomStart=function(){e.props.rootState.scene3D.updateEnableCameraAnimation(!1),e.props.rootState.scene3D.updateZooming(!0)},e.onZoomEnd=function(){e.props.rootState.scene3D.updateZooming(!1)},e.onCameraAnimationEnd=function(){e.props.rootState.scene3D.updateEnableCameraAnimation(!1)},e}return t=i,(r=[{key:"render",value:function(){var e=this.props,t=e.rootState.scene3D,r=e.containerId,n=e.size;return Qn.a.createElement(ty,{onInit:this.onInit,cameraRotatable:!0,containerId:r,size:n,onGrabStart:this.onGrabStart,onGrabEnd:this.onGrabEnd,onZoomStart:this.onZoomStart,onZoomEnd:this.onZoomEnd,onScaleUpdate:t.updateScale,onCameraAttributesChange:t.updateCameraAttributes,onCameraAnimationEnd:this.onCameraAnimationEnd})}}])&&qI(t.prototype,r),n&&qI(t,n),i}(Qn.a.PureComponent));function ny(e){return(ny="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 oy(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function iy(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ay(e,t){return(Ay=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ay(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=uy(e);if(t){var o=uy(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return sy(this,r)}}function sy(e,t){return!t||"object"!==ny(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function uy(e){return(uy=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var cy=xI((function(e,t){return{scene3D:t.scene3D}}),(function(e){return{size:e.scene3D.size}}),function(e){!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}}),t&&Ay(e,t)}(i,e);var t,r,n,o=ay(i);function i(){var e;return oy(this,i),(e=o.apply(this,arguments)).rootRef=Qn.a.createRef(),e.updateLayout=Object(_e.throttle)((function(){var t=e.rootRef.current;if(t){var r=t.getBoundingClientRect();e.props.rootState.scene3D.updateSize(new dt.a(r.width,r.height))}}),200),e}return t=i,(r=[{key:"componentDidMount",value:function(){this.updateLayout(),window.addEventListener("resize",this.updateLayout)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.updateLayout),this.updateLayout.cancel()}},{key:"render",value:function(){var e=this.props,t=e.size,r=e.className;return Qn.a.createElement("div",{ref:this.rootRef,id:Mg.SCENE_ID,className:r},Qn.a.createElement(ry,{containerId:Mg.SCENE_ID,size:new c.Vector2d(t.x,t.y)}))}}])&&iy(t.prototype,r),n&&iy(t,n),i}(Qn.a.PureComponent));r(2070);function ly(e){return(ly="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 gy(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fy(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function py(e,t){return(py=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function hy(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Iy(e);if(t){var o=Iy(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return dy(this,r)}}function dy(e,t){return!t||"object"!==ly(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Iy(e){return(Iy=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var yy=xI((function(e){return{}}),(function(e){return{}}),function(e){!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}}),t&&py(e,t)}(i,e);var t,r,n,o=hy(i);function i(){return gy(this,i),o.apply(this,arguments)}return t=i,(r=[{key:"render",value:function(){return Qn.a.createElement(vn.ViewMounter,{mountPointId:VI},Qn.a.createElement(cy,{key:"s3",className:FI.a.scene3D}))}}])&&fy(t.prototype,r),n&&fy(t,n),i}(Qn.a.PureComponent));function Cy(e,t){return(Cy=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ey(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=vy(e);if(t){var o=vy(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return By(this,r)}}function By(e,t){return!t||"object"!==my(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function vy(e){return(vy=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function my(e){return(my="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)}var Qy,by=function(e,t,r,n){var o,i=arguments.length,A=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"===("undefined"==typeof Reflect?"undefined":my(Reflect))&&"function"==typeof Reflect.decorate)A=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(A=(i<3?o(A):i>3?o(t,r,A):o(t,r))||A);return i>3&&A&&Object.defineProperty(t,r,A),A},_y=function(e,t){if("object"===("undefined"==typeof Reflect?"undefined":my(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},wy=function(e){!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}}),t&&Cy(e,t)}(r,e);var t=Ey(r);function r(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),(n=t.call(this)).$model=e,n.entityType=kg,n.entityId=e.id,n}return r}(vn.Entity);wy=by([Object(vn.provideEntityAPIs)([new vn.EntityAPIs.DrawableAPI3D((function(){var e=this;return{create:function(){return function(e){var t=e.$model.type;if(t===n.GROOVE)return Sy(e);if(t===n.HOLE)return Dy(e)}(e)},update:function(t){var r=e.$model,n=r.position,o=r.visible;t.position.set(n.x,n.y,n.z),t.visible=o,t.material&&(t.material.visible=o)}}})),new vn.EntityAPIs.HighlightGeometryAPI3D((function(){return{geometry:this.$model.boundingBox}}))]),_y("design:paramtypes",["function"==typeof(Qy=void 0!==pt&&pt)?Qy:Object])],wy);var Sy=function(e){var t=e.$model,r=t.position,n=t.size,o=t.rotate,i=t.visible,A=t.viewColor,a=t.opacity,s=new xi.BoxGeometry(n.x,n.y,n.z),u=new xi.MeshBasicMaterial({color:A,opacity:a,visible:i,transparent:!0}),c=new xi.Mesh(s,u);return c.position.set(r.x,r.y,r.z),c.rotation.set(o.x,o.y,o.z),c.visible=i,c},Dy=function(e){var t=e.$model,r=t.position,n=t.visible,o=t.rotate,i=t.height,A=t.viewColor,a=t.opacity,s=t.fittingData.diameter/2,u=new xi.CylinderGeometry(s,s,i),c=new xi.MeshBasicMaterial({color:A,opacity:a,visible:n,transparent:!0}),l=new xi.Mesh(u,c);return l.position.set(r.x,r.y,r.z),l.rotation.set(o.x,o.y,o.z),l};function Ry(e,t){if(e.length!==t.length)return[];for(var r=e.length,n=[],o=0;o<r-1;o++)n.push(e[o].x,e[o].y,e[o].z),n.push(e[o+1].x,e[o+1].y,e[o+1].z),n.push(t[o].x,t[o].y,t[o].z),n.push(t[o].x,t[o].y,t[o].z),n.push(t[o+1].x,t[o+1].y,t[o+1].z),n.push(e[o+1].x,e[o+1].y,e[o+1].z);return n}function My(e){var t=e.elements;return(new Pi.a.Matrix4).set(t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15])}function xy(e){return function(e){if(Array.isArray(e))return Py(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Py(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Py(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Py(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Fy(e,t){return(Fy=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Oy(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Ly(e);if(t){var o=Ly(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Ty(this,r)}}function Ty(e,t){return!t||"object"!==ky(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Ly(e){return(Ly=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ky(e){return(ky="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)}var Ny,Gy=function(e,t,r,n){var o,i=arguments.length,A=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"===("undefined"==typeof Reflect?"undefined":ky(Reflect))&&"function"==typeof Reflect.decorate)A=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(A=(i<3?o(A):i>3?o(t,r,A):o(t,r))||A);return i>3&&A&&Object.defineProperty(t,r,A),A},Uy=function(e,t){if("object"===("undefined"==typeof Reflect?"undefined":ky(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},jy=function(e){!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}}),t&&Fy(e,t)}(r,e);var t=Oy(r);function r(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),(n=t.call(this)).$model=e,n.entityType=Ng,n.entityId=e.id,n}return r}(vn.Entity);function Yy(e){var t=e.matrix,r=e.points,n=e.depth,o=e.color,i=e.side,A=e.position,a=e.opacity,s=new xi.LineBasicMaterial,u=new xi.MeshBasicMaterial({transparent:!0,opacity:a}),c=new xi.Mesh(void 0,u),l=new xi.Line(void 0,s),g=new xi.Group;return c.setAttribute("transparent-line-origin",!1),l.setAttribute("transparent-line-origin",!1),g.add(c),g.setAttribute("outline",!1),g.setAttribute("shadowCaster",!1),u.setValues({color:o,side:i}),g.applyMatrix(t),g.position.set(A.x,A.y,A.z),function(e){var t=e.area,r=e.outline,n=e.points,o=e.height,i=e.holes,A=!!r;if(!n||0===n.length)return;var a=n[0],s=new xi.Shape,u=A?new xi.Geometry:null;s.moveTo(a.x,a.y),n.forEach((function(e){s.lineTo(e.x,e.y),A&&u.vertices.push(new xi.Vector3(e.x,e.y,o))})),s.lineTo(a.x,a.y),i&&(s.holes=i);A&&(u.vertices.push(new xi.Vector3(a.x,a.y,o)),r.geometry&&r.geometry.dispose(),r.geometry=u);var c=new xi.ShapeGeometry(s);t.geometry&&t.geometry.dispose();t.geometry=c,t.position.set(0,0,o)}({area:c,points:r,height:n}),g}function Vy(e){var t=new c.BBox3d;return[].concat(xy(e.getTopRenderPoints()),xy(e.getBottomRenderPoints())).forEach((function(e){t.addPoint(new c.Point3d(e))})),new m.a(new M.a({x:t.width,y:t.height,z:t.depth}),new M.a(t.center),new M.a({x:0,y:0,z:0}))}function Hy(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ky(e,t){return(Ky=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Jy(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Wy(e);if(t){var o=Wy(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return qy(this,r)}}function qy(e,t){return!t||"object"!==zy(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Wy(e){return(Wy=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function zy(e){return(zy="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)}jy=Gy([Object(vn.provideEntityAPIs)([new vn.EntityAPIs.DrawableAPI3D((function(){var e=this;return{create:function(){return function(e){var t=new xi.Group,r=e.pointToGlobalMatrix(),n=e.depth,o=e.viewColor,i=e.opacity,A=e.visible,a=void 0!==A&&A,s=e.path.getAllPolygonPoints(),u=new w.a;u.fromString(r.toArray().join(","));var l=My(u),g=kr.a.decompose(u).position,f=Yy({matrix:l,depth:0,points:s,color:o,side:xi.Side.FrontSide,position:g,opacity:i}),p=Yy({matrix:l,depth:-n,points:s,color:o,side:xi.Side.BackSide,position:g,opacity:i}),h=[].concat(xy(s),[s[0]]),d=function(e){var t=e.matrix,r=e.side,n=e.position,o=e.color,i=e.opacity,A=new xi.MeshBasicMaterial({opacity:i,transparent:!0}),a=new xi.Mesh(new xi.BufferGeometry,A);if(A.setValues({side:r,color:o}),a.setAttribute("transparent-line-origin",!0),a.setAttribute("outline",!1),a.setAttribute("shadowCaster",!1),a.geometry instanceof xi.BufferGeometry){var s=Ry(e.topPoints,e.bottomPoints);a.geometry.addAttribute("position",new xi.Float32BufferAttribute(s,3)),a.geometry.dispose()}return a.applyMatrix(t),a.position.set(n.x,n.y,n.z),a}({position:g,matrix:l,topPoints:h.map((function(e){return new c.Point3d(e.x,e.y,0)})),bottomPoints:h.map((function(e){return new c.Point3d(e.x,e.y,-n)})),color:o,side:xi.Side.DoubleSide,opacity:i});return t.add(f),t.add(p),t.add(d),[f,p,d,t].forEach((function(e){e.visible=a})),t}(e.$model)},update:function(t){var r=e.$model.visible;t.traverse((function(e){e.visible=r,e instanceof xi.Mesh&&e.material&&Object(_e.castArray)(e.material).forEach((function(e){e.visible=r}))})),t.visible=r}}})),new vn.EntityAPIs.HighlightGeometryAPI3D((function(){return{geometry:Vy(this.$model)}}))]),Uy("design:paramtypes",["function"==typeof(Ny=void 0!==Vt&&Vt)?Ny:Object])],jy);var Xy,Zy=function(e,t,r,n){var o,i=arguments.length,A=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"===("undefined"==typeof Reflect?"undefined":zy(Reflect))&&"function"==typeof Reflect.decorate)A=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(A=(i<3?o(A):i>3?o(t,r,A):o(t,r))||A);return i>3&&A&&Object.defineProperty(t,r,A),A},$y=function(e,t){if("object"===("undefined"==typeof Reflect?"undefined":zy(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},eC=vn.__INTERNAL__.Highlighters.generateWireGeometryForHighlighterGeometry,tC=function(e){!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}}),t&&Ky(e,t)}(i,e);var t,r,n,o=Jy(i);function i(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(t=o.call(this)).$model=e,t.entityType=jg,t.entityId=e.id,t}return t=i,(r=[{key:"createOutlineMesh",value:function(){var e=this.$model.hintOutline,t=e.color,r=e.opacity,n=this.$model.visible,o=function(e){var t=new xi.Geometry,r=e.getVertices().map((function(e){var t=e;return new xi.Vector3(t.x,t.y,t.z)}));e.getIndices().forEach((function(e){t.vertices.push(r[e.x],r[e.y])})),t.computeBoundingBox();var n=t.getBoundingBox().getCenter(new xi.Vector3);return t.vertices=t.vertices.map((function(e){return function(e,t){var r=t.clone().sub(e);return e.clone().add(r)}(n,e)})),t}(this.getGeometry()),i=new xi.LineBasicMaterial({color:t,opacity:r,transparent:!0}),A=new xi.LineSegments(o,i);return A.computeLineDistances(),A.renderOrder=999,A.setAttribute("outline",!1),A.setAttribute("transparent-line-origin",!0),A.setAttribute("shadowCaster",!1),A.visible=n,i.visible=n,A}},{key:"getGeometry",value:function(){var e,t=this.$model.linkModel;return e=t instanceof x.CoreParamModel?t.getConcatenatedBox3():t instanceof pt?t.boundingBox:Vy(t),eC(e)}}])&&Hy(t.prototype,r),n&&Hy(t,n),i}(vn.Entity),rC=tC=Zy([Object(vn.provideEntityAPIs)([new vn.EntityAPIs.DrawableAPI3D((function(){var e=this;return{create:function(){return e.createOutlineMesh()},update:function(t){var r=e.$model.visible;t.visible=r,t.material.visible=r}}}))]),$y("design:paramtypes",["function"==typeof(Xy=void 0!==tt&&tt)?Xy:Object])],tC);function nC(e){var t=new xi.BufferGeometry;if(t.index=new xi.BufferAttribute(new Uint16Array(e.indices),1),t.addAttribute("position",new xi.BufferAttribute(new Float32Array(e.vertices),3)),t.addAttribute("uv",new xi.BufferAttribute(new Float32Array(e.textures),2)),e.normals){var r=new Float32Array(e.normals);t.addAttribute("normal",new xi.BufferAttribute(r,3))}else t.computeVertexNormals();return t}function oC(e,t){return(oC=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function iC(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=aC(e);if(t){var o=aC(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return AC(this,r)}}function AC(e,t){return!t||"object"!==sC(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function aC(e){return(aC=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function sC(e){return(sC="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)}var uC,cC=function(e,t,r,n){var o,i=arguments.length,A=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"===("undefined"==typeof Reflect?"undefined":sC(Reflect))&&"function"==typeof Reflect.decorate)A=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(A=(i<3?o(A):i>3?o(t,r,A):o(t,r))||A);return i>3&&A&&Object.defineProperty(t,r,A),A},lC=function(e,t){if("object"===("undefined"==typeof Reflect?"undefined":sC(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},gC=function(e){!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}}),t&&oC(e,t)}(r,e);var t=iC(r);function r(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),(n=t.call(this)).$model=e,n.entityType=Gg,n.entityId=e.id,n}return r}(vn.Entity),fC=gC=cC([Object(vn.provideEntityAPIs)([new vn.EntityAPIs.DrawableAPI3D((function(){var e=this;return{create:function(){return function(e){var t=e.$model,r=t.geometryModel,n=t.viewColor,o=t.originPoints,i=new xi.Group,A=nC(r),a=new xi.MeshBasicMaterial({depthTest:!1,depthWrite:!1,color:n,side:xi.Side.DoubleSide}),s=new xi.Mesh(A,a);s.renderOrder=998,i.add(s),Object({DEPLOY_VERSION:1,APP_VERSION:1}).IS_DEV_OR_TESTING&&i.add(o.map((function(e){var t=new xi.Mesh(pC,hC);return t.position.set(e.x,e.y,e.z),t.renderOrder=999,t})));return i}(e)},update:function(){}}}))]),lC("design:paramtypes",["function"==typeof(uC=void 0!==Ar&&Ar)?uC:Object])],gC),pC=new xi.SphereBufferGeometry(3),hC=new xi.MeshBasicMaterial({depthTest:!1,depthWrite:!1,color:"black"});function dC(e){return function(e){if(Array.isArray(e))return IC(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return IC(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return IC(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function IC(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function yC(e,t){return(yC=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function CC(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=BC(e);if(t){var o=BC(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return EC(this,r)}}function EC(e,t){return!t||"object"!==vC(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function BC(e){return(BC=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function vC(e){return(vC="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)}var mC,QC=function(e,t,r,n){var o,i=arguments.length,A=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"===("undefined"==typeof Reflect?"undefined":vC(Reflect))&&"function"==typeof Reflect.decorate)A=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(A=(i<3?o(A):i>3?o(t,r,A):o(t,r))||A);return i>3&&A&&Object.defineProperty(t,r,A),A},bC=function(e,t){if("object"===("undefined"==typeof Reflect?"undefined":vC(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},_C=function(e){!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}}),t&&yC(e,t)}(r,e);var t=CC(r);function r(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),(n=t.call(this)).$model=e,n.entityType=Ug,n.entityId=e.id,n}return r}(vn.Entity),wC=_C=QC([Object(vn.provideEntityAPIs)([new vn.EntityAPIs.DrawableAPI3D((function(){var e=this;return{create:function(){return function(e){var t=e.$model,r=t.plankFaces,n=t.linkModel,o=t.hintOutline,i=n.getConcatenatedMatrix(),A=new xi.Group;r&&r.forEach((function(e){var t=nC(sn(e,i)),r=new xi.MeshBasicMaterial({depthTest:!0,depthWrite:!0,color:e.color,opacity:e.opacity,transparent:!0,side:xi.Side.DoubleSide}),n=new xi.Mesh(t,r);n.renderOrder=998,A.add(n)}));if(o){var a=n.getSize(),s=n.getWireFrames();if(!s){var u=eh(0,a),c=eh(5,a);s=[].concat(dC(Object(_e.zip)(u,[].concat(dC(u.slice(1)),[u[0]]))),dC(Object(_e.zip)(c,[].concat(dC(c.slice(1)),[c[0]]))),dC(Object(_e.zip)(u,c))).flat().map((function(e){return[e.x,e.y,e.z]})).flat()}var l=Object(_e.chunk)(s,3).map((function(e){return new M.a(e[0],e[1],e[2]).applyMatrix4(i)})).map((function(e){return[e.x,e.y,e.z]})).flat(),g=new Ki({points:l,visible:!0,color:parseInt(o.color.replace(/^#/,""),16)});A.add(g)}return A}(e)},update:function(){}}}))]),bC("design:paramtypes",["function"==typeof(mC=void 0!==pr&&pr)?mC:Object])],_C);function SC(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function DC(e,t){return(DC=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function RC(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=xC(e);if(t){var o=xC(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return MC(this,r)}}function MC(e,t){return!t||"object"!==PC(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function xC(e){return(xC=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function PC(e){return(PC="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)}var FC,OC=function(e,t,r,n){var o,i=arguments.length,A=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"===("undefined"==typeof Reflect?"undefined":PC(Reflect))&&"function"==typeof Reflect.decorate)A=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(A=(i<3?o(A):i>3?o(t,r,A):o(t,r))||A);return i>3&&A&&Object.defineProperty(t,r,A),A},TC=function(e,t){if("object"===("undefined"==typeof Reflect?"undefined":PC(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},LC=function(e){!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}}),t&&DC(e,t)}(i,e);var t,r,n,o=RC(i);function i(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(t=o.call(this)).$model=e,t.entityType=Yg,t.entityId=e.id,t}return t=i,(r=[{key:"createMesh",value:function(){var e=this.$model,t=e.points,r=e.viewColor,n=e.opacity,o=e.visible,i=e.linkModel,A=e.height;if(i){var a=t.map((function(e){return new c.Point3d(e.x,e.y,A/2)})),s=t.map((function(e){return new c.Point3d(e.x,e.y,-A/2)})),u=new xi.MeshBasicMaterial({opacity:n,transparent:!0}),l=new xi.Mesh(new xi.BufferGeometry,u);if(u.setValues({side:xi.Side.DoubleSide,color:r}),l.setAttribute("transparent-line-origin",!0),l.setAttribute("outline",!1),l.setAttribute("shadowCaster",!1),l.geometry instanceof xi.BufferGeometry){var g=Ry(a,s);l.geometry.addAttribute("position",new xi.Float32BufferAttribute(g,3)),l.geometry.dispose()}var f=i.getConcatenatedMatrix(),p=new M.a(0,0,0).applyMatrix4(f);return l.position.set(p.x,p.y,p.z),l.visible=o,u.visible=o,l.rotation.setFromRotationMatrix(My(f)),l}}}])&&SC(t.prototype,r),n&&SC(t,n),i}(vn.Entity),kC=LC=OC([Object(vn.provideEntityAPIs)([new vn.EntityAPIs.DrawableAPI3D((function(){var e=this;return{create:function(){return e.createMesh()},update:function(t){var r=e.$model,n=r.visible,o=r.viewColor,i=r.opacity;t.visible=n,t.material.setValues({opacity:i,color:o}),t.material.visible=n}}}))]),TC("design:paramtypes",["function"==typeof(FC=void 0!==Qr&&Qr)?FC:Object])],LC);var NC=function e(t){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.getDesignDoc=t,this.createFittingEntities=vn.__unstable__.flatEntitiesCreator((function(e){return new wy(e)})),this.createIntersectEntities=vn.__unstable__.flatEntitiesCreator((function(e){return new fC(e)})),this.createGrooveFittingEntities=vn.__unstable__.flatEntitiesCreator((function(e){return new jy(e)})),this.createPlankFaceHintEntities=vn.__unstable__.flatEntitiesCreator((function(e){return new wC(e)})),this.careateFittingHintEntities=vn.__unstable__.flatEntitiesCreator((function(e){return new rC(e)})),this.careatePlankOutlineHintEntities=vn.__unstable__.flatEntitiesCreator((function(e){return new kC(e)})),this.getFittingEntities=function(){var e=r.getDesignDoc();return e?r.createFittingEntities(e.getFittings()):[]},this.getGrooveFittingEntities=function(){var e=r.getDesignDoc();return e?r.createGrooveFittingEntities(e.getGrooveFittings()):[]},this.getIntersectedEntities=function(){var e=r.getDesignDoc();return e?r.createIntersectEntities(e.getIntersects()):[]},this.getPlankFaceHintEntities=function(){var e=r.getDesignDoc();return e?r.createPlankFaceHintEntities(e.getPlankFaceHintModels()):[]},this.getFittingHintEntities=function(){var e=r.getDesignDoc();return e?r.careateFittingHintEntities(e.getFittingHintModels()):[]},this.getPlankOutlineHintEntities=function(){var e=r.getDesignDoc();return e?r.careatePlankOutlineHintEntities(e.getPlankOutlineHintModels()):[]},this.getEntities=[this.getFittingEntities,this.getIntersectedEntities,this.getGrooveFittingEntities,this.getPlankFaceHintEntities,this.getFittingHintEntities,this.getPlankOutlineHintEntities]};function GC(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return UC(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return UC(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,A=!0,a=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return A=e.done,e},e:function(e){a=!0,i=e},f:function(){try{A||null==r.return||r.return()}finally{if(a)throw i}}}}function UC(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function jC(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var YC=function(){function e(){var t=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.disabled=!1,this.pressMap=new Map,this.resetPressStatus=function(){t.pressMap.forEach((function(e,r){t.pressMap.set(r,!1)}))},this.onKeyDown=function(e){var r=t.getKeyBoardKey(e);t.pressMap.get(r)||t.isPrevent(e)||t.pressMap.has(r)&&t.pressMap.set(r,!0)},this.onKeyUp=function(e){var r=t.getKeyBoardKey(e);t.pressMap.get(r)&&(t.isPrevent(e)||t.pressMap.has(r)&&t.pressMap.set(r,!1))},this.active()}var t,r,n;return t=e,(r=[{key:"addKeyboardKeyListener",value:function(e){var t=this,r=Object(_e.castArray)(e);if(r.some((function(e){return!t.isValidKeyboardKey(e)})))throw new Error("keyboard-key is invalid");var n,o=GC(r);try{for(o.s();!(n=o.n()).done;){var i=n.value;this.pressMap.set(i,!1)}}catch(e){o.e(e)}finally{o.f()}}},{key:"removeKeyboardKeyListener",value:function(e){var t,r=GC(Object(_e.castArray)(e));try{for(r.s();!(t=r.n()).done;){var n=t.value;this.pressMap.has(n)&&this.pressMap.delete(n)}}catch(e){r.e(e)}finally{r.f()}}},{key:"active",value:function(){document.addEventListener("keydown",this.onKeyDown),document.addEventListener("keyup",this.onKeyUp),document.addEventListener("mouseenter",this.resetPressStatus),this.disabled=!1}},{key:"dispose",value:function(){document.removeEventListener("keydown",this.onKeyDown),document.removeEventListener("keyup",this.onKeyUp),document.removeEventListener("mouseenter",this.resetPressStatus),this.disabled=!0,this.resetPressStatus()}},{key:"checkIsPress",value:function(e){var t=this;return Object(_e.castArray)(e).every((function(e){return t.pressMap.get(e)}))}},{key:"getKeyBoardKey",value:function(e){return e.key.toLowerCase()}},{key:"isPrevent",value:function(e){if(this.disabled)return!0;var t=e.target;if(!t)return!1;if("INPUT"===t.tagName){var r=t.type;return"radio"!==r&&"checkbox"!==r}return"SELECT"===t.tagName||"TEXTAREA"===t.tagName}},{key:"isValidKeyboardKey",value:function(e){return B.includes(e)}}])&&jC(t.prototype,r),n&&jC(t,n),e}(),VC=new Map([[Tr.ParamModelCategory.FRAME,[Tr.ParamModelCategory.DRAWER,Tr.ParamModelCategory.SWING_DOOR,Tr.ParamModelCategory.PARAM_FURNITURE,Tr.ParamModelCategory.FASCIA_BOARD,Tr.ParamModelCategory.SPECIAL_FRAME,Tr.ParamModelCategory.EMBED_FRAME_W,Tr.ParamModelCategory.POLE_W,Tr.ParamModelCategory.SEGMENT_DOOR_CONTAINER,Tr.ParamModelCategory.BOARD,Tr.ParamModelCategory.DRAWER,Tr.ParamModelCategory.SPACE_GROUP,Tr.ParamModelCategory.SINGLE_SLIDING_DOOR,Tr.ParamModelCategory.FRAME,Tr.ParamModelCategory.SLIDING_DOOR_BOARD,Tr.ParamModelCategory.PARAM_FURNITURE_PART,Tr.ParamModelCategory.SANITARY_COMPONENT,Tr.ParamModelCategory.DOOR_LEAF,Tr.ParamModelCategory.DECORATIVE_MOLDING_C,Tr.ParamModelCategory.DECORATIVE_MOLDING_W,Tr.ParamModelCategory.HANDS_FREE,Tr.ParamModelCategory.REPLACE_STRUCTURE_BOARD]],[Tr.ParamModelCategory.SHOWER_ROOM,[Tr.ParamModelCategory.DRAWER,Tr.ParamModelCategory.SWING_DOOR,Tr.ParamModelCategory.PARAM_FURNITURE,Tr.ParamModelCategory.FASCIA_BOARD,Tr.ParamModelCategory.SPECIAL_FRAME,Tr.ParamModelCategory.EMBED_FRAME_W,Tr.ParamModelCategory.POLE_W,Tr.ParamModelCategory.SEGMENT_DOOR_CONTAINER,Tr.ParamModelCategory.BOARD,Tr.ParamModelCategory.DRAWER,Tr.ParamModelCategory.SPACE_GROUP,Tr.ParamModelCategory.SINGLE_SLIDING_DOOR,Tr.ParamModelCategory.FRAME,Tr.ParamModelCategory.PARAM_FURNITURE_PART,Tr.ParamModelCategory.SANITARY_COMPONENT,Tr.ParamModelCategory.DOOR_LEAF,Tr.ParamModelCategory.REPLACE_STRUCTURE_BOARD]],[void 0,[Tr.ParamModelCategory.DRAWER,Tr.ParamModelCategory.SWING_DOOR,Tr.ParamModelCategory.PARAM_FURNITURE,Tr.ParamModelCategory.FASCIA_BOARD,Tr.ParamModelCategory.SPECIAL_FRAME,Tr.ParamModelCategory.EMBED_FRAME_W,Tr.ParamModelCategory.BOARD,Tr.ParamModelCategory.SPACE_GROUP,Tr.ParamModelCategory.POLE_W,Tr.ParamModelCategory.SINGLE_SLIDING_DOOR,Tr.ParamModelCategory.SLIDING_DOOR_BOARD,Tr.ParamModelCategory.DRAWER,Tr.ParamModelCategory.RAIL,Tr.ParamModelCategory.DOOR_LEAF]],[Tr.ParamModelCategory.SLIDING_DOOR_C,[Tr.ParamModelCategory.RAIL,Tr.ParamModelCategory.SINGLE_SLIDING_DOOR]],[Tr.ParamModelCategory.SPACE_GROUP,[Tr.ParamModelCategory.DRAWER,Tr.ParamModelCategory.SWING_DOOR,Tr.ParamModelCategory.PARAM_FURNITURE,Tr.ParamModelCategory.FASCIA_BOARD,Tr.ParamModelCategory.SEGMENT_DOOR_CONTAINER,Tr.ParamModelCategory.BOARD,Tr.ParamModelCategory.SPECIAL_BOARD,Tr.ParamModelCategory.SPACE_GROUP]],[Tr.ParamModelCategory.SINGLE_SLIDING_DOOR,[Tr.ParamModelCategory.SLIDING_DOOR_CORE,Tr.ParamModelCategory.DOOR_WAIST_LINE]],[Tr.ParamModelCategory.SEGMENT_DOOR_CONTAINER,[Tr.ParamModelCategory.SWING_DOOR]],[Tr.ParamModelCategory.REPLACE_STRUCTURE_BOARD,[Tr.ParamModelCategory.BOARD]],[Tr.ParamModelCategory.SWING_DOOR,[Tr.ParamModelCategory.DOOR_CORE,Tr.ParamModelCategory.DOOR_WAIST_LINE,Tr.ParamModelCategory.DECORATIVE_MOLDING,Tr.ParamModelCategory.BOARD]],[Tr.ParamModelCategory.DRAWER,[Tr.ParamModelCategory.DRAWER_PANEL,Tr.ParamModelCategory.SWING_DOOR,Tr.ParamModelCategory.BOARD]],[Tr.ParamModelCategory.PARAM_FURNITURE,[Tr.ParamModelCategory.FURNITURE_LEG]],[Tr.ParamModelCategory.KADA,[Tr.ParamModelCategory.BYOBU,Tr.ParamModelCategory.BYOBU_FRAME,Tr.ParamModelCategory.BYOBU_PANEL]]]);function HC(e){return function(e){if(Array.isArray(e))return KC(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return KC(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return KC(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function KC(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function JC(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var qC=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.prevModeSelectEntity=[],this.isAccessoryCache=new Map,this.designMode=f.PRODUCT,this.multiSelectShortCut="shift",this.pressManager=new YC,this.pressManager.addKeyboardKeyListener(this.multiSelectShortCut)}var t,r,n;return t=e,(r=[{key:"isAccessory",value:function(e){var t;if(this.isAccessoryCache.has(e.id))return this.isAccessoryCache.get(e.id);var r=null===(t=null==e?void 0:e.getParent)||void 0===t?void 0:t.call(e),n=(VC.get(r?r.getCategory().getRoot():void 0)||[]).some((function(t){return e.getCategory().belongsTo(t)}));return this.isAccessoryCache.set(e.getId(),n),n}},{key:"getAccessoryAtFirstLevel",value:function(e,t){for(var r,n,o=this,i=[],A=t;A&&A!==e;)i.unshift(A),A=(null===(r=A.getParent)||void 0===r?void 0:r.call(A))||(null===(n=A.getAssembly)||void 0===n?void 0:n.call(A));return i.find((function(e){return o.isAccessory(e)}))||t}},{key:"getParamModelLite",value:function(e){var t=(e.isRoot()?e:e.getRoot()).getAssembly();return t?gd(e,{origin:Yh.SENSE},void 0,gd(t,{origin:Yh.SENSE})):gd(e,{origin:Yh.SENSE})}},{key:"topModelModeGetSelectModel",value:function(e,t){var r,n;if(this.isFittingLikeModel(e))return e;var o,i,A,a=e.isRoot()?e:e.getRoot(),s=a.getAssembly(),u=Array.isArray(this.curSelectEntity)?this.curSelectEntity[0]:this.curSelectEntity,c=!1;if(u&&(i=JE(u))&&!this.isFittingLikeModel(i)&&(u.entityType===li?A=(A=i.isRoot()?i:i.getRoot()).getAssembly()||A:(c=!0,A=i),o=A===a||A===s),o){for(var l=!1,g=!1,f=i instanceof x.CoreParamModel?i.getParent():void 0,h=e;h;){if(h===i){l=!0;break}if(h===f){g=!0;break}h=(null===(r=h.getParent)||void 0===r?void 0:r.call(h))||(null===(n=h.getAssembly)||void 0===n?void 0:n.call(h))}if(t===p.CLICK)return l?i:g?this.getAccessoryAtFirstLevel(f,e):A instanceof x.CoreParamModelAssembly?(i.isRoot()?i:i.getRoot())===a?this.getAccessoryAtFirstLevel(a,e):a:this.getAccessoryAtFirstLevel(a,e);if(t===p.DB_CLICK)return l?c?a:this.getAccessoryAtFirstLevel(i,e):this.getAccessoryAtFirstLevel(a,e)}else{if(t===p.CLICK)return s||a;if(t===p.DB_CLICK)return s?a:this.getAccessoryAtFirstLevel(a,e)}}},{key:"accessoryModeGetSelectModel",value:function(e,t){var r,n;if(this.isFittingLikeModel(e))return e;var o=e.isRoot()?e:e.getRoot(),i=Array.isArray(this.curSelectEntity)?this.curSelectEntity[0]:this.curSelectEntity,A=i&&JE(i),a=!1;if(A&&!this.isFittingLikeModel(A)&&(a=(A.isRoot()?A:A.getRoot())===o),a){for(var s=!1,u=!1,c=null==A?void 0:A.getParent(),l=e;l;){if(l===A){s=!0;break}if(l===c){u=!0;break}l=(null===(r=l.getParent)||void 0===r?void 0:r.call(l))||(null===(n=l.getAssembly)||void 0===n?void 0:n.call(l))}if(t===p.CLICK)return s?A:this.getAccessoryAtFirstLevel(u?c:o,e);if(t===p.DB_CLICK){if(s)return this.getAccessoryAtFirstLevel(A,e);var g=this.getAccessoryAtFirstLevel(o,e);return this.getAccessoryAtFirstLevel(g,e)}}else{if(t===p.CLICK)return this.getAccessoryAtFirstLevel(o,e);if(t===p.DB_CLICK){var f=this.getAccessoryAtFirstLevel(o,e);return this.getAccessoryAtFirstLevel(f,e)}}}},{key:"topModelModeAndAccessoryModeHint",value:function(e){var t,r;if(this.isFittingLikeModel(e))return e;var n,o,i=e.isRoot()?e:e.getRoot(),A=i.getAssembly(),a=Array.isArray(this.curSelectEntity)?this.curSelectEntity[0]:this.curSelectEntity,s=!1;if(a&&(n=JE(a))&&!this.isFittingLikeModel(n)&&(s=(o=a.entityType===li?(o=n.isRoot()?n:n.getRoot()).getAssembly()||o:n)===i||o===A),n&&s){for(var u=!1,c=!1,l=n instanceof x.CoreParamModel?n.getParent():void 0,g=e;g;){if(g===n){u=!0;break}if(g===l){c=!0;break}g=(null===(t=g.getParent)||void 0===t?void 0:t.call(g))||(null===(r=g.getAssembly)||void 0===r?void 0:r.call(g))}return u?this.isMultiSelect||Array.isArray(this.curSelectEntity)&&this.curSelectEntity.length>1?n:n instanceof x.CoreParamModelAssembly?i:this.getAccessoryAtFirstLevel(n,e):c?this.getAccessoryAtFirstLevel(l,e):this.designMode===f.TOP_MODEL&&i!==n&&i!==n.getRoot()?i:this.getAccessoryAtFirstLevel(i,e)}return this.designMode===f.TOP_MODEL?i.getAssembly()||i:this.getAccessoryAtFirstLevel(i,e)}},{key:"setCurSelectEntity",value:function(e){this.curSelectEntity=e}},{key:"getCurSelectEntity",value:function(){return this.curSelectEntity}},{key:"setCurHintEntity",value:function(e){this.curHintEntity=e}},{key:"getCurHintEntity",value:function(){return this.curHintEntity}},{key:"clearPrevModeSelectEntity",value:function(){this.prevModeSelectEntity.length&&(this.prevModeSelectEntity=[])}},{key:"getDesignMode",value:function(){return this.designMode}},{key:"setDesignMode",value:function(e,t){this.designMode=e,e===f.CUSTOM?(this.customModeFindSelectModel=null==t?void 0:t.findSelectModel,this.customModeFindHintModel=null==t?void 0:t.findHintModel,!this.pressManager.disabled&&this.pressManager.dispose()):(this.customModeFindSelectModel=void 0,this.customModeFindHintModel=void 0,this.pressManager.disabled&&this.pressManager.active(),this.prevModeSelectEntity=this.prevModeSelectEntity.concat(this.curSelectEntity&&Object(_e.castArray)(this.curSelectEntity)||[])),this.setCurSelectEntity(void 0),this.setCurHintEntity(void 0)}},{key:"genEntityDescriptor",value:function(e){var t=qE[e.type];return{entityId:e.id,entityType:t}}},{key:"customModeSelectModel",value:function(e,t){var r,n;n=this.isFittingLikeModel(e)?fp(e):this.getParamModelLite(e);var o=null===(r=this.customModeFindSelectModel)||void 0===r?void 0:r.call(this,n,t);return Object(_e.castArray)(o).filter((function(e){return e})).map(this.genEntityDescriptor)}},{key:"customModeHintModel",value:function(e){var t,r;r=this.isFittingLikeModel(e)?fp(e):this.getParamModelLite(e);var n=null===(t=this.customModeFindHintModel)||void 0===t?void 0:t.call(this,r);return Object(_e.castArray)(n).filter((function(e){return e})).map(this.genEntityDescriptor)}},{key:"isFittingLikeModel",value:function(e){return e instanceof Vt||e instanceof pt||e instanceof fe&&Boolean(e.isAppendHardware)}},{key:"getSelectEntity",value:function(e,t){var r;if(this.isMultiSelect&&this.designMode!==f.CUSTOM){switch(this.designMode){case f.TOP_MODEL:r=this.topModelModeGetSelectModel(e,t);break;case f.ACCESSORY:r=this.accessoryModeGetSelectModel(e,t);break;case f.PRODUCT:r=e}if(!r)return;var n=KE(r),o=Object(_e.castArray)(this.curSelectEntity).filter((function(e){return e}));this.prevModeSelectEntity.length&&o.push.apply(o,HC(this.prevModeSelectEntity));var i=o[0]&&JE(o[0]);if(i&&this.isFittingLikeModel(i)!==this.isFittingLikeModel(r))return n;var A=o.filter((function(e){return e.entityId!==n.entityId}));return A.length!==o.length?A:[].concat(HC(A),[n])}if(!Array.isArray(this.curSelectEntity)||!this.curSelectEntity.length){switch(this.designMode){case f.TOP_MODEL:r=this.topModelModeGetSelectModel(e,t);break;case f.ACCESSORY:r=this.accessoryModeGetSelectModel(e,t);break;case f.PRODUCT:r=e;break;case f.CUSTOM:return this.customModeSelectModel(e,t)}return KE(r||e)}}},{key:"getHintEntity",value:function(e){var t;switch(this.designMode){case f.TOP_MODEL:case f.ACCESSORY:t=this.topModelModeAndAccessoryModeHint(e);break;case f.PRODUCT:t=e;break;case f.CUSTOM:return this.customModeHintModel(e)}var r=this.curSelectEntity&&Object(_e.castArray)(this.curSelectEntity)||[];if(!([].concat(HC(r),HC(this.prevModeSelectEntity)).findIndex((function(e){return e.entityId===t.id}))>-1))return KE(t)}},{key:"registerMultiSelectShortcut",value:function(e){this.pressManager.removeKeyboardKeyListener(this.multiSelectShortCut),this.multiSelectShortCut=e,this.pressManager.addKeyboardKeyListener(this.multiSelectShortCut)}},{key:"isMultiSelect",get:function(){return this.pressManager.checkIsPress(this.multiSelectShortCut)}}])&&JC(t.prototype,r),n&&JC(t,n),e}();function WC(e){return(WC="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 zC(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function XC(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function ZC(e,t){return(ZC=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function $C(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=tE(e);if(t){var o=tE(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return eE(this,r)}}function eE(e,t){return!t||"object"!==WC(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function tE(e){return(tE=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var rE=function(e){!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}}),t&&ZC(e,t)}(i,e);var t,r,n,o=$C(i);function i(){return zC(this,i),o.apply(this,arguments)}return t=i,(r=[{key:"pickRayTarget",value:function(e){var t=e.event,r=e.sceneId,n=this.context.pick(r,t);return(null==n?void 0:n.entity)&&JE(n.entity)}},{key:"selection",get:function(){return jE().getStateManager().kaf.selection}},{key:"hint",get:function(){return jE().getStateManager().kaf.kaf2.hint}},{key:"designModeCtx",get:function(){return jE().designModeContext}}])&&XC(t.prototype,r),n&&XC(t,n),i}(vn.ToolModule.Feature);function nE(e){return(nE="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 oE(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function iE(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function AE(e,t){return(AE=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function aE(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=uE(e);if(t){var o=uE(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return sE(this,r)}}function sE(e,t){return!t||"object"!==nE(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function uE(e){return(uE=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var cE=function(e){!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}}),t&&AE(e,t)}(i,e);var t,r,n,o=aE(i);function i(){var e;return oE(this,i),(e=o.apply(this,arguments)).isMouseDown=!1,e}return t=i,(r=[{key:"onMouseDown",value:function(){this.isMouseDown=!0}},{key:"onMouseUp",value:function(){this.isMouseDown=!1}},{key:"onMouseMove",value:function(e){if(!this.isMouseDown){var t=this.pickRayTarget(e);if(t){var r=this.designModeCtx.getHintEntity(t);this.designModeCtx.getDesignMode(),f.CUSTOM,this.hint.hint(r)}else this.hint.hint(),this.designModeCtx.setCurHintEntity(void 0)}}}])&&iE(t.prototype,r),n&&iE(t,n),i}(rE);function lE(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return gE(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return gE(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,A=!0,a=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return A=e.done,e},e:function(e){a=!0,i=e},f:function(){try{A||null==r.return||r.return()}finally{if(a)throw i}}}}function gE(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function fE(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function pE(e,t){return(pE=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function hE(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=IE(e);if(t){var o=IE(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return dE(this,r)}}function dE(e,t){return!t||"object"!==yE(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function IE(e){return(IE=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function yE(e){return(yE="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)}var CE=function(e,t,r,n){var o,i=arguments.length,A=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"===("undefined"==typeof Reflect?"undefined":yE(Reflect))&&"function"==typeof Reflect.decorate)A=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(A=(i<3?o(A):i>3?o(t,r,A):o(t,r))||A);return i>3&&A&&Object.defineProperty(t,r,A),A},EE=function(e,t){if("object"===("undefined"==typeof Reflect?"undefined":yE(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},BE=vn.__INTERNAL__.Highlighters.WireGeometry,vE=vn.__INTERNAL__.Highlighters.generateWireGeometryForHighlighterGeometry,mE=function(e){!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}}),t&&pE(e,t)}(i,e);var t,r,n,o=hE(i);function i(e,t){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(r=o.call(this)).models=e,r.createFittingModelBox=t,r}return t=i,(r=[{key:"getGeometry",value:function(){var e,t=new BE,r=lE(this.models);try{for(r.s();!(e=r.n()).done;){var n=e.value,o=void 0;o=n instanceof x.CoreParamModel||n instanceof x.CoreParamModelAssembly?n.getConcatenatedBox3():this.createFittingModelBox(n);var i=vE(o);t.append(i)}}catch(e){r.e(e)}finally{r.f()}return t}}])&&fE(t.prototype,r),n&&fE(t,n),i}(vn.Entity),QE=mE=CE([Object(vn.provideEntityAPIs)([new vn.EntityAPIs.HighlightGeometryAPI3D((function(){return{geometry:this.getGeometry()}}))]),EE("design:paramtypes",[Array,Function])],mE);function bE(e){return(bE="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 _E(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function wE(e,t){return(wE=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function SE(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=RE(e);if(t){var o=RE(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return DE(this,r)}}function DE(e,t){return!t||"object"!==bE(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function RE(e){return(RE=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ME=function(e){!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}}),t&&wE(e,t)}(i,e);var t,r,n,o=SE(i);function i(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(e=o.call(this))._init(),e}return t=i,(r=[{key:"_init",value:function(){var e=this,t={accept:function(){return!0},priority:1,createMultiSelectionEntity:function(t){var r=t.map((function(e){return JE(e)}));return new QE(r.filter((function(e){return e})),e.createFittingModelBox)}};this.selection.addMultiSelectionConfig(t)}},{key:"createFittingModelBox",value:function(e){return e instanceof pt?e.boundingBox:Vy(e)}},{key:"onClick",value:function(e){this.triggerClick(e,p.CLICK)}},{key:"onDblClick",value:function(e){this.designModeCtx.isMultiSelect||this.triggerClick(e,p.DB_CLICK)}},{key:"triggerClick",value:function(e,t){var r=this.pickRayTarget(e);if(r){var n=this.designModeCtx.getSelectEntity(r,t);this.designModeCtx.getDesignMode()===f.CUSTOM?n&&this.selection.select(n):(this.selection.select(n),this.designModeCtx.setCurSelectEntity(n))}else this.selection.select(),this.designModeCtx.setCurSelectEntity(void 0);this.designModeCtx.clearPrevModeSelectEntity()}}])&&_E(t.prototype,r),n&&_E(t,n),i}(rE);function xE(e){return(xE="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 PE(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function FE(e,t,r){return(FE="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=kE(e)););return e}(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(r):o.value}})(e,t,r||e)}function OE(e,t){return(OE=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function TE(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=kE(e);if(t){var o=kE(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return LE(this,r)}}function LE(e,t){return!t||"object"!==xE(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function kE(e){return(kE=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var NE,GE=new Bn.SingletonRef,UE=function(e){!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}}),t&&OE(e,t)}(i,e);var t,r,n,o=TE(i);function i(e,t){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(r=o.call(this,{id:"com.custom.pad",name:"cFrameApp",Component:yy,axrs:wI,singleton:GE},e)).stateManager=t,r.viewer=new oa,r.designModeContext=new qC,r}return t=i,(r=[{key:"init",value:function(){FE(kE(i.prototype),"init",this).call(this),this.initStateManager(),this.initApp()}},{key:"initStateManager",value:function(){var e=this.stateManager;e.initState(),MI(e);var t=this.getDependentPlugin(vn.AppServicePlugin),r=this.getDependentPlugin($l);e.kaf=t.stateManager,e.core=r.stateManager}},{key:"initNet",value:function(){FE(kE(i.prototype),"initNet",this).call(this),this.net.setSendPolicy(new au),this.client=new ws(this.net)}},{key:"initApp",value:function(){var e=this,t=this.stateManager,r=t.core.design,n=this.getDependentPlugin(vn.AppServicePlugin);this.viewer.config(n,{getCustom:function(){return r.getCustom()},getDoc:function(){return r.getDoc()},isEntitySelectable:function(){return e.axr.axrs.scene.state.state.selectable},pickActualInteractiveEntity:function(e){for(var t=Pr(r.getCustom().getParamModels(),e.entityId);t&&!yd.includes(t.getType());)t=t.getParent();return t?{entityId:t.id,entityType:li}:e},paramModelSymbol:li,filterParamModel:function(t){return!e.axr.axrs.fittingDesign.senseSetting.getSenseSettings().renderIgnoreCategory.includes(t.getCategory().categoryId)}}),this.viewer.registerReducer((function(e,t,r){r.interactionPriority=e.isAppendHardware?2:0})),n.registerEntityDocument(new NC((function(){return t.core.fittingDesign}))),t.kaf.toolbox.addIdleToolFeature((function(){return new ME})),t.kaf.toolbox.addIdleToolFeature((function(){return new cE})),n.setLayout(KI)}}])&&PE(t.prototype,r),n&&PE(t,n),i}(Bn.PluginApplication),jE=GE.instance;function YE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function VE(e,t){var r=new Map;return function(){var n,o=t.apply(void 0,arguments);if(r.has(o))n=r.get(o);else if(n=e.apply(void 0,arguments),Object(_e.isObject)(n)&&Object(_e.isFunction)(n.then)&&Object(_e.isFunction)(n.catch)){var i=Promise.resolve(n);r.set(o,i),i.finally((function(){r.delete(o)}))}return n}}function HE(e){return e instanceof fe?li:e instanceof ve?ci:e instanceof pt?kg:e instanceof Vt?Ng:void 0}function KE(e){return{entityId:e.id,entityType:HE(e)}}function JE(e){var t=e.entityId;switch(e.entityType){case li:return Pr(jE().getStateManager().core.design.getCustom().getParamModels(),t);case ci:return jE().getStateManager().core.design.getCustom().getParamModelAssemblies().find((function(e){return e.id===t}));case Ng:return jE().getStateManager().core.fittingDesign.getGrooveFittings().find((function(e){return e.id===t}));case kg:return jE().getStateManager().core.fittingDesign.getFittings().find((function(e){return e.id===t}));default:return}}var qE=(YE(NE={},E.PARAM_MODEL,li),YE(NE,E.PARAM_MODEL_ASSEMBLY,ci),YE(NE,E.HOLE,kg),YE(NE,E.GROOVE,kg),YE(NE,E.HARDWARE_GROOVE,Ng),YE(NE,E.HARDWARE,li),NE);function WE(e,t,r,n,o,i,A){try{var a=e[i](A),s=a.value}catch(e){return void r(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function zE(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function A(e){WE(i,n,o,A,a,"next",e)}function a(e){WE(i,n,o,A,a,"throw",e)}A(void 0)}))}}var XE=new Map;function ZE(e){return["designid","levelid","modelid","toolType"].map((function(t){return e[t]||""})).join(":")}var $E=VE(function(){var e=zE(s.a.mark((function e(t){var r,n,o;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=ou(),n=ZE(t),!XE.has(n)){e.next=4;break}return e.abrupt("return",XE.get(n));case 4:return e.next=6,r.get("/cos/api/fitting-design",{params:t});case 6:return o=e.sent,XE.set(n,o.data.d),e.abrupt("return",o.data.d);case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),ZE);function eB(){var e=ng(tl);"function"==typeof e.fittingDesignHasChanged&&e.fittingDesignHasChanged().catch((function(){}))}var tB,rB,nB=function(){var e=zE(s.a.mark((function e(t,r){var n,o;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=ou(),o=ZE(r),e.prev=2,e.next=5,n.post("/cos/api/fitting-design",t,{params:r});case 5:XE.set(o,t),eB(),e.next=12;break;case 9:throw e.prev=9,e.t0=e.catch(2),e.t0;case 12:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(t,r){return e.apply(this,arguments)}}(),oB=function(){var e=zE(s.a.mark((function e(t){var r,n;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=ou(),n=ZE(t),e.prev=2,e.next=5,r.delete("/cos/api/fitting-design",{params:t});case 5:XE.has(n)&&XE.delete(n),eB(),e.next=12;break;case 9:throw e.prev=9,e.t0=e.catch(2),e.t0;case 12:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(t){return e.apply(this,arguments)}}();function iB(e,t,r,n,o,i,A){try{var a=e[i](A),s=a.value}catch(e){return void r(e)}a.done?t(s):Promise.resolve(s).then(n,o)}!function(e){e.UNKNOWN="UNKNOWN",e.PENDING="PENDING",e.RUNNING="RUNNING",e.SAVING="SAVING",e.SUCCESS="SUCCESS",e.FAIL="FAIL",e.CANCEL="CANCEL",e.TIMEOUT="TIMEOUT"}(tB||(tB={})),function(e){e[e.CABINET=0]="CABINET",e[e.WARDROBE=1]="WARDROBE",e[e.DOOR_WINDOW=2]="DOOR_WINDOW"}(rB||(rB={}));var AB=function(){var e,t=(e=s.a.mark((function e(t){var r,n;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=ou(),e.next=3,r.gzipGet(t,{params:{_time:Date.now()}});case 3:return n=e.sent,e.abrupt("return",n.data);case 5:case"end":return e.stop()}}),e)})),function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function A(e){iB(i,n,o,A,a,"next",e)}function a(e){iB(i,n,o,A,a,"throw",e)}A(void 0)}))});return function(e){return t.apply(this,arguments)}}();function aB(e,t,r,n,o,i,A){try{var a=e[i](A),s=a.value}catch(e){return void r(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function sB(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function A(e){aB(i,n,o,A,a,"next",e)}function a(e){aB(i,n,o,A,a,"throw",e)}A(void 0)}))}}var uB=function(){var e=sB(s.a.mark((function e(t){var r,n;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Object(_e.castArray)(t),n=ng(el),e.abrupt("return",n.getParamModelDataByIds(r));case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),cB=VE(function(){var e=sB(s.a.mark((function e(t,r){var n;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=ng(og.MiniAppParamModelJsonDataService),e.abrupt("return",n.getCachedModelJsonDataByModelId({modelIds:t,templateId:r}));case 2:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),(function(e,t){return e+(t||"")})),lB=VE(function(){var e=sB(s.a.mark((function e(t,r){var n;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=ng(og.MiniAppParamModelJsonDataService),e.abrupt("return",n.getModelJsonDataByModelId({modelIds:t,templateId:r}));case 2:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),(function(e,t){return e+(t||"")}));function gB(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function fB(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function pB(e,t,r,n,o,i,A){try{var a=e[i](A),s=a.value}catch(e){return void r(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function hB(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function A(e){pB(i,n,o,A,a,"next",e)}function a(e){pB(i,n,o,A,a,"throw",e)}A(void 0)}))}}var dB=dd()(function(){var e=hB(s.a.mark((function e(t){var r,n;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=ou(),e.next=3,r.gzipGet("/dcs-model/api/c/parammodeldata",{params:{obsbgid:t,cache:!0}});case 3:return n=e.sent,e.abrupt("return",n.data);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?gB(Object(r),!0).forEach((function(t){fB(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gB(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({promise:!0},Id)),IB=dd()(function(){var e=hB(s.a.mark((function e(t){var r,n,o;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=ou(),e.next=3,n.gzipPost("/dcs-resource/api/c/modelcenter/bgids",{bgIds:t});case 3:return o=e.sent,e.abrupt("return",(null===(r=o.data.d)||void 0===r?void 0:r.modelCenterMap)?Object(_e.mapValues)(o.data.d.modelCenterMap,(function(e){return JSON.parse(e)})):{});case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());var yB=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)};function CB(e){return(CB="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 EB(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function BB(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?EB(Object(r),!0).forEach((function(t){vB(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):EB(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function vB(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function mB(e,t,r,n,o,i,A){try{var a=e[i](A),s=a.value}catch(e){return void r(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function QB(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function A(e){mB(i,n,o,A,a,"next",e)}function a(e){mB(i,n,o,A,a,"throw",e)}A(void 0)}))}}function bB(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _B(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function wB(e,t){return(wB=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function SB(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=RB(e);if(t){var o=RB(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return DB(this,r)}}function DB(e,t){return!t||"object"!==CB(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function RB(e){return(RB=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var MB=function(){return SI().fittingDesign.fittingDesignSense},xB=function(e){!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}}),t&&wB(e,t)}(l,e);var t,r,n,o,i,A,a,c=SB(l);function l(){return bB(this,l),c.apply(this,arguments)}return t=l,(r=[{key:"toggleAutoSave",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];MB().$actionEnableAutoSave.dispatch(e)}},{key:"isAutoSave",value:function(){return MB().isAutoSaveEnabled()}},{key:"getFittingDesignData",value:(a=QB(s.a.mark((function e(t){var r;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&(SI().viewParamModel.state.state.currModelId!==t||MB().state.state.design.id!==t)){e.next=3;break}return e.abrupt("return",this.getConnectedFittingDesign());case 3:return e.next=5,Qf(t);case 5:return r=e.sent,e.abrupt("return",$E(BB(BB({},r),{},{modelid:t})));case 7:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"getConnectedFittingDesign",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return MB().getConnectedFittingDesign(e,t)}},{key:"validateFittingDesign",value:function(e,t){var r=Pr(u.ParamModelUtils.flattenModels(SI().entry.getStateManager().core.design.getCustom().getParamModels()),t);if(!r)return{validated:!1};var n=SI().fittingDesign.senseSetting.getSenseSettings();return{validated:function(e){if(!e.isClosedPath())return!1;for(var t=e.points,r=e.lines,n=t.length,o=0;o<n;o++){var i={type:on.POINT,val:t[o]},A={type:on.LINE,val:r[o]};if(!dn(i.val))return!1;if(!In(A.val))return!1;if(!Cn(i,A))return!1;for(var a=o+1;a<n;a++){var s={type:on.POINT,val:t[a]},u={type:on.LINE,val:r[a]};if(!Cn(i,s))return!1;if(!Cn(i,u))return!1;if(!Cn(A,s))return!1;if(!Cn(A,u))return!1}}return!0}(En(e,r,Object(_e.pick)(n,["holeColor","grooveColor","holeOpacity","grooveOpacity"])).path)}}},{key:"appendFittingDesign",value:(A=QB(s.a.mark((function e(t){var r,n=arguments;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{timeout:5e4},e.abrupt("return",MB().appendFittingDataToFittingDesign(t,r));case 2:case"end":return e.stop()}}),e)}))),function(e){return A.apply(this,arguments)})},{key:"saveDesign",value:(i=QB(s.a.mark((function e(t){var r,n,o,i=arguments;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=i.length>1&&void 0!==i[1]?i[1]:{},n=r.timeout,o=Cf(n),MB().$actionSaveFittingDesign.started.dispatch({defer:o,design:t}),e.abrupt("return",o.promise);case 5:case"end":return e.stop()}}),e)}))),function(e){return i.apply(this,arguments)})},{key:"clearDesign",value:(o=QB(s.a.mark((function e(t){var r,n,o,i,A;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=(r=t||{}).timeout,o=void 0===n?5e4:n,i=r.modelId,A=Cf(o),MB().$actionClearFittingDesign.started.dispatch({defer:A,modelId:i}),e.abrupt("return",A.promise);case 4:case"end":return e.stop()}}),e)}))),function(e){return o.apply(this,arguments)})}])&&_B(t.prototype,r),n&&_B(t,n),l}(yB);function PB(e){return(PB="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 FB(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function OB(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function TB(e,t){return(TB=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function LB(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=NB(e);if(t){var o=NB(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return kB(this,r)}}function kB(e,t){return!t||"object"!==PB(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function NB(e){return(NB=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var GB=(new Gr.a).setFromCenterAndSize(new M.a(0,0,0),new M.a(200,200,100)),UB=function(e){!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}}),t&&TB(e,t)}(i,e);var t,r,n,o=LB(i);function i(){return FB(this,i),o.apply(this,arguments)}return t=i,(r=[{key:"resetDistanceAndLookAt",value:function(){var e=this.state,t=e.initCameraAttributes,r=t.position,n=t.lookAt,o=e.cameraAttributes.position,i=n.clone().sub(r).length(),A=n.clone().add(o.clone().sub(n).normalize().mul(i));this.updateCameraAttributes({position:A,lookAt:n})}},{key:"adjustInitCameraAttributesWithContent",value:function(){return GB}}])&&OB(t.prototype,r),n&&OB(t,n),i}(vn.Scene3DStateManager);function jB(e){return(jB="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 YB(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function VB(e,t){return(VB=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function HB(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=JB(e);if(t){var o=JB(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return KB(this,r)}}function KB(e,t){return!t||"object"!==jB(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function JB(e){return(JB=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var qB=function(e){!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}}),t&&VB(e,t)}(r,e);var t=HB(r);function r(){return YB(this,r),t.apply(this,arguments)}return r}(vn.types.combine({scene3D:UB})),WB=window.document.createElement("script");WB.src="//at.alicdn.com/t/font_2369084_dyxfnutf0ac.js",window.document.body.appendChild(WB);function zB(e){return(zB="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 XB(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ZB(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function $B(e,t){return($B=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ev(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=rv(e);if(t){var o=rv(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return tv(this,r)}}function tv(e,t){return!t||"object"!==zB(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function rv(e){return(rv=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var nv=function(e){!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}}),t&&$B(e,t)}(i,e);var t,r,n,o=ev(i);function i(){var e;return XB(this,i),(e=o.apply(this,arguments)).rootState=new qB,e}return t=i,(r=[{key:"stateManager",get:function(){return this.rootState}},{key:"onInitialize",value:function(){var e=new UE(this,this.rootState);e.init(),e.run()}}])&&ZB(t.prototype,r),n&&ZB(t,n),i}(Vl.BasePlugin);function ov(e){return(ov="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 iv(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Av(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function av(e,t){return(av=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function sv(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=cv(e);if(t){var o=cv(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return uv(this,r)}}function uv(e,t){return!t||"object"!==ov(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function cv(e){return(cv=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}nv.dependencies=[vn.AppServicePlugin,$l];var lv=function(e){!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}}),t&&av(e,t)}(i,e);var t,r,n,o=sv(i);function i(){return iv(this,i),o.apply(this,arguments)}return t=i,(r=[{key:"toggleModelViewIntersected",value:function(e){SI().fittingDesign.intersected.$actionToggleShowIntersected.dispatch(e)}},{key:"toggleModelViewedIntersected",value:function(e){SI().fittingDesign.intersected.toggleShowIntersectGroupData(e)}}])&&Av(t.prototype,r),n&&Av(t,n),i}(yB);function gv(e){return(gv="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 fv(e,t,r,n,o,i,A){try{var a=e[i](A),s=a.value}catch(e){return void r(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function pv(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function A(e){fv(i,n,o,A,a,"next",e)}function a(e){fv(i,n,o,A,a,"throw",e)}A(void 0)}))}}function hv(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dv(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Iv(e,t){return(Iv=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function yv(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Ev(e);if(t){var o=Ev(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Cv(this,r)}}function Cv(e,t){return!t||"object"!==gv(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Ev(e){return(Ev=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Bv=function(e){!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}}),t&&Iv(e,t)}(u,e);var t,r,n,o,i,A,a=yv(u);function u(){return hv(this,u),a.apply(this,arguments)}return t=u,(r=[{key:"getAllCustomModels",value:(A=pv(s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",SI().scene.getAllCustomModels());case 1:case"end":return e.stop()}}),e)}))),function(){return A.apply(this,arguments)})},{key:"getCustomModelById",value:(i=pv(s.a.mark((function e(t){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",SI().scene.getCustomModelById(t));case 1:case"end":return e.stop()}}),e)}))),function(e){return i.apply(this,arguments)})},{key:"save",value:(o=pv(s.a.mark((function e(t){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",SI().scene.save(t.models));case 1:case"end":return e.stop()}}),e)}))),function(e){return o.apply(this,arguments)})}])&&dv(t.prototype,r),n&&dv(t,n),u}(yB);function vv(e){return(vv="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 mv(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Qv(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function bv(e,t){return(bv=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _v(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Sv(e);if(t){var o=Sv(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return wv(this,r)}}function wv(e,t){return!t||"object"!==vv(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Sv(e){return(Sv=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Dv=function(e){!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}}),t&&bv(e,t)}(i,e);var t,r,n,o=_v(i);function i(){return mv(this,i),o.apply(this,arguments)}return t=i,(r=[{key:"setFittingHint",value:function(e){SI().fittingDesign.fittingHint.setFittingHint(e)}},{key:"clearFittingHint",value:function(e){SI().fittingDesign.fittingHint.clearFittingHint(e)}}])&&Qv(t.prototype,r),n&&Qv(t,n),i}(yB);function Rv(e){return(Rv="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 Mv(e,t,r,n,o,i,A){try{var a=e[i](A),s=a.value}catch(e){return void r(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function xv(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function A(e){Mv(i,n,o,A,a,"next",e)}function a(e){Mv(i,n,o,A,a,"throw",e)}A(void 0)}))}}function Pv(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Fv(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ov(e,t){return(Ov=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Tv(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=kv(e);if(t){var o=kv(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Lv(this,r)}}function Lv(e,t){return!t||"object"!==Rv(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function kv(e){return(kv=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Nv,Gv,Uv=function(e){!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}}),t&&Ov(e,t)}(a,e);var t,r,n,o,i,A=Tv(a);function a(){return Pv(this,a),A.apply(this,arguments)}return t=a,(r=[{key:"getAllFittingModels",value:(i=xv(s.a.mark((function e(t){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",SI().fittingDesign.fittingModel.getAllFittingModels(t));case 1:case"end":return e.stop()}}),e)}))),function(e){return i.apply(this,arguments)})},{key:"save",value:(o=xv(s.a.mark((function e(t){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",SI().fittingDesign.fittingModel.save(t.models));case 1:case"end":return e.stop()}}),e)}))),function(e){return o.apply(this,arguments)})}])&&Fv(t.prototype,r),n&&Fv(t,n),a}(yB);function jv(e){return(jv="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 Yv(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Vv(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Hv(e,t){return(Hv=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Kv(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=qv(e);if(t){var o=qv(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Jv(this,r)}}function Jv(e,t){return!t||"object"!==jv(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function qv(e){return(qv=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}!function(e){e.View3D="view3d",e.Roamer="roamer"}(Nv||(Nv={})),function(e){e.UP="UP",e.DOWN="DOWN",e.LEFT="LEFT",e.RIGHT="RIGHT",e.FRONT="FRONT",e.BACK="BACK"}(Gv||(Gv={}));var Wv=function(e){!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}}),t&&Hv(e,t)}(i,e);var t,r,n,o=Kv(i);function i(){return Yv(this,i),o.apply(this,arguments)}return t=i,(r=[{key:"toggleCameraMode",value:function(e){var t;switch(e){case Nv.View3D:t=vn.PerspectiveCameraMode.View3D;break;case Nv.Roamer:t=vn.PerspectiveCameraMode.Roamer}jE().getStateManager().scene3D.updatePerspectiveCameraMode(t)}},{key:"moveCamera",value:function(e){var t,r=jE().getStateManager().scene3D;switch(e){case Gv.UP:case Gv.FRONT:t=vn.ArrowType.UP;break;case Gv.DOWN:case Gv.BACK:t=vn.ArrowType.DOWN;break;case Gv.LEFT:t=vn.ArrowType.LEFT;break;case Gv.RIGHT:t=vn.ArrowType.RIGHT}if(t){if(e===Gv.UP||e===Gv.DOWN)return void r.onQEPress(t);r.onWASDPress(t)}}}])&&Vv(t.prototype,r),n&&Vv(t,n),i}(yB);function zv(e){return(zv="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 Xv(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Zv(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function $v(e,t){return($v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function em(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=rm(e);if(t){var o=rm(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return tm(this,r)}}function tm(e,t){return!t||"object"!==zv(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function rm(e){return(rm=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var nm=function(e){!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}}),t&&$v(e,t)}(i,e);var t,r,n,o=em(i);function i(){return Xv(this,i),o.apply(this,arguments)}return t=i,(r=[{key:"setDefaultHint",value:function(e){SI().fittingDesign.plankFaceHint.setDefaultHintConfig(e)}},{key:"setModelHint",value:function(e){SI().fittingDesign.plankFaceHint.setModelHint(e)}},{key:"clearModelHint",value:function(e){SI().fittingDesign.plankFaceHint.clearModelHint(e)}}])&&Zv(t.prototype,r),n&&Zv(t,n),i}(yB);function om(e){return(om="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 im(e,t,r,n,o,i,A){try{var a=e[i](A),s=a.value}catch(e){return void r(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function Am(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function am(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function sm(e,t){return(sm=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function um(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=lm(e);if(t){var o=lm(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return cm(this,r)}}function cm(e,t){return!t||"object"!==om(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function lm(e){return(lm=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var gm=function(e){!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}}),t&&sm(e,t)}(a,e);var t,r,n,o,i,A=um(a);function a(){return Am(this,a),A.apply(this,arguments)}return t=a,(r=[{key:"getParamData",value:function(e){return SI().viewParamModel.getParamModelJsonData(e)}},{key:"getParamIntersected",value:(o=s.a.mark((function e(t){var r;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,SI().fittingDesign.intersected.getParamModelIntersectedData(t);case 2:return r=e.sent,e.abrupt("return",(n=r,{intersectedGroups:Object(_e.map)(n.intersectedGroups,(function(e){return Bf(Bf({},e),{},{intersecteds:Object(_e.map)(e.intersecteds,(function(e){return Object(_e.omit)(e,["shell"])}))})}))}));case 4:case"end":return e.stop()}var n}),e)})),i=function(){var e=this,t=arguments;return new Promise((function(r,n){var i=o.apply(e,t);function A(e){im(i,r,n,A,a,"next",e)}function a(e){im(i,r,n,A,a,"throw",e)}A(void 0)}))},function(e){return i.apply(this,arguments)})},{key:"getTopParamModels",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.ignoreCategory||(e.ignoreCategory=y),SI().viewParamModel.getTopModelList(e)}},{key:"getParamModelPhotoById",value:function(e){return SI().viewParamModel.getParamModelPhotoData(e)}}])&&am(t.prototype,r),n&&am(t,n),a}(yB);function fm(e){return(fm="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 pm(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hm(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function dm(e,t){return(dm=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Im(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Cm(e);if(t){var o=Cm(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return ym(this,r)}}function ym(e,t){return!t||"object"!==fm(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Cm(e){return(Cm=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Em,Bm,vm=function(){return SI().select},mm=function(){return SI().baseDesignInfo};!function(e){e[e.NULL=0]="NULL",e[e.MODEL=1]="MODEL",e[e.CASBIN=2]="CASBIN"}(Em||(Em={})),function(e){e[e.MODEL=1]="MODEL",e[e.CASBIN=2]="CASBIN"}(Bm||(Bm={}));var Qm=function(e){!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}}),t&&dm(e,t)}(i,e);var t,r,n,o=Im(i);function i(){var e;return pm(this,i),(e=o.apply(this,arguments)).hasWatchSelectionChange=!1,e.__generateEntity=function(e){return Object(_e.castArray)(e).map((function(e){var t={__sceneId:Mg.SCENE_ID,entityId:e.id,entityType:li};return e.type===Bm.CASBIN&&(t.entityId=mm().state.casbinModelIdMap[e.id]),t}))},e.onSelectedChanged=function(){Qe.emit(Be.SELECTION_SERVICE_MODEL_CHANGE,e.getSelected())},e}return t=i,(r=[{key:"getSelected",value:function(){var e=vm().state.state.selectedData,t=SI().viewParamModel.state.state.allSubModels;if(e.length){var r=e[0].$model;if(r&&r instanceof fe&&r.isAppendHardware)return{data:[r.hardwareData],type:Em.CASBIN};var n=Object(_e.map)(e,"id"),o=t.filter((function(e){return n.includes(e.id)}));if(n.length)return{data:o,type:Em.MODEL}}return{data:[],type:Em.NULL}}},{key:"select",value:function(e){var t=this.__generateEntity(e);vm().select(t)}},{key:"unSelect",value:function(e){if(e){var t=this.__generateEntity(e);vm().unSelect(t)}else vm().select([])}},{key:"startWatchSelectedChangedEvent",value:function(){this.hasWatchSelectionChange||(this.hasWatchSelectionChange=!0,vm().on(_I.EVENT_SELECT_CHANGED,this.onSelectedChanged))}},{key:"on",value:function(e){this.startWatchSelectedChangedEvent(),Qe.on(Be.SELECTION_SERVICE_MODEL_CHANGE,e)}},{key:"off",value:function(e){Qe.off(Be.SELECTION_SERVICE_MODEL_CHANGE,e)}},{key:"once",value:function(e){this.startWatchSelectedChangedEvent(),Qe.once(Be.SELECTION_SERVICE_MODEL_CHANGE,e)}},{key:"__onDestroy",value:function(){vm().off(_I.EVENT_SELECT_CHANGED,this.onSelectedChanged)}}])&&hm(t.prototype,r),n&&hm(t,n),i}(yB);function bm(e){return(bm="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 _m(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wm(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Sm(e,t){return(Sm=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Dm(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Mm(e);if(t){var o=Mm(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Rm(this,r)}}function Rm(e,t){return!t||"object"!==bm(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Mm(e){return(Mm=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var xm=function(){return SI().select},Pm=function(){return jE().designModeContext},Fm=function(e){!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}}),t&&Sm(e,t)}(A,e);var t,r,o,i=Dm(A);function A(){var e;return _m(this,A),(e=i.apply(this,arguments)).hasWatchSelectionChange=!1,e.onSelectedChanged=function(){Qe.emit(Be.SELECTION_SERVICE_V2_MODEL_CHANGE,e.getSelected())},e}return t=A,(r=[{key:"getSelected",value:function(){return xm().state.state.selectedDataV2.map(this._genElement).filter((function(e){return!!e}))}},{key:"select",value:function(e){var t=Object(_e.castArray)(e).map(this._genEntityFromElement);xm().select(t),Pm().setCurSelectEntity(t)}},{key:"unSelect",value:function(e){if(e){var t=Object(_e.castArray)(e).map(this._genEntityFromElement);xm().unSelect(t);var r=Pm().getCurSelectEntity();r&&(Array.isArray(r)?Pm().setCurSelectEntity(Object(_e.difference)(r,t)):t.includes(r)&&Pm().setCurSelectEntity(void 0))}else xm().select(),Pm().setCurSelectEntity(void 0)}},{key:"on",value:function(e){this.startWatchSelectedChangedEvent(),Qe.on(Be.SELECTION_SERVICE_V2_MODEL_CHANGE,e)}},{key:"off",value:function(e){Qe.off(Be.SELECTION_SERVICE_V2_MODEL_CHANGE,e)}},{key:"once",value:function(e){this.startWatchSelectedChangedEvent(),Qe.once(Be.SELECTION_SERVICE_V2_MODEL_CHANGE,e)}},{key:"startWatchSelectedChangedEvent",value:function(){this.hasWatchSelectionChange||(this.hasWatchSelectionChange=!0,xm().on(_I.EVENT_SELECT_CHANGED_V2,this.onSelectedChanged))}},{key:"_genEntityFromElement",value:function(e){return{entityId:e.id,entityType:qE[e.type]}}},{key:"_genElement",value:function(e){var t;if(e instanceof fe?t=e.isAppendHardware?E.HARDWARE:E.PARAM_MODEL:e instanceof ve?t=E.PARAM_MODEL_ASSEMBLY:e instanceof Vt?t=E.HARDWARE_GROOVE:e instanceof pt&&(t=e.type===n.HOLE?E.HOLE:E.GROOVE),t)return{id:e.id,type:t}}},{key:"__onDestroy",value:function(){xm().off(_I.EVENT_SELECT_CHANGED,this.onSelectedChanged)}}])&&wm(t.prototype,r),o&&wm(t,o),A}(yB);function Om(e){return(Om="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 Tm(e,t,r,n,o,i,A){try{var a=e[i](A),s=a.value}catch(e){return void r(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function Lm(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function A(e){Tm(i,n,o,A,a,"next",e)}function a(e){Tm(i,n,o,A,a,"throw",e)}A(void 0)}))}}function km(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Nm(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Gm(e,t){return(Gm=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Um(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Ym(e);if(t){var o=Ym(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return jm(this,r)}}function jm(e,t){return!t||"object"!==Om(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Ym(e){return(Ym=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Vm=function(e){!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}}),t&&Gm(e,t)}(u,e);var t,r,n,o,i,A,a=Um(u);function u(){return km(this,u),a.apply(this,arguments)}return t=u,(r=[{key:"viewSelected",value:(A=Lm(s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",SI().viewParamModel.viewSelectedParamModel());case 1:case"end":return e.stop()}}),e)}))),function(){return A.apply(this,arguments)})},{key:"viewModelById",value:(i=Lm(s.a.mark((function e(t){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",SI().viewParamModel.viewParamModelById(t));case 1:case"end":return e.stop()}}),e)}))),function(e){return i.apply(this,arguments)})},{key:"resetPerspective",value:function(){var e=jE().getStateManager().scene3D;e.updateEnableCameraAnimation(!0),e.reset()}},{key:"toggleModelBorder",value:function(e){SI().scene.$actionToggleRenderBorder.dispatch(e)}},{key:"toggleModelTransparent",value:function(e){SI().scene.$actionToggleRenderTranslucent.dispatch(e)}},{key:"setting",value:function(e){SI().fittingDesign.senseSetting.$actionSenseSetting.dispatch(e)}},{key:"refreshModel",value:(o=Lm(s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",SI().viewParamModel.refreshCustomModelData());case 1:case"end":return e.stop()}}),e)}))),function(){return o.apply(this,arguments)})}])&&Nm(t.prototype,r),n&&Nm(t,n),u}(yB),Hm=r(280);function Km(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Jm(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Km(Object(r),!0).forEach((function(t){qm(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Km(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function qm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Wm(e){return function(e){if(Array.isArray(e))return zm(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return zm(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return zm(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function zm(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Xm(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var Zm=function(){function e(t,r){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._changeMap={},this.id=Ke()(),this.modelID=t,this.paths=r,r.forEach((function(e){e.plankArea=n}))}var t,r,n;return t=e,(r=[{key:"getRealPaths",value:function(t){var r;if(this._realPathsCache&&!t)return this._realPathsCache;if(!this.paths.length)return new e(this.modelID,[]);var n=this.getFace2ds();if(this.paths.length>1){var o=[];c.FacesBoolean.faces2DBoolean(n.slice(0,1),n.slice(1),c.FacesBoolean.FaceBooleanType.subtract,o),n=o}var i=0===n.length?n[0]:{loops:(r=[]).concat.apply(r,Wm(n.map((function(e){return e.loops}))))};Object(Hm.calculateFaceBBox)(i);var A=i.box.center,a=c.Matrix3.makeTranslation(-A.x,-A.y);n.forEach((function(e){e.loops.forEach((function(e){e.forEach((function(e){e.transform(a)}))}))}));var s=n.map((function(e){return e.loops[0]})).map((function(e){return $m(C.OUTER,e)})),u=n.reduce((function(e,t){return e.push.apply(e,Wm(t.loops.slice(1))),e}),[]).map((function(e){return $m(C.INNER,e,!0)})),l=new e(this.modelID,[].concat(Wm(s),Wm(u)));return this._realPathsCache=l,l}},{key:"getFace2ds",value:function(){var e=[];return this.paths.forEach((function(t){var r=[];if(t.lines.forEach((function(e){var t=e.start;t.getType()!==l.NONE&&r.push(t.getCurveLineAndPoints().curveLine),r.push(e.getRealLine())})),t.offset){var n=(0,c.LoopCCW.isPolygonCCW2D)(r.map((function(e){return e.startPoint})))?t.offset:-t.offset,o=c.Path2dOffset.offsetPath2d(r,n);e.push({loops:o.resultPaths})}else e.push({loops:[r]})})),e}},{key:"_trackUpdateField",value:function(e,t,r){this._changeMap.update=this._changeMap.update||[];var n=this._changeMap.update,o=e.field;t===r||n.some((function(t){return t.field===o&&t.context.id===e.context.id}))||n.push(e)}},{key:"changeMap",get:function(){return this._changeMap},set:function(e){this._changeMap=e}}])&&Xm(t.prototype,r),n&&Xm(t,n),e}();function $m(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=t.map((function(e){return new Qt({type:l.NONE,position:e.startPoint})})),o=t.map((function(e){var t;return t=e instanceof c.LineSeg2d?{type:g.SEGMENT}:e instanceof c.Arc2d?eQ(e):tQ(e),new Et(t)})),i=c.LoopCCW.isPolygonCCW2D(n.map((function(e){return e.getPosition()})));r!==i&&(n=n.reverse(),o=(o=o.reverse().map((function(e){return"boolean"==typeof e.clockwise&&(e.clockwise=!e.clockwise),e}))).slice(1).concat(o[0]));var A=nQ(n.map((function(e){return e.getPosition()})));return n=n.slice(A).concat(n.slice(0,A)),o=o.slice(A).concat(o.slice(0,A)),new Rt({type:e,points:n,lines:o,forceCCW:!1})}function eQ(e){var t={};t.type=g.CIRCLE_ARC,t.radius=e.radius,t.clockwise=!e.isCCW;var r=e.center,n=e.startPoint,o=e.endPoint,i=new c.LineSeg2d(n,o),A=i.length/2,a=new c.Vector2d(i.getPoint(A)),s=new c.Vector2d(r).subtracted(a).normalized();return t.clockwise?t.minorArc=s.isSameDirection(i.rightNormal):t.minorArc=s.isSameDirection(i.leftNormal),t}function tQ(e){var t={};return t.type=g.ELLIPSE_ARC,t.majorRadius=e.majorRadius,t.minorRadius=e.minorRadius,t.clockwise=!e.isCCW,t.ellipseCenter=e.ccs.origin,t}function rQ(e){var t=e.changeMap.update;t&&t.length>0&&(t.forEach((function(e){var t=e.field,r=e.context;"hint"===t&&((r=r).getHint()?mu(r):function(e,t){var r=Iu().getStateManager().fittingDesign,n=r.getPlankOutlineHintModels(),o=n.findIndex((function(r){return r.linkModel.id===e&&r.id===t}));if(o>-1){var i=yu(n);i.splice(o,1),r.setPlankOutlineHintModels(i)}}(r.path.plankArea.modelID,r.id))})),e.changeMap=Jm(Jm({},e.changeMap),{},{update:[]}))}function nQ(e){if(!e.length)return 0;var t=e[0].y,r=e[0].x;e.slice(1).forEach((function(e){t<e.y&&(t=e.y),r>e.x&&(r=e.x)}));var n,o,i=-r,A=-t;return e.forEach((function(t,r){var a=t.x,s=t.y,u=Math.pow(a+i,2)+Math.pow(s+A,2);void 0===n||u<n?(n=u,o=r):n===u&&e[o].x>t.x&&(o=r)})),o}function oQ(e){return(oQ="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 iQ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function AQ(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function aQ(e,t){return(aQ=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function sQ(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=cQ(e);if(t){var o=cQ(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return uQ(this,r)}}function uQ(e,t){return!t||"object"!==oQ(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function cQ(e){return(cQ=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var lQ=function(e){!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}}),t&&aQ(e,t)}(i,e);var t,r,n,o=sQ(i);function i(){return iQ(this,i),o.apply(this,arguments)}return t=i,(r=[{key:"parseModelPlankPath",value:function(e){return t=e.modelID,r=e.data,n=[],r.path&&n.push(Mt(C.OUTER,r.path)),n.push.apply(n,Wm(r.holes.map((function(e){return Mt(C.INNER,e)})))),new Zm(t,n);var t,r,n}},{key:"syncModelPlankPath",value:function(e){rQ(e)}}])&&AQ(t.prototype,r),n&&AQ(t,n),i}(yB);function gQ(e){return(gQ="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 fQ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pQ(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function hQ(e,t){return(hQ=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function dQ(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=yQ(e);if(t){var o=yQ(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return IQ(this,r)}}function IQ(e,t){return!t||"object"!==gQ(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function yQ(e){return(yQ=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var CQ=function(e){!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}}),t&&hQ(e,t)}(i,e);var t,r,n,o=dQ(i);function i(){return fQ(this,i),o.apply(this,arguments)}return t=i,(r=[{key:"setDesignMode",value:function(e){var t=e.mode,r=e.customModeCb;jE().designModeContext.setDesignMode(t,r)}},{key:"registerMultiSelectShortcut",value:function(e){jE().designModeContext.registerMultiSelectShortcut(e)}}])&&pQ(t.prototype,r),n&&pQ(t,n),i}(yB),EQ=r(425),BQ=r.n(EQ),vQ=new Bn.I18NManager,mQ="custom_order_split",QQ={"custom.pad.resetPerspective":"重置视角","custom.pad.confirm":"确定","custom.pad.cannotAdd":"无法适配该模型","custom.pad.chooseBasicModule":"请选择基础模块","custom.pad.loadSeriesFailed":"加载系列失败","custom.pad.invalidSeries":"系列信息无效","custom.pad.invalidURL":"页面走丢了","custom.pad.loadDesignFailed":"产品加载失败","custom.pad.invalidDesign":"产品信息无效","custom.pad.loadFailed":"数据加载失败","custom.pad.invalidData":"数据无效","custom.pad.saveFailed":"产品保存失败","custom.pad.previewFailed":"生成预览图失败","custom.pad.save":"保存","custom.pad.saveAs":"另存为","custom.pad.saveTitle":"产品保存","custom.pad.saveAsTitle":"产品另存为","custom.pad.saveName":"产品名称","custom.pad.saveNameHolder":"请输入产品名称","custom.pad.saveRequired":"该项为必填项","custom.pad.savePos":"存储位置","custom.pad.savePersonal":"个人库","custom.pad.saveEnterprise":"企业库","custom.pad.cancel":"取消","custom.pad.askSave":"是否保存?","custom.pad.askSaveDesc":"是否要保存当前产品方案?","custom.pad.notSave":"不保存","custom.pad.getAuthFailed":"获取用户账号类型失败","custom.pad.uploadCoverFailed":"上传图片封面失败","custom.pad.hideDoor":"隐藏柜门","custom.pad.showDoor":"显示柜门","custom.pad.showDoorTip":"柜门已隐藏, 点击此处可显示柜门","custom.pad.shadingMode":"材质","custom.pad.outlineShadingMode":"材质 + 线框","custom.pad.frameStyle":"柜体样式","custom.pad.replaceFail":"修改样式失败","custom.pad.productNameExist":"产品名称已存在","custom.pad.saveSuccess":"产品保存成功","custom.pad.defaultSaveName":"未命名","custom.pad.showRuler":"显示尺寸","custom.pad.hideRuler":"隐藏尺寸"};function bQ(e,t,r,n,o,i,A){try{var a=e[i](A),s=a.value}catch(e){return void r(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function _Q(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function A(e){bQ(i,n,o,A,a,"next",e)}function a(e){bQ(i,n,o,A,a,"throw",e)}A(void 0)}))}}var wQ=Object(_e.once)((function(){return!!Object(bu.parseServQueryParams)()}));function SQ(){return DQ.apply(this,arguments)}function DQ(){return(DQ=_Q(s.a.mark((function e(){var t,r,n=arguments;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:{},r=bu.servkit.createTerminal({id:t.clientId||"custom-order-split",type:bu.EServTerminal.SLAVE,server:{service:{services:[]},serviceRefer:/.*/},session:{checkSession:!0,channel:{type:bu.EServChannel.WINDOW,config:{slave:{getWindow:function(e){return{target:window.parent,window:window}}}}}}}),e.next=4,r.openSession({timeout:t.timeout||3e4});case 4:return e.abrupt("return",r);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var RQ=r(517),MQ=r.n(RQ),xQ=r(1107),PQ=r.n(xQ);function FQ(e){return(FQ="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 OQ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function TQ(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function LQ(e,t){return(LQ=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function kQ(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=GQ(e);if(t){var o=GQ(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return NQ(this,r)}}function NQ(e,t){return!t||"object"!==FQ(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function GQ(e){return(GQ=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var UQ=function(e){!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}}),t&&LQ(e,t)}(i,e);var t,r,n,o=kQ(i);function i(){return OQ(this,i),o.apply(this,arguments)}return t=i,(r=[{key:"render",value:function(){var e=this.props,t=e.tip,r=e.noImg,n=e.imgSrc,o=e.className;return Qn.a.createElement("div",{className:MQ()(PQ.a.empty,o)},!r&&Qn.a.createElement("img",{src:n||"//qhstaticssl.kujiale.com/newt/227/image/png/1549962437921/D1F6B2D9AF21335BEEF19C45580DE165.png"}),t&&Qn.a.createElement("p",null,t))}}])&&TQ(t.prototype,r),n&&TQ(t,n),i}(Qn.a.PureComponent);function jQ(e){return(jQ="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 YQ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function VQ(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function HQ(e,t){return(HQ=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function KQ(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=qQ(e);if(t){var o=qQ(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return JQ(this,r)}}function JQ(e,t){return!t||"object"!==jQ(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function qQ(e){return(qQ=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var WQ=function(e){!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}}),t&&HQ(e,t)}(i,e);var t,r,n,o=KQ(i);function i(){return YQ(this,i),o.apply(this,arguments)}return t=i,(r=[{key:"render",value:function(){var e=this.props;return Qn.a.createElement(vn.Scene3D,e)}}])&&VQ(t.prototype,r),n&&VQ(t,n),i}(mn.PureComponent),zQ=r(1108),XQ=r.n(zQ);function ZQ(e){return(ZQ="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 $Q(){return($Q=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function eb(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function tb(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function rb(e,t){return(rb=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function nb(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=ib(e);if(t){var o=ib(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return ob(this,r)}}function ob(e,t){return!t||"object"!==ZQ(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ib(e){return(ib=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}mn.PureComponent;var Ab=r(88);function ab(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var A,a=e[Symbol.iterator]();!(n=(A=a.next()).done)&&(r.push(A.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(o)throw i}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return sb(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return sb(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function sb(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}window.React=Qn.a;var ub=document.getElementById("root");function cb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function lb(e,t,r,n,o,i,A){try{var a=e[i](A),s=a.value}catch(e){return void r(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function gb(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function A(e){lb(i,n,o,A,a,"next",e)}function a(e){lb(i,n,o,A,a,"throw",e)}A(void 0)}))}}function fb(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var pb=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.serviceMap=new Map,this.initLange(A.ZH_CN,{zh_CN:QQ}),function(e){Zl=e}(this)}var t,r,n,o,i;return t=e,(r=[{key:"isInCustomMiniAppMode",value:function(){return wQ()}},{key:"start",value:(i=gb(s.a.mark((function e(t){var r,n,o=this;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.isInCustomMiniAppMode()){e.next=7;break}if(bu.sappSDK.isStarted){e.next=4;break}return e.next=4,bu.sappSDK.setConfig({useTerminalId:null==t?void 0:t.clientId,onClose:function(){var e=gb(s.a.mark((function e(t){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.stop();case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}).start();case 4:this.sappSDK=bu.sappSDK,e.next=10;break;case 7:return e.next=9,SQ(t);case 9:this.sappSDK=e.sent;case 10:return e.next=12,Promise.resolve([vn.App,nv]).then((function(e){var t=ab(e,2),r=t[0],n=t[1];(new r).registerPlugin(n).start({fpsDetectorEnabled:!0}),document.body.removeChild(ub)})).catch((function(e){Object(Ab.unmountComponentAtNode)(ub),Object(Ab.render)(Qn.a.createElement(UQ,null),ub),console.error("micros/pad",e)}));case 12:return(r=this.getCustomMiniAppService(zc))?(ou().setMiniAppHttpProxyClientService(r),ag(ou())):ag(nu()),(eg=new Ag.AttachedService).config.setRequestClient(rg),tg=new Ag.ParamModelDataService({paramModelConstructor:fe,requestClient:rg}),new Ag.ParamModelAssemblyDataService({paramModelAssemblyConstructor:ve,requestClient:rg}),n=this.getService(Vm),e.prev=16,e.next=19,n.viewSelected();case 19:e.next=24;break;case 21:e.prev=21,e.t0=e.catch(16),Object({DEPLOY_VERSION:1,APP_VERSION:1}).IS_DEV&&console.error(e.t0);case 24:case"end":return e.stop()}}),e,this,[[16,21]])}))),function(e){return i.apply(this,arguments)})},{key:"initLange",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:A.ZH_CN,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};window.__PUB_LANG__=Object(_e.extend)(window.__PUB_LANG__,{kaf_core:{lang:{}},custom_model:{lange:{}}}),BQ.a.init({lang:e,debug:!1,initImmediate:!0,translatorType:EQ.ENUM.TranslatorType.I18next,packages:[mQ],resource:cb({},mQ,t)}),vQ.init({namespace:mQ,resources:mQ})}},{key:"stop",value:(o=gb(s.a.mark((function e(){var t;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t=this.getCustomMiniAppService(tl))){e.next=4;break}return e.next=4,t.lockModelBySplit();case 4:this.serviceMap.forEach((function(e){Object(_e.isFunction)(e.__onDestroy)&&e.__onDestroy()})),this.serviceMap=new Map;case 6:case"end":return e.stop()}}),e,this)}))),function(){return o.apply(this,arguments)})},{key:"getService",value:function(e){if(yB.isPrototypeOf(e)){var t=this.serviceMap,r=t.get(e);return r||(r=new e,t.set(e,r)),r}throw new Error("service not found!")}},{key:"getCustomMiniAppService",value:function(e){var t=this.sappSDK;if(!this.sappSDK)throw new Error("app not started!");return t instanceof bu.SappSDK?t.getService(e):t.client.getService(e)}},{key:"getCustomMiniAppServiceUnSafe",value:function(e){return this.getCustomMiniAppService(e)}}])&&fb(t.prototype,r),n&&fb(t,n),e}()},function(e,t,r){"use strict";r.r(t),r.d(t,"changeLanguage",(function(){return X})),r.d(t,"cloneInstance",(function(){return Z})),r.d(t,"createInstance",(function(){return $})),r.d(t,"dir",(function(){return ee})),r.d(t,"exists",(function(){return te})),r.d(t,"getFixedT",(function(){return re})),r.d(t,"init",(function(){return ne})),r.d(t,"loadLanguages",(function(){return oe})),r.d(t,"loadNamespaces",(function(){return ie})),r.d(t,"loadResources",(function(){return Ae})),r.d(t,"off",(function(){return ae})),r.d(t,"on",(function(){return se})),r.d(t,"setDefaultNamespace",(function(){return ue})),r.d(t,"t",(function(){return ce})),r.d(t,"use",(function(){return le}));var n=r(186),o=r.n(n),i=r(82),A=r.n(i),a=r(74),s=r.n(a),u=r(75),c=r.n(u),l=r(210),g=r.n(l),f=r(239),p=r.n(f),h=r(240),d=r.n(h),I=r(101),y=r.n(I),C=r(1100),E=r.n(C),B={type:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("warn",e)},error:function(e){this.output("error",e)},output:function(e,t){var r;console&&console[e]&&(r=console)[e].apply(r,E()(t))}},v=new(function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};s()(this,e),this.init(t,r)}return c()(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||B,this.options=t,this.debug=t.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.forward(t,"log","",!0)}},{key:"warn",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.forward(t,"warn","",!0)}},{key:"error",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.forward(t,"error","")}},{key:"deprecate",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(e,t,r,n){return n&&!this.debug?null:("string"==typeof e[0]&&(e[0]="".concat(r).concat(this.prefix," ").concat(e[0])),this.logger[t](e))}},{key:"create",value:function(t){return new e(this.logger,A()({},{prefix:"".concat(this.prefix,":").concat(t,":")},this.options))}}]),e}()),m=function(){function e(){s()(this,e),this.observers={}}return c()(e,[{key:"on",value:function(e,t){var r=this;return e.split(" ").forEach((function(e){r.observers[e]=r.observers[e]||[],r.observers[e].push(t)})),this}},{key:"off",value:function(e,t){var r=this;this.observers[e]&&this.observers[e].forEach((function(){if(t){var n=r.observers[e].indexOf(t);n>-1&&r.observers[e].splice(n,1)}else delete r.observers[e]}))}},{key:"emit",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];if(this.observers[e]){var o=[].concat(this.observers[e]);o.forEach((function(e){e.apply(void 0,r)}))}if(this.observers["*"]){var i=[].concat(this.observers["*"]);i.forEach((function(t){t.apply(t,[e].concat(r))}))}}}]),e}();function Q(){var e,t,r=new Promise((function(r,n){e=r,t=n}));return r.resolve=e,r.reject=t,r}function b(e){return null==e?"":""+e}function _(e,t,r){e.forEach((function(e){t[e]&&(r[e]=t[e])}))}function w(e,t,r){function n(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function o(){return!e||"string"==typeof e}for(var i="string"!=typeof t?[].concat(t):t.split(".");i.length>1;){if(o())return{};var A=n(i.shift());!e[A]&&r&&(e[A]=new r),e=e[A]}return o()?{}:{obj:e,k:n(i.shift())}}function S(e,t,r){var n=w(e,t,Object);n.obj[n.k]=r}function D(e,t){var r=w(e,t),n=r.obj,o=r.k;if(n)return n[o]}function R(e,t,r){for(var n in t)n in e?"string"==typeof e[n]||e[n]instanceof String||"string"==typeof t[n]||t[n]instanceof String?r&&(e[n]=t[n]):R(e[n],t[n],r):e[n]=t[n];return e}function M(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var x={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function P(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return x[e]})):e}var F=function(e){function t(e){var r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return s()(this,t),r=g()(this,p()(t).call(this)),m.call(y()(y()(r))),r.data=e||{},r.options=n,void 0===r.options.keySeparator&&(r.options.keySeparator="."),r}return d()(t,e),c()(t,[{key:"addNamespaces",value:function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}},{key:"getResource",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,i=[e,t];return r&&"string"!=typeof r&&(i=i.concat(r)),r&&"string"==typeof r&&(i=i.concat(o?r.split(o):r)),e.indexOf(".")>-1&&(i=e.split(".")),D(this.data,i)}},{key:"addResource",value:function(e,t,r,n){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},i=this.options.keySeparator;void 0===i&&(i=".");var A=[e,t];r&&(A=A.concat(i?r.split(i):r)),e.indexOf(".")>-1&&(n=t,t=(A=e.split("."))[1]),this.addNamespaces(t),S(this.data,A,n),o.silent||this.emit("added",e,t,r,n)}},{key:"addResources",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var o in r)"string"!=typeof r[o]&&"[object Array]"!==Object.prototype.toString.apply(r[o])||this.addResource(e,t,o,r[o],{silent:!0});n.silent||this.emit("added",e,t,r)}},{key:"addResourceBundle",value:function(e,t,r,n,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},a=[e,t];e.indexOf(".")>-1&&(n=r,r=t,t=(a=e.split("."))[1]),this.addNamespaces(t);var s=D(this.data,a)||{};n?R(s,r,o):s=A()({},s,r),S(this.data,a,s),i.silent||this.emit("added",e,t,r)}},{key:"removeResourceBundle",value:function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}},{key:"hasResourceBundle",value:function(e,t){return void 0!==this.getResource(e,t)}},{key:"getResourceBundle",value:function(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?A()({},{},this.getResource(e,t)):this.getResource(e,t)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"toJSON",value:function(){return this.data}}]),t}(m),O={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,r,n,o){var i=this;return e.forEach((function(e){i.processors[e]&&(t=i.processors[e].process(t,r,n,o))})),t}},T=function(e){function t(e){var r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return s()(this,t),r=g()(this,p()(t).call(this)),m.call(y()(y()(r))),_(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat"],e,y()(y()(r))),r.options=n,void 0===r.options.keySeparator&&(r.options.keySeparator="."),r.logger=v.create("translator"),r}return d()(t,e),c()(t,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},r=this.resolve(e,t);return r&&void 0!==r.res}},{key:"extractFromKey",value:function(e,t){var r=t.nsSeparator||this.options.nsSeparator;void 0===r&&(r=":");var n=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,o=t.ns||this.options.defaultNS;if(r&&e.indexOf(r)>-1){var i=e.split(r);(r!==n||r===n&&this.options.ns.indexOf(i[0])>-1)&&(o=i.shift()),e=i.join(n)}return"string"==typeof o&&(o=[o]),{key:e,namespaces:o}}},{key:"translate",value:function(e,t){var r=this;if("object"!==o()(t)&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var n=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,i=this.extractFromKey(e[e.length-1],t),a=i.key,s=i.namespaces,u=s[s.length-1],c=t.lng||this.language,l=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(c&&"cimode"===c.toLowerCase()){if(l){var g=t.nsSeparator||this.options.nsSeparator;return u+g+a}return a}var f=this.resolve(e,t),p=f&&f.res,h=f&&f.usedKey||a,d=f&&f.exactUsedKey||a,I=Object.prototype.toString.apply(p),y=["[object Number]","[object Function]","[object RegExp]"],C=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,E=!this.i18nFormat||this.i18nFormat.handleAsObject,B="string"!=typeof p&&"boolean"!=typeof p&&"number"!=typeof p;if(E&&p&&B&&y.indexOf(I)<0&&("string"!=typeof C||"[object Array]"!==I)){if(!t.returnObjects&&!this.options.returnObjects)return this.logger.warn("accessing an object - but returnObjects options is not enabled!"),this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,p,t):"key '".concat(a," (").concat(this.language,")' returned an object instead of string.");if(n){var v="[object Array]"===I,m=v?[]:{},Q=v?d:h;for(var b in p)if(Object.prototype.hasOwnProperty.call(p,b)){var _="".concat(Q).concat(n).concat(b);m[b]=this.translate(_,A()({},t,{joinArrays:!1,ns:s})),m[b]===_&&(m[b]=p[b])}p=m}}else if(E&&"string"==typeof C&&"[object Array]"===I)(p=p.join(C))&&(p=this.extendTranslation(p,e,t));else{var w=!1,S=!1;if(!this.isValidLookup(p)&&void 0!==t.defaultValue){if(w=!0,void 0!==t.count){var D=this.pluralResolver.getSuffix(c,t.count);p=t["defaultValue".concat(D)]}p||(p=t.defaultValue)}this.isValidLookup(p)||(S=!0,p=a);var R=t.defaultValue&&t.defaultValue!==p&&this.options.updateMissing;if(S||w||R){this.logger.log(R?"updateKey":"missingKey",c,u,a,R?t.defaultValue:p);var M=[],x=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&x&&x[0])for(var P=0;P<x.length;P++)M.push(x[P]);else"all"===this.options.saveMissingTo?M=this.languageUtils.toResolveHierarchy(t.lng||this.language):M.push(t.lng||this.language);var F=function(e,n){r.options.missingKeyHandler?r.options.missingKeyHandler(e,u,n,R?t.defaultValue:p,R,t):r.backendConnector&&r.backendConnector.saveMissing&&r.backendConnector.saveMissing(e,u,n,R?t.defaultValue:p,R,t),r.emit("missingKey",e,u,n,p)};if(this.options.saveMissing){var O=void 0!==t.count&&"string"!=typeof t.count;this.options.saveMissingPlurals&&O?M.forEach((function(e){r.pluralResolver.getPluralFormsOfKey(e,a).forEach((function(t){return F([e],t)}))})):F(M,a)}}p=this.extendTranslation(p,e,t,f),S&&p===a&&this.options.appendNamespaceToMissingKey&&(p="".concat(u,":").concat(a)),S&&this.options.parseMissingKeyHandler&&(p=this.options.parseMissingKeyHandler(p))}return p}},{key:"extendTranslation",value:function(e,t,r,n){var o=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,r,n.usedLng,n.usedNS,n.usedKey,{resolved:n});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init(A()({},r,{interpolation:A()({},this.options.interpolation,r.interpolation)}));var i=r.replace&&"string"!=typeof r.replace?r.replace:r;this.options.interpolation.defaultVariables&&(i=A()({},this.options.interpolation.defaultVariables,i)),e=this.interpolator.interpolate(e,i,r.lng||this.language,r),!1!==r.nest&&(e=this.interpolator.nest(e,(function(){return o.translate.apply(o,arguments)}),r)),r.interpolation&&this.interpolator.reset()}var a=r.postProcess||this.options.postProcess,s="string"==typeof a?[a]:a;return null!=e&&s&&s.length&&!1!==r.applyPostProcessor&&(e=O.handle(s,e,t,r,this)),e}},{key:"resolve",value:function(e){var t,r,n,o,i,A=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach((function(e){if(!A.isValidLookup(t)){var s=A.extractFromKey(e,a),u=s.key;r=u;var c=s.namespaces;A.options.fallbackNS&&(c=c.concat(A.options.fallbackNS));var l=void 0!==a.count&&"string"!=typeof a.count,g=void 0!==a.context&&"string"==typeof a.context&&""!==a.context,f=a.lngs?a.lngs:A.languageUtils.toResolveHierarchy(a.lng||A.language,a.fallbackLng);c.forEach((function(e){A.isValidLookup(t)||(i=e,f.forEach((function(r){if(!A.isValidLookup(t)){o=r;var i,s,c=u,f=[c];if(A.i18nFormat&&A.i18nFormat.addLookupKeys)A.i18nFormat.addLookupKeys(f,u,r,e,a);else l&&(i=A.pluralResolver.getSuffix(r,a.count)),l&&g&&f.push(c+i),g&&f.push(c+="".concat(A.options.contextSeparator).concat(a.context)),l&&f.push(c+=i);for(;s=f.pop();)A.isValidLookup(t)||(n=s,t=A.getResource(r,e,s,a))}})))}))}})),{res:t,usedKey:r,exactUsedKey:n,usedLng:o,usedNS:i}}},{key:"isValidLookup",value:function(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}},{key:"getResource",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,r,n):this.resourceStore.getResource(e,t,r,n)}}]),t}(m);function L(e){return e.charAt(0).toUpperCase()+e.slice(1)}var k=function(){function e(t){s()(this,e),this.options=t,this.whitelist=this.options.whitelist||!1,this.logger=v.create("languageUtils")}return c()(e,[{key:"getScriptPartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return null;var t=e.split("-");return 2===t.length?null:(t.pop(),this.formatLanguageCode(t.join("-")))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return e;var t=e.split("-");return this.formatLanguageCode(t[0])}},{key:"formatLanguageCode",value:function(e){if("string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],r=e.split("-");return this.options.lowerCaseLng?r=r.map((function(e){return e.toLowerCase()})):2===r.length?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),t.indexOf(r[1].toLowerCase())>-1&&(r[1]=L(r[1].toLowerCase()))):3===r.length&&(r[0]=r[0].toLowerCase(),2===r[1].length&&(r[1]=r[1].toUpperCase()),"sgn"!==r[0]&&2===r[2].length&&(r[2]=r[2].toUpperCase()),t.indexOf(r[1].toLowerCase())>-1&&(r[1]=L(r[1].toLowerCase())),t.indexOf(r[2].toLowerCase())>-1&&(r[2]=L(r[2].toLowerCase()))),r.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isWhitelisted",value:function(e){return("languageOnly"===this.options.load||this.options.nonExplicitWhitelist)&&(e=this.getLanguagePartFromCode(e)),!this.whitelist||!this.whitelist.length||this.whitelist.indexOf(e)>-1}},{key:"getFallbackCodes",value:function(e,t){if(!e)return[];if("string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];var r=e[t];return r||(r=e[this.getScriptPartFromCode(t)]),r||(r=e[this.formatLanguageCode(t)]),r||(r=e.default),r||[]}},{key:"toResolveHierarchy",value:function(e,t){var r=this,n=this.getFallbackCodes(t||this.options.fallbackLng||[],e),o=[],i=function(e){e&&(r.isWhitelisted(e)?o.push(e):r.logger.warn("rejecting non-whitelisted language code: ".concat(e)))};return"string"==typeof e&&e.indexOf("-")>-1?("languageOnly"!==this.options.load&&i(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&i(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&i(this.getLanguagePartFromCode(e))):"string"==typeof e&&i(this.formatLanguageCode(e)),n.forEach((function(e){o.indexOf(e)<0&&i(r.formatLanguageCode(e))})),o}}]),e}(),N=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","id","ja","jbo","ka","kk","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he"],nr:[1,2,20,21],fc:22}],G={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0===e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0===e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0===e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1===e?0:2===e?1:(e<0||e>10)&&e%10==0?2:3)}};function U(){var e={};return N.forEach((function(t){t.lngs.forEach((function(r){e[r]={numbers:t.nr,plurals:G[t.fc]}}))})),e}var j=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};s()(this,e),this.languageUtils=t,this.options=r,this.logger=v.create("pluralResolver"),this.rules=U()}return c()(e,[{key:"addRule",value:function(e,t){this.rules[e]=t}},{key:"getRule",value:function(e){return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var t=this.getRule(e);return t&&t.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,t){var r=this,n=[],o=this.getRule(e);return o?(o.numbers.forEach((function(o){var i=r.getSuffix(e,o);n.push("".concat(t).concat(i))})),n):n}},{key:"getSuffix",value:function(e,t){var r=this,n=this.getRule(e);if(n){var o=n.noAbs?n.plurals(t):n.plurals(Math.abs(t)),i=n.numbers[o];this.options.simplifyPluralSuffix&&2===n.numbers.length&&1===n.numbers[0]&&(2===i?i="plural":1===i&&(i=""));var A=function(){return r.options.prepend&&i.toString()?r.options.prepend+i.toString():i.toString()};return"v1"===this.options.compatibilityJSON?1===i?"":"number"==typeof i?"_plural_".concat(i.toString()):A():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===n.numbers.length&&1===n.numbers[0]?A():this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString()}return this.logger.warn("no plural rule found for: ".concat(e)),""}}]),e}(),Y=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};s()(this,e),this.logger=v.create("interpolator"),this.init(t,!0)}return c()(e,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;t&&(this.options=e,this.format=e.interpolation&&e.interpolation.format||function(e){return e}),e.interpolation||(e.interpolation={escapeValue:!0});var r=e.interpolation;this.escape=void 0!==r.escape?r.escape:P,this.escapeValue=void 0===r.escapeValue||r.escapeValue,this.useRawValueToEscape=void 0!==r.useRawValueToEscape&&r.useRawValueToEscape,this.prefix=r.prefix?M(r.prefix):r.prefixEscaped||"{{",this.suffix=r.suffix?M(r.suffix):r.suffixEscaped||"}}",this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||",",this.unescapePrefix=r.unescapeSuffix?"":r.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":r.unescapeSuffix||"",this.nestingPrefix=r.nestingPrefix?M(r.nestingPrefix):r.nestingPrefixEscaped||M("$t("),this.nestingSuffix=r.nestingSuffix?M(r.nestingSuffix):r.nestingSuffixEscaped||M(")"),this.maxReplaces=r.maxReplaces?r.maxReplaces:1e3,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(e,"g");var t="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(t,"g");var r="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(r,"g")}},{key:"interpolate",value:function(e,t,r,n){var o,i,A,a=this;function s(e){return e.replace(/\$/g,"$$$$")}var u=function(e){if(e.indexOf(a.formatSeparator)<0)return D(t,e);var n=e.split(a.formatSeparator),o=n.shift().trim(),i=n.join(a.formatSeparator).trim();return a.format(D(t,o),i,r)};this.resetRegExp();var c=n&&n.missingInterpolationHandler||this.options.missingInterpolationHandler;for(A=0;(o=this.regexpUnescape.exec(e))&&(i=u(o[1].trim()),e=e.replace(o[0],i),this.regexpUnescape.lastIndex=0,!(++A>=this.maxReplaces)););for(A=0;o=this.regexp.exec(e);){if(void 0===(i=u(o[1].trim())))if("function"==typeof c){var l=c(e,o,n);i="string"==typeof l?l:""}else this.logger.warn("missed to pass in variable ".concat(o[1]," for interpolating ").concat(e)),i="";else"string"==typeof i||this.useRawValueToEscape||(i=b(i));if(i=this.escapeValue?s(this.escape(i)):s(i),e=e.replace(o[0],i),this.regexp.lastIndex=0,++A>=this.maxReplaces)break}return e}},{key:"nest",value:function(e,t){var r,n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=A()({},o);function a(e,t){if(e.indexOf(",")<0)return e;var r=e.split(",");e=r.shift();var n=r.join(",");n=(n=this.interpolate(n,i)).replace(/'/g,'"');try{i=JSON.parse(n),t&&(i=A()({},t,i))}catch(t){this.logger.error("failed parsing options string in nesting for key ".concat(e),t)}return e}for(i.applyPostProcessor=!1;r=this.nestingRegexp.exec(e);){if((n=t(a.call(this,r[1].trim(),i),i))&&r[0]===e&&"string"!=typeof n)return n;"string"!=typeof n&&(n=b(n)),n||(this.logger.warn("missed to resolve ".concat(r[1]," for nesting ").concat(e)),n=""),e=e.replace(r[0],n),this.regexp.lastIndex=0}return e}}]),e}(),V=r(712),H=r.n(V);var K=function(e){function t(e,r,n){var o,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return s()(this,t),o=g()(this,p()(t).call(this)),m.call(y()(y()(o))),o.backend=e,o.store=r,o.languageUtils=n.languageUtils,o.options=i,o.logger=v.create("backendConnector"),o.state={},o.queue=[],o.backend&&o.backend.init&&o.backend.init(n,i.backend,i),o}return d()(t,e),c()(t,[{key:"queueLoad",value:function(e,t,r,n){var o=this,i=[],A=[],a=[],s=[];return e.forEach((function(e){var n=!0;t.forEach((function(t){var a="".concat(e,"|").concat(t);!r.reload&&o.store.hasResourceBundle(e,t)?o.state[a]=2:o.state[a]<0||(1===o.state[a]?A.indexOf(a)<0&&A.push(a):(o.state[a]=1,n=!1,A.indexOf(a)<0&&A.push(a),i.indexOf(a)<0&&i.push(a),s.indexOf(t)<0&&s.push(t)))})),n||a.push(e)})),(i.length||A.length)&&this.queue.push({pending:A,loaded:{},errors:[],callback:n}),{toLoad:i,pending:A,toLoadLanguages:a,toLoadNamespaces:s}}},{key:"loaded",value:function(e,t,r){var n=e.split("|"),o=H()(n,2),i=o[0],A=o[1];t&&this.emit("failedLoading",i,A,t),r&&this.store.addResourceBundle(i,A,r),this.state[e]=t?-1:2;var a={};this.queue.forEach((function(r){var n,o,s,u,c,l;n=r.loaded,o=A,u=w(n,[i],Object),c=u.obj,l=u.k,c[l]=c[l]||[],s&&(c[l]=c[l].concat(o)),s||c[l].push(o),function(e,t){for(var r=e.indexOf(t);-1!==r;)e.splice(r,1),r=e.indexOf(t)}(r.pending,e),t&&r.errors.push(t),0!==r.pending.length||r.done||(Object.keys(r.loaded).forEach((function(e){a[e]||(a[e]=[]),r.loaded[e].length&&r.loaded[e].forEach((function(t){a[e].indexOf(t)<0&&a[e].push(t)}))})),r.done=!0,r.errors.length?r.callback(r.errors):r.callback())})),this.emit("loaded",a),this.queue=this.queue.filter((function(e){return!e.done}))}},{key:"read",value:function(e,t,r){var n=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:250,A=arguments.length>5?arguments[5]:void 0;return e.length?this.backend[r](e,t,(function(a,s){a&&s&&o<5?setTimeout((function(){n.read.call(n,e,t,r,o+1,2*i,A)}),i):A(a,s)})):A(null,{})}},{key:"prepareLoading",value:function(e,t){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var i=this.queueLoad(e,t,n,o);if(!i.toLoad.length)return i.pending.length||o(),null;i.toLoad.forEach((function(e){r.loadOne(e)}))}},{key:"load",value:function(e,t,r){this.prepareLoading(e,t,{},r)}},{key:"reload",value:function(e,t,r){this.prepareLoading(e,t,{reload:!0},r)}},{key:"loadOne",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=e.split("|"),o=H()(n,2),i=o[0],A=o[1];this.read(i,A,"read",null,null,(function(n,o){n&&t.logger.warn("".concat(r,"loading namespace ").concat(A," for language ").concat(i," failed"),n),!n&&o&&t.logger.log("".concat(r,"loaded namespace ").concat(A," for language ").concat(i),o),t.loaded(e,n,o)}))}},{key:"saveMissing",value:function(e,t,r,n,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.backend&&this.backend.create&&this.backend.create(e,t,r,n,null,A()({},i,{isUpdate:o})),e&&e[0]&&this.store.addResource(e[0],t,r,n)}}]),t}(m);function J(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,whitelist:!1,nonExplicitWhitelist:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:function(){},parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if("object"===o()(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===o()(e[2])||"object"===o()(e[3])){var r=e[3]||e[2];Object.keys(r).forEach((function(e){t[e]=r[e]}))}return t},interpolation:{escapeValue:!0,format:function(e,t,r){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",maxReplaces:1e3}}}function q(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.whitelist&&e.whitelist.indexOf("cimode")<0&&(e.whitelist=e.whitelist.concat(["cimode"])),e}function W(){}var z=new(function(e){function t(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(s()(this,t),e=g()(this,p()(t).call(this)),m.call(y()(y()(e))),e.options=q(r),e.services={},e.logger=v,e.modules={external:[]},n&&!e.isInitialized&&!r.isClone){if(!e.options.initImmediate)return e.init(r,n),g()(e,y()(y()(e)));setTimeout((function(){e.init(r,n)}),0)}return e}return d()(t,e),c()(t,[{key:"init",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;function n(e){return e?"function"==typeof e?new e:e:null}if("function"==typeof t&&(r=t,t={}),this.options=A()({},J(),this.options,q(t)),this.format=this.options.interpolation.format,r||(r=W),!this.options.isClone){this.modules.logger?v.init(n(this.modules.logger),this.options):v.init(null,this.options);var o=new k(this.options);this.store=new F(this.options.resources,this.options);var i=this.services;i.logger=v,i.resourceStore=this.store,i.languageUtils=o,i.pluralResolver=new j(o,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),i.interpolator=new Y(this.options),i.backendConnector=new K(n(this.modules.backend),i.resourceStore,i,this.options),i.backendConnector.on("*",(function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];e.emit.apply(e,[t].concat(n))})),this.modules.languageDetector&&(i.languageDetector=n(this.modules.languageDetector),i.languageDetector.init(i,this.options.detection,this.options)),this.modules.i18nFormat&&(i.i18nFormat=n(this.modules.i18nFormat),i.i18nFormat.init&&i.i18nFormat.init(this)),this.translator=new T(this.services,this.options),this.translator.on("*",(function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];e.emit.apply(e,[t].concat(n))})),this.modules.external.forEach((function(t){t.init&&t.init(e)}))}var a=["getResource","addResource","addResources","addResourceBundle","removeResourceBundle","hasResourceBundle","getResourceBundle","getDataByLanguage"];a.forEach((function(t){e[t]=function(){var r;return(r=e.store)[t].apply(r,arguments)}}));var s=Q(),u=function(){e.changeLanguage(e.options.lng,(function(t,n){e.isInitialized=!0,e.logger.log("initialized",e.options),e.emit("initialized",e.options),s.resolve(n),r(t,n)}))};return this.options.resources||!this.options.initImmediate?u():setTimeout(u,0),s}},{key:"loadResources",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:W;if(!this.options.resources||this.options.partialBundledLanguages){if(this.language&&"cimode"===this.language.toLowerCase())return t();var r=[],n=function(t){t&&e.services.languageUtils.toResolveHierarchy(t).forEach((function(e){r.indexOf(e)<0&&r.push(e)}))};if(this.language)n(this.language);else{var o=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);o.forEach((function(e){return n(e)}))}this.options.preload&&this.options.preload.forEach((function(e){return n(e)})),this.services.backendConnector.load(r,this.options.ns,t)}else t(null)}},{key:"reloadResources",value:function(e,t,r){var n=Q();return e||(e=this.languages),t||(t=this.options.ns),r||(r=W),this.services.backendConnector.reload(e,t,(function(e){n.resolve(),r(e)})),n}},{key:"use",value:function(e){return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&O.addPostProcessor(e),"3rdParty"===e.type&&this.modules.external.push(e),this}},{key:"changeLanguage",value:function(e,t){var r=this,n=Q();this.emit("languageChanging",e);var o=function(e){e&&(r.language=e,r.languages=r.services.languageUtils.toResolveHierarchy(e),r.translator.language||r.translator.changeLanguage(e),r.services.languageDetector&&r.services.languageDetector.cacheUserLanguage(e)),r.loadResources((function(o){!function(e,o){r.translator.changeLanguage(o),o&&(r.emit("languageChanged",o),r.logger.log("languageChanged",o)),n.resolve((function(){return r.t.apply(r,arguments)})),t&&t(e,(function(){return r.t.apply(r,arguments)}))}(o,e)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(o):o(e):o(this.services.languageDetector.detect()),n}},{key:"getFixedT",value:function(e,t){var r=this,n=function e(t,n){var i=A()({},n);if("object"!==o()(n)){for(var a=arguments.length,s=new Array(a>2?a-2:0),u=2;u<a;u++)s[u-2]=arguments[u];i=r.options.overloadTranslationOptionHandler([t,n].concat(s))}return i.lng=i.lng||e.lng,i.lngs=i.lngs||e.lngs,i.ns=i.ns||e.ns,r.t(t,i)};return"string"==typeof e?n.lng=e:n.lngs=e,n.ns=t,n}},{key:"t",value:function(){var e;return this.translator&&(e=this.translator).translate.apply(e,arguments)}},{key:"exists",value:function(){var e;return this.translator&&(e=this.translator).exists.apply(e,arguments)}},{key:"setDefaultNamespace",value:function(e){this.options.defaultNS=e}},{key:"loadNamespaces",value:function(e,t){var r=this,n=Q();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach((function(e){r.options.ns.indexOf(e)<0&&r.options.ns.push(e)})),this.loadResources((function(e){n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}},{key:"loadLanguages",value:function(e,t){var r=Q();"string"==typeof e&&(e=[e]);var n=this.options.preload||[],o=e.filter((function(e){return n.indexOf(e)<0}));return o.length?(this.options.preload=n.concat(o),this.loadResources((function(e){r.resolve(),t&&t(e)})),r):(t&&t(),Promise.resolve())}},{key:"dir",value:function(e){if(e||(e=this.languages&&this.languages.length>0?this.languages[0]:this.language),!e)return"rtl";return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam"].indexOf(this.services.languageUtils.getLanguagePartFromCode(e))>=0?"rtl":"ltr"}},{key:"createInstance",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;return new t(e,r)}},{key:"cloneInstance",value:function(){var e=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:W,o=A()({},this.options,r,{isClone:!0}),i=new t(o),a=["store","services","language"];return a.forEach((function(t){i[t]=e[t]})),i.translator=new T(i.services,i.options),i.translator.on("*",(function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];i.emit.apply(i,[e].concat(r))})),i.init(o,n),i.translator.options=i.options,i}}]),t}(m)),X=(t.default=z,z.changeLanguage.bind(z)),Z=z.cloneInstance.bind(z),$=z.createInstance.bind(z),ee=z.dir.bind(z),te=z.exists.bind(z),re=z.getFixedT.bind(z),ne=z.init.bind(z),oe=z.loadLanguages.bind(z),ie=z.loadNamespaces.bind(z),Ae=z.loadResources.bind(z),ae=z.off.bind(z),se=z.on.bind(z),ue=z.setDefaultNamespace.bind(z),ce=z.t.bind(z),le=z.use.bind(z)}])}));
145
+ function Nh(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),A=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)A.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return A}function Gh(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Nh(arguments[t]));return e}var Uh="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),jh=new Array(36);var Yh,Vh=function(){function e(){this.data={name:"",displayName:"",type:Fh.FIT,value:""}}return e.prototype.getValue=function(){return this.data.value},e.prototype.setValue=function(e){this.getEditable()&&(this.ref&&"function"==typeof this.ref.__trackUpdateField&&this.ref.__trackUpdateField({type:Mh.STORE,attr:this.data.name},this.getValue(),e),this.data.value=e)},e.prototype.toJSON=function(){return this.data},e.prototype.getMin=function(){return this.data.min},e.prototype.getEditable=function(){return!0===this.data.editable},e.prototype.getMax=function(){return this.data.max},e.prototype.getOptionValues=function(){return this.data.optionValues||[]},e.prototype.getPrimitiveOverride=function(){return this.data.primitiveOverride},e.prototype.getRecommendValues=function(){return this.data.recommendValues||[]},e.prototype.getValueDisplayNames=function(){return this.data.valueDisplayNames||[]},e.prototype.setPrimitiveOverride=function(e){this.getEditable()&&(this.ref&&"function"==typeof this.ref.__trackUpdateField&&this.ref.__trackUpdateField({type:Mh.STORE,attr:this.data.name},this.data.primitiveOverride,e),this.data.primitiveOverride=e)},e.prototype.getStep=function(){return this.data.step},e.prototype.getType=function(){return this.data.type},e.prototype.getParsedValue=function(){return this.getValue()},e.prototype.setParsedValue=function(e){return this.setValue(e)},e}();function Hh(e){var t=new Vh;return t.data=e,t}!function(e){e.SENSE="SENSE",e.BRANDGOOD="BRANDGOOD",e.CATEGORY="CATEGORY",e.TEMPLATE_ID="TEMPLATE_ID"}(Yh||(Yh={}));var Kh,Jh,qh,Wh,zh=function(){function e(){this._changeMap={}}return Object.defineProperty(e.prototype,"rotate",{get:function(){return this.rotation},enumerable:!1,configurable:!0}),e.prototype.getRoot=function(){return this.root},e.prototype.clone=function(){var t=this.toJSON(),r=e.deserialize(JSON.stringify(t));return r._changeMap.cloned=!0,r._changeMap.forceUpdate=!1,r._changeMap.originId||(r._changeMap.originId=r.id),r.id=function(){for(var e=0,t=0;t<36;t++)if(8===t||13===t||18===t||23===t)jh[t]="-";else if(14===t)jh[t]="4";else{e<=2&&(e=33554432+16777216*Math.random()|0);var r=15&e;e>>=4,jh[t]=Uh[19===t?3&r|8:r]}return jh.join("")}(),r},e.prototype.getName=function(){return this.name},e.prototype.setName=function(e){this.__trackUpdateField({type:Mh.ATTRIBUTE,attr:"name"},this.name,e),this.name=e},e.prototype.getRemark=function(){return this.remark},e.prototype.setRemark=function(e){this.__trackUpdateField({type:Mh.ATTRIBUTE,attr:"remark"},this.remark,e),this.remark=e},e.prototype.setRotate=function(e){this.setRotation(e)},e.prototype.getRotate=function(){return this.getRotation()},e.prototype.setRotation=function(e){this.__trackUpdateField({type:Mh.ATTRIBUTE,attr:"rotation"},this.rotation,e),this.rotation=e},e.prototype.getRotation=function(){return this.rotation},e.prototype.setPosition=function(e){this.__trackUpdateField({type:Mh.ATTRIBUTE,attr:"position"},this.position,e),this.position=e},e.prototype.getPosition=function(){return this.position},e.prototype.dispose=function(){this._changeMap.deleted=!0,this._changeMap.forceUpdate=void 0},e.prototype.getChild=function(){return this.children},e.prototype.getAccessory=function(){return this.accessories},e.prototype.appendChild=function(e){if(!this.children.some((function(t){return t.id===e.id}))){e.root=this.root,e._parent=void 0,this.children.push(e);var t=this._changeMap.addNodes;t||(t=[],this._changeMap.addNodes=t),t.push({type:xh.CHILD,linkId:e.id})}},e.prototype.appendAccessory=function(e){if(!this.accessories.some((function(t){return t.id===e.id}))){e.root=this.root,e._parent=void 0,this.accessories.push(e);var t=this._changeMap.addNodes;t||(t=[],this._changeMap.addNodes=t),t.push({type:xh.ACCESSORY,linkId:e.id})}},e.prototype.getParam=function(e){var t=this.params.get(e);return t&&!t.ref&&(t.ref=this),t},e.prototype.hasParam=function(e){return this.params.has(e)},e.prototype.toJSON=function(e){void 0===e&&(e=!0);var t=this.isRoot,r=e&&!t?this.root:this,n={id:r.id,name:r.name,remark:r.remark,position:r.position,rotate:r.rotate,rotation:r.rotation,size:r.size,params:Array.from(r.params).map((function(e){var t=Nh(e,2);return[t[0],t[1].toJSON()]})),productId:r.productId,category:r.category,isRoot:r.isRoot,modelType:r.modelType,isHidden:r.isHidden,toolType:r.toolType,children:r.children.map((function(e){return e.toJSON(!1)})),accessories:r.accessories.map((function(e){return e.toJSON(!1)})),_changeMap:r._changeMap,_origin:r._origin};return e&&!t&&(n._currentId=this.id),n},e.prototype.serialize=function(){return JSON.stringify(this.toJSON())},e.prototype.deserialize=function(t){var r=this,n=JSON.parse(t);return function e(t,r,n,o){void 0===r&&(r=new Map);void 0===o&&(o=function(e,t){return new zh});var i=o(t,n);i.id=t.id,i.name=t.name,i.remark=t.remark,i.position=t.position,i.rotation=t.rotation,i.size=t.size,i.params=new Map(t.params.map((function(e){return[e[0],Hh(e[1])]}))),i.productId=t.productId,i.category=t.category,i.isRoot=t.isRoot,i.modelType=t.modelType,i.isHidden=t.isHidden,i._origin=t._origin,i._changeMap=t._changeMap,!t.isRoot&&n&&(i.root=n);if(r.set(i.id,i),i.children=t.children.map((function(t){return e(t,r,n||i,o)})),i.accessories=t.accessories.map((function(t){return e(t,r,n||i,o)})),!n&&t._currentId&&r.has(t._currentId))return r.get(t._currentId);return i}(n,void 0,void 0,(function(t,o){return void 0!==n._currentId||o?n._currentId===t.id?r:new e:r}))},e.serialize=function(e){return e.serialize()},e.deserialize=function(t){var r=new e;return r.deserialize(t),r},e.prototype.__trackUpdateField=function(e,t,r){var n=this._changeMap.update;n||(n=[],this._changeMap.update=n),n.some((function(t){return t.type===e.type&&t.attr===e.attr}))||t!==r&&n.push(e)},e.prototype.getParent=function(){var e=this;if(this._parent)return this._parent;var t=function(t){return t.id===e.id};if(this.root)for(var r=[this.root],n=void 0;n=r.pop();){var o=n.getChild(),i=n.getAccessory();if(o.some(t)||i.some(t))return this._parent=n,n;r.push.apply(r,Gh(o)),r.push.apply(r,Gh(i))}},e.prototype.forceUpdate=function(e){if(void 0===e&&(e=!0),!this.productId)throw new Error("Can't force-update model without productId");if(this._origin!=Yh.SENSE||!this.isRoot)throw new Error("only the root param models in design support force update!");this._changeMap.forceUpdate=e},e}();!function(e){e[e.SUCCESS=1]="SUCCESS",e[e.FAIL=-1]="FAIL"}(Kh||(Kh={})),function(e){e[e.CABINET=0]="CABINET",e[e.WARDROBE=1]="WARDROBE",e[e.DOOR_WINDOW=2]="DOOR_WINDOW",e[e.CABINET_COPY=4]="CABINET_COPY",e[e.WARDROBE_COPY=5]="WARDROBE_COPY",e[e.DOOR_WINDOW_COPY=6]="DOOR_WINDOW_COPY"}(Jh||(Jh={})),function(e){e[e.ADD=0]="ADD",e[e.UPDATE=1]="UPDATE",e[e.REMOVE=2]="REMOVE",e[e.NONE=3]="NONE"}(qh||(qh={})),function(e){e[e.CROWN=0]="CROWN",e[e.LIGHT=1]="LIGHT",e[e.SKIRT=2]="SKIRT",e[e.COUNTERTOP=3]="COUNTERTOP"}(Wh||(Wh={}));var Xh=r(701),Zh=r.n(Xh);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})(e)}function ed(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function td(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function rd(e,t){return(rd=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function nd(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=id(e);if(t){var o=id(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return od(this,r)}}function od(e,t){return!t||"object"!==$h(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function id(e){return(id=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Ad=function(e){!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}}),t&&rd(e,t)}(i,e);var t,r,n,o=nd(i);function i(){return ed(this,i),o.apply(this,arguments)}return t=i,(r=[{key:"getHidden",value:function(){return this.isHidden}},{key:"setHidden",value:function(e){this.__trackUpdateField({type:Mh.ATTRIBUTE,attr:"isHidden"},this.isHidden,e),this.isHidden=e}}])&&td(t.prototype,r),n&&td(t,n),i}(zh);function ad(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function sd(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ad(Object(r),!0).forEach((function(t){ud(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ad(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function ud(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var cd={x:0,y:0,z:0},ld={x:0,y:0,z:0};function gd(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Map,n=arguments.length>3?arguments[3]:void 0,o=t.category,i=t.origin,A=new Ad,a=!(e instanceof fe)||e.isRoot(),s=n||a?e:e.getRoot(),u=s instanceof fe;A.id=s.id,A.isRoot=!u||s.isRoot(),A.isHidden=!!s.getInvisible();var c=Ph.ASSEMBLY;if(u?c=Ph.COMMON:e.isTemplateAssembly()&&(c=Ph.TEMPLATE_ASSEMBLY),A.modelType=c,A.position=A.isRoot?cd:s.getPosition(),A.rotation=A.isRoot?ld:s.getRotation(),A.size="function"==typeof s.getScaledSize?s.getScaledSize():s.getSize(),A.params=pd(s),A.category=o||s.getCategory().categoryId,u){var l=s.getModel();A.productId=null==l?void 0:l.obsBrandGoodId}return n&&(A.root=n),A.isRoot&&(A._origin=i),A.children=(u?s.getChildren():s.getParamModels()).map((function(e){return gd(e,t,r,n||A)})),A.accessories=(u?s.getAccessories():[]).map((function(e){return gd(e,t,r,n||A)})),r.set(A.id,A),s!==e&&r.has(e.id)?r.get(e.id):A}function fd(e,t){var r=e.isRoot?e:e.root;if(!r)return{};var n=r._changeMap,o=t.getUnSafeParamModelFromParamModelLite(r);if(!o)return{};var i=o.getCustom(),A=n.cloned;return A&&(o=o.clone(!1)),o=function e(t,r,n,o){var i=t._changeMap;if(i.cloned&&i.deleted)return;if(i.deleted)return n.dispose(),n;var A=i.update,a=void 0===A?[]:A,s=i.addNodes,u=void 0===s?[]:s,c=o?sd({},o):{parentModelLite:t,parentModel:n,rootModelLite:t,rootModel:n};a.forEach((function(e){if(e.type===Mh.ATTRIBUTE)switch(e.attr){case"position":n.setPosition(t.getPosition());break;case"rotate":n.setRotation(t.getRotation());break;case"isHidden":n.setInvisible(t.getHidden()),function(e){var t=e.getInvisible();SI().entry.getStateManager().core.fittingDesign.getPlankOutlineHintModels().forEach((function(r){r.linkModel.id===e.id&&r.setVisible(!t)}))}(n)}if(e.type===Mh.STORE){var o=n.getParamStore().getParam(e.attr),i=t.getParam(e.attr);if(o&&i){var A=i.getValue();[Tr.ParamType.MATERIAL,Tr.ParamType.SHAPE].includes(o.getType())&&(A=r.getUnSafeObsBrandGoodToBrandGoodId(A)),A&&o.setValue(A),i.getPrimitiveOverride()!==o.getPrimitiveOverride()&&o.setPrimitiveOverride(i.getPrimitiveOverride())}}})),u.forEach((function(o){var i=o.type,A=o.linkId,a=(i===xh.CHILD?t.getChild():t.getAccessory()).find((function(e){return e.id===A}));if(a){var s=r.getUnSafeParamModelFromParamModelLite(a);s&&((a._changeMap.cloned||a._origin!==Yh.SENSE)&&(s=s.clone(!1)),i===xh.CHILD?(s.setIsAppend(!0),s.setAppendType(Zh.a.CENTER),n.addChild(s)):n.addAccessory(s),e(a,r,s,sd(sd({},c),{},{parentModel:n,parentModelLite:t})),(a._changeMap.cloned||a._origin!==Yh.SENSE)&&s.assignUniqueId())}}));var l=function(o){return function(i){if(!u.some((function(e){return e.type===o&&e.linkId===i.id}))){var A=o===xh.ACCESSORY?n.getAccessories():n.getChildren(),a=i._changeMap.originId||i.id,s=A.find((function(e){return e.id===a}));s&&e(i,r,s,sd(sd({},c),{},{parentModel:n,parentModelLite:t}))}}};return t.getChild().forEach(l(xh.CHILD)),t.getAccessory().forEach(l(xh.ACCESSORY)),n}(r,t,o),A&&o&&o.assignUniqueId(),{create:A,custom:i,model:o}}function pd(e){var t=new Map;return e.getParamStore().forEach((function(e,r){t.set(r,function(e){var t=new Vh;if(t.data={type:e.getType(),displayName:e.getDisplayName(),name:e.getName(),value:e.getValue(),max:e.getMax(),min:e.getMin(),editable:e.getEditable(),optionValues:e.getOptionValues(),recommendValues:e.getRecommendValues(),primitiveOverride:e.getPrimitiveOverride(),step:e.getStep()},[Fh.MATERIAL,Fh.SHAPE].includes(t.getType())){var r=e.getProduct();t.data.value=r?r.obsBrandGoodId:""}return t}(e))})),t}var hd=r(159),dd=r.n(hd),Id={maxAge:6e5,max:20},yd=(Og.SHADING,Og.OUTLINE_WITH_SHADING,Og.TRANSLUCENT,Og.OUTLINE_AND_TRANSLUCENT,[x.ParamModelType.PARAM_ENTITY,x.ParamModelType.PARAM_FURNITURE,x.ParamModelType.PARAM_PRIMITIVE]);function Cd(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ed(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Cd(Object(r),!0).forEach((function(t){Bd(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Cd(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Bd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function vd(e,t,r,n,o,i,A){try{var a=e[i](A),s=a.value}catch(e){return void r(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function md(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function A(e){vd(i,n,o,A,a,"next",e)}function a(e){vd(i,n,o,A,a,"throw",e)}A(void 0)}))}}dd()(function(){var e=md(s.a.mark((function e(t){var r,n;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=ou(),e.next=3,r.gzipPost("/dcs/api/c/products/available",{obsBgIds:t});case 3:return n=e.sent,e.abrupt("return",n.data);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Ed({promise:!0},Id));function Qd(){return(Qd=md(s.a.mark((function e(t){var r,n,o,i,A;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ou().gzipPost("/dcs-resource/api/c/productdata/obsbgid",{obsBgIds:t});case 2:if(r=e.sent,n=r.data,o=n.c,i=n.m,A=n.d,"0"!==o){e.next=11;break}return e.abrupt("return",A);case 11:throw new Error(o+i);case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function bd(){return(bd=md(s.a.mark((function e(t){var r,n,o,i,A;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ou().gzipPost("/dcs-resource/api/c/productdata/bgid",{bgIds:t});case 2:if(r=e.sent,n=r.data,o=n.c,i=n.m,A=n.d,"0"!==o){e.next=11;break}return e.abrupt("return",A);case 11:throw new Error(o+i);case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var _d=dd()((function(e){return Qd.apply(this,arguments)}),Ed(Ed({},Id),{},{promise:!0})),wd=dd()((function(e){return bd.apply(this,arguments)}),Ed(Ed({},Id),{},{promise:!0}));function Sd(e){return function(e){if(Array.isArray(e))return Dd(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Dd(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Dd(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Dd(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Rd(e,t,r,n,o,i,A){try{var a=e[i](A),s=a.value}catch(e){return void r(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function Md(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var xd=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.cached=new Map}var t,r,n,o,i;return t=e,(r=[{key:"setProduct",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"__global__",r=this.cached.get(t);r||(r=new Map,this.cached.set(t,r)),r.set(e.brandGoodId,e.obsBrandGoodId),r.set(e.obsBrandGoodId,e.brandGoodId)}},{key:"getToggledBrandGood",value:function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"__global__";return null===(t=this.cached.get(r))||void 0===t?void 0:t.get(e)}},{key:"removeCachedModel",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"__global__";this.cached.delete(e)}},{key:"safeGetToggleBrandGood",value:(o=s.a.mark((function e(t){var r,n,o,i,A,a,u=this,c=arguments;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=c.length>1&&void 0!==c[1]?c[1]:"__global__",n=Object(_e.castArray)(t),o=[],i=[],A=new Map,n.forEach((function(e){var t=u.getToggledBrandGood(e,r);t?A.set(e,t):/^[0-9]$/.test(e.toString())?i.push(e):o.push(e)})),a=function(e){return[].concat(Sd(e.hardwares||[]),Sd(e.textures||[]),Sd(e.virtualModels||[]),Sd(e.paramModelProducts||[]),Sd(e.moldings||[]))},!o.length){e.next=12;break}return e.next=10,_d(o).then(a);case 10:e.sent.forEach((function(e){u.setProduct(e,r)}));case 12:if(!i.length){e.next=17;break}return e.next=15,wd(i).then(a);case 15:e.sent.forEach((function(e){u.setProduct(e,r)}));case 17:return[].concat(o,i).forEach((function(e){var t=u.getToggledBrandGood(e,r);t&&A.set(e,t)})),e.abrupt("return",A);case 19:case"end":return e.stop()}}),e)})),i=function(){var e=this,t=arguments;return new Promise((function(r,n){var i=o.apply(e,t);function A(e){Rd(i,r,n,A,a,"next",e)}function a(e){Rd(i,r,n,A,a,"throw",e)}A(void 0)}))},function(e){return i.apply(this,arguments)})}])&&Md(t.prototype,r),n&&Md(t,n),e}();function Pd(e,t,r,n,o,i,A){try{var a=e[i](A),s=a.value}catch(e){return void r(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function Fd(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function A(e){Pd(i,n,o,A,a,"next",e)}function a(e){Pd(i,n,o,A,a,"throw",e)}A(void 0)}))}}function Od(e){return function(e){if(Array.isArray(e))return Td(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Td(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Td(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Td(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Ld(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function kd(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var Nd=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new xd;Ld(this,e),this.callback=t,this.brandGoodsTranslate=r,this.cached=new Map,this.models=[]}var t,r,n,o;return t=e,(r=[{key:"getParamModelFromId",value:function(e){if(this.cached.has(e))return this.cached.get(e);var t=this.callback(e);return this.cached.set(e,t),t}},{key:"getUnSafeParamModel",value:function(e){return this.cached.get(e)}},{key:"getUnSafeObsBrandGoodToBrandGoodId",value:function(e){return this.brandGoodsTranslate.getToggledBrandGood(e)}},{key:"addParamModelLite",value:function(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];(e=this.models).push.apply(e,Od(r.map((function(e){return e.root||e}))))}},{key:"getUnSafeParamModelFromParamModelLite",value:function(e){var t,r=e.root||e;switch(e._origin||r._origin){case Yh.BRANDGOOD:case Yh.CATEGORY:break;case Yh.SENSE:var n=r._changeMap.originId||r.id;t=this.getUnSafeParamModel(n)}if(!t||r===e)return t;for(var o,i=e._changeMap.originId||e.id,A=[t];o=A.pop();){if(o.id===i)return o;A.push.apply(A,Od(o.getChildNodes()))}}},{key:"attach",value:(o=Fd(s.a.mark((function e(){var t,r,n,o,i,A,a,u,c=this;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=this.models,r={modelIds:[],category:[],brandGoodIds:[]},n=[];case 3:if(!(o=t.pop())){e.next=18;break}A=(i=o)._changeMap,a=i._origin,e.t0=a,e.next=e.t0===Yh.SENSE?8:e.t0===Yh.CATEGORY||e.t0===Yh.BRANDGOOD||e.t0===Yh.TEMPLATE_ID?11:12;break;case 8:return u=A.originId||o.id,r.modelIds.push(u),e.abrupt("break",12);case 11:return e.abrupt("break",12);case 12:if(!A.deleted){e.next=14;break}return e.abrupt("continue",3);case 14:A.update&&A.update.forEach((function(e){if(o&&e.type===Mh.STORE&&o.hasParam(e.attr)){var t=o.getParam(e.attr);t&&[Fh.MATERIAL,Fh.SHAPE].includes(t.getType())&&t.getValue()&&n.push(t.getValue())}})),t.push.apply(t,Od(o.getChild()).concat(Od(o.getAccessory()))),e.next=3;break;case 18:return e.next=20,Promise.allSettled(Od(Object(_e.uniq)(r.modelIds).map(function(){var e=Fd(s.a.mark((function e(t){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",c.getParamModelFromId(t));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())));case 20:return e.next=22,this.brandGoodsTranslate.safeGetToggleBrandGood(n);case 22:case"end":return e.stop()}}),e,this)}))),function(){return o.apply(this,arguments)})}])&&kd(t.prototype,r),n&&kd(t,n),e}(),Gd=r(715);function Ud(e){return(Ud="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 jd(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Yd(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Vd(e,t,r){return(Vd="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=qd(e)););return e}(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(r):o.value}})(e,t,r||e)}function Hd(e,t){return(Hd=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Kd(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=qd(e);if(t){var o=qd(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Jd(this,r)}}function Jd(e,t){return!t||"object"!==Ud(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function qd(e){return(qd=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Wd=function(e){!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}}),t&&Hd(e,t)}(i,e);var t,r,n,o=Kd(i);function i(){var e;return jd(this,i),(e=o.apply(this,arguments)).$actionInit=e.unitCreator.sync((function(e){e.latest(s.a.mark((function e(t,r){var n;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this.getAxr(of),e.next=3,Object(Lg.take)([n.$actionLoad.done.messageType(),n.$actionAddModelToSense.done.messageType(),n.$actionAddParamModelToSense.done.messageType(),n.$actionAddParamModelAssemblyToSense.done.messageType()]);case 3:if(n.state.state.main!==Dg.SUCCESS){e.next=13;break}return e.next=6,Object(Lg.put)(this.$actionSetCamera.message(!0));case 6:return e.next=9,Object(Lg.take)(this.$actionSyncCamera.messageType());case 9:return e.next=11,Object(Lg.put)(this.$actionSetCamera.message(!1));case 11:e.next=6;break;case 13:case"end":return e.stop()}}),e,this)})))})),e.$actionSyncCamera=e.unitCreator.sync((function(e){})),e.$actionSetCamera=e.unitCreator.sync((function(e){e.latest(s.a.mark((function e(t,r){var n,o,i,A,a,u;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=r.core.design.getCustom(),o=n.getParamModels(),i=n.getParamModelAssemblies(),(A=r.scene3D).updateEnableCameraAnimation(!1),a=o.length?Object(Gd.computeAssemblyBox)(o.map((function(e){return e.getBox3()})),o[0].getMatrix4()):Object(Gd.computeAssemblyBox)(i.map((function(e){return e.getBox3()})),i[0].getMatrix4()),u=If(a),A.updateInitCameraAttributes(u),t?r.scene3D.reset():r.scene3D.resetDistanceAndLookAt();case 9:case"end":return e.stop()}}),e)})))})),e}return t=i,(r=[{key:"init",value:function(){Vd(qd(i.prototype),"init",this).call(this),this.$actionInit.dispatch()}}])&&Yd(t.prototype,r),n&&Yd(t,n),i}(ff);function zd(e){return(zd="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 Xd(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=$d(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,A=!0,a=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return A=e.done,e},e:function(e){a=!0,i=e},f:function(){try{A||null==r.return||r.return()}finally{if(a)throw i}}}}function Zd(e){return function(e){if(Array.isArray(e))return eI(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||$d(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $d(e,t){if(e){if("string"==typeof e)return eI(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?eI(e,t):void 0}}function eI(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function tI(e,t,r,n,o,i,A){try{var a=e[i](A),s=a.value}catch(e){return void r(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function rI(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function A(e){tI(i,n,o,A,a,"next",e)}function a(e){tI(i,n,o,A,a,"throw",e)}A(void 0)}))}}function nI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function oI(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function iI(e,t,r){return(iI="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=uI(e)););return e}(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(r):o.value}})(e,t,r||e)}function AI(e,t){return(AI=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function aI(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=uI(e);if(t){var o=uI(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return sI(this,r)}}function sI(e,t){return!t||"object"!==zd(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function uI(e){return(uI=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var cI=function(e){!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}}),t&&AI(e,t)}(u,e);var t,r,n,o,i,A,a=aI(u);function u(){var e;return nI(this,u),(e=a.apply(this,arguments)).cameraController=e.partialCreator.create(Wd),e.state=e.stateCreator.create({renderMode:xi.RenderMode.SHADING,translucent:!1,selectable:!0}),e.$reducerState=e.reducerCreator.create(e.state),e.$actionMergeState=e.unitCreator.sync((function(t){t.produce(e.$reducerState,(function(e,t){Object.assign(e,t)}))})),e.$actionToggleRenderMode=e.unitCreator.sync((function(e){e.latest(s.a.mark((function e(t,r){var n,o;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=xi.RenderMode.SHADING,o=!1,e.t0=t.mode,e.next=e.t0===Og.SHADING?5:e.t0===Og.OUTLINE_WITH_SHADING?7:e.t0===Og.TRANSLUCENT?9:e.t0===Og.OUTLINE_AND_TRANSLUCENT?11:14;break;case 5:return n=xi.RenderMode.SHADING,e.abrupt("break",14);case 7:return n=xi.RenderMode.OUTLINE_WITH_SHADING,e.abrupt("break",14);case 9:return o=!0,e.abrupt("break",14);case 11:return n=xi.RenderMode.OUTLINE_WITH_SHADING,o=!0,e.abrupt("break",14);case 14:return e.next=16,Object(Lg.put)(this.$actionMergeState.message({renderMode:n,translucent:o}));case 16:jE().viewer.toggleShowModelOutline(n===xi.RenderMode.OUTLINE_WITH_SHADING),r.scene3D.updateRenderMode(n),jE().viewer.triggerReducer(),this.emit(Pg.renderModeChange);case 20:case"end":return e.stop()}}),e,this)})))})),e.$actionToggleRenderBorder=e.unitCreator.sync((function(e){e.latest(s.a.mark((function e(t,r){var n;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t?xi.RenderMode.OUTLINE_WITH_SHADING:xi.RenderMode.SHADING,e.next=3,Object(Lg.put)(this.$actionMergeState.message({renderMode:n}));case 3:jE().viewer.toggleShowModelOutline(n===xi.RenderMode.OUTLINE_WITH_SHADING),r.scene3D.updateRenderMode(n),this.emit(Pg.renderModeChange);case 6:case"end":return e.stop()}}),e,this)})))})),e.$actionToggleRenderTranslucent=e.unitCreator.sync((function(e){e.latest(s.a.mark((function e(t){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(Lg.put)(this.$actionMergeState.message({translucent:t}));case 2:jE().viewer.triggerReducer(),this.emit(Pg.renderModeChange);case 4:case"end":return e.stop()}}),e,this)})))})),e.$actionToggleSelectModel=e.unitCreator.sync((function(e){e.every(s.a.mark((function e(t){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(Lg.put)(this.$actionMergeState.message({selectable:t}));case 2:case"end":return e.stop()}}),e,this)})))})),e}return t=u,(r=[{key:"module",value:function(){return"scene"}},{key:"init",value:function(){var e=this;iI(uI(u.prototype),"init",this).call(this),jE().viewer.registerReducer((function(t,r,n){n.opacity=e.state.state.translucent?Fg.translucentModel:Fg.opaqueModel})),jE().viewer.registerReducer((function(e,t,r){r.visible=!e.getInvisible()}))}},{key:"getAllParamModels",value:function(){return this.stateManager.core.design.getCustom().getParamModels().filter((function(e){return!e.isAppendHardware}))}},{key:"findParamModelById",value:function(e){return Pr(this.getAllParamModels(),e)}},{key:"getAllCustomModels",value:(A=rI(s.a.mark((function e(){var t;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.getAllParamModels(),e.abrupt("return",t.map((function(e){return gd(e,{origin:Yh.SENSE})})));case 2:case"end":return e.stop()}}),e,this)}))),function(){return A.apply(this,arguments)})},{key:"getCustomModelById",value:(i=rI(s.a.mark((function e(t){var r;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(r=this.findParamModelById(t))){e.next=3;break}return e.abrupt("return",gd(r,{origin:Yh.SENSE}));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"save",value:(o=rI(s.a.mark((function e(t){var r,n,o,i,A,a,u,c,l=this;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t,(n=new Nd((function(e){return l.findParamModelById(e)}))).addParamModelLite.apply(n,Zd(r)),e.next=5,n.attach();case 5:return e.next=7,Promise.all(r.map((function(e){return fd(e,n)})));case 7:o=e.sent,i=[],A=[],a=Xd(o);try{for(a.s();!(u=a.n()).done;)(c=u.value).create&&c.custom&&c.model&&i.push(c),!c.create&&c.model&&A.push(c.model)}catch(e){a.e(e)}finally{a.f()}(i.length||A.length)&&i.length&&i.forEach((function(e){var t;null===(t=e.custom)||void 0===t||t.addParamModels(e.model)})),jE().viewer.triggerReducer();case 14:case"end":return e.stop()}}),e)}))),function(e){return o.apply(this,arguments)})}])&&oI(t.prototype,r),n&&oI(t,n),u}(Bn.AXR);function lI(e){return(lI="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 gI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function fI(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?gI(Object(r),!0).forEach((function(t){pI(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gI(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function pI(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function hI(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var A,a=e[Symbol.iterator]();!(n=(A=a.next()).done)&&(r.push(A.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(o)throw i}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return dI(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return dI(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function dI(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function II(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yI(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function CI(e,t,r){return(CI="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=mI(e)););return e}(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(r):o.value}})(e,t,r||e)}function EI(e,t){return(EI=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function BI(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=mI(e);if(t){var o=mI(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return vI(this,r)}}function vI(e,t){return!t||"object"!==lI(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function mI(e){return(mI=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var QI={rawSelected:[],selectedData:[],selectedDataV2:[]},bI=function(e,t){var r=e.entityId+"%%"+e.entityType.toString(),n=t.entityId+"%%"+t.entityType.toString();return r>n?1:r===n?0:-1},_I=function(e){!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}}),t&&EI(e,t)}(i,e);var t,r,n,o=BI(i);function i(){var e;return II(this,i),(e=o.apply(this,arguments)).state=e.stateCreator.create(QI).mutable(),e.onModelsChange=function(){var t=e.selected.map((function(t){return e.stateManager.core.pad.findModel(t.entityId)})).filter((function(e){return!!e})),r=e.state.state.selectedData;t.length===r.length&&Object(_e.unzip)([t,r]).every((function(e){var t=hI(e,2);return t[0]===t[1]}))||(e.state.reduce((function(e){return fI(fI({},e),{},{selectedData:t})})),e.emit(i.EVENT_SELECT_CHANGED))},e.onModelChangeV2=function(){setTimeout((function(){e.onModelsChange()}),0);var t=e.stateManager.core,r=t.pad,n=t.fittingDesign,o=n.getFittings(),A=n.getGrooveFittings(),a=e.rawSelected.map((function(e){switch(e.entityType){case li:return r.findModelEx(e.entityId,ls);case ci:return r.findParamModelAssembly(e.entityId);case kg:return o.find((function(t){return t.id===e.entityId}));case Ng:return A.find((function(t){return t.id===e.entityId}));default:return}})).filter((function(e){return!!e})),s=e.state.state.selectedDataV2;s.length===a.length&&Object(_e.unzip)([s,a]).every((function(e){var t=hI(e,2);return t[0]===t[1]}))||(e.state.reduce((function(e){return fI(fI({},e),{},{selectedDataV2:a})})),e.emit(i.EVENT_SELECT_CHANGED_V2))},e._onSelectionChange=function(){e.onStateChange()},e}return t=i,(r=[{key:"module",value:function(){return"select"}},{key:"select",value:function(e){this.selectionStateManager.select(e)}},{key:"unSelect",value:function(e){this.selectionStateManager.unSelect(e)}},{key:"getSelected",value:function(){return this.state.state.selectedData}},{key:"selectionStateManager",get:function(){return this.stateManager.core.kaf.selection}},{key:"init",value:function(){CI(mI(i.prototype),"init",this).call(this),this.enable()}},{key:"release",value:function(){this.disable(),CI(mI(i.prototype),"release",this).call(this)}},{key:"onEnable",value:function(e){CI(mI(i.prototype),"onEnable",this).call(this,e),this.rawSelected=[],this.selected=[],this.selectionStateManager.on(VA.UPDATE,this._onSelectionChange),this.stateManager.core.pad.on(gs.EVENT_PARAM_MODELS_CHANGED,this.onModelChangeV2),Qe.on(Be.FITTING_MODEL_CHANGE,this.onModelChangeV2),this.onStateChange()}},{key:"onDisable",value:function(e){this.stateManager.core.pad.off(gs.EVENT_PARAM_MODELS_CHANGED,this.onModelChangeV2),Qe.off(Be.FITTING_MODEL_CHANGE,this.onModelChangeV2),this.state.reduce((function(){return QI})),this.selectionStateManager.off(VA.UPDATE,this._onSelectionChange),this.rawSelected=[],this.selected=[],CI(mI(i.prototype),"onDisable",this).call(this,e)}},{key:"onStateChange",value:function(){var e=this.selectionStateManager.state.value;if(e.sort(bI),this.rawSelected!==e){this.rawSelected=e;var t=this.resolveSelected(e)||[];this.selectedIsChanged(this.selected,t)&&(this.selected=t),this.onModelChangeV2()}}},{key:"resolveSelected",value:function(e){return e.filter((function(e){return e.entityType===li}))}},{key:"selectedIsChanged",value:function(e,t){if(e.length!==t.length)return!0;if(0===e.length&&0===t.length)return!1;for(var r=e.map((function(e){return e.entityId+"%%"+e.entityType.toString()})),n=t.map((function(e){return e.entityId+"%%"+e.entityType.toString()})),o=0,i=n.length;o<i;++o)if(r[o]!==n[o])return!0;return!1}}])&&yI(t.prototype,r),n&&yI(t,n),i}(Bn.AXR);_I.EVENT_SELECT_CHANGED="EVENT_SELECT_CHANGED",_I.EVENT_SELECT_CHANGED_V2="EVENT_SELECT_CHANGED_V2";var wI={entry:of,scene:cI,select:_I,fittingDesign:kh,baseDesignInfo:Eg,viewParamModel:Gf};function SI(){return jE().axr.axrs}var DI=Object(ui.getConnector)(),RI=DI.connect,MI=DI.setRootState;function xI(e,t,r){return RI((function(){return e(SI(),jE().getStateManager())}),t,r)}var PI=r(1106),FI=r.n(PI);function OI(e){return(OI="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 TI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function LI(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function kI(e,t,r){return t&&LI(e.prototype,t),r&&LI(e,r),e}function NI(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}}),t&&GI(e,t)}function GI(e,t){return(GI=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function UI(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=YI(e);if(t){var o=YI(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return jI(this,r)}}function jI(e,t){return!t||"object"!==OI(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function YI(e){return(YI=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var VI=Symbol("layout"),HI=xI((function(e){return{status:e.entry.state}}),(function(e){return{status:e.status.main}}),function(e){NI(r,e);var t=UI(r);function r(){return TI(this,r),t.apply(this,arguments)}return kI(r,[{key:"render",value:function(){return this.state.views.map((function(e){return e.content}))}}]),r}(vn.MountPoint)),KI=function(e){NI(r,e);var t=UI(r);function r(){return TI(this,r),t.apply(this,arguments)}return kI(r,[{key:"render",value:function(){return Qn.a.createElement(HI,{mountPointId:VI})}}]),r}(Qn.a.PureComponent);function JI(e){return(JI="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 qI(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function WI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zI(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}}),t&&XI(e,t)}function XI(e,t){return(XI=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ZI(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=ey(e);if(t){var o=ey(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return $I(this,r)}}function $I(e,t){return!t||"object"!==JI(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ey(e){return(ey=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}KI.contextType=vn.AppContext;var ty=xI((function(e,t){return{scene3D:t.scene3D}}),(function(e){var t=e.scene3D;return{cameraType:t.cameraType,cameraAttributes:t.cameraAttributes,initCameraAttributes:t.initCameraAttributes,perspectiveCameraMode:t.perspectiveCameraMode,perspectiveCameraFov:t.perspectiveCameraFov,groundGridConfig:t.groundGridConfig,enableCameraAnimation:t.enableCameraAnimation,renderMode:t.renderMode}}),function(e){zI(r,e);var t=ZI(r);function r(){return WI(this,r),t.apply(this,arguments)}return r}(vn.Scene3D)),ry=xI((function(){return{}}),(function(){return{}}),function(e){zI(i,e);var t,r,n,o=ZI(i);function i(){var e;return WI(this,i),(e=o.apply(this,arguments)).onInit=function(e){var t=e.viewer.config;t.autoInstance.enabled.set(!0),t.popMeshMerge.enabled.set(!0),t.background.active.set(xi.BackgroundMode.SolidColorBackground),t.background.solid.color.set(new xi.Color(xg.sceneBG)),t.ground.enabled.set(!1),t.postEffect.planarShadow.enabled.set(!1),t.postEffect.taa.enabled.set(!1),t.staticFrameCache.enabled.set(!1),t.isExtraCopyBeforeScreenEnabled.set(!1),t.postEffect.ao.enabled.set(!1),jE().viewer.onScene3DInit(e)},e.onGrabStart=function(){e.props.rootState.scene3D.updateEnableCameraAnimation(!1),e.props.rootState.scene3D.updateGrabing(!0)},e.onGrabEnd=function(){e.props.rootState.scene3D.updateGrabing(!1)},e.onZoomStart=function(){e.props.rootState.scene3D.updateEnableCameraAnimation(!1),e.props.rootState.scene3D.updateZooming(!0)},e.onZoomEnd=function(){e.props.rootState.scene3D.updateZooming(!1)},e.onCameraAnimationEnd=function(){e.props.rootState.scene3D.updateEnableCameraAnimation(!1)},e}return t=i,(r=[{key:"render",value:function(){var e=this.props,t=e.rootState.scene3D,r=e.containerId,n=e.size;return Qn.a.createElement(ty,{onInit:this.onInit,cameraRotatable:!0,containerId:r,size:n,onGrabStart:this.onGrabStart,onGrabEnd:this.onGrabEnd,onZoomStart:this.onZoomStart,onZoomEnd:this.onZoomEnd,onScaleUpdate:t.updateScale,onCameraAttributesChange:t.updateCameraAttributes,onCameraAnimationEnd:this.onCameraAnimationEnd})}}])&&qI(t.prototype,r),n&&qI(t,n),i}(Qn.a.PureComponent));function ny(e){return(ny="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 oy(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function iy(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ay(e,t){return(Ay=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ay(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=uy(e);if(t){var o=uy(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return sy(this,r)}}function sy(e,t){return!t||"object"!==ny(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function uy(e){return(uy=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var cy=xI((function(e,t){return{scene3D:t.scene3D}}),(function(e){return{size:e.scene3D.size}}),function(e){!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}}),t&&Ay(e,t)}(i,e);var t,r,n,o=ay(i);function i(){var e;return oy(this,i),(e=o.apply(this,arguments)).rootRef=Qn.a.createRef(),e.updateLayout=Object(_e.throttle)((function(){var t=e.rootRef.current;if(t){var r=t.getBoundingClientRect();e.props.rootState.scene3D.updateSize(new dt.a(r.width,r.height))}}),200),e}return t=i,(r=[{key:"componentDidMount",value:function(){this.updateLayout(),window.addEventListener("resize",this.updateLayout)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.updateLayout),this.updateLayout.cancel()}},{key:"render",value:function(){var e=this.props,t=e.size,r=e.className;return Qn.a.createElement("div",{ref:this.rootRef,id:Mg.SCENE_ID,className:r},Qn.a.createElement(ry,{containerId:Mg.SCENE_ID,size:new c.Vector2d(t.x,t.y)}))}}])&&iy(t.prototype,r),n&&iy(t,n),i}(Qn.a.PureComponent));r(2070);function ly(e){return(ly="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 gy(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fy(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function py(e,t){return(py=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function hy(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Iy(e);if(t){var o=Iy(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return dy(this,r)}}function dy(e,t){return!t||"object"!==ly(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Iy(e){return(Iy=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var yy=xI((function(e){return{}}),(function(e){return{}}),function(e){!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}}),t&&py(e,t)}(i,e);var t,r,n,o=hy(i);function i(){return gy(this,i),o.apply(this,arguments)}return t=i,(r=[{key:"render",value:function(){return Qn.a.createElement(vn.ViewMounter,{mountPointId:VI},Qn.a.createElement(cy,{key:"s3",className:FI.a.scene3D}))}}])&&fy(t.prototype,r),n&&fy(t,n),i}(Qn.a.PureComponent));function Cy(e,t){return(Cy=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ey(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=vy(e);if(t){var o=vy(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return By(this,r)}}function By(e,t){return!t||"object"!==my(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function vy(e){return(vy=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function my(e){return(my="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)}var Qy,by=function(e,t,r,n){var o,i=arguments.length,A=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"===("undefined"==typeof Reflect?"undefined":my(Reflect))&&"function"==typeof Reflect.decorate)A=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(A=(i<3?o(A):i>3?o(t,r,A):o(t,r))||A);return i>3&&A&&Object.defineProperty(t,r,A),A},_y=function(e,t){if("object"===("undefined"==typeof Reflect?"undefined":my(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},wy=function(e){!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}}),t&&Cy(e,t)}(r,e);var t=Ey(r);function r(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),(n=t.call(this)).$model=e,n.entityType=kg,n.entityId=e.id,n}return r}(vn.Entity);wy=by([Object(vn.provideEntityAPIs)([new vn.EntityAPIs.DrawableAPI3D((function(){var e=this;return{create:function(){return function(e){var t=e.$model.type;if(t===n.GROOVE)return Sy(e);if(t===n.HOLE)return Dy(e)}(e)},update:function(t){var r=e.$model,n=r.position,o=r.visible;t.position.set(n.x,n.y,n.z),t.visible=o,t.material&&(t.material.visible=o)}}})),new vn.EntityAPIs.HighlightGeometryAPI3D((function(){return{geometry:this.$model.boundingBox}}))]),_y("design:paramtypes",["function"==typeof(Qy=void 0!==pt&&pt)?Qy:Object])],wy);var Sy=function(e){var t=e.$model,r=t.position,n=t.size,o=t.rotate,i=t.visible,A=t.viewColor,a=t.opacity,s=new xi.BoxGeometry(n.x,n.y,n.z),u=new xi.MeshBasicMaterial({color:A,opacity:a,visible:i,transparent:!0}),c=new xi.Mesh(s,u);return c.position.set(r.x,r.y,r.z),c.rotation.set(o.x,o.y,o.z),c.visible=i,c},Dy=function(e){var t=e.$model,r=t.position,n=t.visible,o=t.rotate,i=t.height,A=t.viewColor,a=t.opacity,s=t.fittingData.diameter/2,u=new xi.CylinderGeometry(s,s,i),c=new xi.MeshBasicMaterial({color:A,opacity:a,visible:n,transparent:!0}),l=new xi.Mesh(u,c);return l.position.set(r.x,r.y,r.z),l.rotation.set(o.x,o.y,o.z),l};function Ry(e,t){if(e.length!==t.length)return[];for(var r=e.length,n=[],o=0;o<r-1;o++)n.push(e[o].x,e[o].y,e[o].z),n.push(e[o+1].x,e[o+1].y,e[o+1].z),n.push(t[o].x,t[o].y,t[o].z),n.push(t[o].x,t[o].y,t[o].z),n.push(t[o+1].x,t[o+1].y,t[o+1].z),n.push(e[o+1].x,e[o+1].y,e[o+1].z);return n}function My(e){var t=e.elements;return(new Pi.a.Matrix4).set(t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15])}function xy(e){return function(e){if(Array.isArray(e))return Py(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Py(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Py(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Py(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Fy(e,t){return(Fy=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Oy(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Ly(e);if(t){var o=Ly(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Ty(this,r)}}function Ty(e,t){return!t||"object"!==ky(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Ly(e){return(Ly=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ky(e){return(ky="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)}var Ny,Gy=function(e,t,r,n){var o,i=arguments.length,A=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"===("undefined"==typeof Reflect?"undefined":ky(Reflect))&&"function"==typeof Reflect.decorate)A=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(A=(i<3?o(A):i>3?o(t,r,A):o(t,r))||A);return i>3&&A&&Object.defineProperty(t,r,A),A},Uy=function(e,t){if("object"===("undefined"==typeof Reflect?"undefined":ky(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},jy=function(e){!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}}),t&&Fy(e,t)}(r,e);var t=Oy(r);function r(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),(n=t.call(this)).$model=e,n.entityType=Ng,n.entityId=e.id,n}return r}(vn.Entity);function Yy(e){var t=e.matrix,r=e.points,n=e.depth,o=e.color,i=e.side,A=e.position,a=e.opacity,s=new xi.LineBasicMaterial,u=new xi.MeshBasicMaterial({transparent:!0,opacity:a}),c=new xi.Mesh(void 0,u),l=new xi.Line(void 0,s),g=new xi.Group;return c.setAttribute("transparent-line-origin",!1),l.setAttribute("transparent-line-origin",!1),g.add(c),g.setAttribute("outline",!1),g.setAttribute("shadowCaster",!1),u.setValues({color:o,side:i}),g.applyMatrix(t),g.position.set(A.x,A.y,A.z),function(e){var t=e.area,r=e.outline,n=e.points,o=e.height,i=e.holes,A=!!r;if(!n||0===n.length)return;var a=n[0],s=new xi.Shape,u=A?new xi.Geometry:null;s.moveTo(a.x,a.y),n.forEach((function(e){s.lineTo(e.x,e.y),A&&u.vertices.push(new xi.Vector3(e.x,e.y,o))})),s.lineTo(a.x,a.y),i&&(s.holes=i);A&&(u.vertices.push(new xi.Vector3(a.x,a.y,o)),r.geometry&&r.geometry.dispose(),r.geometry=u);var c=new xi.ShapeGeometry(s);t.geometry&&t.geometry.dispose();t.geometry=c,t.position.set(0,0,o)}({area:c,points:r,height:n}),g}function Vy(e){var t=new c.BBox3d;return[].concat(xy(e.getTopRenderPoints()),xy(e.getBottomRenderPoints())).forEach((function(e){t.addPoint(new c.Point3d(e))})),new m.a(new M.a({x:t.width,y:t.height,z:t.depth}),new M.a(t.center),new M.a({x:0,y:0,z:0}))}function Hy(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ky(e,t){return(Ky=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Jy(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Wy(e);if(t){var o=Wy(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return qy(this,r)}}function qy(e,t){return!t||"object"!==zy(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Wy(e){return(Wy=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function zy(e){return(zy="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)}jy=Gy([Object(vn.provideEntityAPIs)([new vn.EntityAPIs.DrawableAPI3D((function(){var e=this;return{create:function(){return function(e){var t=new xi.Group,r=e.pointToGlobalMatrix(),n=e.depth,o=e.viewColor,i=e.opacity,A=e.visible,a=void 0!==A&&A,s=e.path.getAllPolygonPoints(),u=new w.a;u.fromString(r.toArray().join(","));var l=My(u),g=kr.a.decompose(u).position,f=Yy({matrix:l,depth:0,points:s,color:o,side:xi.Side.FrontSide,position:g,opacity:i}),p=Yy({matrix:l,depth:-n,points:s,color:o,side:xi.Side.BackSide,position:g,opacity:i}),h=[].concat(xy(s),[s[0]]),d=function(e){var t=e.matrix,r=e.side,n=e.position,o=e.color,i=e.opacity,A=new xi.MeshBasicMaterial({opacity:i,transparent:!0}),a=new xi.Mesh(new xi.BufferGeometry,A);if(A.setValues({side:r,color:o}),a.setAttribute("transparent-line-origin",!0),a.setAttribute("outline",!1),a.setAttribute("shadowCaster",!1),a.geometry instanceof xi.BufferGeometry){var s=Ry(e.topPoints,e.bottomPoints);a.geometry.addAttribute("position",new xi.Float32BufferAttribute(s,3)),a.geometry.dispose()}return a.applyMatrix(t),a.position.set(n.x,n.y,n.z),a}({position:g,matrix:l,topPoints:h.map((function(e){return new c.Point3d(e.x,e.y,0)})),bottomPoints:h.map((function(e){return new c.Point3d(e.x,e.y,-n)})),color:o,side:xi.Side.DoubleSide,opacity:i});return t.add(f),t.add(p),t.add(d),[f,p,d,t].forEach((function(e){e.visible=a})),t}(e.$model)},update:function(t){var r=e.$model.visible;t.traverse((function(e){e.visible=r,e instanceof xi.Mesh&&e.material&&Object(_e.castArray)(e.material).forEach((function(e){e.visible=r}))})),t.visible=r}}})),new vn.EntityAPIs.HighlightGeometryAPI3D((function(){return{geometry:Vy(this.$model)}}))]),Uy("design:paramtypes",["function"==typeof(Ny=void 0!==Vt&&Vt)?Ny:Object])],jy);var Xy,Zy=function(e,t,r,n){var o,i=arguments.length,A=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"===("undefined"==typeof Reflect?"undefined":zy(Reflect))&&"function"==typeof Reflect.decorate)A=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(A=(i<3?o(A):i>3?o(t,r,A):o(t,r))||A);return i>3&&A&&Object.defineProperty(t,r,A),A},$y=function(e,t){if("object"===("undefined"==typeof Reflect?"undefined":zy(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},eC=vn.__INTERNAL__.Highlighters.generateWireGeometryForHighlighterGeometry,tC=function(e){!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}}),t&&Ky(e,t)}(i,e);var t,r,n,o=Jy(i);function i(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(t=o.call(this)).$model=e,t.entityType=jg,t.entityId=e.id,t}return t=i,(r=[{key:"createOutlineMesh",value:function(){var e=this.$model.hintOutline,t=e.color,r=e.opacity,n=this.$model.visible,o=function(e){var t=new xi.Geometry,r=e.getVertices().map((function(e){var t=e;return new xi.Vector3(t.x,t.y,t.z)}));e.getIndices().forEach((function(e){t.vertices.push(r[e.x],r[e.y])})),t.computeBoundingBox();var n=t.getBoundingBox().getCenter(new xi.Vector3);return t.vertices=t.vertices.map((function(e){return function(e,t){var r=t.clone().sub(e);return e.clone().add(r)}(n,e)})),t}(this.getGeometry()),i=new xi.LineBasicMaterial({color:t,opacity:r,transparent:!0}),A=new xi.LineSegments(o,i);return A.computeLineDistances(),A.renderOrder=999,A.setAttribute("outline",!1),A.setAttribute("transparent-line-origin",!0),A.setAttribute("shadowCaster",!1),A.visible=n,i.visible=n,A}},{key:"getGeometry",value:function(){var e,t=this.$model.linkModel;return e=t instanceof x.CoreParamModel?t.getConcatenatedBox3():t instanceof pt?t.boundingBox:Vy(t),eC(e)}}])&&Hy(t.prototype,r),n&&Hy(t,n),i}(vn.Entity),rC=tC=Zy([Object(vn.provideEntityAPIs)([new vn.EntityAPIs.DrawableAPI3D((function(){var e=this;return{create:function(){return e.createOutlineMesh()},update:function(t){var r=e.$model.visible;t.visible=r,t.material.visible=r}}}))]),$y("design:paramtypes",["function"==typeof(Xy=void 0!==tt&&tt)?Xy:Object])],tC);function nC(e){var t=new xi.BufferGeometry;if(t.index=new xi.BufferAttribute(new Uint16Array(e.indices),1),t.addAttribute("position",new xi.BufferAttribute(new Float32Array(e.vertices),3)),t.addAttribute("uv",new xi.BufferAttribute(new Float32Array(e.textures),2)),e.normals){var r=new Float32Array(e.normals);t.addAttribute("normal",new xi.BufferAttribute(r,3))}else t.computeVertexNormals();return t}function oC(e,t){return(oC=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function iC(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=aC(e);if(t){var o=aC(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return AC(this,r)}}function AC(e,t){return!t||"object"!==sC(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function aC(e){return(aC=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function sC(e){return(sC="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)}var uC,cC=function(e,t,r,n){var o,i=arguments.length,A=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"===("undefined"==typeof Reflect?"undefined":sC(Reflect))&&"function"==typeof Reflect.decorate)A=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(A=(i<3?o(A):i>3?o(t,r,A):o(t,r))||A);return i>3&&A&&Object.defineProperty(t,r,A),A},lC=function(e,t){if("object"===("undefined"==typeof Reflect?"undefined":sC(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},gC=function(e){!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}}),t&&oC(e,t)}(r,e);var t=iC(r);function r(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),(n=t.call(this)).$model=e,n.entityType=Gg,n.entityId=e.id,n}return r}(vn.Entity),fC=gC=cC([Object(vn.provideEntityAPIs)([new vn.EntityAPIs.DrawableAPI3D((function(){var e=this;return{create:function(){return function(e){var t=e.$model,r=t.geometryModel,n=t.viewColor,o=t.originPoints,i=new xi.Group,A=nC(r),a=new xi.MeshBasicMaterial({depthTest:!1,depthWrite:!1,color:n,side:xi.Side.DoubleSide}),s=new xi.Mesh(A,a);s.renderOrder=998,i.add(s),Object({DEPLOY_VERSION:1,APP_VERSION:1}).IS_DEV_OR_TESTING&&i.add(o.map((function(e){var t=new xi.Mesh(pC,hC);return t.position.set(e.x,e.y,e.z),t.renderOrder=999,t})));return i}(e)},update:function(){}}}))]),lC("design:paramtypes",["function"==typeof(uC=void 0!==Ar&&Ar)?uC:Object])],gC),pC=new xi.SphereBufferGeometry(3),hC=new xi.MeshBasicMaterial({depthTest:!1,depthWrite:!1,color:"black"});function dC(e){return function(e){if(Array.isArray(e))return IC(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return IC(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return IC(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function IC(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function yC(e,t){return(yC=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function CC(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=BC(e);if(t){var o=BC(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return EC(this,r)}}function EC(e,t){return!t||"object"!==vC(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function BC(e){return(BC=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function vC(e){return(vC="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)}var mC,QC=function(e,t,r,n){var o,i=arguments.length,A=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"===("undefined"==typeof Reflect?"undefined":vC(Reflect))&&"function"==typeof Reflect.decorate)A=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(A=(i<3?o(A):i>3?o(t,r,A):o(t,r))||A);return i>3&&A&&Object.defineProperty(t,r,A),A},bC=function(e,t){if("object"===("undefined"==typeof Reflect?"undefined":vC(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},_C=function(e){!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}}),t&&yC(e,t)}(r,e);var t=CC(r);function r(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),(n=t.call(this)).$model=e,n.entityType=Ug,n.entityId=e.id,n}return r}(vn.Entity),wC=_C=QC([Object(vn.provideEntityAPIs)([new vn.EntityAPIs.DrawableAPI3D((function(){var e=this;return{create:function(){return function(e){var t=e.$model,r=t.plankFaces,n=t.linkModel,o=t.hintOutline,i=n.getConcatenatedMatrix(),A=new xi.Group;r&&r.forEach((function(e){var t=nC(sn(e,i)),r=new xi.MeshBasicMaterial({depthTest:!0,depthWrite:!0,color:e.color,opacity:e.opacity,transparent:!0,side:xi.Side.DoubleSide}),n=new xi.Mesh(t,r);n.renderOrder=998,A.add(n)}));if(o){var a=n.getSize(),s=n.getWireFrames();if(!s){var u=eh(0,a),c=eh(5,a);s=[].concat(dC(Object(_e.zip)(u,[].concat(dC(u.slice(1)),[u[0]]))),dC(Object(_e.zip)(c,[].concat(dC(c.slice(1)),[c[0]]))),dC(Object(_e.zip)(u,c))).flat().map((function(e){return[e.x,e.y,e.z]})).flat()}var l=Object(_e.chunk)(s,3).map((function(e){return new M.a(e[0],e[1],e[2]).applyMatrix4(i)})).map((function(e){return[e.x,e.y,e.z]})).flat(),g=new Ki({points:l,visible:!0,color:parseInt(o.color.replace(/^#/,""),16)});A.add(g)}return A}(e)},update:function(){}}}))]),bC("design:paramtypes",["function"==typeof(mC=void 0!==pr&&pr)?mC:Object])],_C);function SC(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function DC(e,t){return(DC=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function RC(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=xC(e);if(t){var o=xC(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return MC(this,r)}}function MC(e,t){return!t||"object"!==PC(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function xC(e){return(xC=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function PC(e){return(PC="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)}var FC,OC=function(e,t,r,n){var o,i=arguments.length,A=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"===("undefined"==typeof Reflect?"undefined":PC(Reflect))&&"function"==typeof Reflect.decorate)A=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(A=(i<3?o(A):i>3?o(t,r,A):o(t,r))||A);return i>3&&A&&Object.defineProperty(t,r,A),A},TC=function(e,t){if("object"===("undefined"==typeof Reflect?"undefined":PC(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},LC=function(e){!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}}),t&&DC(e,t)}(i,e);var t,r,n,o=RC(i);function i(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(t=o.call(this)).$model=e,t.entityType=Yg,t.entityId=e.id,t}return t=i,(r=[{key:"createMesh",value:function(){var e=this.$model,t=e.points,r=e.viewColor,n=e.opacity,o=e.visible,i=e.linkModel,A=e.height;if(i){var a=t.map((function(e){return new c.Point3d(e.x,e.y,A/2)})),s=t.map((function(e){return new c.Point3d(e.x,e.y,-A/2)})),u=new xi.MeshBasicMaterial({opacity:n,transparent:!0}),l=new xi.Mesh(new xi.BufferGeometry,u);if(u.setValues({side:xi.Side.DoubleSide,color:r}),l.setAttribute("transparent-line-origin",!0),l.setAttribute("outline",!1),l.setAttribute("shadowCaster",!1),l.geometry instanceof xi.BufferGeometry){var g=Ry(a,s);l.geometry.addAttribute("position",new xi.Float32BufferAttribute(g,3)),l.geometry.dispose()}var f=i.getConcatenatedMatrix(),p=new M.a(0,0,0).applyMatrix4(f);return l.position.set(p.x,p.y,p.z),l.visible=o,u.visible=o,l.rotation.setFromRotationMatrix(My(f)),l}}}])&&SC(t.prototype,r),n&&SC(t,n),i}(vn.Entity),kC=LC=OC([Object(vn.provideEntityAPIs)([new vn.EntityAPIs.DrawableAPI3D((function(){var e=this;return{create:function(){return e.createMesh()},update:function(t){var r=e.$model,n=r.visible,o=r.viewColor,i=r.opacity;t.visible=n,t.material.setValues({opacity:i,color:o}),t.material.visible=n}}}))]),TC("design:paramtypes",["function"==typeof(FC=void 0!==Qr&&Qr)?FC:Object])],LC);var NC=function e(t){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.getDesignDoc=t,this.createFittingEntities=vn.__unstable__.flatEntitiesCreator((function(e){return new wy(e)})),this.createIntersectEntities=vn.__unstable__.flatEntitiesCreator((function(e){return new fC(e)})),this.createGrooveFittingEntities=vn.__unstable__.flatEntitiesCreator((function(e){return new jy(e)})),this.createPlankFaceHintEntities=vn.__unstable__.flatEntitiesCreator((function(e){return new wC(e)})),this.careateFittingHintEntities=vn.__unstable__.flatEntitiesCreator((function(e){return new rC(e)})),this.careatePlankOutlineHintEntities=vn.__unstable__.flatEntitiesCreator((function(e){return new kC(e)})),this.getFittingEntities=function(){var e=r.getDesignDoc();return e?r.createFittingEntities(e.getFittings()):[]},this.getGrooveFittingEntities=function(){var e=r.getDesignDoc();return e?r.createGrooveFittingEntities(e.getGrooveFittings()):[]},this.getIntersectedEntities=function(){var e=r.getDesignDoc();return e?r.createIntersectEntities(e.getIntersects()):[]},this.getPlankFaceHintEntities=function(){var e=r.getDesignDoc();return e?r.createPlankFaceHintEntities(e.getPlankFaceHintModels()):[]},this.getFittingHintEntities=function(){var e=r.getDesignDoc();return e?r.careateFittingHintEntities(e.getFittingHintModels()):[]},this.getPlankOutlineHintEntities=function(){var e=r.getDesignDoc();return e?r.careatePlankOutlineHintEntities(e.getPlankOutlineHintModels()):[]},this.getEntities=[this.getFittingEntities,this.getIntersectedEntities,this.getGrooveFittingEntities,this.getPlankFaceHintEntities,this.getFittingHintEntities,this.getPlankOutlineHintEntities]};function GC(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return UC(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return UC(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,A=!0,a=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return A=e.done,e},e:function(e){a=!0,i=e},f:function(){try{A||null==r.return||r.return()}finally{if(a)throw i}}}}function UC(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function jC(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var YC=function(){function e(){var t=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.disabled=!1,this.pressMap=new Map,this.resetPressStatus=function(){t.pressMap.forEach((function(e,r){t.pressMap.set(r,!1)}))},this.onKeyDown=function(e){var r=t.getKeyBoardKey(e);t.pressMap.get(r)||t.isPrevent(e)||t.pressMap.has(r)&&t.pressMap.set(r,!0)},this.onKeyUp=function(e){var r=t.getKeyBoardKey(e);t.pressMap.get(r)&&(t.isPrevent(e)||t.pressMap.has(r)&&t.pressMap.set(r,!1))},this.active()}var t,r,n;return t=e,(r=[{key:"addKeyboardKeyListener",value:function(e){var t=this,r=Object(_e.castArray)(e);if(r.some((function(e){return!t.isValidKeyboardKey(e)})))throw new Error("keyboard-key is invalid");var n,o=GC(r);try{for(o.s();!(n=o.n()).done;){var i=n.value;this.pressMap.set(i,!1)}}catch(e){o.e(e)}finally{o.f()}}},{key:"removeKeyboardKeyListener",value:function(e){var t,r=GC(Object(_e.castArray)(e));try{for(r.s();!(t=r.n()).done;){var n=t.value;this.pressMap.has(n)&&this.pressMap.delete(n)}}catch(e){r.e(e)}finally{r.f()}}},{key:"active",value:function(){document.addEventListener("keydown",this.onKeyDown),document.addEventListener("keyup",this.onKeyUp),document.addEventListener("mouseenter",this.resetPressStatus),this.disabled=!1}},{key:"dispose",value:function(){document.removeEventListener("keydown",this.onKeyDown),document.removeEventListener("keyup",this.onKeyUp),document.removeEventListener("mouseenter",this.resetPressStatus),this.disabled=!0,this.resetPressStatus()}},{key:"checkIsPress",value:function(e){var t=this;return Object(_e.castArray)(e).every((function(e){return t.pressMap.get(e)}))}},{key:"getKeyBoardKey",value:function(e){return e.key.toLowerCase()}},{key:"isPrevent",value:function(e){if(this.disabled)return!0;var t=e.target;if(!t)return!1;if("INPUT"===t.tagName){var r=t.type;return"radio"!==r&&"checkbox"!==r}return"SELECT"===t.tagName||"TEXTAREA"===t.tagName}},{key:"isValidKeyboardKey",value:function(e){return B.includes(e)}}])&&jC(t.prototype,r),n&&jC(t,n),e}(),VC=new Map([[Tr.ParamModelCategory.FRAME,[Tr.ParamModelCategory.DRAWER,Tr.ParamModelCategory.SWING_DOOR,Tr.ParamModelCategory.PARAM_FURNITURE,Tr.ParamModelCategory.FASCIA_BOARD,Tr.ParamModelCategory.SPECIAL_FRAME,Tr.ParamModelCategory.EMBED_FRAME_W,Tr.ParamModelCategory.POLE_W,Tr.ParamModelCategory.SEGMENT_DOOR_CONTAINER,Tr.ParamModelCategory.BOARD,Tr.ParamModelCategory.DRAWER,Tr.ParamModelCategory.SPACE_GROUP,Tr.ParamModelCategory.SINGLE_SLIDING_DOOR,Tr.ParamModelCategory.FRAME,Tr.ParamModelCategory.SLIDING_DOOR_BOARD,Tr.ParamModelCategory.PARAM_FURNITURE_PART,Tr.ParamModelCategory.SANITARY_COMPONENT,Tr.ParamModelCategory.DOOR_LEAF,Tr.ParamModelCategory.DECORATIVE_MOLDING_C,Tr.ParamModelCategory.DECORATIVE_MOLDING_W,Tr.ParamModelCategory.HANDS_FREE,Tr.ParamModelCategory.REPLACE_STRUCTURE_BOARD]],[Tr.ParamModelCategory.SHOWER_ROOM,[Tr.ParamModelCategory.DRAWER,Tr.ParamModelCategory.SWING_DOOR,Tr.ParamModelCategory.PARAM_FURNITURE,Tr.ParamModelCategory.FASCIA_BOARD,Tr.ParamModelCategory.SPECIAL_FRAME,Tr.ParamModelCategory.EMBED_FRAME_W,Tr.ParamModelCategory.POLE_W,Tr.ParamModelCategory.SEGMENT_DOOR_CONTAINER,Tr.ParamModelCategory.BOARD,Tr.ParamModelCategory.DRAWER,Tr.ParamModelCategory.SPACE_GROUP,Tr.ParamModelCategory.SINGLE_SLIDING_DOOR,Tr.ParamModelCategory.FRAME,Tr.ParamModelCategory.PARAM_FURNITURE_PART,Tr.ParamModelCategory.SANITARY_COMPONENT,Tr.ParamModelCategory.DOOR_LEAF,Tr.ParamModelCategory.REPLACE_STRUCTURE_BOARD]],[void 0,[Tr.ParamModelCategory.DRAWER,Tr.ParamModelCategory.SWING_DOOR,Tr.ParamModelCategory.PARAM_FURNITURE,Tr.ParamModelCategory.FASCIA_BOARD,Tr.ParamModelCategory.SPECIAL_FRAME,Tr.ParamModelCategory.EMBED_FRAME_W,Tr.ParamModelCategory.BOARD,Tr.ParamModelCategory.SPACE_GROUP,Tr.ParamModelCategory.POLE_W,Tr.ParamModelCategory.SINGLE_SLIDING_DOOR,Tr.ParamModelCategory.SLIDING_DOOR_BOARD,Tr.ParamModelCategory.DRAWER,Tr.ParamModelCategory.RAIL,Tr.ParamModelCategory.DOOR_LEAF]],[Tr.ParamModelCategory.SLIDING_DOOR_C,[Tr.ParamModelCategory.RAIL,Tr.ParamModelCategory.SINGLE_SLIDING_DOOR]],[Tr.ParamModelCategory.SPACE_GROUP,[Tr.ParamModelCategory.DRAWER,Tr.ParamModelCategory.SWING_DOOR,Tr.ParamModelCategory.PARAM_FURNITURE,Tr.ParamModelCategory.FASCIA_BOARD,Tr.ParamModelCategory.SEGMENT_DOOR_CONTAINER,Tr.ParamModelCategory.BOARD,Tr.ParamModelCategory.SPECIAL_BOARD,Tr.ParamModelCategory.SPACE_GROUP]],[Tr.ParamModelCategory.SINGLE_SLIDING_DOOR,[Tr.ParamModelCategory.SLIDING_DOOR_CORE,Tr.ParamModelCategory.DOOR_WAIST_LINE]],[Tr.ParamModelCategory.SEGMENT_DOOR_CONTAINER,[Tr.ParamModelCategory.SWING_DOOR]],[Tr.ParamModelCategory.REPLACE_STRUCTURE_BOARD,[Tr.ParamModelCategory.BOARD]],[Tr.ParamModelCategory.SWING_DOOR,[Tr.ParamModelCategory.DOOR_CORE,Tr.ParamModelCategory.DOOR_WAIST_LINE,Tr.ParamModelCategory.DECORATIVE_MOLDING,Tr.ParamModelCategory.BOARD]],[Tr.ParamModelCategory.DRAWER,[Tr.ParamModelCategory.DRAWER_PANEL,Tr.ParamModelCategory.SWING_DOOR,Tr.ParamModelCategory.BOARD]],[Tr.ParamModelCategory.PARAM_FURNITURE,[Tr.ParamModelCategory.FURNITURE_LEG]],[Tr.ParamModelCategory.KADA,[Tr.ParamModelCategory.BYOBU,Tr.ParamModelCategory.BYOBU_FRAME,Tr.ParamModelCategory.BYOBU_PANEL]]]);function HC(e){return function(e){if(Array.isArray(e))return KC(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return KC(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return KC(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function KC(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function JC(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var qC=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.prevModeSelectEntity=[],this.isAccessoryCache=new Map,this.designMode=f.PRODUCT,this.multiSelectShortCut="shift",this.pressManager=new YC,this.pressManager.addKeyboardKeyListener(this.multiSelectShortCut)}var t,r,n;return t=e,(r=[{key:"isAccessory",value:function(e){var t;if(this.isAccessoryCache.has(e.id))return this.isAccessoryCache.get(e.id);var r=null===(t=null==e?void 0:e.getParent)||void 0===t?void 0:t.call(e),n=(VC.get(r?r.getCategory().getRoot():void 0)||[]).some((function(t){return e.getCategory().belongsTo(t)}));return this.isAccessoryCache.set(e.getId(),n),n}},{key:"getAccessoryAtFirstLevel",value:function(e,t){for(var r,n,o=this,i=[],A=t;A&&A!==e;)i.unshift(A),A=(null===(r=A.getParent)||void 0===r?void 0:r.call(A))||(null===(n=A.getAssembly)||void 0===n?void 0:n.call(A));return i.find((function(e){return o.isAccessory(e)}))||t}},{key:"getParamModelLite",value:function(e){var t=(e.isRoot()?e:e.getRoot()).getAssembly();return t?gd(e,{origin:Yh.SENSE},void 0,gd(t,{origin:Yh.SENSE})):gd(e,{origin:Yh.SENSE})}},{key:"topModelModeGetSelectModel",value:function(e,t){var r,n;if(this.isFittingLikeModel(e))return e;var o,i,A,a=e.isRoot()?e:e.getRoot(),s=a.getAssembly(),u=Array.isArray(this.curSelectEntity)?this.curSelectEntity[0]:this.curSelectEntity,c=!1;if(u&&(i=JE(u))&&!this.isFittingLikeModel(i)&&(u.entityType===li?A=(A=i.isRoot()?i:i.getRoot()).getAssembly()||A:(c=!0,A=i),o=A===a||A===s),o){for(var l=!1,g=!1,f=i instanceof x.CoreParamModel?i.getParent():void 0,h=e;h;){if(h===i){l=!0;break}if(h===f){g=!0;break}h=(null===(r=h.getParent)||void 0===r?void 0:r.call(h))||(null===(n=h.getAssembly)||void 0===n?void 0:n.call(h))}if(t===p.CLICK)return l?i:g?this.getAccessoryAtFirstLevel(f,e):A instanceof x.CoreParamModelAssembly?(i.isRoot()?i:i.getRoot())===a?this.getAccessoryAtFirstLevel(a,e):a:this.getAccessoryAtFirstLevel(a,e);if(t===p.DB_CLICK)return l?c?a:this.getAccessoryAtFirstLevel(i,e):this.getAccessoryAtFirstLevel(a,e)}else{if(t===p.CLICK)return s||a;if(t===p.DB_CLICK)return s?a:this.getAccessoryAtFirstLevel(a,e)}}},{key:"accessoryModeGetSelectModel",value:function(e,t){var r,n;if(this.isFittingLikeModel(e))return e;var o=e.isRoot()?e:e.getRoot(),i=Array.isArray(this.curSelectEntity)?this.curSelectEntity[0]:this.curSelectEntity,A=i&&JE(i),a=!1;if(A&&!this.isFittingLikeModel(A)&&(a=(A.isRoot()?A:A.getRoot())===o),a){for(var s=!1,u=!1,c=null==A?void 0:A.getParent(),l=e;l;){if(l===A){s=!0;break}if(l===c){u=!0;break}l=(null===(r=l.getParent)||void 0===r?void 0:r.call(l))||(null===(n=l.getAssembly)||void 0===n?void 0:n.call(l))}if(t===p.CLICK)return s?A:this.getAccessoryAtFirstLevel(u?c:o,e);if(t===p.DB_CLICK){if(s)return this.getAccessoryAtFirstLevel(A,e);var g=this.getAccessoryAtFirstLevel(o,e);return this.getAccessoryAtFirstLevel(g,e)}}else{if(t===p.CLICK)return this.getAccessoryAtFirstLevel(o,e);if(t===p.DB_CLICK){var f=this.getAccessoryAtFirstLevel(o,e);return this.getAccessoryAtFirstLevel(f,e)}}}},{key:"topModelModeAndAccessoryModeHint",value:function(e){var t,r;if(this.isFittingLikeModel(e))return e;var n,o,i=e.isRoot()?e:e.getRoot(),A=i.getAssembly(),a=Array.isArray(this.curSelectEntity)?this.curSelectEntity[0]:this.curSelectEntity,s=!1;if(a&&(n=JE(a))&&!this.isFittingLikeModel(n)&&(s=(o=a.entityType===li?(o=n.isRoot()?n:n.getRoot()).getAssembly()||o:n)===i||o===A),n&&s){for(var u=!1,c=!1,l=n instanceof x.CoreParamModel?n.getParent():void 0,g=e;g;){if(g===n){u=!0;break}if(g===l){c=!0;break}g=(null===(t=g.getParent)||void 0===t?void 0:t.call(g))||(null===(r=g.getAssembly)||void 0===r?void 0:r.call(g))}return u?this.isMultiSelect||Array.isArray(this.curSelectEntity)&&this.curSelectEntity.length>1?n:n instanceof x.CoreParamModelAssembly?i:this.getAccessoryAtFirstLevel(n,e):c?this.getAccessoryAtFirstLevel(l,e):this.designMode===f.TOP_MODEL&&i!==n&&i!==n.getRoot()?i:this.getAccessoryAtFirstLevel(i,e)}return this.designMode===f.TOP_MODEL?i.getAssembly()||i:this.getAccessoryAtFirstLevel(i,e)}},{key:"setCurSelectEntity",value:function(e){this.curSelectEntity=e}},{key:"getCurSelectEntity",value:function(){return this.curSelectEntity}},{key:"setCurHintEntity",value:function(e){this.curHintEntity=e}},{key:"getCurHintEntity",value:function(){return this.curHintEntity}},{key:"clearPrevModeSelectEntity",value:function(){this.prevModeSelectEntity.length&&(this.prevModeSelectEntity=[])}},{key:"getDesignMode",value:function(){return this.designMode}},{key:"setDesignMode",value:function(e,t){this.designMode=e,e===f.CUSTOM?(this.customModeFindSelectModel=null==t?void 0:t.findSelectModel,this.customModeFindHintModel=null==t?void 0:t.findHintModel,!this.pressManager.disabled&&this.pressManager.dispose()):(this.customModeFindSelectModel=void 0,this.customModeFindHintModel=void 0,this.pressManager.disabled&&this.pressManager.active(),this.prevModeSelectEntity=this.prevModeSelectEntity.concat(this.curSelectEntity&&Object(_e.castArray)(this.curSelectEntity)||[])),this.setCurSelectEntity(void 0),this.setCurHintEntity(void 0)}},{key:"genEntityDescriptor",value:function(e){var t=qE[e.type];return{entityId:e.id,entityType:t}}},{key:"customModeSelectModel",value:function(e,t){var r,n;n=this.isFittingLikeModel(e)?fp(e):this.getParamModelLite(e);var o=null===(r=this.customModeFindSelectModel)||void 0===r?void 0:r.call(this,n,t);return Object(_e.castArray)(o).filter((function(e){return e})).map(this.genEntityDescriptor)}},{key:"customModeHintModel",value:function(e){var t,r;r=this.isFittingLikeModel(e)?fp(e):this.getParamModelLite(e);var n=null===(t=this.customModeFindHintModel)||void 0===t?void 0:t.call(this,r);return Object(_e.castArray)(n).filter((function(e){return e})).map(this.genEntityDescriptor)}},{key:"isFittingLikeModel",value:function(e){return e instanceof Vt||e instanceof pt||e instanceof fe&&Boolean(e.isAppendHardware)}},{key:"getSelectEntity",value:function(e,t){var r;if(this.isMultiSelect&&this.designMode!==f.CUSTOM){switch(this.designMode){case f.TOP_MODEL:r=this.topModelModeGetSelectModel(e,t);break;case f.ACCESSORY:r=this.accessoryModeGetSelectModel(e,t);break;case f.PRODUCT:r=e}if(!r)return;var n=KE(r),o=Object(_e.castArray)(this.curSelectEntity).filter((function(e){return e}));this.prevModeSelectEntity.length&&o.push.apply(o,HC(this.prevModeSelectEntity));var i=o[0]&&JE(o[0]);if(i&&this.isFittingLikeModel(i)!==this.isFittingLikeModel(r))return n;var A=o.filter((function(e){return e.entityId!==n.entityId}));return A.length!==o.length?A:[].concat(HC(A),[n])}if(!Array.isArray(this.curSelectEntity)||!this.curSelectEntity.length){switch(this.designMode){case f.TOP_MODEL:r=this.topModelModeGetSelectModel(e,t);break;case f.ACCESSORY:r=this.accessoryModeGetSelectModel(e,t);break;case f.PRODUCT:r=e;break;case f.CUSTOM:return this.customModeSelectModel(e,t)}return KE(r||e)}}},{key:"getHintEntity",value:function(e){var t;switch(this.designMode){case f.TOP_MODEL:case f.ACCESSORY:t=this.topModelModeAndAccessoryModeHint(e);break;case f.PRODUCT:t=e;break;case f.CUSTOM:return this.customModeHintModel(e)}var r=this.curSelectEntity&&Object(_e.castArray)(this.curSelectEntity)||[];if(!([].concat(HC(r),HC(this.prevModeSelectEntity)).findIndex((function(e){return e.entityId===t.id}))>-1))return KE(t)}},{key:"registerMultiSelectShortcut",value:function(e){this.pressManager.removeKeyboardKeyListener(this.multiSelectShortCut),this.multiSelectShortCut=e,this.pressManager.addKeyboardKeyListener(this.multiSelectShortCut)}},{key:"isMultiSelect",get:function(){return this.pressManager.checkIsPress(this.multiSelectShortCut)}}])&&JC(t.prototype,r),n&&JC(t,n),e}();function WC(e){return(WC="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 zC(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function XC(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function ZC(e,t){return(ZC=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function $C(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=tE(e);if(t){var o=tE(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return eE(this,r)}}function eE(e,t){return!t||"object"!==WC(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function tE(e){return(tE=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var rE=function(e){!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}}),t&&ZC(e,t)}(i,e);var t,r,n,o=$C(i);function i(){return zC(this,i),o.apply(this,arguments)}return t=i,(r=[{key:"pickRayTarget",value:function(e){var t=e.event,r=e.sceneId,n=this.context.pick(r,t);return(null==n?void 0:n.entity)&&JE(n.entity)}},{key:"selection",get:function(){return jE().getStateManager().kaf.selection}},{key:"hint",get:function(){return jE().getStateManager().kaf.kaf2.hint}},{key:"designModeCtx",get:function(){return jE().designModeContext}}])&&XC(t.prototype,r),n&&XC(t,n),i}(vn.ToolModule.Feature);function nE(e){return(nE="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 oE(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function iE(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function AE(e,t){return(AE=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function aE(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=uE(e);if(t){var o=uE(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return sE(this,r)}}function sE(e,t){return!t||"object"!==nE(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function uE(e){return(uE=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var cE=function(e){!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}}),t&&AE(e,t)}(i,e);var t,r,n,o=aE(i);function i(){var e;return oE(this,i),(e=o.apply(this,arguments)).isMouseDown=!1,e}return t=i,(r=[{key:"onMouseDown",value:function(){this.isMouseDown=!0}},{key:"onMouseUp",value:function(){this.isMouseDown=!1}},{key:"onMouseMove",value:function(e){if(!this.isMouseDown){var t=this.pickRayTarget(e);if(t){var r=this.designModeCtx.getHintEntity(t);this.designModeCtx.getDesignMode(),f.CUSTOM,this.hint.hint(r)}else this.hint.hint(),this.designModeCtx.setCurHintEntity(void 0)}}}])&&iE(t.prototype,r),n&&iE(t,n),i}(rE);function lE(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return gE(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return gE(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,A=!0,a=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return A=e.done,e},e:function(e){a=!0,i=e},f:function(){try{A||null==r.return||r.return()}finally{if(a)throw i}}}}function gE(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function fE(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function pE(e,t){return(pE=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function hE(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=IE(e);if(t){var o=IE(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return dE(this,r)}}function dE(e,t){return!t||"object"!==yE(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function IE(e){return(IE=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function yE(e){return(yE="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)}var CE=function(e,t,r,n){var o,i=arguments.length,A=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"===("undefined"==typeof Reflect?"undefined":yE(Reflect))&&"function"==typeof Reflect.decorate)A=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(A=(i<3?o(A):i>3?o(t,r,A):o(t,r))||A);return i>3&&A&&Object.defineProperty(t,r,A),A},EE=function(e,t){if("object"===("undefined"==typeof Reflect?"undefined":yE(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},BE=vn.__INTERNAL__.Highlighters.WireGeometry,vE=vn.__INTERNAL__.Highlighters.generateWireGeometryForHighlighterGeometry,mE=function(e){!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}}),t&&pE(e,t)}(i,e);var t,r,n,o=hE(i);function i(e,t){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(r=o.call(this)).models=e,r.createFittingModelBox=t,r}return t=i,(r=[{key:"getGeometry",value:function(){var e,t=new BE,r=lE(this.models);try{for(r.s();!(e=r.n()).done;){var n=e.value,o=void 0;o=n instanceof x.CoreParamModel||n instanceof x.CoreParamModelAssembly?n.getConcatenatedBox3():this.createFittingModelBox(n);var i=vE(o);t.append(i)}}catch(e){r.e(e)}finally{r.f()}return t}}])&&fE(t.prototype,r),n&&fE(t,n),i}(vn.Entity),QE=mE=CE([Object(vn.provideEntityAPIs)([new vn.EntityAPIs.HighlightGeometryAPI3D((function(){return{geometry:this.getGeometry()}}))]),EE("design:paramtypes",[Array,Function])],mE);function bE(e){return(bE="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 _E(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function wE(e,t){return(wE=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function SE(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=RE(e);if(t){var o=RE(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return DE(this,r)}}function DE(e,t){return!t||"object"!==bE(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function RE(e){return(RE=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ME=function(e){!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}}),t&&wE(e,t)}(i,e);var t,r,n,o=SE(i);function i(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(e=o.call(this))._init(),e}return t=i,(r=[{key:"_init",value:function(){var e=this,t={accept:function(){return!0},priority:1,createMultiSelectionEntity:function(t){var r=t.map((function(e){return JE(e)}));return new QE(r.filter((function(e){return e})),e.createFittingModelBox)}};this.selection.addMultiSelectionConfig(t)}},{key:"createFittingModelBox",value:function(e){return e instanceof pt?e.boundingBox:Vy(e)}},{key:"onClick",value:function(e){this.triggerClick(e,p.CLICK)}},{key:"onDblClick",value:function(e){this.designModeCtx.isMultiSelect||this.triggerClick(e,p.DB_CLICK)}},{key:"triggerClick",value:function(e,t){var r=this.pickRayTarget(e);if(r){var n=this.designModeCtx.getSelectEntity(r,t);this.designModeCtx.getDesignMode()===f.CUSTOM?n&&this.selection.select(n):(this.selection.select(n),this.designModeCtx.setCurSelectEntity(n))}else this.selection.select(),this.designModeCtx.setCurSelectEntity(void 0);this.designModeCtx.clearPrevModeSelectEntity()}}])&&_E(t.prototype,r),n&&_E(t,n),i}(rE);function xE(e){return(xE="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 PE(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function FE(e,t,r){return(FE="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=kE(e)););return e}(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(r):o.value}})(e,t,r||e)}function OE(e,t){return(OE=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function TE(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=kE(e);if(t){var o=kE(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return LE(this,r)}}function LE(e,t){return!t||"object"!==xE(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function kE(e){return(kE=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var NE,GE=new Bn.SingletonRef,UE=function(e){!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}}),t&&OE(e,t)}(i,e);var t,r,n,o=TE(i);function i(e,t){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(r=o.call(this,{id:"com.custom.pad",name:"cFrameApp",Component:yy,axrs:wI,singleton:GE},e)).stateManager=t,r.viewer=new oa,r.designModeContext=new qC,r}return t=i,(r=[{key:"init",value:function(){FE(kE(i.prototype),"init",this).call(this),this.initStateManager(),this.initApp()}},{key:"initStateManager",value:function(){var e=this.stateManager;e.initState(),MI(e);var t=this.getDependentPlugin(vn.AppServicePlugin),r=this.getDependentPlugin($l);e.kaf=t.stateManager,e.core=r.stateManager}},{key:"initNet",value:function(){FE(kE(i.prototype),"initNet",this).call(this),this.net.setSendPolicy(new au),this.client=new ws(this.net)}},{key:"initApp",value:function(){var e=this,t=this.stateManager,r=t.core.design,n=this.getDependentPlugin(vn.AppServicePlugin);this.viewer.config(n,{getCustom:function(){return r.getCustom()},getDoc:function(){return r.getDoc()},isEntitySelectable:function(){return e.axr.axrs.scene.state.state.selectable},pickActualInteractiveEntity:function(e){for(var t=Pr(r.getCustom().getParamModels(),e.entityId);t&&!yd.includes(t.getType());)t=t.getParent();return t?{entityId:t.id,entityType:li}:e},paramModelSymbol:li,filterParamModel:function(t){return!e.axr.axrs.fittingDesign.senseSetting.getSenseSettings().renderIgnoreCategory.includes(t.getCategory().categoryId)}}),this.viewer.registerReducer((function(e,t,r){r.interactionPriority=e.isAppendHardware?2:0})),n.registerEntityDocument(new NC((function(){return t.core.fittingDesign}))),t.kaf.toolbox.addIdleToolFeature((function(){return new ME})),t.kaf.toolbox.addIdleToolFeature((function(){return new cE})),n.setLayout(KI)}}])&&PE(t.prototype,r),n&&PE(t,n),i}(Bn.PluginApplication),jE=GE.instance;function YE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function VE(e,t){var r=new Map;return function(){var n,o=t.apply(void 0,arguments);if(r.has(o))n=r.get(o);else if(n=e.apply(void 0,arguments),Object(_e.isObject)(n)&&Object(_e.isFunction)(n.then)&&Object(_e.isFunction)(n.catch)){var i=Promise.resolve(n);r.set(o,i),i.finally((function(){r.delete(o)}))}return n}}function HE(e){return e instanceof fe?li:e instanceof ve?ci:e instanceof pt?kg:e instanceof Vt?Ng:void 0}function KE(e){return{entityId:e.id,entityType:HE(e)}}function JE(e){var t=e.entityId;switch(e.entityType){case li:return Pr(jE().getStateManager().core.design.getCustom().getParamModels(),t);case ci:return jE().getStateManager().core.design.getCustom().getParamModelAssemblies().find((function(e){return e.id===t}));case Ng:return jE().getStateManager().core.fittingDesign.getGrooveFittings().find((function(e){return e.id===t}));case kg:return jE().getStateManager().core.fittingDesign.getFittings().find((function(e){return e.id===t}));default:return}}var qE=(YE(NE={},E.PARAM_MODEL,li),YE(NE,E.PARAM_MODEL_ASSEMBLY,ci),YE(NE,E.HOLE,kg),YE(NE,E.GROOVE,kg),YE(NE,E.HARDWARE_GROOVE,Ng),YE(NE,E.HARDWARE,li),NE);function WE(e,t,r,n,o,i,A){try{var a=e[i](A),s=a.value}catch(e){return void r(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function zE(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function A(e){WE(i,n,o,A,a,"next",e)}function a(e){WE(i,n,o,A,a,"throw",e)}A(void 0)}))}}var XE=new Map;function ZE(e){return["designid","levelid","modelid","toolType"].map((function(t){return e[t]||""})).join(":")}var $E=VE(function(){var e=zE(s.a.mark((function e(t){var r,n,o;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=ou(),n=ZE(t),!XE.has(n)){e.next=4;break}return e.abrupt("return",XE.get(n));case 4:return e.next=6,r.get("/cos/api/fitting-design",{params:t});case 6:return o=e.sent,XE.set(n,o.data.d),e.abrupt("return",o.data.d);case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),ZE);function eB(){var e=ng(tl);"function"==typeof e.fittingDesignHasChanged&&e.fittingDesignHasChanged().catch((function(){}))}var tB,rB,nB=function(){var e=zE(s.a.mark((function e(t,r){var n,o;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=ou(),o=ZE(r),e.prev=2,e.next=5,n.post("/cos/api/fitting-design",t,{params:r});case 5:XE.set(o,t),eB(),e.next=12;break;case 9:throw e.prev=9,e.t0=e.catch(2),e.t0;case 12:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(t,r){return e.apply(this,arguments)}}(),oB=function(){var e=zE(s.a.mark((function e(t){var r,n;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=ou(),n=ZE(t),e.prev=2,e.next=5,r.delete("/cos/api/fitting-design",{params:t});case 5:XE.has(n)&&XE.delete(n),eB(),e.next=12;break;case 9:throw e.prev=9,e.t0=e.catch(2),e.t0;case 12:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(t){return e.apply(this,arguments)}}();function iB(e,t,r,n,o,i,A){try{var a=e[i](A),s=a.value}catch(e){return void r(e)}a.done?t(s):Promise.resolve(s).then(n,o)}!function(e){e.UNKNOWN="UNKNOWN",e.PENDING="PENDING",e.RUNNING="RUNNING",e.SAVING="SAVING",e.SUCCESS="SUCCESS",e.FAIL="FAIL",e.CANCEL="CANCEL",e.TIMEOUT="TIMEOUT"}(tB||(tB={})),function(e){e[e.CABINET=0]="CABINET",e[e.WARDROBE=1]="WARDROBE",e[e.DOOR_WINDOW=2]="DOOR_WINDOW"}(rB||(rB={}));var AB=function(){var e,t=(e=s.a.mark((function e(t){var r,n;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=ou(),e.next=3,r.gzipGet(t,{params:{_time:Date.now()}});case 3:return n=e.sent,e.abrupt("return",n.data);case 5:case"end":return e.stop()}}),e)})),function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function A(e){iB(i,n,o,A,a,"next",e)}function a(e){iB(i,n,o,A,a,"throw",e)}A(void 0)}))});return function(e){return t.apply(this,arguments)}}();function aB(e,t,r,n,o,i,A){try{var a=e[i](A),s=a.value}catch(e){return void r(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function sB(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function A(e){aB(i,n,o,A,a,"next",e)}function a(e){aB(i,n,o,A,a,"throw",e)}A(void 0)}))}}var uB=function(){var e=sB(s.a.mark((function e(t){var r,n;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Object(_e.castArray)(t),n=ng(el),e.abrupt("return",n.getParamModelDataByIds(r));case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),cB=VE(function(){var e=sB(s.a.mark((function e(t,r){var n;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=ng(og.MiniAppParamModelJsonDataService),e.abrupt("return",n.getCachedModelJsonDataByModelId({modelIds:t,templateId:r}));case 2:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),(function(e,t){return e+(t||"")})),lB=VE(function(){var e=sB(s.a.mark((function e(t,r){var n;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=ng(og.MiniAppParamModelJsonDataService),e.abrupt("return",n.getModelJsonDataByModelId({modelIds:t,templateId:r}));case 2:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),(function(e,t){return e+(t||"")}));function gB(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function fB(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function pB(e,t,r,n,o,i,A){try{var a=e[i](A),s=a.value}catch(e){return void r(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function hB(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function A(e){pB(i,n,o,A,a,"next",e)}function a(e){pB(i,n,o,A,a,"throw",e)}A(void 0)}))}}var dB=dd()(function(){var e=hB(s.a.mark((function e(t){var r,n;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=ou(),e.next=3,r.gzipGet("/dcs-model/api/c/parammodeldata",{params:{obsbgid:t,cache:!0}});case 3:return n=e.sent,e.abrupt("return",n.data);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?gB(Object(r),!0).forEach((function(t){fB(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gB(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({promise:!0},Id)),IB=dd()(function(){var e=hB(s.a.mark((function e(t){var r,n,o;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=ou(),e.next=3,n.gzipPost("/dcs-resource/api/c/modelcenter/bgids",{bgIds:t});case 3:return o=e.sent,e.abrupt("return",(null===(r=o.data.d)||void 0===r?void 0:r.modelCenterMap)?Object(_e.mapValues)(o.data.d.modelCenterMap,(function(e){return JSON.parse(e)})):{});case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());var yB=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)};function CB(e){return(CB="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 EB(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function BB(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?EB(Object(r),!0).forEach((function(t){vB(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):EB(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function vB(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function mB(e,t,r,n,o,i,A){try{var a=e[i](A),s=a.value}catch(e){return void r(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function QB(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function A(e){mB(i,n,o,A,a,"next",e)}function a(e){mB(i,n,o,A,a,"throw",e)}A(void 0)}))}}function bB(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _B(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function wB(e,t){return(wB=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function SB(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=RB(e);if(t){var o=RB(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return DB(this,r)}}function DB(e,t){return!t||"object"!==CB(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function RB(e){return(RB=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var MB=function(){return SI().fittingDesign.fittingDesignSense},xB=function(e){!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}}),t&&wB(e,t)}(l,e);var t,r,n,o,i,A,a,c=SB(l);function l(){return bB(this,l),c.apply(this,arguments)}return t=l,(r=[{key:"toggleAutoSave",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];MB().$actionEnableAutoSave.dispatch(e)}},{key:"isAutoSave",value:function(){return MB().isAutoSaveEnabled()}},{key:"getFittingDesignData",value:(a=QB(s.a.mark((function e(t){var r;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&(SI().viewParamModel.state.state.currModelId!==t||MB().state.state.design.id!==t)){e.next=3;break}return e.abrupt("return",this.getConnectedFittingDesign());case 3:return e.next=5,Qf(t);case 5:return r=e.sent,e.abrupt("return",$E(BB(BB({},r),{},{modelid:t})));case 7:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"getConnectedFittingDesign",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return MB().getConnectedFittingDesign(e,t)}},{key:"validateFittingDesign",value:function(e,t){var r=Pr(u.ParamModelUtils.flattenModels(SI().entry.getStateManager().core.design.getCustom().getParamModels()),t);if(!r)return{validated:!1};var n=SI().fittingDesign.senseSetting.getSenseSettings();return{validated:function(e){if(!e.isClosedPath())return!1;for(var t=e.points,r=e.lines,n=t.length,o=0;o<n;o++){var i={type:on.POINT,val:t[o]},A={type:on.LINE,val:r[o]};if(!dn(i.val))return!1;if(!In(A.val))return!1;if(!Cn(i,A))return!1;for(var a=o+1;a<n;a++){var s={type:on.POINT,val:t[a]},u={type:on.LINE,val:r[a]};if(!Cn(i,s))return!1;if(!Cn(i,u))return!1;if(!Cn(A,s))return!1;if(!Cn(A,u))return!1}}return!0}(En(e,r,Object(_e.pick)(n,["holeColor","grooveColor","holeOpacity","grooveOpacity"])).path)}}},{key:"appendFittingDesign",value:(A=QB(s.a.mark((function e(t){var r,n=arguments;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{timeout:5e4},e.abrupt("return",MB().appendFittingDataToFittingDesign(t,r));case 2:case"end":return e.stop()}}),e)}))),function(e){return A.apply(this,arguments)})},{key:"saveDesign",value:(i=QB(s.a.mark((function e(t){var r,n,o,i=arguments;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=i.length>1&&void 0!==i[1]?i[1]:{},n=r.timeout,o=Cf(n),MB().$actionSaveFittingDesign.started.dispatch({defer:o,design:t}),e.abrupt("return",o.promise);case 5:case"end":return e.stop()}}),e)}))),function(e){return i.apply(this,arguments)})},{key:"clearDesign",value:(o=QB(s.a.mark((function e(t){var r,n,o,i,A;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=(r=t||{}).timeout,o=void 0===n?5e4:n,i=r.modelId,A=Cf(o),MB().$actionClearFittingDesign.started.dispatch({defer:A,modelId:i}),e.abrupt("return",A.promise);case 4:case"end":return e.stop()}}),e)}))),function(e){return o.apply(this,arguments)})}])&&_B(t.prototype,r),n&&_B(t,n),l}(yB);function PB(e){return(PB="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 FB(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function OB(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function TB(e,t){return(TB=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function LB(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=NB(e);if(t){var o=NB(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return kB(this,r)}}function kB(e,t){return!t||"object"!==PB(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function NB(e){return(NB=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var GB=(new Gr.a).setFromCenterAndSize(new M.a(0,0,0),new M.a(200,200,100)),UB=function(e){!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}}),t&&TB(e,t)}(i,e);var t,r,n,o=LB(i);function i(){return FB(this,i),o.apply(this,arguments)}return t=i,(r=[{key:"resetDistanceAndLookAt",value:function(){var e=this.state,t=e.initCameraAttributes,r=t.position,n=t.lookAt,o=e.cameraAttributes.position,i=n.clone().sub(r).length(),A=n.clone().add(o.clone().sub(n).normalize().mul(i));this.updateCameraAttributes({position:A,lookAt:n})}},{key:"adjustInitCameraAttributesWithContent",value:function(){return GB}}])&&OB(t.prototype,r),n&&OB(t,n),i}(vn.Scene3DStateManager);function jB(e){return(jB="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 YB(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function VB(e,t){return(VB=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function HB(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=JB(e);if(t){var o=JB(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return KB(this,r)}}function KB(e,t){return!t||"object"!==jB(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function JB(e){return(JB=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var qB=function(e){!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}}),t&&VB(e,t)}(r,e);var t=HB(r);function r(){return YB(this,r),t.apply(this,arguments)}return r}(vn.types.combine({scene3D:UB})),WB=window.document.createElement("script");WB.src="//at.alicdn.com/t/font_2369084_dyxfnutf0ac.js",window.document.body.appendChild(WB);function zB(e){return(zB="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 XB(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ZB(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function $B(e,t){return($B=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ev(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=rv(e);if(t){var o=rv(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return tv(this,r)}}function tv(e,t){return!t||"object"!==zB(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function rv(e){return(rv=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var nv=function(e){!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}}),t&&$B(e,t)}(i,e);var t,r,n,o=ev(i);function i(){var e;return XB(this,i),(e=o.apply(this,arguments)).rootState=new qB,e}return t=i,(r=[{key:"stateManager",get:function(){return this.rootState}},{key:"onInitialize",value:function(){var e=new UE(this,this.rootState);e.init(),e.run()}}])&&ZB(t.prototype,r),n&&ZB(t,n),i}(Vl.BasePlugin);function ov(e){return(ov="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 iv(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Av(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function av(e,t){return(av=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function sv(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=cv(e);if(t){var o=cv(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return uv(this,r)}}function uv(e,t){return!t||"object"!==ov(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function cv(e){return(cv=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}nv.dependencies=[vn.AppServicePlugin,$l];var lv=function(e){!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}}),t&&av(e,t)}(i,e);var t,r,n,o=sv(i);function i(){return iv(this,i),o.apply(this,arguments)}return t=i,(r=[{key:"toggleModelViewIntersected",value:function(e){SI().fittingDesign.intersected.$actionToggleShowIntersected.dispatch(e)}},{key:"toggleModelViewedIntersected",value:function(e){SI().fittingDesign.intersected.toggleShowIntersectGroupData(e)}}])&&Av(t.prototype,r),n&&Av(t,n),i}(yB);function gv(e){return(gv="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 fv(e,t,r,n,o,i,A){try{var a=e[i](A),s=a.value}catch(e){return void r(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function pv(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function A(e){fv(i,n,o,A,a,"next",e)}function a(e){fv(i,n,o,A,a,"throw",e)}A(void 0)}))}}function hv(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dv(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Iv(e,t){return(Iv=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function yv(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Ev(e);if(t){var o=Ev(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Cv(this,r)}}function Cv(e,t){return!t||"object"!==gv(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Ev(e){return(Ev=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Bv=function(e){!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}}),t&&Iv(e,t)}(u,e);var t,r,n,o,i,A,a=yv(u);function u(){return hv(this,u),a.apply(this,arguments)}return t=u,(r=[{key:"getAllCustomModels",value:(A=pv(s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",SI().scene.getAllCustomModels());case 1:case"end":return e.stop()}}),e)}))),function(){return A.apply(this,arguments)})},{key:"getCustomModelById",value:(i=pv(s.a.mark((function e(t){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",SI().scene.getCustomModelById(t));case 1:case"end":return e.stop()}}),e)}))),function(e){return i.apply(this,arguments)})},{key:"save",value:(o=pv(s.a.mark((function e(t){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",SI().scene.save(t.models));case 1:case"end":return e.stop()}}),e)}))),function(e){return o.apply(this,arguments)})}])&&dv(t.prototype,r),n&&dv(t,n),u}(yB);function vv(e){return(vv="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 mv(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Qv(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function bv(e,t){return(bv=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _v(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Sv(e);if(t){var o=Sv(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return wv(this,r)}}function wv(e,t){return!t||"object"!==vv(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Sv(e){return(Sv=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Dv=function(e){!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}}),t&&bv(e,t)}(i,e);var t,r,n,o=_v(i);function i(){return mv(this,i),o.apply(this,arguments)}return t=i,(r=[{key:"setFittingHint",value:function(e){SI().fittingDesign.fittingHint.setFittingHint(e)}},{key:"clearFittingHint",value:function(e){SI().fittingDesign.fittingHint.clearFittingHint(e)}}])&&Qv(t.prototype,r),n&&Qv(t,n),i}(yB);function Rv(e){return(Rv="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 Mv(e,t,r,n,o,i,A){try{var a=e[i](A),s=a.value}catch(e){return void r(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function xv(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function A(e){Mv(i,n,o,A,a,"next",e)}function a(e){Mv(i,n,o,A,a,"throw",e)}A(void 0)}))}}function Pv(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Fv(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ov(e,t){return(Ov=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Tv(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=kv(e);if(t){var o=kv(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Lv(this,r)}}function Lv(e,t){return!t||"object"!==Rv(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function kv(e){return(kv=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Nv,Gv,Uv=function(e){!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}}),t&&Ov(e,t)}(a,e);var t,r,n,o,i,A=Tv(a);function a(){return Pv(this,a),A.apply(this,arguments)}return t=a,(r=[{key:"getAllFittingModels",value:(i=xv(s.a.mark((function e(t){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",SI().fittingDesign.fittingModel.getAllFittingModels(t));case 1:case"end":return e.stop()}}),e)}))),function(e){return i.apply(this,arguments)})},{key:"save",value:(o=xv(s.a.mark((function e(t){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",SI().fittingDesign.fittingModel.save(t.models));case 1:case"end":return e.stop()}}),e)}))),function(e){return o.apply(this,arguments)})}])&&Fv(t.prototype,r),n&&Fv(t,n),a}(yB);function jv(e){return(jv="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 Yv(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Vv(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Hv(e,t){return(Hv=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Kv(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=qv(e);if(t){var o=qv(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Jv(this,r)}}function Jv(e,t){return!t||"object"!==jv(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function qv(e){return(qv=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}!function(e){e.View3D="view3d",e.Roamer="roamer"}(Nv||(Nv={})),function(e){e.UP="UP",e.DOWN="DOWN",e.LEFT="LEFT",e.RIGHT="RIGHT",e.FRONT="FRONT",e.BACK="BACK"}(Gv||(Gv={}));var Wv=function(e){!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}}),t&&Hv(e,t)}(i,e);var t,r,n,o=Kv(i);function i(){return Yv(this,i),o.apply(this,arguments)}return t=i,(r=[{key:"toggleCameraMode",value:function(e){var t;switch(e){case Nv.View3D:t=vn.PerspectiveCameraMode.View3D;break;case Nv.Roamer:t=vn.PerspectiveCameraMode.Roamer}jE().getStateManager().scene3D.updatePerspectiveCameraMode(t)}},{key:"moveCamera",value:function(e){var t,r=jE().getStateManager().scene3D;switch(e){case Gv.UP:case Gv.FRONT:t=vn.ArrowType.UP;break;case Gv.DOWN:case Gv.BACK:t=vn.ArrowType.DOWN;break;case Gv.LEFT:t=vn.ArrowType.LEFT;break;case Gv.RIGHT:t=vn.ArrowType.RIGHT}if(t){if(e===Gv.UP||e===Gv.DOWN)return void r.onQEPress(t);r.onWASDPress(t)}}}])&&Vv(t.prototype,r),n&&Vv(t,n),i}(yB);function zv(e){return(zv="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 Xv(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Zv(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function $v(e,t){return($v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function em(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=rm(e);if(t){var o=rm(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return tm(this,r)}}function tm(e,t){return!t||"object"!==zv(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function rm(e){return(rm=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var nm=function(e){!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}}),t&&$v(e,t)}(i,e);var t,r,n,o=em(i);function i(){return Xv(this,i),o.apply(this,arguments)}return t=i,(r=[{key:"setDefaultHint",value:function(e){SI().fittingDesign.plankFaceHint.setDefaultHintConfig(e)}},{key:"setModelHint",value:function(e){SI().fittingDesign.plankFaceHint.setModelHint(e)}},{key:"clearModelHint",value:function(e){SI().fittingDesign.plankFaceHint.clearModelHint(e)}}])&&Zv(t.prototype,r),n&&Zv(t,n),i}(yB);function om(e){return(om="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 im(e,t,r,n,o,i,A){try{var a=e[i](A),s=a.value}catch(e){return void r(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function Am(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function am(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function sm(e,t){return(sm=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function um(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=lm(e);if(t){var o=lm(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return cm(this,r)}}function cm(e,t){return!t||"object"!==om(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function lm(e){return(lm=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var gm=function(e){!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}}),t&&sm(e,t)}(a,e);var t,r,n,o,i,A=um(a);function a(){return Am(this,a),A.apply(this,arguments)}return t=a,(r=[{key:"getParamData",value:function(e){return SI().viewParamModel.getParamModelJsonData(e)}},{key:"getParamIntersected",value:(o=s.a.mark((function e(t){var r;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,SI().fittingDesign.intersected.getParamModelIntersectedData(t);case 2:return r=e.sent,e.abrupt("return",(n=r,{intersectedGroups:Object(_e.map)(n.intersectedGroups,(function(e){return Bf(Bf({},e),{},{intersecteds:Object(_e.map)(e.intersecteds,(function(e){return Object(_e.omit)(e,["shell"])}))})}))}));case 4:case"end":return e.stop()}var n}),e)})),i=function(){var e=this,t=arguments;return new Promise((function(r,n){var i=o.apply(e,t);function A(e){im(i,r,n,A,a,"next",e)}function a(e){im(i,r,n,A,a,"throw",e)}A(void 0)}))},function(e){return i.apply(this,arguments)})},{key:"getTopParamModels",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.ignoreCategory||(e.ignoreCategory=y),SI().viewParamModel.getTopModelList(e)}},{key:"getParamModelPhotoById",value:function(e){return SI().viewParamModel.getParamModelPhotoData(e)}}])&&am(t.prototype,r),n&&am(t,n),a}(yB);function fm(e){return(fm="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 pm(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hm(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function dm(e,t){return(dm=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Im(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Cm(e);if(t){var o=Cm(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return ym(this,r)}}function ym(e,t){return!t||"object"!==fm(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Cm(e){return(Cm=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Em,Bm,vm=function(){return SI().select},mm=function(){return SI().baseDesignInfo};!function(e){e[e.NULL=0]="NULL",e[e.MODEL=1]="MODEL",e[e.CASBIN=2]="CASBIN"}(Em||(Em={})),function(e){e[e.MODEL=1]="MODEL",e[e.CASBIN=2]="CASBIN"}(Bm||(Bm={}));var Qm=function(e){!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}}),t&&dm(e,t)}(i,e);var t,r,n,o=Im(i);function i(){var e;return pm(this,i),(e=o.apply(this,arguments)).hasWatchSelectionChange=!1,e.__generateEntity=function(e){return Object(_e.castArray)(e).map((function(e){var t={__sceneId:Mg.SCENE_ID,entityId:e.id,entityType:li};return e.type===Bm.CASBIN&&(t.entityId=mm().state.casbinModelIdMap[e.id]),t}))},e.onSelectedChanged=function(){Qe.emit(Be.SELECTION_SERVICE_MODEL_CHANGE,e.getSelected())},e}return t=i,(r=[{key:"getSelected",value:function(){var e=vm().state.state.selectedData,t=SI().viewParamModel.state.state.allSubModels;if(e.length){var r=e[0].$model;if(r&&r instanceof fe&&r.isAppendHardware)return{data:[r.hardwareData],type:Em.CASBIN};var n=Object(_e.map)(e,"id"),o=t.filter((function(e){return n.includes(e.id)}));if(n.length)return{data:o,type:Em.MODEL}}return{data:[],type:Em.NULL}}},{key:"select",value:function(e){var t=this.__generateEntity(e);vm().select(t)}},{key:"unSelect",value:function(e){if(e){var t=this.__generateEntity(e);vm().unSelect(t)}else vm().select([])}},{key:"startWatchSelectedChangedEvent",value:function(){this.hasWatchSelectionChange||(this.hasWatchSelectionChange=!0,vm().on(_I.EVENT_SELECT_CHANGED,this.onSelectedChanged))}},{key:"on",value:function(e){this.startWatchSelectedChangedEvent(),Qe.on(Be.SELECTION_SERVICE_MODEL_CHANGE,e)}},{key:"off",value:function(e){Qe.off(Be.SELECTION_SERVICE_MODEL_CHANGE,e)}},{key:"once",value:function(e){this.startWatchSelectedChangedEvent(),Qe.once(Be.SELECTION_SERVICE_MODEL_CHANGE,e)}},{key:"__onDestroy",value:function(){vm().off(_I.EVENT_SELECT_CHANGED,this.onSelectedChanged)}}])&&hm(t.prototype,r),n&&hm(t,n),i}(yB);function bm(e){return(bm="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 _m(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wm(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Sm(e,t){return(Sm=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Dm(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Mm(e);if(t){var o=Mm(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Rm(this,r)}}function Rm(e,t){return!t||"object"!==bm(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Mm(e){return(Mm=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var xm=function(){return SI().select},Pm=function(){return jE().designModeContext},Fm=function(e){!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}}),t&&Sm(e,t)}(A,e);var t,r,o,i=Dm(A);function A(){var e;return _m(this,A),(e=i.apply(this,arguments)).hasWatchSelectionChange=!1,e.onSelectedChanged=function(){Qe.emit(Be.SELECTION_SERVICE_V2_MODEL_CHANGE,e.getSelected())},e}return t=A,(r=[{key:"getSelected",value:function(){return xm().state.state.selectedDataV2.map(this._genElement).filter((function(e){return!!e}))}},{key:"select",value:function(e){var t=Object(_e.castArray)(e).map(this._genEntityFromElement);xm().select(t),Pm().setCurSelectEntity(t)}},{key:"unSelect",value:function(e){if(e){var t=Object(_e.castArray)(e).map(this._genEntityFromElement);xm().unSelect(t);var r=Pm().getCurSelectEntity();r&&(Array.isArray(r)?Pm().setCurSelectEntity(Object(_e.difference)(r,t)):t.includes(r)&&Pm().setCurSelectEntity(void 0))}else xm().select(),Pm().setCurSelectEntity(void 0)}},{key:"on",value:function(e){this.startWatchSelectedChangedEvent(),Qe.on(Be.SELECTION_SERVICE_V2_MODEL_CHANGE,e)}},{key:"off",value:function(e){Qe.off(Be.SELECTION_SERVICE_V2_MODEL_CHANGE,e)}},{key:"once",value:function(e){this.startWatchSelectedChangedEvent(),Qe.once(Be.SELECTION_SERVICE_V2_MODEL_CHANGE,e)}},{key:"startWatchSelectedChangedEvent",value:function(){this.hasWatchSelectionChange||(this.hasWatchSelectionChange=!0,xm().on(_I.EVENT_SELECT_CHANGED_V2,this.onSelectedChanged))}},{key:"_genEntityFromElement",value:function(e){return{entityId:e.id,entityType:qE[e.type]}}},{key:"_genElement",value:function(e){var t;if(e instanceof fe?t=e.isAppendHardware?E.HARDWARE:E.PARAM_MODEL:e instanceof ve?t=E.PARAM_MODEL_ASSEMBLY:e instanceof Vt?t=E.HARDWARE_GROOVE:e instanceof pt&&(t=e.type===n.HOLE?E.HOLE:E.GROOVE),t)return{id:e.id,type:t}}},{key:"__onDestroy",value:function(){xm().off(_I.EVENT_SELECT_CHANGED,this.onSelectedChanged)}}])&&wm(t.prototype,r),o&&wm(t,o),A}(yB);function Om(e){return(Om="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 Tm(e,t,r,n,o,i,A){try{var a=e[i](A),s=a.value}catch(e){return void r(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function Lm(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function A(e){Tm(i,n,o,A,a,"next",e)}function a(e){Tm(i,n,o,A,a,"throw",e)}A(void 0)}))}}function km(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Nm(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Gm(e,t){return(Gm=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Um(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Ym(e);if(t){var o=Ym(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return jm(this,r)}}function jm(e,t){return!t||"object"!==Om(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Ym(e){return(Ym=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Vm=function(e){!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}}),t&&Gm(e,t)}(u,e);var t,r,n,o,i,A,a=Um(u);function u(){return km(this,u),a.apply(this,arguments)}return t=u,(r=[{key:"viewSelected",value:(A=Lm(s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",SI().viewParamModel.viewSelectedParamModel());case 1:case"end":return e.stop()}}),e)}))),function(){return A.apply(this,arguments)})},{key:"viewModelById",value:(i=Lm(s.a.mark((function e(t){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",SI().viewParamModel.viewParamModelById(t));case 1:case"end":return e.stop()}}),e)}))),function(e){return i.apply(this,arguments)})},{key:"resetPerspective",value:function(){var e=jE().getStateManager().scene3D;e.updateEnableCameraAnimation(!0),e.reset()}},{key:"toggleModelBorder",value:function(e){SI().scene.$actionToggleRenderBorder.dispatch(e)}},{key:"toggleModelTransparent",value:function(e){SI().scene.$actionToggleRenderTranslucent.dispatch(e)}},{key:"setting",value:function(e){SI().fittingDesign.senseSetting.$actionSenseSetting.dispatch(e)}},{key:"refreshModel",value:(o=Lm(s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",SI().viewParamModel.refreshCustomModelData());case 1:case"end":return e.stop()}}),e)}))),function(){return o.apply(this,arguments)})}])&&Nm(t.prototype,r),n&&Nm(t,n),u}(yB),Hm=r(280);function Km(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Jm(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Km(Object(r),!0).forEach((function(t){qm(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Km(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function qm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Wm(e){return function(e){if(Array.isArray(e))return zm(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return zm(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return zm(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function zm(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Xm(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var Zm=function(){function e(t,r){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._changeMap={},this.id=Ke()(),this.modelID=t,this.paths=r,r.forEach((function(e){e.plankArea=n}))}var t,r,n;return t=e,(r=[{key:"getRealPaths",value:function(t){var r;if(this._realPathsCache&&!t)return this._realPathsCache;if(!this.paths.length)return new e(this.modelID,[]);var n=this.getFace2ds();if(this.paths.length>1){var o=[];c.FacesBoolean.faces2DBoolean(n.slice(0,1),n.slice(1),c.FacesBoolean.FaceBooleanType.subtract,o),n=o}var i=0===n.length?n[0]:{loops:(r=[]).concat.apply(r,Wm(n.map((function(e){return e.loops}))))};Object(Hm.calculateFaceBBox)(i);var A=i.box.center,a=c.Matrix3.makeTranslation(-A.x,-A.y);n.forEach((function(e){e.loops.forEach((function(e){e.forEach((function(e){e.transform(a)}))}))}));var s=n.map((function(e){return e.loops[0]})).map((function(e){return $m(C.OUTER,e)})),u=n.reduce((function(e,t){return e.push.apply(e,Wm(t.loops.slice(1))),e}),[]).map((function(e){return $m(C.INNER,e,!0)})),l=new e(this.modelID,[].concat(Wm(s),Wm(u)));return this._realPathsCache=l,l}},{key:"getFace2ds",value:function(){var e=[];return this.paths.forEach((function(t){var r=[];if(t.lines.forEach((function(e){var t=e.start;t.getType()!==l.NONE&&r.push(t.getCurveLineAndPoints().curveLine),r.push(e.getRealLine())})),t.offset){var n=(0,c.LoopCCW.isPolygonCCW2D)(r.map((function(e){return e.startPoint})))?t.offset:-t.offset,o=c.Path2dOffset.offsetPath2d(r,n);e.push({loops:o.resultPaths})}else e.push({loops:[r]})})),e}},{key:"_trackUpdateField",value:function(e,t,r){this._changeMap.update=this._changeMap.update||[];var n=this._changeMap.update,o=e.field;t===r||n.some((function(t){return t.field===o&&t.context.id===e.context.id}))||n.push(e)}},{key:"changeMap",get:function(){return this._changeMap},set:function(e){this._changeMap=e}}])&&Xm(t.prototype,r),n&&Xm(t,n),e}();function $m(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=t.map((function(e){return new Qt({type:l.NONE,position:e.startPoint})})),o=t.map((function(e){var t;return t=e instanceof c.LineSeg2d?{type:g.SEGMENT}:e instanceof c.Arc2d?eQ(e):tQ(e),new Et(t)})),i=c.LoopCCW.isPolygonCCW2D(n.map((function(e){return e.getPosition()})));r!==i&&(n=n.reverse(),o=(o=o.reverse().map((function(e){return"boolean"==typeof e.clockwise&&(e.clockwise=!e.clockwise),e}))).slice(1).concat(o[0]));var A=nQ(n.map((function(e){return e.getPosition()})));return n=n.slice(A).concat(n.slice(0,A)),o=o.slice(A).concat(o.slice(0,A)),new Rt({type:e,points:n,lines:o,forceCCW:!1})}function eQ(e){var t={};t.type=g.CIRCLE_ARC,t.radius=e.radius,t.clockwise=!e.isCCW;var r=e.center,n=e.startPoint,o=e.endPoint,i=new c.LineSeg2d(n,o),A=i.length/2,a=new c.Vector2d(i.getPoint(A)),s=new c.Vector2d(r).subtracted(a).normalized();return t.clockwise?t.minorArc=s.isSameDirection(i.rightNormal):t.minorArc=s.isSameDirection(i.leftNormal),t}function tQ(e){var t={};return t.type=g.ELLIPSE_ARC,t.majorRadius=e.majorRadius,t.minorRadius=e.minorRadius,t.clockwise=!e.isCCW,t.ellipseCenter=e.ccs.origin,t}function rQ(e){var t=e.changeMap.update;t&&t.length>0&&(t.forEach((function(e){var t=e.field,r=e.context;"hint"===t&&((r=r).getHint()?mu(r):function(e,t){var r=Iu().getStateManager().fittingDesign,n=r.getPlankOutlineHintModels(),o=n.findIndex((function(r){return r.linkModel.id===e&&r.id===t}));if(o>-1){var i=yu(n);i.splice(o,1),r.setPlankOutlineHintModels(i)}}(r.path.plankArea.modelID,r.id))})),e.changeMap=Jm(Jm({},e.changeMap),{},{update:[]}))}function nQ(e){if(!e.length)return 0;var t=e[0].y,r=e[0].x;e.slice(1).forEach((function(e){t<e.y&&(t=e.y),r>e.x&&(r=e.x)}));var n,o,i=-r,A=-t;return e.forEach((function(t,r){var a=t.x,s=t.y,u=Math.pow(a+i,2)+Math.pow(s+A,2);void 0===n||u<n?(n=u,o=r):n===u&&e[o].x>t.x&&(o=r)})),o}function oQ(e){return(oQ="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 iQ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function AQ(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function aQ(e,t){return(aQ=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function sQ(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=cQ(e);if(t){var o=cQ(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return uQ(this,r)}}function uQ(e,t){return!t||"object"!==oQ(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function cQ(e){return(cQ=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var lQ=function(e){!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}}),t&&aQ(e,t)}(i,e);var t,r,n,o=sQ(i);function i(){return iQ(this,i),o.apply(this,arguments)}return t=i,(r=[{key:"parseModelPlankPath",value:function(e){return t=e.modelID,r=e.data,n=[],r.path&&n.push(Mt(C.OUTER,r.path)),n.push.apply(n,Wm(r.holes.map((function(e){return Mt(C.INNER,e)})))),new Zm(t,n);var t,r,n}},{key:"syncModelPlankPath",value:function(e){rQ(e)}}])&&AQ(t.prototype,r),n&&AQ(t,n),i}(yB);function gQ(e){return(gQ="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 fQ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pQ(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function hQ(e,t){return(hQ=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function dQ(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=yQ(e);if(t){var o=yQ(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return IQ(this,r)}}function IQ(e,t){return!t||"object"!==gQ(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function yQ(e){return(yQ=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var CQ=function(e){!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}}),t&&hQ(e,t)}(i,e);var t,r,n,o=dQ(i);function i(){return fQ(this,i),o.apply(this,arguments)}return t=i,(r=[{key:"setDesignMode",value:function(e){var t=e.mode,r=e.customModeCb;jE().designModeContext.setDesignMode(t,r)}},{key:"registerMultiSelectShortcut",value:function(e){jE().designModeContext.registerMultiSelectShortcut(e)}}])&&pQ(t.prototype,r),n&&pQ(t,n),i}(yB),EQ=r(425),BQ=r.n(EQ),vQ=new Bn.I18NManager,mQ="custom_order_split",QQ={"custom.pad.resetPerspective":"重置视角","custom.pad.confirm":"确定","custom.pad.cannotAdd":"无法适配该模型","custom.pad.chooseBasicModule":"请选择基础模块","custom.pad.loadSeriesFailed":"加载系列失败","custom.pad.invalidSeries":"系列信息无效","custom.pad.invalidURL":"页面走丢了","custom.pad.loadDesignFailed":"产品加载失败","custom.pad.invalidDesign":"产品信息无效","custom.pad.loadFailed":"数据加载失败","custom.pad.invalidData":"数据无效","custom.pad.saveFailed":"产品保存失败","custom.pad.previewFailed":"生成预览图失败","custom.pad.save":"保存","custom.pad.saveAs":"另存为","custom.pad.saveTitle":"产品保存","custom.pad.saveAsTitle":"产品另存为","custom.pad.saveName":"产品名称","custom.pad.saveNameHolder":"请输入产品名称","custom.pad.saveRequired":"该项为必填项","custom.pad.savePos":"存储位置","custom.pad.savePersonal":"个人库","custom.pad.saveEnterprise":"企业库","custom.pad.cancel":"取消","custom.pad.askSave":"是否保存?","custom.pad.askSaveDesc":"是否要保存当前产品方案?","custom.pad.notSave":"不保存","custom.pad.getAuthFailed":"获取用户账号类型失败","custom.pad.uploadCoverFailed":"上传图片封面失败","custom.pad.hideDoor":"隐藏柜门","custom.pad.showDoor":"显示柜门","custom.pad.showDoorTip":"柜门已隐藏, 点击此处可显示柜门","custom.pad.shadingMode":"材质","custom.pad.outlineShadingMode":"材质 + 线框","custom.pad.frameStyle":"柜体样式","custom.pad.replaceFail":"修改样式失败","custom.pad.productNameExist":"产品名称已存在","custom.pad.saveSuccess":"产品保存成功","custom.pad.defaultSaveName":"未命名","custom.pad.showRuler":"显示尺寸","custom.pad.hideRuler":"隐藏尺寸"};function bQ(e,t,r,n,o,i,A){try{var a=e[i](A),s=a.value}catch(e){return void r(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function _Q(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function A(e){bQ(i,n,o,A,a,"next",e)}function a(e){bQ(i,n,o,A,a,"throw",e)}A(void 0)}))}}var wQ=Object(_e.once)((function(){return!!Object(bu.parseServQueryParams)()}));function SQ(){return DQ.apply(this,arguments)}function DQ(){return(DQ=_Q(s.a.mark((function e(){var t,r,n=arguments;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:{},r=bu.servkit.createTerminal({id:t.clientId||"custom-order-split",type:bu.EServTerminal.SLAVE,server:{service:{services:[]},serviceRefer:/.*/},session:{checkSession:!0,channel:{type:bu.EServChannel.WINDOW,config:{slave:{getWindow:function(e){return{target:window.parent,window:window}}}}}}}),e.next=4,r.openSession({timeout:t.timeout||3e4});case 4:return e.abrupt("return",r);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var RQ=r(517),MQ=r.n(RQ),xQ=r(1107),PQ=r.n(xQ);function FQ(e){return(FQ="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 OQ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function TQ(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function LQ(e,t){return(LQ=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function kQ(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=GQ(e);if(t){var o=GQ(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return NQ(this,r)}}function NQ(e,t){return!t||"object"!==FQ(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function GQ(e){return(GQ=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var UQ=function(e){!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}}),t&&LQ(e,t)}(i,e);var t,r,n,o=kQ(i);function i(){return OQ(this,i),o.apply(this,arguments)}return t=i,(r=[{key:"render",value:function(){var e=this.props,t=e.tip,r=e.noImg,n=e.imgSrc,o=e.className;return Qn.a.createElement("div",{className:MQ()(PQ.a.empty,o)},!r&&Qn.a.createElement("img",{src:n||"//qhstaticssl.kujiale.com/newt/227/image/png/1549962437921/D1F6B2D9AF21335BEEF19C45580DE165.png"}),t&&Qn.a.createElement("p",null,t))}}])&&TQ(t.prototype,r),n&&TQ(t,n),i}(Qn.a.PureComponent);function jQ(e){return(jQ="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 YQ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function VQ(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function HQ(e,t){return(HQ=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function KQ(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=qQ(e);if(t){var o=qQ(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return JQ(this,r)}}function JQ(e,t){return!t||"object"!==jQ(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function qQ(e){return(qQ=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var WQ=function(e){!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}}),t&&HQ(e,t)}(i,e);var t,r,n,o=KQ(i);function i(){return YQ(this,i),o.apply(this,arguments)}return t=i,(r=[{key:"render",value:function(){var e=this.props;return Qn.a.createElement(vn.Scene3D,e)}}])&&VQ(t.prototype,r),n&&VQ(t,n),i}(mn.PureComponent),zQ=r(1108),XQ=r.n(zQ);function ZQ(e){return(ZQ="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 $Q(){return($Q=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function eb(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function tb(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function rb(e,t){return(rb=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function nb(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=ib(e);if(t){var o=ib(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return ob(this,r)}}function ob(e,t){return!t||"object"!==ZQ(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ib(e){return(ib=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}mn.PureComponent;var Ab=r(88);function ab(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var A,a=e[Symbol.iterator]();!(n=(A=a.next()).done)&&(r.push(A.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(o)throw i}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return sb(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return sb(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function sb(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}window.React=Qn.a;var ub=document.getElementById("root");function cb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function lb(e,t,r,n,o,i,A){try{var a=e[i](A),s=a.value}catch(e){return void r(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function gb(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function A(e){lb(i,n,o,A,a,"next",e)}function a(e){lb(i,n,o,A,a,"throw",e)}A(void 0)}))}}function fb(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var pb=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.serviceMap=new Map,this.initLange(A.ZH_CN,{zh_CN:QQ}),function(e){Zl=e}(this)}var t,r,n,o,i;return t=e,(r=[{key:"isInCustomMiniAppMode",value:function(){return wQ()}},{key:"start",value:(i=gb(s.a.mark((function e(t){var r,n,o=this;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.isInCustomMiniAppMode()){e.next=7;break}if(bu.sappSDK.isStarted){e.next=4;break}return e.next=4,bu.sappSDK.setConfig({useTerminalId:null==t?void 0:t.clientId,onClose:function(){var e=gb(s.a.mark((function e(t){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.stop();case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}).start();case 4:this.sappSDK=bu.sappSDK,e.next=10;break;case 7:return e.next=9,SQ(t);case 9:this.sappSDK=e.sent;case 10:return e.next=12,Promise.resolve([vn.App,nv]).then((function(e){var t=ab(e,2),r=t[0],n=t[1];(new r).registerPlugin(n).start({fpsDetectorEnabled:!0}),document.body.removeChild(ub)})).catch((function(e){Object(Ab.unmountComponentAtNode)(ub),Object(Ab.render)(Qn.a.createElement(UQ,null),ub),console.error("micros/pad",e)}));case 12:return(r=this.getCustomMiniAppService(zc))?(ou().setMiniAppHttpProxyClientService(r),ag(ou())):ag(nu()),(eg=new Ag.AttachedService).config.setRequestClient(rg),tg=new Ag.ParamModelDataService({paramModelConstructor:fe,requestClient:rg}),new Ag.ParamModelAssemblyDataService({paramModelAssemblyConstructor:ve,requestClient:rg}),n=this.getService(Vm),e.prev=16,e.next=19,n.viewSelected();case 19:e.next=24;break;case 21:e.prev=21,e.t0=e.catch(16),Object({DEPLOY_VERSION:1,APP_VERSION:1}).IS_DEV&&console.error(e.t0);case 24:case"end":return e.stop()}}),e,this,[[16,21]])}))),function(e){return i.apply(this,arguments)})},{key:"initLange",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:A.ZH_CN,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};window.__PUB_LANG__=Object(_e.extend)(window.__PUB_LANG__,{kaf_core:{lang:{}},custom_model:{lange:{}}}),BQ.a.init({lang:e,debug:!1,initImmediate:!0,translatorType:EQ.ENUM.TranslatorType.I18next,packages:[mQ],resource:cb({},mQ,t)}),vQ.init({namespace:mQ,resources:mQ})}},{key:"stop",value:(o=gb(s.a.mark((function e(){var t;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t=this.getCustomMiniAppService(tl))){e.next=4;break}return e.next=4,t.lockModelBySplit();case 4:this.serviceMap.forEach((function(e){Object(_e.isFunction)(e.__onDestroy)&&e.__onDestroy()})),this.serviceMap=new Map;case 6:case"end":return e.stop()}}),e,this)}))),function(){return o.apply(this,arguments)})},{key:"getService",value:function(e){if(yB.isPrototypeOf(e)){var t=this.serviceMap,r=t.get(e);return r||(r=new e,t.set(e,r)),r}throw new Error("service not found!")}},{key:"getCustomMiniAppService",value:function(e){var t=this.sappSDK;if(!this.sappSDK)throw new Error("app not started!");return t instanceof bu.SappSDK?t.getService(e):t.client.getService(e)}},{key:"getCustomMiniAppServiceUnSafe",value:function(e){return this.getCustomMiniAppService(e)}}])&&fb(t.prototype,r),n&&fb(t,n),e}()},function(e,t,r){"use strict";r.r(t),r.d(t,"changeLanguage",(function(){return X})),r.d(t,"cloneInstance",(function(){return Z})),r.d(t,"createInstance",(function(){return $})),r.d(t,"dir",(function(){return ee})),r.d(t,"exists",(function(){return te})),r.d(t,"getFixedT",(function(){return re})),r.d(t,"init",(function(){return ne})),r.d(t,"loadLanguages",(function(){return oe})),r.d(t,"loadNamespaces",(function(){return ie})),r.d(t,"loadResources",(function(){return Ae})),r.d(t,"off",(function(){return ae})),r.d(t,"on",(function(){return se})),r.d(t,"setDefaultNamespace",(function(){return ue})),r.d(t,"t",(function(){return ce})),r.d(t,"use",(function(){return le}));var n=r(186),o=r.n(n),i=r(82),A=r.n(i),a=r(74),s=r.n(a),u=r(75),c=r.n(u),l=r(210),g=r.n(l),f=r(239),p=r.n(f),h=r(240),d=r.n(h),I=r(101),y=r.n(I),C=r(1100),E=r.n(C),B={type:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("warn",e)},error:function(e){this.output("error",e)},output:function(e,t){var r;console&&console[e]&&(r=console)[e].apply(r,E()(t))}},v=new(function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};s()(this,e),this.init(t,r)}return c()(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||B,this.options=t,this.debug=t.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.forward(t,"log","",!0)}},{key:"warn",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.forward(t,"warn","",!0)}},{key:"error",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.forward(t,"error","")}},{key:"deprecate",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(e,t,r,n){return n&&!this.debug?null:("string"==typeof e[0]&&(e[0]="".concat(r).concat(this.prefix," ").concat(e[0])),this.logger[t](e))}},{key:"create",value:function(t){return new e(this.logger,A()({},{prefix:"".concat(this.prefix,":").concat(t,":")},this.options))}}]),e}()),m=function(){function e(){s()(this,e),this.observers={}}return c()(e,[{key:"on",value:function(e,t){var r=this;return e.split(" ").forEach((function(e){r.observers[e]=r.observers[e]||[],r.observers[e].push(t)})),this}},{key:"off",value:function(e,t){var r=this;this.observers[e]&&this.observers[e].forEach((function(){if(t){var n=r.observers[e].indexOf(t);n>-1&&r.observers[e].splice(n,1)}else delete r.observers[e]}))}},{key:"emit",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];if(this.observers[e]){var o=[].concat(this.observers[e]);o.forEach((function(e){e.apply(void 0,r)}))}if(this.observers["*"]){var i=[].concat(this.observers["*"]);i.forEach((function(t){t.apply(t,[e].concat(r))}))}}}]),e}();function Q(){var e,t,r=new Promise((function(r,n){e=r,t=n}));return r.resolve=e,r.reject=t,r}function b(e){return null==e?"":""+e}function _(e,t,r){e.forEach((function(e){t[e]&&(r[e]=t[e])}))}function w(e,t,r){function n(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function o(){return!e||"string"==typeof e}for(var i="string"!=typeof t?[].concat(t):t.split(".");i.length>1;){if(o())return{};var A=n(i.shift());!e[A]&&r&&(e[A]=new r),e=e[A]}return o()?{}:{obj:e,k:n(i.shift())}}function S(e,t,r){var n=w(e,t,Object);n.obj[n.k]=r}function D(e,t){var r=w(e,t),n=r.obj,o=r.k;if(n)return n[o]}function R(e,t,r){for(var n in t)n in e?"string"==typeof e[n]||e[n]instanceof String||"string"==typeof t[n]||t[n]instanceof String?r&&(e[n]=t[n]):R(e[n],t[n],r):e[n]=t[n];return e}function M(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var x={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function P(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return x[e]})):e}var F=function(e){function t(e){var r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return s()(this,t),r=g()(this,p()(t).call(this)),m.call(y()(y()(r))),r.data=e||{},r.options=n,void 0===r.options.keySeparator&&(r.options.keySeparator="."),r}return d()(t,e),c()(t,[{key:"addNamespaces",value:function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}},{key:"getResource",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,i=[e,t];return r&&"string"!=typeof r&&(i=i.concat(r)),r&&"string"==typeof r&&(i=i.concat(o?r.split(o):r)),e.indexOf(".")>-1&&(i=e.split(".")),D(this.data,i)}},{key:"addResource",value:function(e,t,r,n){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},i=this.options.keySeparator;void 0===i&&(i=".");var A=[e,t];r&&(A=A.concat(i?r.split(i):r)),e.indexOf(".")>-1&&(n=t,t=(A=e.split("."))[1]),this.addNamespaces(t),S(this.data,A,n),o.silent||this.emit("added",e,t,r,n)}},{key:"addResources",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var o in r)"string"!=typeof r[o]&&"[object Array]"!==Object.prototype.toString.apply(r[o])||this.addResource(e,t,o,r[o],{silent:!0});n.silent||this.emit("added",e,t,r)}},{key:"addResourceBundle",value:function(e,t,r,n,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},a=[e,t];e.indexOf(".")>-1&&(n=r,r=t,t=(a=e.split("."))[1]),this.addNamespaces(t);var s=D(this.data,a)||{};n?R(s,r,o):s=A()({},s,r),S(this.data,a,s),i.silent||this.emit("added",e,t,r)}},{key:"removeResourceBundle",value:function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}},{key:"hasResourceBundle",value:function(e,t){return void 0!==this.getResource(e,t)}},{key:"getResourceBundle",value:function(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?A()({},{},this.getResource(e,t)):this.getResource(e,t)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"toJSON",value:function(){return this.data}}]),t}(m),O={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,r,n,o){var i=this;return e.forEach((function(e){i.processors[e]&&(t=i.processors[e].process(t,r,n,o))})),t}},T=function(e){function t(e){var r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return s()(this,t),r=g()(this,p()(t).call(this)),m.call(y()(y()(r))),_(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat"],e,y()(y()(r))),r.options=n,void 0===r.options.keySeparator&&(r.options.keySeparator="."),r.logger=v.create("translator"),r}return d()(t,e),c()(t,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},r=this.resolve(e,t);return r&&void 0!==r.res}},{key:"extractFromKey",value:function(e,t){var r=t.nsSeparator||this.options.nsSeparator;void 0===r&&(r=":");var n=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,o=t.ns||this.options.defaultNS;if(r&&e.indexOf(r)>-1){var i=e.split(r);(r!==n||r===n&&this.options.ns.indexOf(i[0])>-1)&&(o=i.shift()),e=i.join(n)}return"string"==typeof o&&(o=[o]),{key:e,namespaces:o}}},{key:"translate",value:function(e,t){var r=this;if("object"!==o()(t)&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var n=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,i=this.extractFromKey(e[e.length-1],t),a=i.key,s=i.namespaces,u=s[s.length-1],c=t.lng||this.language,l=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(c&&"cimode"===c.toLowerCase()){if(l){var g=t.nsSeparator||this.options.nsSeparator;return u+g+a}return a}var f=this.resolve(e,t),p=f&&f.res,h=f&&f.usedKey||a,d=f&&f.exactUsedKey||a,I=Object.prototype.toString.apply(p),y=["[object Number]","[object Function]","[object RegExp]"],C=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,E=!this.i18nFormat||this.i18nFormat.handleAsObject,B="string"!=typeof p&&"boolean"!=typeof p&&"number"!=typeof p;if(E&&p&&B&&y.indexOf(I)<0&&("string"!=typeof C||"[object Array]"!==I)){if(!t.returnObjects&&!this.options.returnObjects)return this.logger.warn("accessing an object - but returnObjects options is not enabled!"),this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,p,t):"key '".concat(a," (").concat(this.language,")' returned an object instead of string.");if(n){var v="[object Array]"===I,m=v?[]:{},Q=v?d:h;for(var b in p)if(Object.prototype.hasOwnProperty.call(p,b)){var _="".concat(Q).concat(n).concat(b);m[b]=this.translate(_,A()({},t,{joinArrays:!1,ns:s})),m[b]===_&&(m[b]=p[b])}p=m}}else if(E&&"string"==typeof C&&"[object Array]"===I)(p=p.join(C))&&(p=this.extendTranslation(p,e,t));else{var w=!1,S=!1;if(!this.isValidLookup(p)&&void 0!==t.defaultValue){if(w=!0,void 0!==t.count){var D=this.pluralResolver.getSuffix(c,t.count);p=t["defaultValue".concat(D)]}p||(p=t.defaultValue)}this.isValidLookup(p)||(S=!0,p=a);var R=t.defaultValue&&t.defaultValue!==p&&this.options.updateMissing;if(S||w||R){this.logger.log(R?"updateKey":"missingKey",c,u,a,R?t.defaultValue:p);var M=[],x=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&x&&x[0])for(var P=0;P<x.length;P++)M.push(x[P]);else"all"===this.options.saveMissingTo?M=this.languageUtils.toResolveHierarchy(t.lng||this.language):M.push(t.lng||this.language);var F=function(e,n){r.options.missingKeyHandler?r.options.missingKeyHandler(e,u,n,R?t.defaultValue:p,R,t):r.backendConnector&&r.backendConnector.saveMissing&&r.backendConnector.saveMissing(e,u,n,R?t.defaultValue:p,R,t),r.emit("missingKey",e,u,n,p)};if(this.options.saveMissing){var O=void 0!==t.count&&"string"!=typeof t.count;this.options.saveMissingPlurals&&O?M.forEach((function(e){r.pluralResolver.getPluralFormsOfKey(e,a).forEach((function(t){return F([e],t)}))})):F(M,a)}}p=this.extendTranslation(p,e,t,f),S&&p===a&&this.options.appendNamespaceToMissingKey&&(p="".concat(u,":").concat(a)),S&&this.options.parseMissingKeyHandler&&(p=this.options.parseMissingKeyHandler(p))}return p}},{key:"extendTranslation",value:function(e,t,r,n){var o=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,r,n.usedLng,n.usedNS,n.usedKey,{resolved:n});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init(A()({},r,{interpolation:A()({},this.options.interpolation,r.interpolation)}));var i=r.replace&&"string"!=typeof r.replace?r.replace:r;this.options.interpolation.defaultVariables&&(i=A()({},this.options.interpolation.defaultVariables,i)),e=this.interpolator.interpolate(e,i,r.lng||this.language,r),!1!==r.nest&&(e=this.interpolator.nest(e,(function(){return o.translate.apply(o,arguments)}),r)),r.interpolation&&this.interpolator.reset()}var a=r.postProcess||this.options.postProcess,s="string"==typeof a?[a]:a;return null!=e&&s&&s.length&&!1!==r.applyPostProcessor&&(e=O.handle(s,e,t,r,this)),e}},{key:"resolve",value:function(e){var t,r,n,o,i,A=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach((function(e){if(!A.isValidLookup(t)){var s=A.extractFromKey(e,a),u=s.key;r=u;var c=s.namespaces;A.options.fallbackNS&&(c=c.concat(A.options.fallbackNS));var l=void 0!==a.count&&"string"!=typeof a.count,g=void 0!==a.context&&"string"==typeof a.context&&""!==a.context,f=a.lngs?a.lngs:A.languageUtils.toResolveHierarchy(a.lng||A.language,a.fallbackLng);c.forEach((function(e){A.isValidLookup(t)||(i=e,f.forEach((function(r){if(!A.isValidLookup(t)){o=r;var i,s,c=u,f=[c];if(A.i18nFormat&&A.i18nFormat.addLookupKeys)A.i18nFormat.addLookupKeys(f,u,r,e,a);else l&&(i=A.pluralResolver.getSuffix(r,a.count)),l&&g&&f.push(c+i),g&&f.push(c+="".concat(A.options.contextSeparator).concat(a.context)),l&&f.push(c+=i);for(;s=f.pop();)A.isValidLookup(t)||(n=s,t=A.getResource(r,e,s,a))}})))}))}})),{res:t,usedKey:r,exactUsedKey:n,usedLng:o,usedNS:i}}},{key:"isValidLookup",value:function(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}},{key:"getResource",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,r,n):this.resourceStore.getResource(e,t,r,n)}}]),t}(m);function L(e){return e.charAt(0).toUpperCase()+e.slice(1)}var k=function(){function e(t){s()(this,e),this.options=t,this.whitelist=this.options.whitelist||!1,this.logger=v.create("languageUtils")}return c()(e,[{key:"getScriptPartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return null;var t=e.split("-");return 2===t.length?null:(t.pop(),this.formatLanguageCode(t.join("-")))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return e;var t=e.split("-");return this.formatLanguageCode(t[0])}},{key:"formatLanguageCode",value:function(e){if("string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],r=e.split("-");return this.options.lowerCaseLng?r=r.map((function(e){return e.toLowerCase()})):2===r.length?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),t.indexOf(r[1].toLowerCase())>-1&&(r[1]=L(r[1].toLowerCase()))):3===r.length&&(r[0]=r[0].toLowerCase(),2===r[1].length&&(r[1]=r[1].toUpperCase()),"sgn"!==r[0]&&2===r[2].length&&(r[2]=r[2].toUpperCase()),t.indexOf(r[1].toLowerCase())>-1&&(r[1]=L(r[1].toLowerCase())),t.indexOf(r[2].toLowerCase())>-1&&(r[2]=L(r[2].toLowerCase()))),r.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isWhitelisted",value:function(e){return("languageOnly"===this.options.load||this.options.nonExplicitWhitelist)&&(e=this.getLanguagePartFromCode(e)),!this.whitelist||!this.whitelist.length||this.whitelist.indexOf(e)>-1}},{key:"getFallbackCodes",value:function(e,t){if(!e)return[];if("string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];var r=e[t];return r||(r=e[this.getScriptPartFromCode(t)]),r||(r=e[this.formatLanguageCode(t)]),r||(r=e.default),r||[]}},{key:"toResolveHierarchy",value:function(e,t){var r=this,n=this.getFallbackCodes(t||this.options.fallbackLng||[],e),o=[],i=function(e){e&&(r.isWhitelisted(e)?o.push(e):r.logger.warn("rejecting non-whitelisted language code: ".concat(e)))};return"string"==typeof e&&e.indexOf("-")>-1?("languageOnly"!==this.options.load&&i(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&i(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&i(this.getLanguagePartFromCode(e))):"string"==typeof e&&i(this.formatLanguageCode(e)),n.forEach((function(e){o.indexOf(e)<0&&i(r.formatLanguageCode(e))})),o}}]),e}(),N=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","id","ja","jbo","ka","kk","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he"],nr:[1,2,20,21],fc:22}],G={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0===e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0===e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0===e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1===e?0:2===e?1:(e<0||e>10)&&e%10==0?2:3)}};function U(){var e={};return N.forEach((function(t){t.lngs.forEach((function(r){e[r]={numbers:t.nr,plurals:G[t.fc]}}))})),e}var j=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};s()(this,e),this.languageUtils=t,this.options=r,this.logger=v.create("pluralResolver"),this.rules=U()}return c()(e,[{key:"addRule",value:function(e,t){this.rules[e]=t}},{key:"getRule",value:function(e){return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var t=this.getRule(e);return t&&t.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,t){var r=this,n=[],o=this.getRule(e);return o?(o.numbers.forEach((function(o){var i=r.getSuffix(e,o);n.push("".concat(t).concat(i))})),n):n}},{key:"getSuffix",value:function(e,t){var r=this,n=this.getRule(e);if(n){var o=n.noAbs?n.plurals(t):n.plurals(Math.abs(t)),i=n.numbers[o];this.options.simplifyPluralSuffix&&2===n.numbers.length&&1===n.numbers[0]&&(2===i?i="plural":1===i&&(i=""));var A=function(){return r.options.prepend&&i.toString()?r.options.prepend+i.toString():i.toString()};return"v1"===this.options.compatibilityJSON?1===i?"":"number"==typeof i?"_plural_".concat(i.toString()):A():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===n.numbers.length&&1===n.numbers[0]?A():this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString()}return this.logger.warn("no plural rule found for: ".concat(e)),""}}]),e}(),Y=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};s()(this,e),this.logger=v.create("interpolator"),this.init(t,!0)}return c()(e,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;t&&(this.options=e,this.format=e.interpolation&&e.interpolation.format||function(e){return e}),e.interpolation||(e.interpolation={escapeValue:!0});var r=e.interpolation;this.escape=void 0!==r.escape?r.escape:P,this.escapeValue=void 0===r.escapeValue||r.escapeValue,this.useRawValueToEscape=void 0!==r.useRawValueToEscape&&r.useRawValueToEscape,this.prefix=r.prefix?M(r.prefix):r.prefixEscaped||"{{",this.suffix=r.suffix?M(r.suffix):r.suffixEscaped||"}}",this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||",",this.unescapePrefix=r.unescapeSuffix?"":r.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":r.unescapeSuffix||"",this.nestingPrefix=r.nestingPrefix?M(r.nestingPrefix):r.nestingPrefixEscaped||M("$t("),this.nestingSuffix=r.nestingSuffix?M(r.nestingSuffix):r.nestingSuffixEscaped||M(")"),this.maxReplaces=r.maxReplaces?r.maxReplaces:1e3,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(e,"g");var t="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(t,"g");var r="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(r,"g")}},{key:"interpolate",value:function(e,t,r,n){var o,i,A,a=this;function s(e){return e.replace(/\$/g,"$$$$")}var u=function(e){if(e.indexOf(a.formatSeparator)<0)return D(t,e);var n=e.split(a.formatSeparator),o=n.shift().trim(),i=n.join(a.formatSeparator).trim();return a.format(D(t,o),i,r)};this.resetRegExp();var c=n&&n.missingInterpolationHandler||this.options.missingInterpolationHandler;for(A=0;(o=this.regexpUnescape.exec(e))&&(i=u(o[1].trim()),e=e.replace(o[0],i),this.regexpUnescape.lastIndex=0,!(++A>=this.maxReplaces)););for(A=0;o=this.regexp.exec(e);){if(void 0===(i=u(o[1].trim())))if("function"==typeof c){var l=c(e,o,n);i="string"==typeof l?l:""}else this.logger.warn("missed to pass in variable ".concat(o[1]," for interpolating ").concat(e)),i="";else"string"==typeof i||this.useRawValueToEscape||(i=b(i));if(i=this.escapeValue?s(this.escape(i)):s(i),e=e.replace(o[0],i),this.regexp.lastIndex=0,++A>=this.maxReplaces)break}return e}},{key:"nest",value:function(e,t){var r,n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=A()({},o);function a(e,t){if(e.indexOf(",")<0)return e;var r=e.split(",");e=r.shift();var n=r.join(",");n=(n=this.interpolate(n,i)).replace(/'/g,'"');try{i=JSON.parse(n),t&&(i=A()({},t,i))}catch(t){this.logger.error("failed parsing options string in nesting for key ".concat(e),t)}return e}for(i.applyPostProcessor=!1;r=this.nestingRegexp.exec(e);){if((n=t(a.call(this,r[1].trim(),i),i))&&r[0]===e&&"string"!=typeof n)return n;"string"!=typeof n&&(n=b(n)),n||(this.logger.warn("missed to resolve ".concat(r[1]," for nesting ").concat(e)),n=""),e=e.replace(r[0],n),this.regexp.lastIndex=0}return e}}]),e}(),V=r(712),H=r.n(V);var K=function(e){function t(e,r,n){var o,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return s()(this,t),o=g()(this,p()(t).call(this)),m.call(y()(y()(o))),o.backend=e,o.store=r,o.languageUtils=n.languageUtils,o.options=i,o.logger=v.create("backendConnector"),o.state={},o.queue=[],o.backend&&o.backend.init&&o.backend.init(n,i.backend,i),o}return d()(t,e),c()(t,[{key:"queueLoad",value:function(e,t,r,n){var o=this,i=[],A=[],a=[],s=[];return e.forEach((function(e){var n=!0;t.forEach((function(t){var a="".concat(e,"|").concat(t);!r.reload&&o.store.hasResourceBundle(e,t)?o.state[a]=2:o.state[a]<0||(1===o.state[a]?A.indexOf(a)<0&&A.push(a):(o.state[a]=1,n=!1,A.indexOf(a)<0&&A.push(a),i.indexOf(a)<0&&i.push(a),s.indexOf(t)<0&&s.push(t)))})),n||a.push(e)})),(i.length||A.length)&&this.queue.push({pending:A,loaded:{},errors:[],callback:n}),{toLoad:i,pending:A,toLoadLanguages:a,toLoadNamespaces:s}}},{key:"loaded",value:function(e,t,r){var n=e.split("|"),o=H()(n,2),i=o[0],A=o[1];t&&this.emit("failedLoading",i,A,t),r&&this.store.addResourceBundle(i,A,r),this.state[e]=t?-1:2;var a={};this.queue.forEach((function(r){var n,o,s,u,c,l;n=r.loaded,o=A,u=w(n,[i],Object),c=u.obj,l=u.k,c[l]=c[l]||[],s&&(c[l]=c[l].concat(o)),s||c[l].push(o),function(e,t){for(var r=e.indexOf(t);-1!==r;)e.splice(r,1),r=e.indexOf(t)}(r.pending,e),t&&r.errors.push(t),0!==r.pending.length||r.done||(Object.keys(r.loaded).forEach((function(e){a[e]||(a[e]=[]),r.loaded[e].length&&r.loaded[e].forEach((function(t){a[e].indexOf(t)<0&&a[e].push(t)}))})),r.done=!0,r.errors.length?r.callback(r.errors):r.callback())})),this.emit("loaded",a),this.queue=this.queue.filter((function(e){return!e.done}))}},{key:"read",value:function(e,t,r){var n=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:250,A=arguments.length>5?arguments[5]:void 0;return e.length?this.backend[r](e,t,(function(a,s){a&&s&&o<5?setTimeout((function(){n.read.call(n,e,t,r,o+1,2*i,A)}),i):A(a,s)})):A(null,{})}},{key:"prepareLoading",value:function(e,t){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var i=this.queueLoad(e,t,n,o);if(!i.toLoad.length)return i.pending.length||o(),null;i.toLoad.forEach((function(e){r.loadOne(e)}))}},{key:"load",value:function(e,t,r){this.prepareLoading(e,t,{},r)}},{key:"reload",value:function(e,t,r){this.prepareLoading(e,t,{reload:!0},r)}},{key:"loadOne",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=e.split("|"),o=H()(n,2),i=o[0],A=o[1];this.read(i,A,"read",null,null,(function(n,o){n&&t.logger.warn("".concat(r,"loading namespace ").concat(A," for language ").concat(i," failed"),n),!n&&o&&t.logger.log("".concat(r,"loaded namespace ").concat(A," for language ").concat(i),o),t.loaded(e,n,o)}))}},{key:"saveMissing",value:function(e,t,r,n,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.backend&&this.backend.create&&this.backend.create(e,t,r,n,null,A()({},i,{isUpdate:o})),e&&e[0]&&this.store.addResource(e[0],t,r,n)}}]),t}(m);function J(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,whitelist:!1,nonExplicitWhitelist:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:function(){},parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if("object"===o()(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===o()(e[2])||"object"===o()(e[3])){var r=e[3]||e[2];Object.keys(r).forEach((function(e){t[e]=r[e]}))}return t},interpolation:{escapeValue:!0,format:function(e,t,r){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",maxReplaces:1e3}}}function q(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.whitelist&&e.whitelist.indexOf("cimode")<0&&(e.whitelist=e.whitelist.concat(["cimode"])),e}function W(){}var z=new(function(e){function t(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(s()(this,t),e=g()(this,p()(t).call(this)),m.call(y()(y()(e))),e.options=q(r),e.services={},e.logger=v,e.modules={external:[]},n&&!e.isInitialized&&!r.isClone){if(!e.options.initImmediate)return e.init(r,n),g()(e,y()(y()(e)));setTimeout((function(){e.init(r,n)}),0)}return e}return d()(t,e),c()(t,[{key:"init",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;function n(e){return e?"function"==typeof e?new e:e:null}if("function"==typeof t&&(r=t,t={}),this.options=A()({},J(),this.options,q(t)),this.format=this.options.interpolation.format,r||(r=W),!this.options.isClone){this.modules.logger?v.init(n(this.modules.logger),this.options):v.init(null,this.options);var o=new k(this.options);this.store=new F(this.options.resources,this.options);var i=this.services;i.logger=v,i.resourceStore=this.store,i.languageUtils=o,i.pluralResolver=new j(o,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),i.interpolator=new Y(this.options),i.backendConnector=new K(n(this.modules.backend),i.resourceStore,i,this.options),i.backendConnector.on("*",(function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];e.emit.apply(e,[t].concat(n))})),this.modules.languageDetector&&(i.languageDetector=n(this.modules.languageDetector),i.languageDetector.init(i,this.options.detection,this.options)),this.modules.i18nFormat&&(i.i18nFormat=n(this.modules.i18nFormat),i.i18nFormat.init&&i.i18nFormat.init(this)),this.translator=new T(this.services,this.options),this.translator.on("*",(function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];e.emit.apply(e,[t].concat(n))})),this.modules.external.forEach((function(t){t.init&&t.init(e)}))}var a=["getResource","addResource","addResources","addResourceBundle","removeResourceBundle","hasResourceBundle","getResourceBundle","getDataByLanguage"];a.forEach((function(t){e[t]=function(){var r;return(r=e.store)[t].apply(r,arguments)}}));var s=Q(),u=function(){e.changeLanguage(e.options.lng,(function(t,n){e.isInitialized=!0,e.logger.log("initialized",e.options),e.emit("initialized",e.options),s.resolve(n),r(t,n)}))};return this.options.resources||!this.options.initImmediate?u():setTimeout(u,0),s}},{key:"loadResources",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:W;if(!this.options.resources||this.options.partialBundledLanguages){if(this.language&&"cimode"===this.language.toLowerCase())return t();var r=[],n=function(t){t&&e.services.languageUtils.toResolveHierarchy(t).forEach((function(e){r.indexOf(e)<0&&r.push(e)}))};if(this.language)n(this.language);else{var o=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);o.forEach((function(e){return n(e)}))}this.options.preload&&this.options.preload.forEach((function(e){return n(e)})),this.services.backendConnector.load(r,this.options.ns,t)}else t(null)}},{key:"reloadResources",value:function(e,t,r){var n=Q();return e||(e=this.languages),t||(t=this.options.ns),r||(r=W),this.services.backendConnector.reload(e,t,(function(e){n.resolve(),r(e)})),n}},{key:"use",value:function(e){return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&O.addPostProcessor(e),"3rdParty"===e.type&&this.modules.external.push(e),this}},{key:"changeLanguage",value:function(e,t){var r=this,n=Q();this.emit("languageChanging",e);var o=function(e){e&&(r.language=e,r.languages=r.services.languageUtils.toResolveHierarchy(e),r.translator.language||r.translator.changeLanguage(e),r.services.languageDetector&&r.services.languageDetector.cacheUserLanguage(e)),r.loadResources((function(o){!function(e,o){r.translator.changeLanguage(o),o&&(r.emit("languageChanged",o),r.logger.log("languageChanged",o)),n.resolve((function(){return r.t.apply(r,arguments)})),t&&t(e,(function(){return r.t.apply(r,arguments)}))}(o,e)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(o):o(e):o(this.services.languageDetector.detect()),n}},{key:"getFixedT",value:function(e,t){var r=this,n=function e(t,n){var i=A()({},n);if("object"!==o()(n)){for(var a=arguments.length,s=new Array(a>2?a-2:0),u=2;u<a;u++)s[u-2]=arguments[u];i=r.options.overloadTranslationOptionHandler([t,n].concat(s))}return i.lng=i.lng||e.lng,i.lngs=i.lngs||e.lngs,i.ns=i.ns||e.ns,r.t(t,i)};return"string"==typeof e?n.lng=e:n.lngs=e,n.ns=t,n}},{key:"t",value:function(){var e;return this.translator&&(e=this.translator).translate.apply(e,arguments)}},{key:"exists",value:function(){var e;return this.translator&&(e=this.translator).exists.apply(e,arguments)}},{key:"setDefaultNamespace",value:function(e){this.options.defaultNS=e}},{key:"loadNamespaces",value:function(e,t){var r=this,n=Q();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach((function(e){r.options.ns.indexOf(e)<0&&r.options.ns.push(e)})),this.loadResources((function(e){n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}},{key:"loadLanguages",value:function(e,t){var r=Q();"string"==typeof e&&(e=[e]);var n=this.options.preload||[],o=e.filter((function(e){return n.indexOf(e)<0}));return o.length?(this.options.preload=n.concat(o),this.loadResources((function(e){r.resolve(),t&&t(e)})),r):(t&&t(),Promise.resolve())}},{key:"dir",value:function(e){if(e||(e=this.languages&&this.languages.length>0?this.languages[0]:this.language),!e)return"rtl";return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam"].indexOf(this.services.languageUtils.getLanguagePartFromCode(e))>=0?"rtl":"ltr"}},{key:"createInstance",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;return new t(e,r)}},{key:"cloneInstance",value:function(){var e=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:W,o=A()({},this.options,r,{isClone:!0}),i=new t(o),a=["store","services","language"];return a.forEach((function(t){i[t]=e[t]})),i.translator=new T(i.services,i.options),i.translator.on("*",(function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];i.emit.apply(i,[e].concat(r))})),i.init(o,n),i.translator.options=i.options,i}}]),t}(m)),X=(t.default=z,z.changeLanguage.bind(z)),Z=z.cloneInstance.bind(z),$=z.createInstance.bind(z),ee=z.dir.bind(z),te=z.exists.bind(z),re=z.getFixedT.bind(z),ne=z.init.bind(z),oe=z.loadLanguages.bind(z),ie=z.loadNamespaces.bind(z),Ae=z.loadResources.bind(z),ae=z.off.bind(z),se=z.on.bind(z),ue=z.setDefaultNamespace.bind(z),ce=z.t.bind(z),le=z.use.bind(z)}])}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@manycore/custom-sdk",
3
- "version": "1.10.1",
3
+ "version": "1.11.0-alpha.0",
4
4
  "description": "custom v2.0 sdk",
5
5
  "scripts": {
6
6
  "build:tsc": "tsc",