(self["webpackChunkcomplexes"]=self["webpackChunkcomplexes"]||[]).push([[421],{12952:function(e,l,a){var t="Expected a function",n=NaN,o="[object Symbol]",i=/^\s+|\s+$/g,s=/^[-+]0x[0-9a-f]+$/i,r=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt,d="object"==typeof a.g&&a.g&&a.g.Object===Object&&a.g,v="object"==typeof self&&self&&self.Object===Object&&self,f=d||v||Function("return this")(),g=Object.prototype,p=g.toString,C=Math.max,m=Math.min,h=function(){return f.Date.now()};function x(e,l,a){var n,o,i,s,r,u,c=0,d=!1,v=!1,f=!0;if("function"!=typeof e)throw new TypeError(t);function g(l){var a=n,t=o;return n=o=void 0,c=l,s=e.apply(t,a),s}function p(e){return c=e,r=setTimeout(k,l),d?g(e):s}function x(e){var a=e-u,t=e-c,n=l-a;return v?m(n,i-t):n}function _(e){var a=e-u,t=e-c;return void 0===u||a>=l||a<0||v&&t>=i}function k(){var e=h();if(_(e))return L(e);r=setTimeout(k,x(e))}function L(e){return r=void 0,f&&n?g(e):(n=o=void 0,s)}function y(){void 0!==r&&clearTimeout(r),c=0,n=u=o=r=void 0}function F(){return void 0===r?s:L(h())}function V(){var e=h(),a=_(e);if(n=arguments,o=this,u=e,a){if(void 0===r)return p(u);if(v)return r=setTimeout(k,l),g(u)}return void 0===r&&(r=setTimeout(k,l)),s}return l=w(l)||0,b(a)&&(d=!!a.leading,v="maxWait"in a,i=v?C(w(a.maxWait)||0,l):i,f="trailing"in a?!!a.trailing:f),V.cancel=y,V.flush=F,V}function b(e){var l=typeof e;return!!e&&("object"==l||"function"==l)}function _(e){return!!e&&"object"==typeof e}function k(e){return"symbol"==typeof e||_(e)&&p.call(e)==o}function w(e){if("number"==typeof e)return e;if(k(e))return n;if(b(e)){var l="function"==typeof e.valueOf?e.valueOf():e;e=b(l)?l+"":l}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(i,"");var a=r.test(e);return a||u.test(e)?c(e.slice(2),a?2:8):s.test(e)?n:+e}e.exports=x},71953:function(e,l,a){"use strict";a.r(l),a.d(l,{default:function(){return G}});a(44114);var t=a(56768),n=a(90144),o=a(76882),i=a(84961),s=a(24232),r=a(45130),u=a(12463),c=(a(17642),a(58004),a(33853),a(45876),a(32475),a(15024),a(31698),a(6017));function d(){const e=(0,n.KR)(null),l=(0,n.KR)(null),a=(0,n.KR)(null),o=(0,n.KR)(null),i=(0,n.KR)([]),s=(0,n.KR)(null),r=(0,n.KR)(null),u=(0,n.KR)(""),d=(0,n.KR)({isVisible:!1,figure:null,x:0,y:0});function v(t){if(e.value=t.target,l.value=e.value.getContext("2d"),!a.value||!l.value||!e.value)return;if(d.value.isVisible)return void(d.value.isVisible=!1);const n=t.clientX-e.value.getBoundingClientRect().left,o=t.clientY-e.value.getBoundingClientRect().top;null===s.value&&(s.value=[]),null!==s.value&&(s.value.push({x:n,y:o}),p(s.value)&&(c.A.$emit("canvas:figure-added",{points:s.value,background:"173, 169, 219"}),s.value=null)),x()}function f(t){if(e.value=t.target,l.value=e.value.getContext("2d"),t.preventDefault(),a.value&&l.value&&e.value){if(!(s.value&&s.value.length>0)){const a=t.clientX-e.value.getBoundingClientRect().left,n=t.clientY-e.value.getBoundingClientRect().top;for(const e of i.value){const t=C(e.points);l.value.isPointInPath(t,a,n)&&(u.value=e.id,d.value.isVisible=!0,d.value.figure=e,d.value.x=a,d.value.y=n)}return d.value}return s.value.pop(),x(),null}}function g(t){if(e.value=t.target,l.value=e.value.getContext("2d"),!a.value||!l.value||!e.value)return;const n=t.clientX-e.value.getBoundingClientRect().left,o=t.clientY-e.value.getBoundingClientRect().top;for(const e of i.value){const a=C(e.points);if(l.value.isPointInPath(a,n,o))return r.value=e.id,void x(!0,e.id)}r.value=null,x()}function p(e){if(e.length>=3){const l=e[0],a=e[e.length-1],t=Math.abs(l.x-a.x),n=Math.abs(l.y-a.y);return t<10&&n<10}return!1}function C(e){if(!e)return;const l=new Path2D;l.moveTo(e[0].x,e[0].y);for(let a=1;al.id===e));l>=0&&i.value.splice(l,1),localStorage.setItem("figures",JSON.stringify(i.value)),x()}(0,t.wB)(a,(()=>x()));const h=(t,n)=>{if(e.value=n,l.value=e.value.getContext("2d"),o.value=localStorage.getItem("imageSize")?JSON.parse(localStorage.getItem("imageSize")):null,i.value=localStorage.getItem("figures")?JSON.parse(localStorage.getItem("figures")):[],t){const e=new FileReader;e.onload=e=>{if(e.target){const l=new Image;l.onload=()=>{a.value=l,o.value&&(l.naturalWidth===o.value.width&&l.naturalHeight===o.value.height||(localStorage.removeItem("figures"),i.value=[])),localStorage.setItem("imageSize",JSON.stringify({width:l.naturalWidth,height:l.naturalHeight})),x()},l.src=e.target.result}},e.readAsDataURL(t)}};function x(t,n){if(l.value&&a.value&&e.value){e.value.width=a.value.naturalWidth,e.value.height=a.value.naturalHeight,l.value.clearRect(0,0,e.value.width,e.value.height),l.value.drawImage(a.value,0,0,a.value.naturalWidth,a.value.naturalHeight);for(const e of i.value)l.value.fillStyle=`rgba(${e.background}, ${t&&n==e.id?"0.8":"0.5"})`,l.value.fill(C(e.points));if(null!==s.value){l.value.fillStyle="red",l.value.strokeStyle="blue";for(let e=0;e0){const t=s.value[e-1];l.value.moveTo(t.x,t.y),l.value.lineTo(a.x,a.y),l.value.stroke()}}}}}return{figures:i,sourceImage:a,idFigureOnContextMenu:u,contextMenuOptions:d,clickHandler:v,contextmenuHandler:f,mousemoveHandler:g,uploadImage:h,deleteFigure:m,canvas:e,imageSize:o,ctx:l}}var v=a(40141);const f={class:"items grid grid-cols-5 gap-7.5"},g=["onClick"],p={class:"itemPlan__place"},C={class:"itemPlan__image"},m=["src"];function h(e,l,a,n,o,i){const r=(0,t.g2)("Dialog");return(0,t.uX)(),(0,t.Wv)(r,{modal:"",visible:n.visibleWindowLocal,"onUpdate:visible":[l[0]||(l[0]=e=>n.visibleWindowLocal=e),l[1]||(l[1]=l=>e.$emit("update:visibleWindow"))],style:"width: 95%; height: 90%;",draggable:!1},{header:(0,t.k6)((()=>l[2]||(l[2]=[(0,t.Lk)("div",{class:"title 2xl:text-[32px] xl:text-[28px]"}," Связать размеченную область с планировкой ",-1)]))),default:(0,t.k6)((()=>[(0,t.Lk)("div",f,[((0,t.uX)(!0),(0,t.CE)(t.FK,null,(0,t.pI)(n.plans,(e=>((0,t.uX)(),(0,t.CE)("div",{class:"itemPlan hover:!bg-grey-200",key:"itemPlan"+e.id,onClick:l=>i.onSelectPlan(e.id)},[l[3]||(l[3]=(0,t.Lk)("div",{class:"itemPlan__title"},"Тип планировки",-1)),(0,t.Lk)("div",p,(0,s.v_)(e.images.length&&e.images[0].name),1),(0,t.Lk)("div",C,[(0,t.Lk)("img",{src:e.images.length&&e.images[0].url,alt:""},null,8,m)])],8,g)))),128))])])),_:1},8,["visible"])}var x=a(22093),b={props:{visibleWindow:{type:Boolean},figure_id:Number},setup(e){const l=(0,n.KR)(e.visibleWindow),a=(0,n.KR)([]);return{visibleWindowLocal:l,plans:a}},watch:{visibleWindow(e){this.visibleWindowLocal=e}},methods:{getPlans(){if(this.$route.params.house_id)return x.A.getHousePlans(this.$route.params.house_id).then((e=>{var l=e.data;l&&(this.plans=l)}))},onSelectPlan(e){c.A.$emit("floor-plan:figure-plan-selected",{room_plan_id:e,figure_id:this.figure_id,background:"51, 255, 87"}),this.$emit("update:visibleWindow")}},mounted(){this.getPlans()}},_=a(71241);const k=(0,_.A)(b,[["render",h],["__scopeId","data-v-893f6550"]]);var w=k,L=a(82815);const y=["onClick"],F=["innerHTML"],V={class:"uploadImageBtn"};var P={__name:"canvasMarkupFloor",props:{propImageConfigs:null|File},setup(e,{expose:l}){const a=e,o=(0,n.KR)(!1),i=(0,v.S)(),f=(0,n.KR)(null),{figures:g,idFigureOnContextMenu:p,contextMenuOptions:C,uploadImage:m,clickHandler:h,contextmenuHandler:x,sourceImage:b,imageSize:_,mousemoveHandler:k,deleteFigure:P,canvas:R,ctx:H}=d();l({canvas:f}),(0,t.wB)((()=>a.propImageConfigs),(async e=>{if(R.value=f.value,H.value=f.value.getContext("2d"),e.url){const l=new Image;l.crossOrigin="anonymous",l.src=e.url,l.onload=()=>{b.value=l,g.value=e.figures}}}),{deep:!0});const I=(0,n.KR)(null),A=(0,n.KR)([{label:"Связать с планировкой",icon:'\n\n\n\n\n\n\n\n\n\n\n',command:()=>{o.value=!0}},{label:"Удалить область",icon:'\n\n\n',class:"text-red",command:e=>{M(e)}}]),M=e=>{i.require({target:e.currentTarget,group:"deletePlan",message:"Удалить область?",acceptLabel:"Да",rejectLabel:"Нет",acceptClass:"!bg-red !shadow-none",rejectClass:"!bg-green !shadow-none",accept:()=>{c.A.$emit("floor-plan:figure-deleted",C.value.figure?.id),C.value={isVisible:!1,x:0,y:0}},reject:()=>{C.value={isVisible:!1,x:0,y:0}}})},O=e=>{const l=e.target.files;f.value&&l&&0!==l.length&&m(l[0],f.value)};(0,t.wB)(o,(e=>{e||(C.value={isVisible:!1,x:0,y:0})}));const W=()=>{I.value?.requestFullscreen&&(document.fullscreenElement?document.exitFullscreen():I.value.requestFullscreen())};return(0,t.sV)((()=>{f.value.addEventListener("click",(e=>h(e))),f.value.addEventListener("contextmenu",(e=>{const l=x(e);l&&(l.figure&&l.figure.room_plan_id?(A.value[0].label="Отвязать планировку",A.value[0].command=()=>{c.A.$emit("floor-plan:figure-plan-selected",{room_plan_id:null,figure_id:l.figure.id,background:"173, 169, 219"}),C.value.isVisible=!1}):(A.value[0].label="Связать с планировкой",A.value[0].command=()=>{o.value=!0}))})),f.value.addEventListener("mousemove",(e=>k(e)))})),(e,l)=>{const a=(0,t.g2)("Button");return(0,t.uX)(),(0,t.CE)("div",{class:"editPlanFloors w-full h-full flex justify-center items-center relative",ref_key:"canvasContainer",ref:I,style:(0,s.Tr)(e.imageSource?"":"justify-content: center")},[(0,n.R1)(C).figure?((0,t.uX)(),(0,t.Wv)(w,{key:0,figure_id:(0,n.R1)(C).figure.id,visibleWindow:o.value,"onUpdate:visibleWindow":l[0]||(l[0]=e=>o.value=!1)},null,8,["figure_id","visibleWindow"])):(0,t.Q3)("",!0),(0,t.Lk)("div",{class:(0,s.C4)(["contextMenu",(0,n.R1)(C).isVisible?"open":""]),style:(0,s.Tr)(`left: ${(0,n.R1)(C).x}px; top: ${(0,n.R1)(C).y}px`)},[((0,t.uX)(!0),(0,t.CE)(t.FK,null,(0,t.pI)(A.value,(e=>((0,t.uX)(),(0,t.CE)("div",{class:"contextMenu__item cursor-pointer",key:"item"+e.label,onClick:l=>e.command(l)},[(0,t.Lk)("div",{class:"item__icon",innerHTML:e.icon},null,8,F),(0,t.Lk)("div",{class:(0,s.C4)(["item__text",e.class])},(0,s.v_)(e.label),3)],8,y)))),128)),(0,t.bF)((0,n.R1)(u.A),{group:"deletePlan",pt:(0,n.R1)(L.qW)},null,8,["pt"])],6),(0,t.bo)((0,t.bF)(a,{severity:"success",class:"!absolute 2xl:!top-[50px] xl:!top-[30px] 2xl:!left-[50px] xl:!left-[30px]",onClick:l[1]||(l[1]=e=>W())},{default:(0,t.k6)((()=>l[3]||(l[3]=[(0,t.Lk)("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"mr-2.5"},[(0,t.Lk)("path",{d:"M10.2359 8.4375C10.2359 8.6625 10.0859 8.8125 9.86094 8.8125H8.73594V9.9375C8.73594 10.1625 8.58594 10.3125 8.36094 10.3125C8.13594 10.3125 7.98594 10.1625 7.98594 9.9375V8.8125H6.86094C6.63594 8.8125 6.48594 8.6625 6.48594 8.4375C6.48594 8.2125 6.63594 8.0625 6.86094 8.0625H7.98594V6.9375C7.98594 6.7125 8.13594 6.5625 8.36094 6.5625C8.58594 6.5625 8.73594 6.7125 8.73594 6.9375V8.0625H9.86094C10.0859 8.0625 10.2359 8.2125 10.2359 8.4375ZM14.1734 14.0625C14.0984 14.175 13.9859 14.2125 13.8734 14.2125C13.7984 14.2125 13.7234 14.175 13.6484 14.1375L11.0984 12.15C10.3484 12.7125 9.37344 13.05 8.36094 13.05C5.81094 13.05 3.71094 10.9875 3.71094 8.4C3.71094 5.8125 5.77344 3.75 8.36094 3.75C10.9484 3.75 13.0109 5.8125 13.0109 8.4C13.0109 9.6375 12.5234 10.8 11.6984 11.625L14.1359 13.5C14.2859 13.65 14.3234 13.9125 14.1734 14.0625ZM8.36094 12.3C10.4984 12.3 12.2609 10.575 12.2609 8.4C12.2609 6.225 10.4984 4.5375 8.36094 4.5375C6.22344 4.5375 4.46094 6.2625 4.46094 8.4375C4.46094 10.6125 6.22344 12.3 8.36094 12.3Z",fill:"white"})],-1),(0,t.eW)(" Развернуть конструктор ")]))),_:1},512),[[r.aG,(0,n.R1)(b)]]),(0,t.bo)((0,t.Lk)("canvas",{ref_key:"canvas",ref:f},null,512),[[r.aG,(0,n.R1)(b)]]),(0,t.bo)((0,t.Lk)("div",V,[(0,t.Lk)("input",{type:"file",ref:"inputFile",class:"hidden",id:"changeFileInput",onChange:l[2]||(l[2]=e=>O(e))},null,544),l[4]||(l[4]=(0,t.Lk)("label",{for:"changeFileInput",class:"py-2 px-3 bg-green text-white rounded cursor-pointer mx-auto"},"Загрузить изображение этажа",-1))],512),[[r.aG,!(0,n.R1)(b)]])],4)}}};const R=(0,_.A)(P,[["__scopeId","data-v-7f5195cb"]]);var H=R;const I={class:"markupFloor"},A={class:"markupFloor__head flex flex-row justify-between items-center mb-7.5"},M={class:"updateImage"},O={class:"markupFloor__content mt-7.5 grid grid-cols-[1fr_312px] gap-x-[90px] 2xl:max-w-[1400px] xl:max-w-[1100px]"},W={class:"markupFloor__fields flex flex-col"},S={class:"flex flex-row mb-7.5 items-center"},$={key:0,class:"field flex flex-col mb-5"},E={class:"field flex flex-col mb-5"},j={class:"markupFloor__sideWorld"},K={class:"flex flex-row mb-7.5 items-center"},B={class:"markupFloor__editPlanFloors border-2 border-dashed border-grey-400 flex justify-center items-center mt-7.5"};var T={__name:"markupFloor",props:{floorPlan:Object,floorsOptions:Array,entrancesOptions:Array,dataForm:Object},setup(e){const l=(0,n.KR)(),a=e,s={root:{class:["min-h-[40px] h-auto !py-[3px] !px-[10px] !border-grey-400"]},label:{class:["!p-0"]},token:{class:["!bg-green-300 !p-2.5 !rounded !h-[34px]"]},wrapper:{class:["!p-0"]},list:{class:["!p-0"]},item:({context:e})=>({class:[e.selected?"!bg-green-300 text-black":""]}),checkboxContainer:{class:["!hidden"]}},r=e=>{const l=e.target.files;if(l&&0!==l.length){const e=new FormData;e.append("floor_plan_id",a.floorPlan.id),e.append("photo",l[0]),x.A.updateFloorPlanPhoto(e).then((e=>{e.data&&(a.floorPlan.figures=[],a.floorPlan.image=e.data.url,a.floorPlan.name=e.data.name)}))}};return(0,t.sV)((()=>{Object.keys(a.dataForm).forEach((e=>{a.dataForm[e]=a.floorPlan[e]}))})),(a,u)=>{const c=(0,t.g2)("Message"),d=(0,t.g2)("InputSwitch");return(0,t.uX)(),(0,t.CE)("div",I,[(0,t.Lk)("div",A,[u[6]||(u[6]=(0,t.Lk)("div",{class:"markupFloor__title text-[32px]"},"Разметка",-1)),(0,t.Lk)("div",M,[(0,t.Lk)("input",{type:"file",ref:"inputFile",class:"hidden",id:"changeFileInput",onChange:u[0]||(u[0]=e=>r(e))},null,544),u[5]||(u[5]=(0,t.Lk)("label",{for:"changeFileInput",class:"py-2 px-3 bg-green text-white rounded cursor-pointer mx-auto"},"Заменить изображение",-1))])]),(0,t.bF)(c,{severity:"warn",closable:!1},{messageicon:(0,t.k6)((()=>u[7]||(u[7]=[(0,t.Lk)("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"w-[22px] h-auto mr-2.5"},[(0,t.Lk)("path",{d:"M9.00161 8.25C8.8027 8.25 8.61193 8.32902 8.47128 8.46967C8.33063 8.61032 8.25161 8.80109 8.25161 9V11.25C8.25161 11.4489 8.33063 11.6397 8.47128 11.7803C8.61193 11.921 8.8027 12 9.00161 12C9.20052 12 9.39129 11.921 9.53194 11.7803C9.67259 11.6397 9.75161 11.4489 9.75161 11.25V9C9.75161 8.80109 9.67259 8.61032 9.53194 8.46967C9.39129 8.32902 9.20052 8.25 9.00161 8.25ZM9.00161 6C8.85327 6 8.70827 6.04399 8.58493 6.1264C8.46159 6.20881 8.36546 6.32594 8.3087 6.46299C8.25193 6.60003 8.23708 6.75083 8.26602 6.89632C8.29496 7.0418 8.36639 7.17544 8.47128 7.28033C8.57617 7.38522 8.70981 7.45665 8.85529 7.48559C9.00078 7.51453 9.15158 7.49968 9.28862 7.44291C9.42567 7.38614 9.5428 7.29001 9.62521 7.16668C9.70762 7.04334 9.75161 6.89834 9.75161 6.75C9.75161 6.55109 9.67259 6.36032 9.53194 6.21967C9.39129 6.07902 9.20052 6 9.00161 6ZM9.00161 1.5C8.01669 1.5 7.04142 1.69399 6.13148 2.0709C5.22154 2.44781 4.39475 3.00026 3.69831 3.6967C2.29178 5.10322 1.50161 7.01088 1.50161 9C1.49505 10.7319 2.0947 12.4114 3.19661 13.7475L1.69661 15.2475C1.59254 15.353 1.52204 15.4869 1.49401 15.6324C1.46598 15.7779 1.48167 15.9284 1.53911 16.065C1.6014 16.1999 1.70239 16.3133 1.82924 16.3908C1.9561 16.4682 2.10311 16.5063 2.25161 16.5H9.00161C10.9907 16.5 12.8984 15.7098 14.3049 14.3033C15.7114 12.8968 16.5016 10.9891 16.5016 9C16.5016 7.01088 15.7114 5.10322 14.3049 3.6967C12.8984 2.29018 10.9907 1.5 9.00161 1.5ZM9.00161 15H4.05911L4.75661 14.3025C4.82747 14.233 4.88385 14.1502 4.92247 14.0588C4.9611 13.9674 4.9812 13.8692 4.98161 13.77C4.97879 13.5722 4.89792 13.3835 4.75661 13.245C3.77455 12.264 3.16299 10.9729 3.02613 9.59159C2.88926 8.21029 3.23557 6.82425 4.00603 5.66964C4.77649 4.51503 5.92345 3.66327 7.25149 3.25948C8.57954 2.85569 10.0065 2.92485 11.2893 3.45519C12.572 3.98552 13.6312 4.94421 14.2864 6.16792C14.9416 7.39163 15.1523 8.80466 14.8825 10.1663C14.6126 11.5279 13.8791 12.7538 12.8068 13.6352C11.7344 14.5166 10.3897 14.9989 9.00161 15Z",fill:"#F57C00"})],-1)]))),default:(0,t.k6)((()=>u[8]||(u[8]=[(0,t.Lk)("p",{class:"2xl:text-base xl:text-sm"}," Текущий размер изображения 3000x1298px. Если новое изображение будет отличаться по высоте или ширине, то разметка будет удалена. ",-1)]))),_:1}),(0,t.Lk)("div",O,[(0,t.Lk)("div",W,[u[12]||(u[12]=(0,t.Lk)("div",{class:"smallTitle text-xl mb-5"},"Подъезды",-1)),(0,t.Lk)("div",S,[(0,t.bF)(d,{modelValue:e.dataForm.is_use_all_entrances,"onUpdate:modelValue":u[1]||(u[1]=l=>e.dataForm.is_use_all_entrances=l)},null,8,["modelValue"]),u[9]||(u[9]=(0,t.Lk)("label",{for:"",class:"ml-5 2xl:text-base xl:text-sm"},"У подъездов общая планировка",-1))]),e.dataForm.is_use_all_entrances?(0,t.Q3)("",!0):((0,t.uX)(),(0,t.CE)("div",$,[u[10]||(u[10]=(0,t.Lk)("label",{for:"",class:"mb-5"},[(0,t.eW)("Привязать планировку к подъездам "),(0,t.Lk)("span",{class:"text-red"},"*")],-1)),(0,t.bF)((0,n.R1)(i.A),{modelValue:e.dataForm.entrances,"onUpdate:modelValue":u[2]||(u[2]=l=>e.dataForm.entrances=l),display:"chip",optionLabel:"name",optionValue:"value",options:e.entrancesOptions,placeholder:"",showToggleAll:!1,pt:s},null,8,["modelValue","options"])])),(0,t.Lk)("div",E,[u[11]||(u[11]=(0,t.Lk)("label",{for:"",class:"mb-5"},[(0,t.eW)("Укажите этажи, соответствующие планировке "),(0,t.Lk)("span",{class:"text-red"},"*")],-1)),(0,t.bF)((0,n.R1)(i.A),{modelValue:e.dataForm.floor_positions,"onUpdate:modelValue":u[3]||(u[3]=l=>e.dataForm.floor_positions=l),optionLabel:"name",optionValue:"value",display:"chip",options:e.floorsOptions,placeholder:"",pt:s},null,8,["modelValue","options"])])]),(0,t.Lk)("div",j,[(0,t.Lk)("div",K,[(0,t.bF)(d,{modelValue:e.dataForm.has_light_angle,"onUpdate:modelValue":u[4]||(u[4]=l=>e.dataForm.has_light_angle=l)},null,8,["modelValue"]),u[13]||(u[13]=(0,t.Lk)("label",{for:"",class:"ml-5 2xl:text-base xl:text-sm"},"Отображать стороны света",-1))]),e.dataForm.has_light_angle?((0,t.uX)(),(0,t.Wv)(o.A,{key:0,formData:e.dataForm},null,8,["formData"])):(0,t.Q3)("",!0)])]),(0,t.Lk)("div",B,[(0,t.bF)(H,{ref_key:"canvasRef",ref:l,propImageConfigs:{url:e.floorPlan.image,name:e.floorPlan.name,figures:e.floorPlan.figures}},null,8,["propImageConfigs"])])])}}};const Z=(0,_.A)(T,[["__scopeId","data-v-825f70c4"]]);var X=Z,D=a(81387),N=a(12952),U=a.n(N),q=a(54409);const z={class:"editPlanFloors bg-white"};var J={__name:"EditPlanFloors",setup(e){const l=(0,n.KR)([]),a=(0,n.KR)(null),o=(0,q.j)(),i=(0,D.lq)(),s=()=>x.A.getHouseEntrances(i.params.house_id,["rooms"]).then((e=>{l.value=e.data})).catch((e=>console.log(e))),r=()=>x.A.getFloorPlan(i.params.floor_plan_id).then((e=>{a.value=e.data})).catch((e=>console.log(e))),u={light_angle:0,has_light_angle:!0,floor_positions:[],is_use_all_entrances:!1,entrances:[],image:null},d=(0,n.KR)({...u}),v=(0,t.EW)((()=>{const e={};return l.value.length&&l.value.forEach((l=>{(d.value.entrances?.find((e=>e.id==l.id))||d.value.is_use_all_entrances)&&l.floors.forEach((l=>{e[`${l.position}`]?e[`${l.position}`].push(l.id):e[`${l.position}`]=[l.id]}))})),Object.entries(e).map((([e,l])=>({name:e,value:l})))})),f=(0,t.EW)((()=>l.value.map((e=>({name:e.name,value:{id:e.id,position:e.position}}))))),g=U()((async e=>{const l=d.value.floor_positions?.reduce(((e,l)=>(Array.from(l).forEach((l=>{e=[...e,l]})),e)),[]);await x.A.updateFloorPlans([a.value.id],l,e).then((e=>{e.data&&Array.isArray(e.data)&&(a.value=e.data[0])})).catch((e=>console.log(e)))}),300);(0,t.wB)((()=>d.value),g,{deep:!0}),(0,t.wB)((()=>d.value.is_use_all_entrances),((e,a)=>{e!=a&&!e&&l.value.length&&(d.value.floor_positions=[])})),(0,t.wB)((()=>d.value.entrances),((e,a)=>{e?.length!==a?.length&&l.value.length&&(d.value.floor_positions=[])}));const p=e=>{x.A.deleteFloorPlanFigure(e).then((l=>{if(l.data){const l=a.value.figures.findIndex((l=>l.id===e));a.value.figures.splice(l,1)}})).catch((e=>console.log(e)))},C=e=>x.A.addFigureToFloorPlan(a.value.id,e).then((e=>{e.data&&a.value.figures.push(e.data)})).catch((e=>console.log(e))),m=({room_plan_id:e,figure_id:l,background:t})=>{x.A.updateFigure(l,{room_plan_id:e,background:t}).then((e=>{if(e.data){const t=a.value.figures.find((e=>e.id===l));Object.keys(e.data).forEach((l=>{t[l]=e.data[l]}))}})).catch((e=>console.log(e)))};return(0,t.sV)((async()=>{await r(),await s(),o.get_house(i.params.house_id),c.A.$on("canvas:figure-added",C),c.A.$on("floor-plan:figure-deleted",p),c.A.$on("floor-plan:figure-plan-selected",m)})),(0,t.xo)((()=>{c.A.$off("canvas:figure-added",C),c.A.$off("floor-plan:figure-deleted",p),c.A.$off("floor-plan:figure-plan-selected",m)})),(e,l)=>{const n=(0,t.g2)("Message");return(0,t.uX)(),(0,t.CE)("div",z,[l[2]||(l[2]=(0,t.Lk)("div",{class:"editPlanFloors__title mb-7.5"}," Редактирование планировки этажа ",-1)),(0,t.bF)(n,{severity:"info",closable:!1},{messageicon:(0,t.k6)((()=>l[0]||(l[0]=[(0,t.Lk)("svg",{width:"18",height:"19",viewBox:"0 0 18 19",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"w-[22px] h-auto mr-2.5"},[(0,t.Lk)("path",{d:"M9.00161 8.75C8.8027 8.75 8.61193 8.82902 8.47128 8.96967C8.33063 9.11032 8.25161 9.30109 8.25161 9.5V11.75C8.25161 11.9489 8.33063 12.1397 8.47128 12.2803C8.61193 12.421 8.8027 12.5 9.00161 12.5C9.20052 12.5 9.39129 12.421 9.53194 12.2803C9.67259 12.1397 9.75161 11.9489 9.75161 11.75V9.5C9.75161 9.30109 9.67259 9.11032 9.53194 8.96967C9.39129 8.82902 9.20052 8.75 9.00161 8.75ZM9.00161 6.5C8.85327 6.5 8.70827 6.54399 8.58493 6.6264C8.46159 6.70881 8.36546 6.82594 8.3087 6.96299C8.25193 7.10003 8.23708 7.25083 8.26602 7.39632C8.29496 7.5418 8.36639 7.67544 8.47128 7.78033C8.57617 7.88522 8.70981 7.95665 8.85529 7.98559C9.00078 8.01453 9.15158 7.99968 9.28862 7.94291C9.42567 7.88614 9.5428 7.79001 9.62521 7.66668C9.70762 7.54334 9.75161 7.39834 9.75161 7.25C9.75161 7.05109 9.67259 6.86032 9.53194 6.71967C9.39129 6.57902 9.20052 6.5 9.00161 6.5ZM9.00161 2C8.01669 2 7.04142 2.19399 6.13148 2.5709C5.22154 2.94781 4.39475 3.50026 3.69831 4.1967C2.29178 5.60322 1.50161 7.51088 1.50161 9.5C1.49505 11.2319 2.0947 12.9114 3.19661 14.2475L1.69661 15.7475C1.59254 15.853 1.52204 15.9869 1.49401 16.1324C1.46598 16.2779 1.48167 16.4284 1.53911 16.565C1.6014 16.6999 1.70239 16.8133 1.82924 16.8908C1.9561 16.9682 2.10311 17.0063 2.25161 17H9.00161C10.9907 17 12.8984 16.2098 14.3049 14.8033C15.7114 13.3968 16.5016 11.4891 16.5016 9.5C16.5016 7.51088 15.7114 5.60322 14.3049 4.1967C12.8984 2.79018 10.9907 2 9.00161 2ZM9.00161 15.5H4.05911L4.75661 14.8025C4.82747 14.733 4.88385 14.6502 4.92247 14.5588C4.9611 14.4674 4.9812 14.3692 4.98161 14.27C4.97879 14.0722 4.89792 13.8835 4.75661 13.745C3.77455 12.764 3.16299 11.4729 3.02613 10.0916C2.88926 8.71029 3.23557 7.32425 4.00603 6.16964C4.77649 5.01503 5.92345 4.16327 7.25149 3.75948C8.57954 3.35569 10.0065 3.42485 11.2893 3.95519C12.572 4.48552 13.6312 5.44421 14.2864 6.66792C14.9416 7.89163 15.1523 9.30466 14.8825 10.6663C14.6126 12.0279 13.8791 13.2538 12.8068 14.1352C11.7344 15.0166 10.3897 15.4989 9.00161 15.5Z",fill:"#3A8EFA"})],-1)]))),default:(0,t.k6)((()=>l[1]||(l[1]=[(0,t.Lk)("p",{class:"2xl:max-w-[1300px] xl:max-w-[990px] 2xl:text-base xl:text-sm"}," Отметьте на поэтажном плане границы помещения. Кликните кнопкой мыши на размеченную область и свяжите её с соответствующей планировкой. Разметьте таким образом каждое помещение на плане. Если возникнут вопросы обратитесь к инструкции. Быстрые кнопки: Левая кнопка мыши = поставить точку, Правая кнопка мыши = удалить точку ",-1)]))),_:1}),a.value?((0,t.uX)(),(0,t.Wv)(X,{key:0,floorPlan:a.value,floorsOptions:v.value,entrancesOptions:f.value,dataForm:d.value,class:"mt-7.5"},null,8,["floorPlan","floorsOptions","entrancesOptions","dataForm"])):(0,t.Q3)("",!0)])}}};const Q=(0,_.A)(J,[["__scopeId","data-v-211d35ff"]]);var G=Q}}]); //# sourceMappingURL=bd6b25afd59320fc.js.map