sprof 0.0.53 → 0.0.55

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -84,14 +84,14 @@ import { default as ToggleInfoItem } from './components/ToggleInfoItem.vue';
84
84
  import { default as TopSliderContainer } from './components/TopSliderContainer.vue';
85
85
  import { default as UploaderImage } from './components/UploaderImage.vue';
86
86
  import { default as typesNames } from './types/indexNames';
87
+ import { default as PF } from './PF';
87
88
  declare const servicesComponents: {
88
89
  install: (app: {
89
90
  component: (a: string, b: unknown) => void;
90
91
  }) => void;
91
92
  };
92
93
  export * from './index';
93
- export * from './PF';
94
94
  export * from './PFM';
95
95
  export * from './types/index';
96
96
  declare const pfName: string[];
97
- export { AdaptiveContainer, AdaptiveContainerHorizontal, AdminGallery, ArrowLeft, ArrowRight, AuthForm, AuthModal, AuthPage, CarouselImages, CollapseContainer, CollapseItem, ContextWindow, DateInputRange, DateInputRange_v2, DoubleArrowLeft, DoubleArrowRight, DropList, EllipsisSvg, FilterCheckbox, FiltersButtonsSelect, FilterSelect, FTSPPanel, GeneralItem, GridContainer, IconArrowLeft, IconCheckDefault, IconClose, IconDownload, IconEdit, IconEmail, IconFilter, IconMove, IconPhone, IconSearch, IconSelectArrow, ImageCropper, InfoItem, InfoItemSelectButtons, LeftRightContainer, MessageBody, PAdd, PageNotFound, PAutocomplete, PButton, PCheckBox, PContainer, PContainerStickyHead, PDatePicker, PDel, PDialog, PFlex, pfName, PhoneForm, PInput, PInputDate, PInputNumber, PLeftSlider, PList, PListItem, PLoader, PModal, PNotification, PPagination, PRadio, PRightSlider, PSelect, PSticky, PString, PTabs, PTextarea, PTopSlider, RemoteSearch, ResearcheContainer, RightSliderContainer, RightTabsContainer, SelectValueType, servicesComponents, SingleNameToggleForm, SortList, SortSelect, Switch3Pos, ThemeWrapper, ToggleInfoItem, TopSliderContainer, typesNames, UploaderFile, UploaderImage, VerticalCollapseContainer, };
97
+ export { AdaptiveContainer, AdaptiveContainerHorizontal, AdminGallery, ArrowLeft, ArrowRight, AuthForm, AuthModal, AuthPage, CarouselImages, CollapseContainer, CollapseItem, ContextWindow, DateInputRange, DateInputRange_v2, DoubleArrowLeft, DoubleArrowRight, DropList, EllipsisSvg, FilterCheckbox, FiltersButtonsSelect, FilterSelect, FTSPPanel, GeneralItem, GridContainer, IconArrowLeft, IconCheckDefault, IconClose, IconDownload, IconEdit, IconEmail, IconFilter, IconMove, IconPhone, IconSearch, IconSelectArrow, ImageCropper, InfoItem, InfoItemSelectButtons, LeftRightContainer, MessageBody, PAdd, PageNotFound, PAutocomplete, PButton, PCheckBox, PContainer, PContainerStickyHead, PDatePicker, PDel, PDialog, PF, PFlex, pfName, PhoneForm, PInput, PInputDate, PInputNumber, PLeftSlider, PList, PListItem, PLoader, PModal, PNotification, PPagination, PRadio, PRightSlider, PSelect, PSticky, PString, PTabs, PTextarea, PTopSlider, RemoteSearch, ResearcheContainer, RightSliderContainer, RightTabsContainer, SelectValueType, servicesComponents, SingleNameToggleForm, SortList, SortSelect, Switch3Pos, ThemeWrapper, ToggleInfoItem, TopSliderContainer, typesNames, UploaderFile, UploaderImage, VerticalCollapseContainer, };
package/dist/sprof.js CHANGED
@@ -12198,6 +12198,7 @@ export {
12198
12198
  ph as PDatePicker,
12199
12199
  bg as PDel,
12200
12200
  Bg as PDialog,
12201
+ M as PF,
12201
12202
  k1 as PFM,
12202
12203
  So as PFlex,
12203
12204
  oi as PInput,
@@ -39,4 +39,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
39
39
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
40
40
  PERFORMANCE OF THIS SOFTWARE.
41
41
  ***************************************************************************** */function Qo(t,e){var n,r;return t&&e?(n=""+t+e[0].toUpperCase()+e.slice(1),r=t+"-"+e):(n=t||e,r=t||e),{name:n,classname:r}}function Ko(t){return/^blob:/.test(t)}function es(t){return Ko(t)||function(e){return/^data:/.test(e)}(t)}function mt(t){return!!(t&&t.constructor&&t.call&&t.apply)}function ne(t){return t===void 0}function wn(t){return typeof t=="object"&&t!==null}function Bi(t,e,n){var r={};return wn(t)?(Object.keys(e).forEach(function(o){ne(t[o])?r[o]=e[o]:wn(e[o])?wn(t[o])?r[o]=Bi(t[o],e[o],n[o]):r[o]=t[o]?e[o]:n[o]:e[o]===!0||e[o]===!1?r[o]=!!t[o]:r[o]=t[o]}),r):t?e:n}function bn(t){var e=Number(t);return Number.isNaN(e)?t:e}function ts(t){return typeof(t=="number"||function(e){return typeof e=="object"&&e!==null}(t)&&toString.call(t)=="[object Number]")&&!ns(t)}function ns(t){return t!=t}function is(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}var Vt=function(t,e){t===void 0&&(t={}),e===void 0&&(e={}),this.type="manipulateImage",this.move=t,this.scale=e},kh=function(t,e){e===void 0&&(e={}),this.type="resize",this.directions=t,this.params=e},Ri=function(t){this.type="move",this.directions=t},Eh=function(){function t(e,n,r,o,s){this.type="drag",this.nativeEvent=e,this.position=r,this.previousPosition=o,this.element=n,this.anchor=s}return t.prototype.shift=function(){var e=this,n=e.element,r=e.anchor,o=e.position;if(n){var s=n.getBoundingClientRect(),a=s.left,c=s.top;return{left:o.left-a-r.left,top:o.top-c-r.top}}return{left:0,top:0}},t}(),$i={name:"DraggableElement",props:{classname:{type:String}},beforeMount:function(){window.addEventListener("mouseup",this.onMouseUp,{passive:!1}),window.addEventListener("mousemove",this.onMouseMove,{passive:!1}),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.onTouchEnd,{passive:!1})},beforeUnmount:function(){window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd)},mounted:function(){if(!this.$refs.draggable)throw new Error('You should add ref "draggable" to your root element to use draggable mixin');this.touches=[],this.hovered=!1},methods:{onMouseOver:function(){this.hovered||(this.hovered=!0,this.$emit("enter"))},onMouseLeave:function(){this.hovered&&!this.touches.length&&(this.hovered=!1,this.$emit("leave"))},onTouchStart:function(t){t.cancelable&&!this.disabled&&t.touches.length===1&&(this.touches=it(t.touches),this.hovered||(this.$emit("enter"),this.hovered=!0),t.touches.length&&this.initAnchor(this.touches.reduce(function(e,n){return{clientX:e.clientX+n.clientX/t.touches.length,clientY:e.clientY+n.clientY/t.touches.length}},{clientX:0,clientY:0})),t.preventDefault&&t.preventDefault(),t.stopPropagation())},onTouchEnd:function(){this.processEnd()},onTouchMove:function(t){this.touches.length&&(this.processMove(t,t.touches),t.preventDefault&&t.preventDefault(),t.stopPropagation&&t.stopPropagation())},onMouseDown:function(t){if(!this.disabled){var e={fake:!0,clientX:t.clientX,clientY:t.clientY};this.touches=[e],this.initAnchor(e),t.stopPropagation()}},onMouseMove:function(t){this.touches.length&&(this.processMove(t,[{fake:!0,clientX:t.clientX,clientY:t.clientY}]),t.preventDefault&&t.preventDefault())},onMouseUp:function(){this.processEnd()},initAnchor:function(t){var e=this.$refs.draggable.getBoundingClientRect(),n=e.left,r=e.right,o=e.bottom,s=e.top;this.anchor={left:t.clientX-n,top:t.clientY-s,bottom:o-t.clientY,right:r-t.clientX}},processMove:function(t,e){var n=it(e);if(this.touches.length){if(this.touches.length===1&&n.length===1){var r=this.$refs.draggable;this.$emit("drag",new Eh(t,r,{left:n[0].clientX,top:n[0].clientY},{left:this.touches[0].clientX,top:this.touches[0].clientY},this.anchor))}this.touches=n}},processEnd:function(){this.touches.length&&this.$emit("drag-end"),this.hovered&&(this.$emit("leave"),this.hovered=!1),this.touches=[]}},emits:["drag","drag-end","leave","enter"]};$i.render=function(t,e,n,r,o,s){return i.openBlock(),i.createBlock("div",{ref:"draggable",class:n.classname,onTouchstart:e[1]||(e[1]=function(){return s.onTouchStart&&s.onTouchStart.apply(s,arguments)}),onMousedown:e[2]||(e[2]=function(){return s.onMouseDown&&s.onMouseDown.apply(s,arguments)}),onMouseover:e[3]||(e[3]=function(){return s.onMouseOver&&s.onMouseOver.apply(s,arguments)}),onMouseleave:e[4]||(e[4]=function(){return s.onMouseLeave&&s.onMouseLeave.apply(s,arguments)})},[i.renderSlot(t.$slots,"default")],34)};var Ni=Be("vue-handler-wrapper"),rs={name:"HandlerWrapper",components:{DraggableElement:$i},props:{horizontalPosition:{type:String},verticalPosition:{type:String},disabled:{type:Boolean,default:!1}},computed:{classes:function(){var t;if(this.horizontalPosition||this.verticalPosition){var e,n=Qo(this.horizontalPosition,this.verticalPosition);t=Ni((Se(e={},n.classname,!0),Se(e,"disabled",this.disabled),e))}else t=Ni({disabled:this.disabled});return{root:t,draggable:Ni("draggable")}}},emits:["leave","enter","drag","drag-end"]};rs.render=function(t,e,n,r,o,s){var a=i.resolveComponent("DraggableElement");return i.openBlock(),i.createBlock("div",{class:s.classes.root},[i.createVNode(a,{class:s.classes.draggable,onDrag:e[1]||(e[1]=function(c){return t.$emit("drag",c)}),onDragEnd:e[2]||(e[2]=function(c){return t.$emit("drag-end")}),onLeave:e[3]||(e[3]=function(c){return t.$emit("leave")}),onEnter:e[4]||(e[4]=function(c){return t.$emit("enter")})},{default:i.withCtx(function(){return[i.renderSlot(t.$slots,"default")]}),_:3},8,["class"])],2)};var vh=Be("vue-line-wrapper"),os={name:"LineWrapper",components:{DraggableElement:$i},props:{position:{type:String,required:!0},disabled:{type:Boolean,default:!1}},computed:{classname:function(){var t;return vh((Se(t={},this.position,!0),Se(t,"disabled",this.disabled),t))}},emits:["leave","enter","drag","drag-end"]};os.render=function(t,e,n,r,o,s){var a=i.resolveComponent("DraggableElement");return i.openBlock(),i.createBlock(a,{class:s.classname,onDrag:e[1]||(e[1]=function(c){return t.$emit("drag",c)}),onDragEnd:e[2]||(e[2]=function(c){return t.$emit("drag-end")}),onLeave:e[3]||(e[3]=function(c){return t.$emit("leave")}),onEnter:e[4]||(e[4]=function(c){return t.$emit("enter")})},{default:i.withCtx(function(){return[i.renderSlot(t.$slots,"default")]}),_:3},8,["class"])};var Ae=["left","right","top","bottom"],xh=["left","right"],Mh=["top","bottom"],Bh=["left","top"],Rh=["fill-area","fit-area","stencil","none"],ss={left:0,top:0,width:0,height:0};function as(t,e,n){return!(n=n||["width","height","left","top"]).some(function(r){return t[r]!==e[r]})}function Ie(t){return{left:t.left,top:t.top,right:t.left+t.width,bottom:t.top+t.height}}function pt(t,e){return{left:t.left-e.left,top:t.top-e.top}}function se(t){return{left:t.left+t.width/2,top:t.top+t.height/2}}function Ft(t,e){var n={left:0,top:0,right:0,bottom:0};return Ae.forEach(function(r){var o=e[r],s=Ie(t)[r];n[r]=o!==void 0&&s!==void 0?r==="left"||r==="top"?Math.max(0,o-s):Math.max(0,s-o):0}),n}function Pe(t,e){return{left:t.left-e.left,top:t.top-e.top,width:t.width+e.left+e.right,height:t.height+e.top+e.bottom}}function Cn(t){return{left:-t.left,top:-t.top}}function me(t,e){return I(I({},t),{left:t.left+e.left,top:t.top+e.top})}function ke(t,e,n,r){if(e!==1){if(n){var o=se(t);return{width:t.width*e,height:t.height*e,left:t.left+t.width*(1-e)/2+(n.left-o.left)*(1-e),top:t.top+t.height*(1-e)/2+(n.top-o.top)*(1-e)}}return{width:t.width*e,height:t.height*e,left:t.left+t.width*(1-e)/2,top:t.top+t.height*(1-e)/2}}return t}function W(t){return t.width/t.height}function gt(t,e){return Math.min(e.right!==void 0&&e.left!==void 0?(e.right-e.left)/t.width:1/0,e.bottom!==void 0&&e.top!==void 0?(e.bottom-e.top)/t.height:1/0)}function yt(t,e){var n={left:0,top:0},r=Ft(t,e);return r.left&&r.left>0?n.left=r.left:r.right&&r.right>0&&(n.left=-r.right),r.top&&r.top>0?n.top=r.top:r.bottom&&r.bottom>0&&(n.top=-r.bottom),n}function Ai(t,e){var n;return e.minimum&&t<e.minimum?n=e.minimum:e.maximum&&t>e.maximum&&(n=e.maximum),n}function ls(t,e){var n=W(t),r=W(e);return e.width<1/0&&e.height<1/0?n>r?{width:e.width,height:e.width/n}:{width:e.height*n,height:e.height}:e.width<1/0?{width:e.width,height:e.width/n}:e.height<1/0?{width:e.height*n,height:e.height}:t}function cs(t,e){var n=e*Math.PI/180;return{width:Math.abs(t.width*Math.cos(n))+Math.abs(t.height*Math.sin(n)),height:Math.abs(t.width*Math.sin(n))+Math.abs(t.height*Math.cos(n))}}function We(t,e){var n=e*Math.PI/180;return{left:t.left*Math.cos(n)-t.top*Math.sin(n),top:t.left*Math.sin(n)+t.top*Math.cos(n)}}function Sn(t,e){var n=Ft(ae(t,e),e);return n.left+n.right+n.top+n.bottom?n.left+n.right>n.top+n.bottom?Math.min((t.width+n.left+n.right)/t.width,gt(t,e)):Math.min((t.height+n.top+n.bottom)/t.height,gt(t,e)):1}function ae(t,e,n){n===void 0&&(n=!1);var r=yt(t,e);return me(t,n?Cn(r):r)}function Ii(t){return{width:t.right!==void 0&&t.left!==void 0?t.right-t.left:1/0,height:t.bottom!==void 0&&t.top!==void 0?t.bottom-t.top:1/0}}function $h(t,e){return I(I({},t),{minWidth:Math.min(e.width,t.minWidth),minHeight:Math.min(e.height,t.minHeight),maxWidth:Math.min(e.width,t.maxWidth),maxHeight:Math.min(e.height,t.maxHeight)})}function ds(t,e,n){n===void 0&&(n=!0);var r={};return Ae.forEach(function(o){var s=t[o],a=e[o];s!==void 0&&a!==void 0?r[o]=o==="left"||o==="top"?n?Math.max(s,a):Math.min(s,a):n?Math.min(s,a):Math.max(s,a):a!==void 0?r[o]=a:s!==void 0&&(r[o]=s)}),r}function kn(t,e){return ds(t,e,!0)}function us(t){var e=t.size,n=t.aspectRatio,r=t.ignoreMinimum,o=t.sizeRestrictions;return!!((e.correctRatio||W(e)>=n.minimum&&W(e)<=n.maximum)&&e.height<=o.maxHeight&&e.width<=o.maxWidth&&e.width&&e.height&&(r||e.height>=o.minHeight&&e.width>=o.minWidth))}function hs(t,e){return Math.pow(t.width-e.width,2)+Math.pow(t.height-e.height,2)}function De(t){var e=t.width,n=t.height,r=t.sizeRestrictions,o={minimum:t.aspectRatio&&t.aspectRatio.minimum||0,maximum:t.aspectRatio&&t.aspectRatio.maximum||1/0},s={width:Math.max(r.minWidth,Math.min(r.maxWidth,e)),height:Math.max(r.minHeight,Math.min(r.maxHeight,n))};function a(u,h){return h===void 0&&(h=!1),u.reduce(function(f,m){return us({size:m,aspectRatio:o,sizeRestrictions:r,ignoreMinimum:h})&&(!f||hs(m,{width:e,height:n})<hs(f,{width:e,height:n}))?m:f},null)}var c=[];o&&[o.minimum,o.maximum].forEach(function(u){u&&c.push({width:s.width,height:s.width/u,correctRatio:!0},{width:s.height*u,height:s.height,correctRatio:!0})}),us({size:s,aspectRatio:o,sizeRestrictions:r})&&c.push(s);var l=a(c)||a(c,!0);return l&&{width:l.width,height:l.height}}function Pi(t){var e=t.event,n=t.coordinates,r=t.positionRestrictions,o=r===void 0?{}:r,s=me(n,e.directions);return me(s,yt(s,o))}function Nh(t){var e=t.coordinates,n=t.transform,r=t.imageSize,o=t.sizeRestrictions,s=t.positionRestrictions,a=t.aspectRatio,c=t.visibleArea,l=function(h,f){return Pi({coordinates:h,positionRestrictions:s,event:new Ri({left:f.left-h.left,top:f.top-h.top})})},u=I({},e);return(Array.isArray(n)?n:[n]).forEach(function(h){var f={};ne((f=typeof h=="function"?h({coordinates:u,imageSize:r,visibleArea:c}):h).width)&&ne(f.height)||(u=function(m,g){var p=I(I(I({},m),De({width:g.width,height:g.height,sizeRestrictions:o,aspectRatio:a})),{left:0,top:0});return l(p,{left:m.left,top:m.top})}(u,I(I({},u),f))),ne(f.left)&&ne(f.top)||(u=l(u,I(I({},u),f)))}),u}function Ah(t){t.event;var e=t.getAreaRestrictions,n=t.boundaries,r=t.coordinates,o=t.visibleArea;t.aspectRatio;var s=t.stencilSize,a=t.sizeRestrictions,c=t.positionRestrictions;t.stencilReference;var l,u,h,f=I({},r),m=I({},o),g=I({},s);l=W(g),u=W(f),h===void 0&&(h=.001),(l===0||u===0?Math.abs(u-l)<h:Math.abs(u/l)<1+h&&Math.abs(u/l)>1-h)||(f=I(I({},f),De({sizeRestrictions:a,width:f.width,height:f.height,aspectRatio:{minimum:W(g),maximum:W(g)}})));var p=Sn(m=ke(m,f.width*n.width/(m.width*g.width)),e({visibleArea:m,type:"resize"}));return p!==1&&(m=ke(m,p),f=ke(f,p)),m=ae(m=me(m,pt(se(f),se(m))),e({visibleArea:m,type:"move"})),{coordinates:f=ae(f,kn(Ie(m),c)),visibleArea:m}}function Ih(t){var e=t.event,n=t.getAreaRestrictions,r=t.boundaries,o=t.coordinates,s=t.visibleArea;t.aspectRatio,t.stencilSize,t.sizeRestrictions;var a=t.positionRestrictions;t.stencilReference;var c=I({},o),l=I({},s);if(o&&s&&e.type!=="manipulateImage"){var u={width:0,height:0};l.width,r.width,W(r)>W(c)?(u.height=.8*r.height,u.width=u.height*W(c)):(u.width=.8*r.width,u.height=u.width*W(c));var h=Sn(l=ke(l,c.width*r.width/(l.width*u.width)),n({visibleArea:l,type:"resize"}));l=ke(l,h),h!==1&&(u.height/=h,u.width/=h),l=ae(l=me(l,pt(se(c),se(l))),n({visibleArea:l,type:"move"})),c=ae(c,kn(Ie(l),a))}return{coordinates:c,visibleArea:l}}function Ph(t){var e=t.event,n=t.coordinates,r=t.visibleArea,o=t.getAreaRestrictions,s=I({},r),a=I({},n);if(e.type==="setCoordinates"){var c=Math.max(0,a.width-s.width),l=Math.max(0,a.height-s.height);c>l?s=ke(s,Math.min(a.width/s.width,gt(s,o({visibleArea:s,type:"resize"})))):l>c&&(s=ke(s,Math.min(a.height/s.height,gt(s,o({visibleArea:s,type:"resize"}))))),s=ae(s=me(s,Cn(yt(a,Ie(s)))),o({visibleArea:s,type:"move"}))}return{visibleArea:s,coordinates:a}}function Th(t){var e=t.imageSize,n=t.visibleArea,r=t.coordinates,o=n||e;return{left:(n?n.left:0)+o.width/2-r.width/2,top:(n?n.top:0)+o.height/2-r.height/2}}function zh(t){var e=t.imageSize,n=t.visibleArea,r=t.aspectRatio,o=t.sizeRestrictions,s=n||e,a=Math.min(r.maximum||1/0,Math.max(r.minimum||0,W(s))),c=s.width<s.height?{width:.8*s.width,height:.8*s.width/a}:{height:.8*s.height,width:.8*s.height*a};return De(I(I({},c),{aspectRatio:r,sizeRestrictions:o}))}function Vh(t){var e,n,r=t.imageSize,o=t.visibleArea,s=t.boundaries,a=t.aspectRatio,c=t.sizeRestrictions,l=t.stencilSize,u=o||r;return W(u)>W(s)?n=(e=l.height*u.height/s.height)*W(l):e=(n=l.width*u.width/s.width)/W(l),De({width:n,height:e,aspectRatio:a,sizeRestrictions:c})}function Fh(t){var e=t.getAreaRestrictions,n=t.coordinates,r=t.imageSize,o=W(t.boundaries);if(n){var s={height:Math.max(n.height,r.height),width:Math.max(n.width,r.width)},a=ls({width:W(s)>o?s.width:s.height*o,height:W(s)>o?s.width/o:s.height},Ii(e())),c={left:n.left+n.width/2-a.width/2,top:n.top+n.height/2-a.height/2,width:a.width,height:a.height},l=Ft(n,Ie(I({left:0,top:0},r))),u={};return!l.left&&!l.right&&c.width<=r.width&&(u.left=0,u.right=r.width),!l.top&&!l.bottom&&c.height<=r.height&&(u.top=0,u.bottom=r.height),ae(c,u)}var h=W(r);return a={height:h>o?r.height:r.width/o,width:h>o?r.height*o:r.width},{left:r.width/2-a.width/2,top:r.height/2-a.height/2,width:a.width,height:a.height}}function En(t,e){return ds(t,Ie(e))}function Oh(t){var e=t.event,n=t.coordinates,r=t.visibleArea,o=t.sizeRestrictions,s=t.getAreaRestrictions,a=t.positionRestrictions,c=t.adjustStencil,l=e.scale,u=e.move,h=I({},r),f=I({},n),m=1,g=1,p=l.factor&&Math.abs(l.factor-1)>.001;h=me(h,{left:u.left||0,top:u.top||0});var k={stencil:{minimum:Math.max(o.minWidth?o.minWidth/f.width:0,o.minHeight?o.minHeight/f.height:0),maximum:Math.min(o.maxWidth?o.maxWidth/f.width:1/0,o.maxHeight?o.maxHeight/f.height:1/0,gt(f,a))},area:{maximum:gt(h,s({visibleArea:h,type:"resize"}))}};l.factor&&p&&(l.factor<1?(g=Math.max(l.factor,k.stencil.minimum))>1&&(g=1):l.factor>1&&(g=Math.min(l.factor,Math.min(k.area.maximum,k.stencil.maximum)))<1&&(g=1)),g&&(h=ke(h,g,l.center));var w=n.left-r.left,B=r.width+r.left-(n.width+n.left),D=n.top-r.top,L=r.height+r.top-(n.height+n.top);return h=ae(h=me(h,yt(h,{left:a.left!==void 0?a.left-w*g:void 0,top:a.top!==void 0?a.top-D*g:void 0,bottom:a.bottom!==void 0?a.bottom+L*g:void 0,right:a.right!==void 0?a.right+B*g:void 0})),s({visibleArea:h,type:"move"})),f.width=f.width*g,f.height=f.height*g,f.left=h.left+w*g,f.top=h.top+D*g,f=ae(f,kn(Ie(h),a)),l.factor&&p&&c&&(l.factor>1?m=Math.min(k.area.maximum,l.factor)/g:l.factor<1&&(m=Math.max(f.height/h.height,f.width/h.width,l.factor/g)),m!==1&&(h=me(h=ae(h=ke(h,m,l.factor>1?l.center:se(f)),s({visibleArea:h,type:"move"})),Cn(yt(f,Ie(h)))))),{coordinates:f,visibleArea:h}}function Dh(t){var e=t.aspectRatio,n=t.getAreaRestrictions,r=t.coordinates,o=t.visibleArea,s=t.sizeRestrictions,a=t.positionRestrictions,c=t.imageSize,l=t.previousImageSize,u=t.angle,h=I({},r),f=I({},o),m=We(se(I({left:0,top:0},l)),u);return(h=I(I({},De({sizeRestrictions:s,aspectRatio:e,width:h.width,height:h.height})),We(se(h),u))).left-=m.left-c.width/2+h.width/2,h.top-=m.top-c.height/2+h.height/2,f=ke(f,Sn(f,n({visibleArea:f,type:"resize"}))),{coordinates:h=ae(h,a),visibleArea:f=ae(f=me(f,pt(se(h),se(r))),n({visibleArea:f,type:"move"}))}}function Lh(t){var e=t.flip,n=t.previousFlip,r=t.rotate,o=t.getAreaRestrictions,s=t.coordinates,a=t.visibleArea,c=t.imageSize,l=I({},s),u=I({},a),h=n.horizontal!==e.horizontal,f=n.vertical!==e.vertical;if(h||f){var m=We({left:c.width/2,top:c.height/2},-r),g=We(se(l),-r),p=We({left:h?m.left-(g.left-m.left):g.left,top:f?m.top-(g.top-m.top):g.top},r);l=me(l,pt(p,se(l))),g=We(se(u),-r),u=ae(u=me(u,pt(p=We({left:h?m.left-(g.left-m.left):g.left,top:f?m.top-(g.top-m.top):g.top},r),se(u))),o({visibleArea:u,type:"move"}))}return{coordinates:l,visibleArea:u}}function fs(t){var e=t.directions,n=t.coordinates,r=t.positionRestrictions,o=r===void 0?{}:r,s=t.sizeRestrictions,a=t.preserveRatio,c=t.compensate,l=I({},e),u=Pe(n,l).width,h=Pe(n,l).height;u<0&&(l.left<0&&l.right<0?(l.left=-(n.width-s.minWidth)/(l.left/l.right),l.right=-(n.width-s.minWidth)/(l.right/l.left)):l.left<0?l.left=-(n.width-s.minWidth):l.right<0&&(l.right=-(n.width-s.minWidth))),h<0&&(l.top<0&&l.bottom<0?(l.top=-(n.height-s.minHeight)/(l.top/l.bottom),l.bottom=-(n.height-s.minHeight)/(l.bottom/l.top)):l.top<0?l.top=-(n.height-s.minHeight):l.bottom<0&&(l.bottom=-(n.height-s.minHeight)));var f=Ft(Pe(n,l),o);c&&(f.left&&f.left>0&&f.right===0?(l.right+=f.left,l.left-=f.left):f.right&&f.right>0&&f.left===0&&(l.left+=f.right,l.right-=f.right),f.top&&f.top>0&&f.bottom===0?(l.bottom+=f.top,l.top-=f.top):f.bottom&&f.bottom>0&&f.top===0&&(l.top+=f.bottom,l.bottom-=f.bottom),f=Ft(Pe(n,l),o));var m={width:1/0,height:1/0,left:1/0,right:1/0,top:1/0,bottom:1/0};if(Ae.forEach(function(k){var w=f[k];w&&l[k]&&(m[k]=Math.max(0,1-w/l[k]))}),a){var g=Math.min.apply(null,Ae.map(function(k){return m[k]}));g!==1/0&&Ae.forEach(function(k){l[k]*=g})}else Ae.forEach(function(k){m[k]!==1/0&&(l[k]*=m[k])});if(u=Pe(n,l).width,h=Pe(n,l).height,l.right+l.left&&(u>s.maxWidth?m.width=(s.maxWidth-n.width)/(l.right+l.left):u<s.minWidth&&(m.width=(s.minWidth-n.width)/(l.right+l.left))),l.bottom+l.top&&(h>s.maxHeight?m.height=(s.maxHeight-n.height)/(l.bottom+l.top):h<s.minHeight&&(m.height=(s.minHeight-n.height)/(l.bottom+l.top))),a){var p=Math.min(m.width,m.height);p!==1/0&&Ae.forEach(function(k){l[k]*=p})}else m.width!==1/0&&xh.forEach(function(k){l[k]*=m.width}),m.height!==1/0&&Mh.forEach(function(k){l[k]*=m.height});return l}function vn(t,e,n){return e==0&&n==0?t/2:e==0?0:n==0?t:t*Math.abs(e/(e+n))}var Hh=Be("vue-simple-handler"),_h=Be("vue-simple-handler-wrapper"),Ti={name:"SimpleHandler",components:{HandlerWrapper:rs},props:{defaultClass:{type:String},hoverClass:{type:String},wrapperClass:{type:String},horizontalPosition:{type:String},verticalPosition:{type:String},disabled:{type:Boolean,default:!1}},data:function(){return{hover:!1}},computed:{classes:function(){var t,e=(Se(t={},this.horizontalPosition,!!this.horizontalPosition),Se(t,this.verticalPosition,!!this.verticalPosition),Se(t,"".concat(this.horizontalPosition,"-").concat(this.verticalPosition),!!(this.verticalPosition&&this.horizontalPosition)),Se(t,"hover",this.hover),t);return{default:Y(Hh(e),this.defaultClass,this.hover&&this.hoverClass),wrapper:Y(_h(e),this.wrapperClass)}}},methods:{onDrag:function(t){this.$emit("drag",t)},onEnter:function(){this.hover=!0},onLeave:function(){this.hover=!1},onDragEnd:function(){this.$emit("drag-end")}},emits:["drag","drag-end"]};Ti.render=function(t,e,n,r,o,s){var a=i.resolveComponent("HandlerWrapper");return i.openBlock(),i.createBlock(a,{class:s.classes.wrapper,"vertical-position":n.verticalPosition,"horizontal-position":n.horizontalPosition,disabled:n.disabled,onDrag:s.onDrag,onDragEnd:s.onDragEnd,onEnter:s.onEnter,onLeave:s.onLeave},{default:i.withCtx(function(){return[i.createVNode("div",{class:s.classes.default},null,2)]}),_:1},8,["class","vertical-position","horizontal-position","disabled","onDrag","onDragEnd","onEnter","onLeave"])};var qh=Be("vue-simple-line"),Uh=Be("vue-simple-line-wrapper"),zi={name:"SimpleLine",components:{LineWrapper:os},props:{defaultClass:{type:String},hoverClass:{type:String},wrapperClass:{type:String},position:{type:String},disabled:{type:Boolean,default:!1}},data:function(){return{hover:!1}},computed:{classes:function(){return{root:Y(qh(Se({},this.position,!0)),this.defaultClass,this.hover&&this.hoverClass),wrapper:Y(Uh(Se({},this.position,!0)),this.wrapperClass)}}},methods:{onDrag:function(t){this.$emit("drag",t)},onEnter:function(){this.hover=!0},onLeave:function(){this.hover=!1},onDragEnd:function(){this.$emit("drag-end")}},emits:["drag","drag-end"]};zi.render=function(t,e,n,r,o,s){var a=i.resolveComponent("LineWrapper");return i.openBlock(),i.createBlock(a,{class:s.classes.wrapper,position:n.position,disabled:n.disabled,onDrag:s.onDrag,onDragEnd:s.onDragEnd,onEnter:s.onEnter,onLeave:s.onLeave},{default:i.withCtx(function(){return[i.createVNode("div",{class:s.classes.root},null,2)]}),_:1},8,["class","position","disabled","onDrag","onDragEnd","onEnter","onLeave"])};var Vi=Be("vue-bounding-box"),Wh=["east","west",null],jh=["south","north",null],ms={name:"BoundingBox",props:{width:{type:Number},height:{type:Number},transitions:{type:Object},handlers:{type:Object,default:function(){return{eastNorth:!0,north:!0,westNorth:!0,west:!0,westSouth:!0,south:!0,eastSouth:!0,east:!0}}},handlersComponent:{type:[Object,String],default:function(){return Ti}},handlersClasses:{type:Object,default:function(){return{}}},handlersWrappersClasses:{type:Object,default:function(){return{}}},lines:{type:Object,default:function(){return{west:!0,north:!0,east:!0,south:!0}}},linesComponent:{type:[Object,String],default:function(){return zi}},linesClasses:{type:Object,default:function(){return{}}},linesWrappersClasses:{type:Object,default:function(){return{}}},resizable:{type:Boolean,default:!0}},data:function(){var t=[];return Wh.forEach(function(e){jh.forEach(function(n){if(e!==n){var r=Qo(e,n),o=r.name,s=r.classname;t.push({name:o,classname:s,verticalDirection:n,horizontalDirection:e})}})}),{points:t}},computed:{style:function(){var t={};return this.width&&this.height&&(t.width="".concat(this.width,"px"),t.height="".concat(this.height,"px"),this.transitions&&this.transitions.enabled&&(t.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction))),t},classes:function(){var t=this.handlersClasses,e=this.handlersWrappersClasses,n=this.linesClasses,r=this.linesWrappersClasses;return{root:Vi(),handlers:t,handlersWrappers:e,lines:n,linesWrappers:r}},lineNodes:function(){var t=this,e=[];return this.points.forEach(function(n){n.horizontalDirection&&n.verticalDirection||!t.lines[n.name]||e.push({name:n.name,component:t.linesComponent,class:Y(t.classes.lines.default,t.classes.lines[n.name],!t.resizable&&t.classes.lines.disabled),wrapperClass:Y(t.classes.linesWrappers.default,t.classes.linesWrappers[n.name],!t.resizable&&t.classes.linesWrappers.disabled),hoverClass:t.classes.lines.hover,verticalDirection:n.verticalDirection,horizontalDirection:n.horizontalDirection,disabled:!t.resizable})}),e},handlerNodes:function(){var t=this,e=[],n=this.width,r=this.height;return this.points.forEach(function(o){if(t.handlers[o.name]){var s={name:o.name,component:t.handlersComponent,class:Y(t.classes.handlers.default,t.classes.handlers[o.name]),wrapperClass:Y(t.classes.handlersWrappers.default,t.classes.handlersWrappers[o.name]),hoverClass:t.classes.handlers.hover,verticalDirection:o.verticalDirection,horizontalDirection:o.horizontalDirection,disabled:!t.resizable};if(n&&r){var a=o.horizontalDirection,c=o.verticalDirection,l=a==="east"?n:a==="west"?0:n/2,u=c==="south"?r:c==="north"?0:r/2;s.wrapperClass=Vi("handler"),s.wrapperStyle={transform:"translate(".concat(l,"px, ").concat(u,"px)")},t.transitions&&t.transitions.enabled&&(s.wrapperStyle.transition="".concat(t.transitions.time,"ms ").concat(t.transitions.timingFunction))}else s.wrapperClass=Vi("handler",Se({},o.classname,!0));e.push(s)}}),e}},beforeMount:function(){window.addEventListener("mouseup",this.onMouseUp,{passive:!1}),window.addEventListener("mousemove",this.onMouseMove,{passive:!1}),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.onTouchEnd,{passive:!1})},beforeUnmount:function(){window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd)},mounted:function(){this.touches=[]},methods:{onEnd:function(){this.$emit("resize-end")},onHandlerDrag:function(t,e,n){var r,o=t.shift(),s=o.left,a=o.top,c={left:0,right:0,top:0,bottom:0};e==="west"?c.left-=s:e==="east"&&(c.right+=s),n==="north"?c.top-=a:n==="south"&&(c.bottom+=a),!n&&e?r="width":n&&!e&&(r="height"),this.resizable&&this.$emit("resize",new kh(c,{allowedDirections:{left:e==="west"||!e,right:e==="east"||!e,bottom:n==="south"||!n,top:n==="north"||!n},preserveAspectRatio:t.nativeEvent&&t.nativeEvent.shiftKey,respectDirection:r}))}},emits:["resize","resize-end"]};ms.render=function(t,e,n,r,o,s){return i.openBlock(),i.createBlock("div",{ref:"box",class:s.classes.root,style:s.style},[i.renderSlot(t.$slots,"default"),i.createVNode("div",null,[(i.openBlock(!0),i.createBlock(i.Fragment,null,i.renderList(s.lineNodes,function(a){return i.openBlock(),i.createBlock(i.resolveDynamicComponent(a.component),{key:a.name,"default-class":a.class,"hover-class":a.hoverClass,"wrapper-class":a.wrapperClass,position:a.name,disabled:a.disabled,onDrag:function(c){return s.onHandlerDrag(c,a.horizontalDirection,a.verticalDirection)},onDragEnd:e[1]||(e[1]=function(c){return s.onEnd()})},null,8,["default-class","hover-class","wrapper-class","position","disabled","onDrag"])}),128))]),(i.openBlock(!0),i.createBlock(i.Fragment,null,i.renderList(s.handlerNodes,function(a){return i.openBlock(),i.createBlock("div",{key:a.name,style:a.wrapperStyle,class:a.wrapperClass},[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(a.component),{"default-class":a.class,"hover-class":a.hoverClass,"wrapper-class":a.wrapperClass,"horizontal-position":a.horizontalDirection,"vertical-position":a.verticalDirection,disabled:a.disabled,onDrag:function(c){return s.onHandlerDrag(c,a.horizontalDirection,a.verticalDirection)},onDragEnd:e[2]||(e[2]=function(c){return s.onEnd()})},null,8,["default-class","hover-class","wrapper-class","horizontal-position","vertical-position","disabled","onDrag"]))],6)}),128))],6)};var Gh=Be("vue-draggable-area"),ps={name:"DraggableArea",props:{movable:{type:Boolean,default:!0},activationDistance:{type:Number,default:20}},computed:{classnames:function(){return{default:Gh()}}},beforeMount:function(){window.addEventListener("mouseup",this.onMouseUp,{passive:!1}),window.addEventListener("mousemove",this.onMouseMove,{passive:!1}),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.onTouchEnd,{passive:!1})},beforeUnmount:function(){window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd)},mounted:function(){this.touches=[],this.touchStarted=!1},methods:{onTouchStart:function(t){if(t.cancelable){var e=this.movable&&t.touches.length===1;e&&(this.touches=it(t.touches)),(this.touchStarted||e)&&(t.preventDefault(),t.stopPropagation())}},onTouchEnd:function(){this.touchStarted=!1,this.processEnd()},onTouchMove:function(t){this.touches.length>=1&&(this.touchStarted?(this.processMove(t,t.touches),t.preventDefault(),t.stopPropagation()):is({x:this.touches[0].clientX,y:this.touches[0].clientY},{x:t.touches[0].clientX,y:t.touches[0].clientY})>this.activationDistance&&(this.initAnchor({clientX:t.touches[0].clientX,clientY:t.touches[0].clientY}),this.touchStarted=!0))},onMouseDown:function(t){if(this.movable&&t.button===0){var e={fake:!0,clientX:t.clientX,clientY:t.clientY};this.touches=[e],this.initAnchor(e),t.stopPropagation()}},onMouseMove:function(t){this.touches.length&&(this.processMove(t,[{fake:!0,clientX:t.clientX,clientY:t.clientY}]),t.preventDefault&&t.cancelable&&t.preventDefault(),t.stopPropagation())},onMouseUp:function(){this.processEnd()},initAnchor:function(t){var e=this.$refs.container.getBoundingClientRect(),n=e.left,r=e.top;this.anchor={x:t.clientX-n,y:t.clientY-r}},processMove:function(t,e){var n=it(e);if(this.touches.length){var r=this.$refs.container.getBoundingClientRect(),o=r.left,s=r.top;this.touches.length===1&&n.length===1&&this.$emit("move",new Ri({left:n[0].clientX-(o+this.anchor.x),top:n[0].clientY-(s+this.anchor.y)}))}},processEnd:function(){this.touches.length&&this.$emit("move-end"),this.touches=[]}},emits:["move","move-end"]};ps.render=function(t,e,n,r,o,s){return i.openBlock(),i.createBlock("div",{ref:"container",onTouchstart:e[1]||(e[1]=function(){return s.onTouchStart&&s.onTouchStart.apply(s,arguments)}),onMousedown:e[2]||(e[2]=function(){return s.onMouseDown&&s.onMouseDown.apply(s,arguments)})},[i.renderSlot(t.$slots,"default")],544)};function Fi(t){var e,n;return{rotate:t.rotate||0,flip:{horizontal:((e=t==null?void 0:t.flip)===null||e===void 0?void 0:e.horizontal)||!1,vertical:((n=t==null?void 0:t.flip)===null||n===void 0?void 0:n.vertical)||!1}}}function Zh(t){return new Promise(function(e,n){try{if(t)if(/^data:/i.test(t))e(function(l){l=l.replace(/^data:([^;]+);base64,/gim,"");for(var u=atob(l),h=u.length,f=new ArrayBuffer(h),m=new Uint8Array(f),g=0;g<h;g++)m[g]=u.charCodeAt(g);return f}(t));else if(/^blob:/i.test(t)){var r=new FileReader;r.onload=function(l){e(l.target.result)},s=t,a=function(l){r.readAsArrayBuffer(l)},(c=new XMLHttpRequest).open("GET",s,!0),c.responseType="blob",c.onload=function(){this.status!=200&&this.status!==0||a(this.response)},c.send()}else{var o=new XMLHttpRequest;o.onreadystatechange=function(){o.readyState===4&&(o.status===200||o.status===0?e(o.response):n("Warning: could not load an image to parse its orientation"),o=null)},o.onprogress=function(){o.getResponseHeader("content-type")!=="image/jpeg"&&o.abort()},o.withCredentials=!1,o.open("GET",t,!0),o.responseType="arraybuffer",o.send(null)}else n("Error: the image is empty")}catch(l){n(l)}var s,a,c})}function gs(t){var e=t.rotate,n=t.flip,r=t.scaleX,o=t.scaleY,s="";return s+=" rotate("+e+"deg) ",s+=" scaleX("+r*(n.horizontal?-1:1)+") ",s+=" scaleY("+o*(n.vertical?-1:1)+") "}function Jh(t){try{var e,n=new DataView(t),r=void 0,o=void 0,s=void 0,a=void 0;if(n.getUint8(0)===255&&n.getUint8(1)===216)for(var c=n.byteLength,l=2;l+1<c;){if(n.getUint8(l)===255&&n.getUint8(l+1)===225){s=l;break}l++}if(s&&(r=s+10,function(g,p,k){var w,B="";for(w=p,k+=p;w<k;w++)B+=String.fromCharCode(g.getUint8(w));return B}(n,s+4,4)==="Exif")){var u=n.getUint16(r);if(((o=u===18761)||u===19789)&&n.getUint16(r+2,o)===42){var h=n.getUint32(r+4,o);h>=8&&(a=r+h)}}if(a){for(var f=n.getUint16(a,o),m=0;m<f;m++)if(l=a+12*m+2,n.getUint16(l,o)===274){l+=8,e=n.getUint16(l,o),n.setUint16(l,1,o);break}}return e}catch{return null}}function ys(t,e){var n=e.getBoundingClientRect(),r=n.left,o=n.top,s={left:0,top:0},a=0;return t.forEach(function(c){s.left+=(c.clientX-r)/t.length,s.top+=(c.clientY-o)/t.length}),t.forEach(function(c){a+=is({x:s.left,y:s.top},{x:c.clientX-r,y:c.clientY-o})}),{centerMass:s,spread:a,count:t.length}}var ws={props:{touchMove:{type:Boolean,required:!0},mouseMove:{type:Boolean,required:!0},touchResize:{type:Boolean,required:!0},wheelResize:{type:[Boolean,Object],required:!0},eventsFilter:{type:Function,required:!1}},beforeMount:function(){window.addEventListener("mouseup",this.onMouseUp,{passive:!1}),window.addEventListener("mousemove",this.onMouseMove,{passive:!1}),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.onTouchEnd,{passive:!1})},beforeUnmount:function(){window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd)},created:function(){this.transforming=!1,this.debouncedProcessEnd=Mi(this.processEnd),this.touches=[]},methods:{processMove:function(t,e){if(this.touches.length){if(this.touches.length===1&&e.length===1)this.$emit("move",new Vt({left:this.touches[0].clientX-e[0].clientX,top:this.touches[0].clientY-e[0].clientY}));else if(this.touches.length>1&&this.touchResize){var n=ys(e,this.$refs.container),r=this.oldGeometricProperties;r.count===n.count&&r.count>1&&this.$emit("resize",new Vt({left:r.centerMass.left-n.centerMass.left,top:r.centerMass.top-n.centerMass.top},{factor:r.spread/n.spread,center:n.centerMass})),this.oldGeometricProperties=n}this.touches=e}},processEnd:function(){this.transforming&&(this.transforming=!1,this.$emit("transform-end"))},processStart:function(){this.transforming=!0,this.debouncedProcessEnd.clear()},processEvent:function(t){return this.eventsFilter?this.eventsFilter(t,this.transforming)!==!1:(t.preventDefault(),t.stopPropagation(),!0)},onTouchStart:function(t){if(t.cancelable&&(this.touchMove||this.touchResize&&t.touches.length>1)&&this.processEvent(t)){var e=this.$refs.container,n=e.getBoundingClientRect(),r=n.left,o=n.top,s=n.bottom,a=n.right;this.touches=it(t.touches).filter(function(c){return c.clientX>r&&c.clientX<a&&c.clientY>o&&c.clientY<s}),this.oldGeometricProperties=ys(this.touches,e)}},onTouchEnd:function(t){t.touches.length===0&&(this.touches=[],this.processEnd())},onTouchMove:function(t){var e=this;if(this.touches.length){var n=it(t.touches).filter(function(r){return!r.identifier||e.touches.find(function(o){return o.identifier===r.identifier})});this.processEvent(t)&&(this.processMove(t,n),this.processStart())}},onMouseDown:function(t){if(this.mouseMove&&"buttons"in t&&t.buttons===1&&this.processEvent(t)){var e={fake:!0,clientX:t.clientX,clientY:t.clientY};this.touches=[e],this.processStart()}},onMouseMove:function(t){this.touches.length&&this.processEvent(t)&&this.processMove(t,[{clientX:t.clientX,clientY:t.clientY}])},onMouseUp:function(){this.touches=[],this.processEnd()},onWheel:function(t){if(this.wheelResize&&this.processEvent(t)){var e=this.$refs.container.getBoundingClientRect(),n=e.left,r=e.top,o=1+this.wheelResize.ratio*(a=t.deltaY||t.detail||t.wheelDelta,(c=+a)==0||ns(c)?c:c>0?1:-1),s={left:t.clientX-n,top:t.clientY-r};this.$emit("resize",new Vt({},{factor:o,center:s})),this.touches.length||this.debouncedProcessEnd()}var a,c}},emits:["resize","move","transform-end"]};ws.render=function(t,e,n,r,o,s){return i.openBlock(),i.createBlock("div",{ref:"container",onTouchstart:e[1]||(e[1]=function(){return s.onTouchStart&&s.onTouchStart.apply(s,arguments)}),onMousedown:e[2]||(e[2]=function(){return s.onMouseDown&&s.onMouseDown.apply(s,arguments)}),onWheel:e[3]||(e[3]=function(){return s.onWheel&&s.onWheel.apply(s,arguments)})},[i.renderSlot(t.$slots,"default")],544)};var Oi={components:{TransformableImage:ws},props:{touchMove:{type:Boolean,required:!0},mouseMove:{type:Boolean,required:!0},touchResize:{type:Boolean,required:!0},wheelResize:{type:[Boolean,Object],required:!0}},emits:["resize","move"]};Oi.render=function(t,e,n,r,o,s){var a=i.resolveComponent("transformable-image");return i.openBlock(),i.createBlock(a,{"touch-move":n.touchMove,"touch-resize":n.touchResize,"mouse-move":n.mouseMove,"wheel-resize":n.wheelResize,onMove:e[1]||(e[1]=function(c){return t.$emit("move",c)}),onResize:e[2]||(e[2]=function(c){return t.$emit("resize",c)})},{default:i.withCtx(function(){return[i.renderSlot(t.$slots,"default")]}),_:3},8,["touch-move","touch-resize","mouse-move","wheel-resize"])};var xn=Be("vue-preview"),bs={props:{coordinates:{type:Object},transitions:{type:Object},image:{type:Object,default:function(){return{}}},imageClass:{type:String},width:{type:Number},height:{type:Number},fill:{type:Boolean}},data:function(){return{calculatedImageSize:{width:0,height:0},calculatedSize:{width:0,height:0}}},computed:{classes:function(){return{root:xn({fill:this.fill}),wrapper:xn("wrapper"),imageWrapper:xn("image-wrapper"),image:Y(xn("image"),this.imageClass)}},style:function(){if(this.fill)return{};var t={};return this.width&&(t.width="".concat(this.size.width,"px")),this.height&&(t.height="".concat(this.size.height,"px")),this.transitions&&this.transitions.enabled&&(t.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction)),t},wrapperStyle:function(){var t={width:"".concat(this.size.width,"px"),height:"".concat(this.size.height,"px"),left:"calc(50% - ".concat(this.size.width/2,"px)"),top:"calc(50% - ".concat(this.size.height/2,"px)")};return this.transitions&&this.transitions.enabled&&(t.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction)),t},imageStyle:function(){if(this.coordinates&&this.image){var t=this.coordinates.width/this.size.width,e=U(U({rotate:0,flip:{horizontal:!1,vertical:!1}},this.image.transforms),{},{scaleX:1/t,scaleY:1/t}),n=this.imageSize.width,r=this.imageSize.height,o=cs({width:n,height:r},e.rotate),s={width:"".concat(n,"px"),height:"".concat(r,"px"),left:"0px",top:"0px"},a={rotate:{left:(n-o.width)*e.scaleX/2,top:(r-o.height)*e.scaleY/2},scale:{left:(1-e.scaleX)*n/2,top:(1-e.scaleY)*r/2}};return s.transform=`translate(
42
- `.concat(-this.coordinates.left/t-a.rotate.left-a.scale.left,"px,").concat(-this.coordinates.top/t-a.rotate.top-a.scale.top,"px) ")+gs(e),this.transitions&&this.transitions.enabled&&(s.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction)),s}return{}},size:function(){return{width:this.width||this.calculatedSize.width,height:this.height||this.calculatedSize.height}},imageSize:function(){return{width:this.image.width||this.calculatedImageSize.width,height:this.image.height||this.calculatedImageSize.height}}},watch:{image:function(t){(t.width||t.height)&&this.onChangeImage()}},mounted:function(){var t=this;this.onChangeImage(),this.$refs.image.addEventListener("load",function(){t.refreshImage()}),window.addEventListener("resize",this.refresh),window.addEventListener("orientationchange",this.refresh)},unmounted:function(){window.removeEventListener("resize",this.refresh),window.removeEventListener("orientationchange",this.refresh)},methods:{refreshImage:function(){var t=this.$refs.image;this.calculatedImageSize.height=t.naturalHeight,this.calculatedImageSize.width=t.naturalWidth},refresh:function(){var t=this.$refs.root;this.width||(this.calculatedSize.width=t.clientWidth),this.height||(this.calculatedSize.height=t.clientHeight)},onChangeImage:function(){var t=this.$refs.image;t&&t.complete&&this.refreshImage(),this.refresh()}}};bs.render=function(t,e,n,r,o,s){return i.openBlock(),i.createBlock("div",{ref:"root",class:s.classes.root,style:s.style},[i.createVNode("div",{ref:"wrapper",class:s.classes.wrapper,style:s.wrapperStyle},[i.withDirectives(i.createVNode("img",{ref:"image",src:n.image&&n.image.src,class:s.classes.image,style:s.imageStyle},null,14,["src"]),[[i.vShow,n.image&&n.image.src]])],6)],6)};var Cs={components:{Preview:bs},inheritAttrs:!1};Cs.render=function(t,e,n,r,o,s){var a=i.resolveComponent("preview");return i.openBlock(),i.createBlock(a,i.mergeProps(t.$attrs,{fill:!0}),null,16)};var Di=Be("vue-rectangle-stencil"),Ss={name:"RectangleStencil",components:{StencilPreview:Cs,BoundingBox:ms,DraggableArea:ps},props:{image:{type:Object},coordinates:{type:Object},stencilCoordinates:{type:Object},handlers:{type:Object},handlersComponent:{type:[Object,String],default:function(){return Ti}},lines:{type:Object},linesComponent:{type:[Object,String],default:function(){return zi}},aspectRatio:{type:[Number,String]},minAspectRatio:{type:[Number,String]},maxAspectRatio:{type:[Number,String]},movable:{type:Boolean,default:!0},resizable:{type:Boolean,default:!0},transitions:{type:Object},movingClass:{type:String},resizingClass:{type:String},previewClass:{type:String},boundingBoxClass:{type:String},linesClasses:{type:Object,default:function(){return{}}},linesWrappersClasses:{type:Object,default:function(){return{}}},handlersClasses:{type:Object,default:function(){return{}}},handlersWrappersClasses:{type:Object,default:function(){return{}}}},data:function(){return{moving:!1,resizing:!1}},computed:{classes:function(){return{stencil:Y(Di({movable:this.movable,moving:this.moving,resizing:this.resizing}),this.moving&&this.movingClass,this.resizing&&this.resizingClass),preview:Y(Di("preview"),this.previewClass),boundingBox:Y(Di("bounding-box"),this.boundingBoxClass)}},style:function(){var t=this.stencilCoordinates,e=t.height,n=t.width,r=t.left,o=t.top,s={width:"".concat(n,"px"),height:"".concat(e,"px"),transform:"translate(".concat(r,"px, ").concat(o,"px)")};return this.transitions&&this.transitions.enabled&&(s.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction)),s}},methods:{onMove:function(t){this.$emit("move",t),this.moving=!0},onMoveEnd:function(){this.$emit("move-end"),this.moving=!1},onResize:function(t){this.$emit("resize",t),this.resizing=!0},onResizeEnd:function(){this.$emit("resize-end"),this.resizing=!1},aspectRatios:function(){return{minimum:this.aspectRatio||this.minAspectRatio,maximum:this.aspectRatio||this.maxAspectRatio}}},emits:["resize","resize-end","move","move-end"]};Ss.render=function(t,e,n,r,o,s){var a=i.resolveComponent("stencil-preview"),c=i.resolveComponent("draggable-area"),l=i.resolveComponent("bounding-box");return i.openBlock(),i.createBlock("div",{class:s.classes.stencil,style:s.style},[i.createVNode(l,{width:n.stencilCoordinates.width,height:n.stencilCoordinates.height,transitions:n.transitions,class:s.classes.boundingBox,handlers:n.handlers,"handlers-component":n.handlersComponent,"handlers-classes":n.handlersClasses,"handlers-wrappers-classes":n.handlersWrappersClasses,lines:n.lines,"lines-component":n.linesComponent,"lines-classes":n.linesClasses,"lines-wrappers-classes":n.linesWrappersClasses,resizable:n.resizable,onResize:s.onResize,onResizeEnd:s.onResizeEnd},{default:i.withCtx(function(){return[i.createVNode(c,{movable:n.movable,onMove:s.onMove,onMoveEnd:s.onMoveEnd},{default:i.withCtx(function(){return[i.createVNode(a,{image:n.image,coordinates:n.coordinates,width:n.stencilCoordinates.width,height:n.stencilCoordinates.height,class:s.classes.preview,transitions:n.transitions},null,8,["image","coordinates","width","height","class","transitions"])]}),_:1},8,["movable","onMove","onMoveEnd"])]}),_:1},8,["width","height","transitions","class","handlers","handlers-component","handlers-classes","handlers-wrappers-classes","lines","lines-component","lines-classes","lines-wrappers-classes","resizable","onResize","onResizeEnd"])],6)};var Xh=["transitions"],Le=Be("vue-advanced-cropper"),ks={name:"Cropper",components:{BackgroundWrapper:Oi},props:{src:{type:String,default:null},stencilComponent:{type:[Object,String],default:function(){return Ss}},backgroundWrapperComponent:{type:[Object,String],default:function(){return Oi}},stencilProps:{type:Object,default:function(){return{}}},autoZoom:{type:Boolean,default:!1},imageClass:{type:String},boundariesClass:{type:String},backgroundClass:{type:String},foregroundClass:{type:String},minWidth:{type:[Number,String]},minHeight:{type:[Number,String]},maxWidth:{type:[Number,String]},maxHeight:{type:[Number,String]},debounce:{type:[Boolean,Number],default:500},transitions:{type:Boolean,default:!0},checkOrientation:{type:Boolean,default:!0},canvas:{type:[Object,Boolean],default:!0},crossOrigin:{type:[Boolean,String],default:void 0},transitionTime:{type:Number,default:300},imageRestriction:{type:String,default:"fit-area",validator:function(t){return Rh.indexOf(t)!==-1}},roundResult:{type:Boolean,default:!0},defaultSize:{type:[Function,Object]},defaultPosition:{type:[Function,Object]},defaultVisibleArea:{type:[Function,Object]},defaultTransforms:{type:[Function,Object]},defaultBoundaries:{type:[Function,String],validator:function(t){return!(typeof t=="string"&&t!=="fill"&&t!=="fit")}},priority:{type:String,default:"coordinates"},stencilSize:{type:[Object,Function]},resizeImage:{type:[Boolean,Object],default:!0},moveImage:{type:[Boolean,Object],default:!0},autoZoomAlgorithm:{type:Function},resizeAlgorithm:{type:Function,default:function(t){var e=t.event,n=t.coordinates,r=t.aspectRatio,o=t.positionRestrictions,s=t.sizeRestrictions,a=I(I({},n),{right:n.left+n.width,bottom:n.top+n.height}),c=e.params||{},l=I({},e.directions),u=c.allowedDirections||{left:!0,right:!0,bottom:!0,top:!0};s.widthFrozen&&(l.left=0,l.right=0),s.heightFrozen&&(l.top=0,l.bottom=0),Ae.forEach(function(F){u[F]||(l[F]=0)});var h=Pe(a,l=fs({coordinates:a,directions:l,sizeRestrictions:s,positionRestrictions:o})).width,f=Pe(a,l).height,m=c.preserveRatio?W(a):Ai(h/f,r);if(m){var g=c.respectDirection;if(g||(g=a.width>=a.height||m===1?"width":"height"),g==="width"){var p=h/m-a.height;if(u.top&&u.bottom){var k=l.top,w=l.bottom;l.bottom=vn(p,w,k),l.top=vn(p,k,w)}else u.bottom?l.bottom=p:u.top?l.top=p:u.right?l.right=0:u.left&&(l.left=0)}else if(g==="height"){var B=a.width-f*m;if(u.left&&u.right){var D=l.left,L=l.right;l.left=-vn(B,D,L),l.right=-vn(B,L,D)}else u.left?l.left=-B:u.right?l.right=-B:u.top?l.top=0:u.bottom&&(l.bottom=0)}l=fs({directions:l,coordinates:a,sizeRestrictions:s,positionRestrictions:o,preserveRatio:!0,compensate:c.compensate})}return h=Pe(a,l).width,f=Pe(a,l).height,(m=c.preserveRatio?W(a):Ai(h/f,r))&&Math.abs(m-h/f)>.001&&Ae.forEach(function(F){u[F]||(l[F]=0)}),Pi({event:new Ri({left:-l.left,top:-l.top}),coordinates:{width:n.width+l.right+l.left,height:n.height+l.top+l.bottom,left:n.left,top:n.top},positionRestrictions:o})}},moveAlgorithm:{type:Function,default:Pi},initStretcher:{type:Function,default:function(t){var e=t.stretcher,n=t.imageSize,r=W(n);e.style.width=n.width+"px",e.style.height=e.clientWidth/r+"px",e.style.width=e.clientWidth+"px"}},fitCoordinates:{type:Function,default:function(t){var e=t.visibleArea,n=t.coordinates,r=t.aspectRatio,o=t.sizeRestrictions,s=t.positionRestrictions,a=I(I({},n),De({width:n.width,height:n.height,aspectRatio:r,sizeRestrictions:{maxWidth:e.width,maxHeight:e.height,minHeight:Math.min(e.height,o.minHeight),minWidth:Math.min(e.width,o.minWidth)}}));return a=ae(a=me(a,pt(se(n),se(a))),kn(Ie(e),s))}},fitVisibleArea:{type:Function,default:function(t){var e=t.visibleArea,n=t.boundaries,r=t.getAreaRestrictions,o=t.coordinates,s=I({},e);s.height=s.width/W(n),s.top+=(e.height-s.height)/2,(o.height-s.height>0||o.width-s.width>0)&&(s=ke(s,Math.max(o.height/s.height,o.width/s.width)));var a=Cn(yt(o,Ie(s=ke(s,Sn(s,r({visibleArea:s,type:"resize"}))))));return s.width<o.width&&(a.left=0),s.height<o.height&&(a.top=0),s=ae(s=me(s,a),r({visibleArea:s,type:"move"}))}},areaRestrictionsAlgorithm:{type:Function,default:function(t){var e=t.visibleArea,n=t.boundaries,r=t.imageSize,o=t.imageRestriction,s=t.type,a={};return o==="fill-area"?a={left:0,top:0,right:r.width,bottom:r.height}:o==="fit-area"&&(W(n)>W(r)?(a={top:0,bottom:r.height},e&&s==="move"&&(e.width>r.width?(a.left=-(e.width-r.width)/2,a.right=r.width-a.left):(a.left=0,a.right=r.width))):(a={left:0,right:r.width},e&&s==="move"&&(e.height>r.height?(a.top=-(e.height-r.height)/2,a.bottom=r.height-a.top):(a.top=0,a.bottom=r.height)))),a}},sizeRestrictionsAlgorithm:{type:Function,default:function(t){return{minWidth:t.minWidth,minHeight:t.minHeight,maxWidth:t.maxWidth,maxHeight:t.maxHeight}}},positionRestrictionsAlgorithm:{type:Function,default:function(t){var e=t.imageSize,n={};return t.imageRestriction!=="none"&&(n={left:0,top:0,right:e.width,bottom:e.height}),n}}},data:function(){return{transitionsActive:!1,imageLoaded:!1,imageAttributes:{width:null,height:null,crossOrigin:null,src:null},defaultImageTransforms:{rotate:0,flip:{horizontal:!1,vertical:!1}},appliedImageTransforms:{rotate:0,flip:{horizontal:!1,vertical:!1}},boundaries:{width:0,height:0},visibleArea:null,coordinates:U({},ss)}},computed:{image:function(){return{src:this.imageAttributes.src,width:this.imageAttributes.width,height:this.imageAttributes.height,transforms:this.imageTransforms}},imageTransforms:function(){return{rotate:this.appliedImageTransforms.rotate,flip:{horizontal:this.appliedImageTransforms.flip.horizontal,vertical:this.appliedImageTransforms.flip.vertical},translateX:this.visibleArea?this.visibleArea.left/this.coefficient:0,translateY:this.visibleArea?this.visibleArea.top/this.coefficient:0,scaleX:1/this.coefficient,scaleY:1/this.coefficient}},imageSize:function(){var t=function(e){return e*Math.PI/180}(this.imageTransforms.rotate);return{width:Math.abs(this.imageAttributes.width*Math.cos(t))+Math.abs(this.imageAttributes.height*Math.sin(t)),height:Math.abs(this.imageAttributes.width*Math.sin(t))+Math.abs(this.imageAttributes.height*Math.cos(t))}},initialized:function(){return!!(this.visibleArea&&this.imageLoaded)},settings:function(){var t=Bi(this.resizeImage,{touch:!0,wheel:{ratio:.1},adjustStencil:!0},{touch:!1,wheel:!1,adjustStencil:!1});return{moveImage:Bi(this.moveImage,{touch:!0,mouse:!0},{touch:!1,mouse:!1}),resizeImage:t}},coefficient:function(){return this.visibleArea?this.visibleArea.width/this.boundaries.width:0},areaRestrictions:function(){return this.imageLoaded?this.areaRestrictionsAlgorithm({imageSize:this.imageSize,imageRestriction:this.imageRestriction,boundaries:this.boundaries}):{}},transitionsOptions:function(){return{enabled:this.transitionsActive,timingFunction:"ease-in-out",time:350}},sizeRestrictions:function(){if(this.boundaries.width&&this.boundaries.height&&this.imageSize.width&&this.imageSize.height){var t=this.sizeRestrictionsAlgorithm({imageSize:this.imageSize,minWidth:ne(this.minWidth)?0:bn(this.minWidth),minHeight:ne(this.minHeight)?0:bn(this.minHeight),maxWidth:ne(this.maxWidth)?1/0:bn(this.maxWidth),maxHeight:ne(this.maxHeight)?1/0:bn(this.maxHeight)});if(t=function(r){var o=r.areaRestrictions,s=r.sizeRestrictions,a=r.boundaries,c=r.positionRestrictions,l=I(I({},s),{minWidth:s.minWidth!==void 0?s.minWidth:0,minHeight:s.minHeight!==void 0?s.minHeight:0,maxWidth:s.maxWidth!==void 0?s.maxWidth:1/0,maxHeight:s.maxHeight!==void 0?s.maxHeight:1/0});c.left!==void 0&&c.right!==void 0&&(l.maxWidth=Math.min(l.maxWidth,c.right-c.left)),c.bottom!==void 0&&c.top!==void 0&&(l.maxHeight=Math.min(l.maxHeight,c.bottom-c.top));var u=Ii(o),h=ls(a,u);return u.width<1/0&&(!l.maxWidth||l.maxWidth>h.width)&&(l.maxWidth=Math.min(l.maxWidth,h.width)),u.height<1/0&&(!l.maxHeight||l.maxHeight>h.height)&&(l.maxHeight=Math.min(l.maxHeight,h.height)),l.minWidth>l.maxWidth&&(l.minWidth=l.maxWidth,l.widthFrozen=!0),l.minHeight>l.maxHeight&&(l.minHeight=l.maxHeight,l.heightFrozen=!0),l}({sizeRestrictions:t,areaRestrictions:this.getAreaRestrictions({visibleArea:this.visibleArea,type:"resize"}),imageSize:this.imageSize,boundaries:this.boundaries,positionRestrictions:this.positionRestrictions,imageRestriction:this.imageRestriction,visibleArea:this.visibleArea,stencilSize:this.getStencilSize()}),this.visibleArea&&this.stencilSize){var e=this.getStencilSize(),n=Ii(this.getAreaRestrictions({visibleArea:this.visibleArea,type:"resize"}));t.maxWidth=Math.min(t.maxWidth,n.width*e.width/this.boundaries.width),t.maxHeight=Math.min(t.maxHeight,n.height*e.height/this.boundaries.height),t.maxWidth<t.minWidth&&(t.minWidth=t.maxWidth),t.maxHeight<t.minHeight&&(t.minHeight=t.maxHeight)}return t}return{minWidth:0,minHeight:0,maxWidth:0,maxHeight:0}},positionRestrictions:function(){return this.positionRestrictionsAlgorithm({imageSize:this.imageSize,imageRestriction:this.imageRestriction})},classes:function(){return{cropper:Le(),image:Y(Le("image"),this.imageClass),stencil:Le("stencil"),boundaries:Y(Le("boundaries"),this.boundariesClass),stretcher:Y(Le("stretcher")),background:Y(Le("background"),this.backgroundClass),foreground:Y(Le("foreground"),this.foregroundClass),imageWrapper:Y(Le("image-wrapper")),cropperWrapper:Y(Le("cropper-wrapper"))}},stencilCoordinates:function(){if(this.initialized){var t=this.coordinates,e=t.width,n=t.height,r=t.left,o=t.top;return{width:e/this.coefficient,height:n/this.coefficient,left:(r-this.visibleArea.left)/this.coefficient,top:(o-this.visibleArea.top)/this.coefficient}}return this.defaultCoordinates()},boundariesStyle:function(){var t={width:this.boundaries.width?"".concat(Math.round(this.boundaries.width),"px"):"auto",height:this.boundaries.height?"".concat(Math.round(this.boundaries.height),"px"):"auto",transition:"opacity ".concat(this.transitionTime,"ms"),pointerEvents:this.imageLoaded?"all":"none"};return this.imageLoaded||(t.opacity="0"),t},imageStyle:function(){var t=this.imageAttributes.width>this.imageAttributes.height?{width:Math.min(1024,this.imageAttributes.width),height:Math.min(1024,this.imageAttributes.width)/(this.imageAttributes.width/this.imageAttributes.height)}:{height:Math.min(1024,this.imageAttributes.height),width:Math.min(1024,this.imageAttributes.height)*(this.imageAttributes.width/this.imageAttributes.height)},e={left:(t.width-this.imageSize.width)/(2*this.coefficient),top:(t.height-this.imageSize.height)/(2*this.coefficient)},n={left:(1-1/this.coefficient)*t.width/2,top:(1-1/this.coefficient)*t.height/2},r=U(U({},this.imageTransforms),{},{scaleX:this.imageTransforms.scaleX*(this.imageAttributes.width/t.width),scaleY:this.imageTransforms.scaleY*(this.imageAttributes.height/t.height)}),o={width:"".concat(t.width,"px"),height:"".concat(t.height,"px"),left:"0px",top:"0px",transform:"translate(".concat(-e.left-n.left-this.imageTransforms.translateX,"px, ").concat(-e.top-n.top-this.imageTransforms.translateY,"px)")+gs(r)};return this.transitionsOptions.enabled&&(o.transition="".concat(this.transitionsOptions.time,"ms ").concat(this.transitionsOptions.timingFunction)),o}},watch:{src:function(){this.onChangeImage()},stencilComponent:function(){var t=this;this.$nextTick(function(){t.resetCoordinates(),t.runAutoZoom("setCoordinates"),t.onChange()})},minWidth:function(){this.onPropsChange()},maxWidth:function(){this.onPropsChange()},minHeight:function(){this.onPropsChange()},maxHeight:function(){this.onPropsChange()},imageRestriction:function(){this.reset()},stencilProps:function(t,e){["aspectRatio","minAspectRatio","maxAspectRatio"].find(function(n){return t[n]!==e[n]})&&this.$nextTick(this.onPropsChange)}},created:function(){this.debouncedUpdate=Mi(this.update,this.debounce),this.debouncedDisableTransitions=Mi(this.disableTransitions,this.transitionsOptions.time),this.awaiting=!1},mounted:function(){this.$refs.image.addEventListener("load",this.onSuccessLoadImage),this.$refs.image.addEventListener("error",this.onFailLoadImage),this.onChangeImage(),window.addEventListener("resize",this.refresh),window.addEventListener("orientationchange",this.refresh)},unmounted:function(){window.removeEventListener("resize",this.refresh),window.removeEventListener("orientationchange",this.refresh),this.imageAttributes.revoke&&this.imageAttributes.src&&URL.revokeObjectURL(this.imageAttributes.src),this.debouncedUpdate.clear(),this.debouncedDisableTransitions.clear()},methods:{getResult:function(){var t=this.initialized?this.prepareResult(U({},this.coordinates)):this.defaultCoordinates(),e={rotate:this.imageTransforms.rotate%360,flip:U({},this.imageTransforms.flip)};if(this.src&&this.imageLoaded){var n=this;return{image:this.image,coordinates:t,visibleArea:this.visibleArea?U({},this.visibleArea):null,imageTransforms:e,get canvas(){return n.canvas?n.getCanvas():void 0}}}return{image:this.image,coordinates:t,visibleArea:this.visibleArea?U({},this.visibleArea):null,canvas:void 0,imageTransforms:e}},zoom:function(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.transitions,o=r===void 0||r;this.onManipulateImage(new Vt({},{factor:1/t,center:e}),{normalize:!1,transitions:o})},move:function(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.transitions,o=r===void 0||r;this.onManipulateImage(new Vt({left:t||0,top:e||0}),{normalize:!1,transitions:o})},setCoordinates:function(t){var e=this,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.autoZoom,o=r===void 0||r,s=n.transitions,a=s===void 0||s;this.$nextTick(function(){e.imageLoaded?(e.transitionsActive||(a&&e.enableTransitions(),e.coordinates=e.applyTransform(t),o&&e.runAutoZoom("setCoordinates"),a&&e.debouncedDisableTransitions()),e.onChange()):e.delayedTransforms=t})},refresh:function(){var t=this,e=this.$refs.image;if(this.src&&e)return this.initialized?this.updateVisibleArea().then(function(){t.onChange()}):this.resetVisibleArea().then(function(){t.onChange()})},reset:function(){var t=this;return this.resetVisibleArea().then(function(){t.onChange(!1)})},awaitRender:function(t){var e=this;this.awaiting||(this.awaiting=!0,this.$nextTick(function(){t(),e.awaiting=!1}))},prepareResult:function(t){return this.roundResult?function(e){var n=e.coordinates,r=e.sizeRestrictions,o=e.positionRestrictions,s={width:Math.round(n.width),height:Math.round(n.height),left:Math.round(n.left),top:Math.round(n.top)};return s.width>r.maxWidth?s.width=Math.floor(n.width):s.width<r.minWidth&&(s.width=Math.ceil(n.width)),s.height>r.maxHeight?s.height=Math.floor(n.height):s.height<r.minHeight&&(s.height=Math.ceil(n.height)),ae(s,o)}(U(U({},this.getPublicProperties()),{},{positionRestrictions:En(this.positionRestrictions,this.visibleArea),coordinates:t})):t},processAutoZoom:function(t,e,n,r){var o=this.autoZoomAlgorithm;o||(o=this.stencilSize?Ah:this.autoZoom?Ih:Ph);var s=o({event:{type:t,params:r},visibleArea:e,coordinates:n,boundaries:this.boundaries,aspectRatio:this.getAspectRatio(),positionRestrictions:this.positionRestrictions,getAreaRestrictions:this.getAreaRestrictions,sizeRestrictions:this.sizeRestrictions,stencilSize:this.getStencilSize()});return U(U({},s),{},{changed:!as(s.visibleArea,e)||!as(s.coordinates,n)})},runAutoZoom:function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=e.transitions,r=n!==void 0&&n,o=Ch(e,Xh),s=this.processAutoZoom(t,this.visibleArea,this.coordinates,o),a=s.visibleArea,c=s.coordinates,l=s.changed;r&&l&&this.enableTransitions(),this.visibleArea=a,this.coordinates=c,r&&l&&this.debouncedDisableTransitions()},normalizeEvent:function(t){return function(e){var n=e.event,r=e.visibleArea,o=e.coefficient;if(n.type==="manipulateImage")return I(I({},n),{move:{left:n.move&&n.move.left?o*n.move.left:0,top:n.move&&n.move.top?o*n.move.top:0},scale:{factor:n.scale&&n.scale.factor?n.scale.factor:1,center:n.scale&&n.scale.center?{left:n.scale.center.left*o+r.left,top:n.scale.center.top*o+r.top}:null}});if(n.type==="resize"){var s=I(I({},n),{directions:I({},n.directions)});return Ae.forEach(function(c){s.directions[c]*=o}),s}if(n.type==="move"){var a=I(I({},n),{directions:I({},n.directions)});return Bh.forEach(function(c){a.directions[c]*=o}),a}return n}(U(U({},this.getPublicProperties()),{},{event:t}))},getCanvas:function(){if(this.$refs.canvas){var t=this.$refs.canvas,e=this.$refs.image,n=this.imageTransforms.rotate!==0||this.imageTransforms.flip.horizontal||this.imageTransforms.flip.vertical?function(c,l,u){var h=u.rotate,f=u.flip,m={width:l.naturalWidth,height:l.naturalHeight},g=cs(m,h),p=c.getContext("2d");c.height=g.height,c.width=g.width,p.save();var k=We(se(I({left:0,top:0},m)),h);return p.translate(-(k.left-g.width/2),-(k.top-g.height/2)),p.rotate(h*Math.PI/180),p.translate(f.horizontal?m.width:0,f.vertical?m.height:0),p.scale(f.horizontal?-1:1,f.vertical?-1:1),p.drawImage(l,0,0,m.width,m.height),p.restore(),c}(this.$refs.sourceCanvas,e,this.imageTransforms):e,r=U({minWidth:0,minHeight:0,maxWidth:1/0,maxHeight:1/0,maxArea:this.maxCanvasSize,imageSmoothingEnabled:!0,imageSmoothingQuality:"high",fillColor:"transparent"},this.canvas),o=function(c){return c.find(function(l){return u=l,!Number.isNaN(parseFloat(u))&&isFinite(u);var u})},s=De({sizeRestrictions:{minWidth:o([r.width,r.minWidth])||0,minHeight:o([r.height,r.minHeight])||0,maxWidth:o([r.width,r.maxWidth])||1/0,maxHeight:o([r.height,r.maxHeight])||1/0},width:this.coordinates.width,height:this.coordinates.height,aspectRatio:{minimum:this.coordinates.width/this.coordinates.height,maximum:this.coordinates.width/this.coordinates.height}});if(r.maxArea&&s.width*s.height>r.maxArea){var a=Math.sqrt(r.maxArea/(s.width*s.height));s={width:Math.round(a*s.width),height:Math.round(a*s.height)}}return function(c,l,u,h,f){c.width=h?h.width:u.width,c.height=h?h.height:u.height;var m=c.getContext("2d");m.clearRect(0,0,c.width,c.height),f&&(f.imageSmoothingEnabled&&(m.imageSmoothingEnabled=f.imageSmoothingEnabled),f.imageSmoothingQuality&&(m.imageSmoothingQuality=f.imageSmoothingQuality),f.fillColor&&(m.fillStyle=f.fillColor,m.fillRect(0,0,c.width,c.height),m.save()));var g=u.left<0?-u.left:0,p=u.top<0?-u.top:0;m.drawImage(l,u.left+g,u.top+p,u.width,u.height,g*(c.width/u.width),p*(c.height/u.height),c.width,c.height)}(t,n,this.coordinates,s,r),t}},update:function(){this.$emit("change",this.getResult())},applyTransform:function(t){var e=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n=this.visibleArea&&e?$h(this.sizeRestrictions,this.visibleArea):this.sizeRestrictions,r=this.visibleArea&&e?En(this.positionRestrictions,this.visibleArea):this.positionRestrictions;return Nh({transform:t,coordinates:this.coordinates,imageSize:this.imageSize,sizeRestrictions:n,positionRestrictions:r,aspectRatio:this.getAspectRatio(),visibleArea:this.visibleArea})},resetCoordinates:function(){var t=this;if(this.$refs.image){this.$refs.cropper,this.$refs.image;var e=this.defaultSize;e||(e=this.stencilSize?Vh:zh);var n=this.sizeRestrictions;n.minWidth,n.minHeight,n.maxWidth,n.maxHeight;var r=mt(e)?e({boundaries:this.boundaries,imageSize:this.imageSize,aspectRatio:this.getAspectRatio(),sizeRestrictions:this.sizeRestrictions,stencilSize:this.getStencilSize(),visibleArea:this.visibleArea}):e,o=this.defaultPosition||Th,s=[r,function(a){var c=a.coordinates;return U({},mt(o)?o({coordinates:c,imageSize:t.imageSize,visibleArea:t.visibleArea}):t.defaultPosition)}];this.delayedTransforms&&s.push.apply(s,it(Array.isArray(this.delayedTransforms)?this.delayedTransforms:[this.delayedTransforms])),this.coordinates=this.applyTransform(s,!0),this.delayedTransforms=null}},clearImage:function(){var t=this;this.imageLoaded=!1,setTimeout(function(){var e=t.$refs.stretcher;e&&(e.style.height="auto",e.style.width="auto"),t.coordinates=t.defaultCoordinates(),t.boundaries={width:0,height:0}},this.transitionTime)},enableTransitions:function(){this.transitions&&(this.transitionsActive=!0)},disableTransitions:function(){this.transitionsActive=!1},updateBoundaries:function(){var t=this,e=this.$refs.stretcher,n=this.$refs.cropper;return this.initStretcher({cropper:n,stretcher:e,imageSize:this.imageSize}),this.$nextTick().then(function(){var r={cropper:n,imageSize:t.imageSize};if(mt(t.defaultBoundaries)?t.boundaries=t.defaultBoundaries(r):t.defaultBoundaries==="fit"?t.boundaries=function(o){var s=o.cropper,a=o.imageSize,c=s.clientHeight,l=s.clientWidth,u=c,h=a.width*c/a.height;return h>l&&(h=l,u=a.height*l/a.width),{width:h,height:u}}(r):t.boundaries=function(o){var s=o.cropper;return{width:s.clientWidth,height:s.clientHeight}}(r),!t.boundaries.width||!t.boundaries.height)throw new Error("It's impossible to fit the cropper in the current container")})},resetVisibleArea:function(){var t=this;return this.appliedImageTransforms=U(U({},this.defaultImageTransforms),{},{flip:U({},this.defaultImageTransforms.flip)}),this.updateBoundaries().then(function(){t.priority!=="visible-area"&&(t.visibleArea=null,t.resetCoordinates());var e,n,r,o,s,a,c=t.defaultVisibleArea||Fh;t.visibleArea=mt(c)?c({imageSize:t.imageSize,boundaries:t.boundaries,coordinates:t.priority!=="visible-area"?t.coordinates:null,getAreaRestrictions:t.getAreaRestrictions,stencilSize:t.getStencilSize()}):t.defaultVisibleArea,t.visibleArea=(e={visibleArea:t.visibleArea,boundaries:t.boundaries,getAreaRestrictions:t.getAreaRestrictions},n=e.visibleArea,r=e.boundaries,o=e.getAreaRestrictions,s=I({},n),a=W(r),s.width/s.height!==a&&(s.height=s.width/a),ae(s,o({visibleArea:s,type:"move"}))),t.priority==="visible-area"?t.resetCoordinates():t.coordinates=t.fitCoordinates({visibleArea:t.visibleArea,coordinates:t.coordinates,aspectRatio:t.getAspectRatio(),positionRestrictions:t.positionRestrictions,sizeRestrictions:t.sizeRestrictions}),t.runAutoZoom("resetVisibleArea")}).catch(function(){t.visibleArea=null})},updateVisibleArea:function(){var t=this;return this.updateBoundaries().then(function(){t.visibleArea=t.fitVisibleArea({imageSize:t.imageSize,boundaries:t.boundaries,visibleArea:t.visibleArea,coordinates:t.coordinates,getAreaRestrictions:t.getAreaRestrictions}),t.coordinates=t.fitCoordinates({visibleArea:t.visibleArea,coordinates:t.coordinates,aspectRatio:t.getAspectRatio(),positionRestrictions:t.positionRestrictions,sizeRestrictions:t.sizeRestrictions}),t.runAutoZoom("updateVisibleArea")}).catch(function(){t.visibleArea=null})},onChange:function(){var t=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];t&&this.debounce?this.debouncedUpdate():this.update()},onChangeImage:function(){var t,e=this;if(this.imageLoaded=!1,this.delayedTransforms=null,this.src){if(function(o){if(es(o))return!1;var s=window.location,a=/(\w+:)?(?:\/\/)([\w.-]+)?(?::(\d+))?\/?/.exec(o)||[],c={protocol:a[1]||"",host:a[2]||"",port:a[3]||""},l=function(u){return u.port||((u.protocol||s.protocol)==="http"?80:433)};return!(!c.protocol&&!c.host&&!c.port||c.protocol&&c.protocol==s.protocol&&c.host&&c.host==s.host&&c.host&&l(c)==l(s))}(this.src)){var n=ne(this.crossOrigin)?this.canvas:this.crossOrigin;n===!0&&(n="anonymous"),this.imageAttributes.crossOrigin=n||null}if(this.checkOrientation){var r=(t=this.src,new Promise(function(o){Zh(t).then(function(s){var a=Jh(s);o(s?{source:t,arrayBuffer:s,orientation:a}:{source:t,arrayBuffer:null,orientation:null})}).catch(function(s){console.warn(s),o({source:t,arrayBuffer:null,orientation:null})})}));setTimeout(function(){r.then(e.onParseImage)},this.transitionTime)}else setTimeout(function(){e.onParseImage({source:e.src})},this.transitionTime)}else this.clearImage()},onFailLoadImage:function(){this.imageAttributes.src&&(this.clearImage(),this.$emit("error"))},onSuccessLoadImage:function(){var t=this,e=this.$refs.image;e&&!this.imageLoaded&&(this.imageAttributes.height=e.naturalHeight,this.imageAttributes.width=e.naturalWidth,this.imageLoaded=!0,this.resetVisibleArea().then(function(){t.$emit("ready"),t.onChange(!1)}))},onParseImage:function(t){var e=this,n=t.source,r=t.arrayBuffer,o=t.orientation;this.imageAttributes.revoke&&this.imageAttributes.src&&URL.revokeObjectURL(this.imageAttributes.src),this.imageAttributes.revoke=!1,r&&o&&o>1?Ko(n)||!es(n)?(this.imageAttributes.src=URL.createObjectURL(new Blob([r])),this.imageAttributes.revoke=!0):this.imageAttributes.src=function(s){for(var a=[],c=new Uint8Array(s);c.length>0;){var l=c.subarray(0,8192);a.push(String.fromCharCode.apply(null,Array.from?Array.from(l):l.slice())),c=c.subarray(8192)}return"data:image/jpeg;base64,"+btoa(a.join(""))}(r):this.imageAttributes.src=n,mt(this.defaultTransforms)?this.appliedImageTransforms=Fi(this.defaultTransforms()):wn(this.defaultTransforms)?this.appliedImageTransforms=Fi(this.defaultTransforms):this.appliedImageTransforms=function(s){var a=Fi({});if(s)switch(s){case 2:a.flip.horizontal=!0;break;case 3:a.rotate=-180;break;case 4:a.flip.vertical=!0;break;case 5:a.rotate=90,a.flip.vertical=!0;break;case 6:a.rotate=90;break;case 7:a.rotate=90,a.flip.horizontal=!0;break;case 8:a.rotate=-90}return a}(o),this.defaultImageTransforms=U(U({},this.appliedImageTransforms),{},{flip:U({},this.appliedImageTransforms.flip)}),this.$nextTick(function(){var s=e.$refs.image;s&&s.complete&&(function(a){return!!a.naturalWidth}(s)?e.onSuccessLoadImage():e.onFailLoadImage())})},onResizeEnd:function(){this.runAutoZoom("resize",{transitions:!0})},onMoveEnd:function(){this.runAutoZoom("move",{transitions:!0})},onMove:function(t){var e=this;this.transitionsOptions.enabled||this.awaitRender(function(){e.coordinates=e.moveAlgorithm(U(U({},e.getPublicProperties()),{},{positionRestrictions:En(e.positionRestrictions,e.visibleArea),coordinates:e.coordinates,event:e.normalizeEvent(t)})),e.onChange()})},onResize:function(t){var e=this;this.transitionsOptions.enabled||this.stencilSize&&!this.autoZoom||this.awaitRender(function(){var n=e.sizeRestrictions,r=Math.min(e.coordinates.width,e.coordinates.height,20*e.coefficient);e.coordinates=e.resizeAlgorithm(U(U({},e.getPublicProperties()),{},{positionRestrictions:En(e.positionRestrictions,e.visibleArea),sizeRestrictions:{maxWidth:Math.min(n.maxWidth,e.visibleArea.width),maxHeight:Math.min(n.maxHeight,e.visibleArea.height),minWidth:Math.max(n.minWidth,r),minHeight:Math.max(n.minHeight,r)},event:e.normalizeEvent(t)})),e.onChange(),e.ticking=!1})},onManipulateImage:function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.transitionsOptions.enabled){var n=e.transitions,r=n!==void 0&&n,o=e.normalize,s=o===void 0||o;r&&this.enableTransitions();var a=Oh(U(U({},this.getPublicProperties()),{},{event:s?this.normalizeEvent(t):t,getAreaRestrictions:this.getAreaRestrictions,imageRestriction:this.imageRestriction,adjustStencil:!this.stencilSize&&this.settings.resizeImage.adjustStencil})),c=a.visibleArea,l=a.coordinates;this.visibleArea=c,this.coordinates=l,this.runAutoZoom("manipulateImage"),this.onChange(),r&&this.debouncedDisableTransitions()}},onPropsChange:function(){this.coordinates=this.applyTransform(this.coordinates,!0),this.onChange(!1)},getAreaRestrictions:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=t.visibleArea,n=t.type,r=n===void 0?"move":n;return this.areaRestrictionsAlgorithm({boundaries:this.boundaries,imageSize:this.imageSize,imageRestriction:this.imageRestriction,visibleArea:e,type:r})},getAspectRatio:function(t){var e,n,r=this.stencilProps,o=r.aspectRatio,s=r.minAspectRatio,a=r.maxAspectRatio;if(this.$refs.stencil&&this.$refs.stencil.aspectRatios){var c=this.$refs.stencil.aspectRatios();e=c.minimum,n=c.maximum}if(ne(e)&&(e=ne(o)?s:o),ne(n)&&(n=ne(o)?a:o),!t&&(ne(e)||ne(n))){var l=this.getStencilSize(),u=l?W(l):null;ne(e)&&(e=ts(u)?u:void 0),ne(n)&&(n=ts(u)?u:void 0)}return{minimum:e,maximum:n}},getStencilSize:function(){if(this.stencilSize)return t={currentStencilSize:{width:this.stencilCoordinates.width,height:this.stencilCoordinates.height},stencilSize:this.stencilSize,boundaries:this.boundaries,coefficient:this.coefficient,coordinates:this.coordinates,aspectRatio:this.getAspectRatio(!0)},e=t.boundaries,n=t.stencilSize,r=t.aspectRatio,Ai(W(o=mt(n)?n({boundaries:e,aspectRatio:r}):n),r)&&(o=De({sizeRestrictions:{maxWidth:e.width,maxHeight:e.height,minWidth:0,minHeight:0},width:o.width,height:o.height,aspectRatio:{minimum:r.minimum,maximum:r.maximum}})),(o.width>e.width||o.height>e.height)&&(o=De({sizeRestrictions:{maxWidth:e.width,maxHeight:e.height,minWidth:0,minHeight:0},width:o.width,height:o.height,aspectRatio:{minimum:W(o),maximum:W(o)}})),o;var t,e,n,r,o},getPublicProperties:function(){return{coefficient:this.coefficient,visibleArea:this.visibleArea,coordinates:this.coordinates,boundaries:this.boundaries,sizeRestrictions:this.sizeRestrictions,positionRestrictions:this.positionRestrictions,aspectRatio:this.getAspectRatio(),imageRestriction:this.imageRestriction}},defaultCoordinates:function(){return U({},ss)},flip:function(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.transitions,o=r===void 0||r;if(!this.transitionsActive){o&&this.enableTransitions();var s=U({},this.imageTransforms.flip),a=Lh({flip:{horizontal:t?!s.horizontal:s.horizontal,vertical:e?!s.vertical:s.vertical},previousFlip:s,rotate:this.imageTransforms.rotate,visibleArea:this.visibleArea,coordinates:this.coordinates,imageSize:this.imageSize,positionRestrictions:this.positionRestrictions,sizeRestrictions:this.sizeRestrictions,getAreaRestrictions:this.getAreaRestrictions,aspectRatio:this.getAspectRatio()}),c=a.visibleArea,l=a.coordinates;t&&(this.appliedImageTransforms.flip.horizontal=!this.appliedImageTransforms.flip.horizontal),e&&(this.appliedImageTransforms.flip.vertical=!this.appliedImageTransforms.flip.vertical),this.visibleArea=c,this.coordinates=l,this.onChange(),o&&this.debouncedDisableTransitions()}},rotate:function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=e.transitions,r=n===void 0||n;if(!this.transitionsActive){r&&this.enableTransitions();var o=U({},this.imageSize);this.appliedImageTransforms.rotate+=t;var s=Dh({visibleArea:this.visibleArea,coordinates:this.coordinates,previousImageSize:o,imageSize:this.imageSize,angle:t,positionRestrictions:this.positionRestrictions,sizeRestrictions:this.sizeRestrictions,getAreaRestrictions:this.getAreaRestrictions,aspectRatio:this.getAspectRatio()}),a=s.visibleArea,c=s.coordinates,l=this.processAutoZoom("rotateImage",a,c);a=l.visibleArea,c=l.coordinates,this.visibleArea=a,this.coordinates=c,this.onChange(),r&&this.debouncedDisableTransitions()}}},emits:["change","error","ready"]},Yh={key:0,ref:"canvas",style:{display:"none"}},Qh={key:1,ref:"sourceCanvas",style:{display:"none"}};ks.render=function(t,e,n,r,o,s){return i.openBlock(),i.createBlock("div",{ref:"cropper",class:s.classes.cropper},[i.createVNode("div",{ref:"stretcher",class:s.classes.stretcher},null,2),i.createVNode("div",{class:s.classes.boundaries,style:s.boundariesStyle},[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(n.backgroundWrapperComponent),{class:s.classes.cropperWrapper,"wheel-resize":s.settings.resizeImage.wheel,"touch-resize":s.settings.resizeImage.touch,"touch-move":s.settings.moveImage.touch,"mouse-move":s.settings.moveImage.mouse,onMove:s.onManipulateImage,onResize:s.onManipulateImage},{default:i.withCtx(function(){return[i.createVNode("div",{class:s.classes.background,style:s.boundariesStyle},null,6),i.createVNode("div",{class:s.classes.imageWrapper},[i.createVNode("img",{ref:"image",crossorigin:o.imageAttributes.crossOrigin,src:o.imageAttributes.src,class:s.classes.image,style:s.imageStyle,onMousedown:e[1]||(e[1]=i.withModifiers(function(){},["prevent"]))},null,46,["crossorigin","src"])],2),i.createVNode("div",{class:s.classes.foreground,style:s.boundariesStyle},null,6),i.withDirectives((i.openBlock(),i.createBlock(i.resolveDynamicComponent(n.stencilComponent),i.mergeProps({ref:"stencil",image:s.image,coordinates:o.coordinates,"stencil-coordinates":s.stencilCoordinates,transitions:s.transitionsOptions},n.stencilProps,{onResize:s.onResize,onResizeEnd:s.onResizeEnd,onMove:s.onMove,onMoveEnd:s.onMoveEnd}),null,16,["image","coordinates","stencil-coordinates","transitions","onResize","onResizeEnd","onMove","onMoveEnd"])),[[i.vShow,o.imageLoaded]]),n.canvas?(i.openBlock(),i.createBlock("canvas",Yh,null,512)):i.createCommentVNode("",!0),n.canvas?(i.openBlock(),i.createBlock("canvas",Qh,null,512)):i.createCommentVNode("",!0)]}),_:1},8,["class","wheel-resize","touch-resize","touch-move","mouse-move","onMove","onResize"]))],6)],2)};const Kh={class:"background-container"},ef={class:"tools-line"},tf={class:"line-block"},nf={class:"dialog-footer"},Li=x(i.defineComponent({__name:"ImageCropper",props:{open:{type:Boolean,required:!0},defaultRatio:{type:Number,required:!1,default:1}},emits:["crop","close"],setup(t,{emit:e}){const n=t,r=e,o=S.S.Cropper.Cropper(),s=i.ref(n.defaultRatio);o.ratio=s.value;const a=async()=>{s.value===0?o.ratio=0:o.ratio=s.value},c=i.ref({width:0,height:0,left:0,top:0}),l=i.ref(!1),u=i.ref(""),h=i.ref(),f=async()=>{l.value=!0;const g=h.value.getResult();o.ratio===0&&(s.value=c.value.width/c.value.height),g&&g.canvas.toBlob(p=>{var k;r("crop",{blob:p,src:(k=g.canvas)==null?void 0:k.toDataURL()})}),l.value=!1},m=g=>{var p;c.value=g.coordinates,u.value=(p=g.canvas)==null?void 0:p.toDataURL()};return(g,p)=>{const k=tt,w=i.resolveComponent("el-form-item"),B=i.resolveComponent("el-form"),D=i.resolveComponent("el-button"),L=Tt;return i.openBlock(),i.createBlock(L,{show:t.open,title:"Настройка изображения","close-on-click-modal":!1,"close-on-press-escape":!1,"show-close":!1},{default:i.withCtx(()=>[i.createElementVNode("div",Kh,[i.createElementVNode("div",ef,[i.createElementVNode("div",tf,[i.createVNode(B,null,{default:i.withCtx(()=>[i.createVNode(w,{label:"Задайте пропорции фото:"},{default:i.withCtx(()=>[i.createVNode(k,{modelValue:i.unref(s),"onUpdate:modelValue":p[0]||(p[0]=F=>i.isRef(s)?s.value=F:null),label:"Пропорции изображения",onChange:a},{default:i.withCtx(()=>p[1]||(p[1]=[i.createElementVNode("option",{label:"2:3 (формат A4)",value:2/3},null,-1),i.createElementVNode("option",{label:"4:3 (для карточек новостей)",value:4/3},null,-1),i.createElementVNode("option",{label:"1:1 (для фото сотрудников)",value:1},null,-1),i.createElementVNode("option",{label:"3:2",value:3/2},null,-1),i.createElementVNode("option",{label:"16:9",value:16/9},null,-1),i.createElementVNode("option",{label:"3:4 (вертикальное изображение)",value:3/4},null,-1),i.createElementVNode("option",{label:"Задать пропорции вручную",value:0},null,-1)])),_:1},8,["modelValue"])]),_:1})]),_:1})])]),i.createVNode(i.unref(ks),{ref_key:"cropperRef",ref:h,src:i.unref(o).src,"stencil-props":{aspectRatio:i.unref(o).ratio},style:{"max-height":"50vh","min-height":"50vh"},onChange:m},null,8,["src","stencil-props"]),i.createElementVNode("div",nf,[i.createVNode(D,{loading:i.unref(l),type:"success",onClick:f},{default:i.withCtx(()=>p[2]||(p[2]=[i.createTextVNode(" Сохранить ")])),_:1},8,["loading"])])])]),_:1},8,["show"])}}}),[["__scopeId","data-v-cab0e63b"]]),Es=x(i.defineComponent({__name:"InfoItemSelectButtons",props:{selected:{type:String,required:!0},title:{type:String,required:!0},list:{type:Array,required:!0}},emits:["select","reset"],setup(t,{emit:e}){const n=i.ref(!1),r=e,o=s=>{n.value=!n.value,r("select",s)};return(s,a)=>{const c=fe,l=Ce,u=nt;return i.openBlock(),i.createBlock(u,{close:i.unref(n),title:t.title,"close-window-overflow":"hidden","with-hover":!0,"with-open-window":!0},{"open-inside-content":i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.list,h=>(i.openBlock(),i.createBlock(l,{key:h,type:"admin",color:"blue",text:h,onClick:f=>o(h)},null,8,["text","onClick"]))),128)),i.createVNode(l,{type:"admin",color:"blue",text:"Сбросить",onClick:a[0]||(a[0]=h=>o(void 0))})]),default:i.withCtx(()=>[i.createVNode(c,{string:t.selected,"font-size":"14px",width:"100%"},null,8,["string"])]),_:1},8,["close","title"])}}}),[["__scopeId","data-v-89897936"]]),rf={class:"mainblock"},of={class:"mainline"},vs=x(i.defineComponent({__name:"LeftRightContainer",props:{leftWidth:{type:String,required:!1,default:"0px"},background:{type:String,required:!1,default:"inherit"}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",rf,[i.createElementVNode("div",of,[i.createElementVNode("div",{class:"mainblock-left",style:i.normalizeStyle({minWidth:t.leftWidth,maxWidth:t.leftWidth,background:t.background,display:t.leftWidth!=="0px"?"block":"none"})},[i.renderSlot(e.$slots,"left",{},void 0,!0)],4),i.createElementVNode("div",{class:"mainblock-right",style:i.normalizeStyle({background:t.background})},[i.renderSlot(e.$slots,"right",{},void 0,!0)],4)])]))}}),[["__scopeId","data-v-a4bc6b16"]]),sf={class:"message-title"},af={class:"message-text"},Mn=x(i.defineComponent({__name:"MessageBody",props:{title:{type:String,default:"",required:!1},text:{type:String,default:"",required:!1}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",null,[i.createElementVNode("div",sf,i.toDisplayString(t.title),1),i.createElementVNode("div",af,i.toDisplayString(t.text),1)]))}}),[["__scopeId","data-v-e3c1e672"]]),lf=i.defineComponent({name:"CollapseContainer",props:{initActiveIdx:{type:Number,default:0}},setup(t){const e=i.ref(t.initActiveIdx),n=r=>{e.value=r};return i.watch(()=>t.initActiveIdx,()=>{n(t.initActiveIdx)}),{changeActiveId:n,activeIdx:e}}});function cf(t,e,n,r,o,s){return i.openBlock(),i.createElementBlock("div",null,[i.renderSlot(t.$slots,"default",{activeIdx:t.activeIdx,changeActiveId:t.changeActiveId})])}const xs=x(lf,[["render",cf]]),df=i.defineComponent({name:"CollapseItem",props:{tabId:{type:String,required:!1,default:""},activeId:{type:String,default:""},isCollaps:{type:Boolean,default:!0},title:{type:String,default:""},showToolsOnHover:{type:Boolean,default:!0},background:{type:String,required:!1,default:"#ffffff"},backgroundAttention:{type:String,required:!1,default:"#ffffff"},changeColor:{type:Boolean,default:!1},margin:{type:String,default:"10px 8px 2px 2px"},padding:{type:String,default:"0 10px"},selectable:{type:Boolean,default:!1}},emits:["changeActiveId"],setup(t,{emit:e}){const n=i.ref(t.activeId==="0"),r=()=>{n.value=!n.value,e("changeActiveId",t.tabId)};return i.onUpdated(()=>{t.activeId&&t.activeId!==t.tabId&&(n.value=!0)}),i.onBeforeMount(()=>{t.activeId&&t.activeId!==t.tabId&&(n.value=!1)}),{collapsed:n,handleItemClick:r}}}),uf=["for"],hf={class:"inside-icon"};function ff(t,e,n,r,o,s){return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",{class:"tab",style:i.normalizeStyle({margin:t.margin,height:t.isCollaps&&t.collapsed?"60px":"","box-shadow":t.selectable&&t.activeId===t.tabId?"0px 0px 1px 2px #1979cf":""})},[t.isCollaps&&t.collapsed?(i.openBlock(),i.createElementBlock("svg",{key:0,class:"icon-arrow",onClick:e[0]||(e[0]=(...a)=>t.handleItemClick&&t.handleItemClick(...a))},e[3]||(e[3]=[i.createElementVNode("use",{"xlink:href":"#arrow-down"},null,-1)]))):t.isCollaps&&!t.collapsed?(i.openBlock(),i.createElementBlock("svg",{key:1,class:"icon-arrow",onClick:e[1]||(e[1]=(...a)=>t.handleItemClick&&t.handleItemClick(...a))},e[4]||(e[4]=[i.createElementVNode("use",{"xlink:href":"#arrow-up"},null,-1)]))):i.createCommentVNode("",!0),i.createElementVNode("label",{for:t.tabId,onClick:e[2]||(e[2]=(...a)=>t.handleItemClick&&t.handleItemClick(...a))},[i.createElementVNode("div",{style:i.normalizeStyle({cursor:t.isCollaps?"pointer":"default",background:t.changeColor?t.background:t.backgroundAttention,padding:t.padding,borderRadius:"5px"}),class:"tab-name"},[i.createElementVNode("div",hf,[i.renderSlot(t.$slots,"icon",{},void 0,!0)]),t.title?(i.openBlock(),i.createElementBlock("div",{key:0,class:"title-in",style:i.normalizeStyle({marginRight:t.isCollaps?"50px":"0",width:t.isCollaps?"calc(100% - 50px)":"100%"})},i.toDisplayString(t.title),5)):(i.openBlock(),i.createElementBlock("div",{key:1,class:"title-in",style:i.normalizeStyle({marginRight:t.isCollaps?"50px":"0",width:t.isCollaps?"calc(100% - 50px)":"100%"})},[i.renderSlot(t.$slots,"inside-title",{},void 0,!0)],4)),i.createElementVNode("div",{class:i.normalizeClass(["tools-bar",{"hidden-part":t.showToolsOnHover}])},[i.renderSlot(t.$slots,"tools",{},void 0,!0)],2)],4)],8,uf),i.createElementVNode("div",{style:i.normalizeStyle({maxHeight:t.isCollaps?"":"1000000vh",background:t.changeColor?t.background:t.backgroundAttention}),class:i.normalizeClass(t.collapsed?"tab-content-down":"tab-content-up")},[i.renderSlot(t.$slots,"inside-content",{},void 0,!0)],6)],4),e[5]||(e[5]=i.createStaticVNode('<svg width="0" height="0" class="hidden" data-v-50a7d390><symbol id="arrow-down" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" data-v-50a7d390><path d="M5 6L10 11L15 6L17 7L10 14L3 7L5 6Z" fill="currentColor" data-v-50a7d390></path></symbol><symbol id="arrow-up" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" data-v-50a7d390><path d="M15 14L10 9L5 14L3 13L10 6L17 13L15 14Z" fill="currentColor" data-v-50a7d390></path></symbol></svg>',1))],64)}const Ms=x(df,[["render",ff],["__scopeId","data-v-50a7d390"]]),mf={class:"tab"},pf={class:"rotate"},Bs=x(i.defineComponent({__name:"VerticalCollapseContainer",setup(t){const e=i.ref(!1),n=async()=>{e.value=!e.value};return(r,o)=>{const s=gn,a=pn;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",mf,[i.renderSlot(r.$slots,"main",{},void 0,!0),i.createElementVNode("div",{style:i.normalizeStyle({width:i.unref(e)?"50%":"20px",transition:"0.3s"}),class:"left"},[i.createElementVNode("div",{style:i.normalizeStyle({width:i.unref(e)?"100%":"0",transition:"0.3s"}),class:"left-content"},[i.renderSlot(r.$slots,"inside-content-left",{},void 0,!0)],4),i.createElementVNode("div",{class:"arrow-bar",onClick:n},[i.createElementVNode("div",pf,[i.renderSlot(r.$slots,"inside-title",{},void 0,!0)]),i.unref(e)?(i.openBlock(),i.createBlock(s,{key:0,"icon-class":"icon-arrow"})):(i.openBlock(),i.createBlock(a,{key:1,"icon-class":"icon-arrow"}))])],4),i.createElementVNode("div",{style:i.normalizeStyle({width:i.unref(e)?"50%":"100%",transition:"0.3s"}),class:"right"},[i.renderSlot(r.$slots,"inside-content-right",{},void 0,!0)],4)]),i.createVNode(a),i.createVNode(s)],64)}}}),[["__scopeId","data-v-d802b6b9"]]),gf={class:"add-block_body"},Rs=x(i.defineComponent({__name:"PAdd",props:{background:{type:String,required:!1,default:"inherit"},margin:{type:String,required:!1,default:"0"},padding:{type:String,required:!1,default:"0"},top:{type:String,required:!1,default:"0"},zIndex:{type:Number,required:!1,default:0}},setup(t){return(e,n)=>{const r=mn;return i.openBlock(),i.createElementBlock("div",{class:"add-block",style:i.normalizeStyle({margin:t.margin,background:t.background,padding:t.padding})},[i.createVNode(r,{top:t.top,"z-index":t.zIndex},{default:i.withCtx(()=>[i.renderSlot(e.$slots,"title",{},void 0,!0)]),_:3},8,["top","z-index"]),i.createElementVNode("div",gf,[i.renderSlot(e.$slots,"default",{},void 0,!0)])],4)}}}),[["__scopeId","data-v-b93bc8b1"]]),Hi=x(i.defineComponent({__name:"PContainer",props:{background:{type:String,required:!1,default:"inherit"},margin:{type:String,required:!1,default:"0"},padding:{type:String,required:!1,default:"0"}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",{class:"add-block",style:i.normalizeStyle({margin:t.margin,background:t.background,padding:t.padding})},[i.renderSlot(e.$slots,"default",{},void 0,!0)],4))}}),[["__scopeId","data-v-b89bdc7a"]]),yf={class:"add-block_body"},$s=x(i.defineComponent({__name:"PContainerStickyHead",props:{background:{type:String,required:!1,default:"inherit"},margin:{type:String,required:!1,default:"0"},padding:{type:String,required:!1,default:"0"},top:{type:String,required:!1,default:"0"},zIndex:{type:Number,required:!1,default:0}},setup(t){return(e,n)=>{const r=mn,o=Hi;return i.openBlock(),i.createBlock(o,{background:t.background,margin:t.margin,padding:t.padding},{default:i.withCtx(()=>[i.createVNode(r,{top:t.top,"z-index":t.zIndex},{default:i.withCtx(()=>[i.renderSlot(e.$slots,"title",{},void 0,!0)]),_:3},8,["top","z-index"]),i.createElementVNode("div",yf,[i.renderSlot(e.$slots,"default",{},void 0,!0)])]),_:3},8,["background","margin","padding"])}}}),[["__scopeId","data-v-e59e418e"]]),wf={class:"del-block_title"},bf={class:"del-block_body"},Ns=x(i.defineComponent({__name:"PDel",props:{background:{type:String,required:!1,default:"inherit"},margin:{type:String,required:!1,default:"10px 10px 10px 50px"},padding:{type:String,required:!1,default:"10px"}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",{class:"del-block",style:i.normalizeStyle({margin:t.margin,background:t.background,padding:t.padding})},[i.createElementVNode("div",wf,[i.renderSlot(e.$slots,"title",{},void 0,!0)]),i.createElementVNode("div",bf,[i.renderSlot(e.$slots,"default",{},void 0,!0)])],4))}}),[["__scopeId","data-v-362b7b0d"]]),Cf=["onClick"],As=x(i.defineComponent({__name:"PTabs",props:{tabs:{type:Object,required:!0},tabHeight:{type:String,required:!1,default:"40px"},height:{type:String,required:!1,default:""},minMenuItemWidth:{type:String,required:!1,default:"150px"},outTopMargin:{type:String,required:!1,default:"40px"},background:{type:String,required:!1,default:"#ffffff"}},emits:["select"],setup(t,{emit:e}){const n=t,r=e,o=i.ref(n.tabs[0]),s=i.ref(0),a=i.ref(window.innerWidth),c=i.ref(),l=i.ref(Number(n.tabHeight.replace(/[^+\d]/g,""))),u=()=>{a.value=window.innerWidth,l.value=c.value?c.value.clientHeight:Number(n.tabHeight.replace(/[^+\d]/g,""))};i.onMounted(()=>window.addEventListener("resize",u)),i.onUnmounted(()=>window.removeEventListener("resize",u));const h=i.computed(()=>`calc(100% - ${l.value}px + 1px)`),f=(m,g)=>{o.value=m,s.value=g,r("select",m)};return(m,g)=>(i.openBlock(),i.createElementBlock("div",{class:"mainblock",style:i.normalizeStyle({height:`calc(100% - ${t.outTopMargin} - ${t.tabHeight}`})},[i.createElementVNode("div",{ref_key:"menuRef",ref:c,class:"top-menu",style:i.normalizeStyle({gridTemplateColumns:`repeat(auto-fit, minmax(${t.minMenuItemWidth}, 1fr))`})},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.tabs,(p,k)=>(i.openBlock(),i.createElementBlock("div",{key:k},[i.createElementVNode("div",{class:i.normalizeClass({"selected-tab":k===i.unref(s),tab:k!==i.unref(s)}),style:i.normalizeStyle({minHeight:t.tabHeight,maxHeight:t.tabHeight}),onClick:w=>f(p,k)},i.toDisplayString(p.name),15,Cf)]))),128))],4),i.createElementVNode("div",{class:"body-container",style:i.normalizeStyle({background:t.background,height:i.unref(h)})},[i.renderSlot(m.$slots,"default",{},()=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(i.unref(o).component)))],!0)],4)],4))}}),[["__scopeId","data-v-3cb80968"]]),Sf=["id"],kf=["for"],Ef={class:"left-field"},vf=["href","download"],xf={key:1,class:"text-field__input"},Mf={class:"right-field"},Bf=i.defineComponent({__name:"UploaderFile",props:{fileInfo:{type:Object,required:!1,default:new _e},formats:{type:Array,default:()=>["pdf","jpeg","jpg"]},label:{type:String,default:"Label",required:!1},margin:{type:String,required:!1,default:"10px 0 0 0"},disabled:{type:Boolean,required:!1,default:!1},padding:{type:String,default:"",required:!1},mask:{type:String,required:!1,default:void 0},borderColor:{type:String,default:"var(--input-border-color)",required:!1},color:{type:String,default:"var(--input-font-color)",required:!1},placeholder:{type:String,required:!1,default:""}},emits:["upload","remove"],setup(t,{emit:e}){const n=t,r=e,o=S.H.Strings.CreateGuid(),s=S.H.Strings.CreateGuid(),a=()=>{const u=document.getElementById(o);if(!u.files)return;const h=u.files[0];if(h){if(!l(h.name)){S.Notification.Error("Загруженный файл должен быть в формате pdf, jpg или jpeg");return}n.fileInfo.uploadAndSetFile(h),r("upload",n.fileInfo)}},c=()=>{n.fileInfo.clearFile(),r("remove",n.fileInfo)};i.onMounted(()=>{const u=document.getElementById(s);u&&(u.onclick=()=>{var h;return(h=document.getElementById(o))==null?void 0:h.click()})});const l=u=>{let h=S.H.Extension.Get(u);return!!n.formats.includes(h.toLowerCase())};return(u,h)=>{const f=fe,m=yi,g=Ce;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("input",{id:i.unref(o),type:"file",hidden:"",onChange:a},null,40,Sf),i.createElementVNode("div",{class:"text-field",style:i.normalizeStyle({margin:t.margin,padding:t.padding})},[t.label?(i.openBlock(),i.createElementBlock("label",{key:0,class:"text-field__label",for:t.label},i.toDisplayString(t.label),9,kf)):i.createCommentVNode("",!0),i.createElementVNode("div",{class:"field",style:i.normalizeStyle({borderColor:t.borderColor})},[i.createElementVNode("div",Ef,[i.createVNode(m,null,{default:i.withCtx(()=>[i.renderSlot(u.$slots,"default",{},void 0,!0),i.createVNode(f,{string:t.placeholder,"font-size":"var(--font-size-default:)",color:"var(--input-label-color)",margin:"0 10px 0 0"},null,8,["string"])]),_:3})]),t.fileInfo&&t.fileInfo.originalName?(i.openBlock(),i.createElementBlock("div",{key:0,class:"text-field__input",style:i.normalizeStyle({color:t.color})},[i.createElementVNode("a",{href:t.fileInfo.getFileUrl(),target:"_blank",download:t.fileInfo.originalName},[i.createElementVNode("div",null,i.toDisplayString(t.fileInfo.originalName),1)],8,vf),i.createVNode(g,{skin:"text",type:"del",onClick:c},{default:i.withCtx(()=>[i.createVNode(Pt,{size:"20px",margin:"0 5px"})]),_:1})],4)):(i.openBlock(),i.createElementBlock("div",xf,[i.createVNode(f,{string:"Файл не загружен","font-size":"var(--inpur-font-size-default)",color:"var(--palette-warning)",margin:"0 10px 0 0"})])),i.createElementVNode("div",Mf,[i.createVNode(g,{id:i.unref(s),skin:"text",type:"success","data-test":"upload-btn",text:t.fileInfo&&t.fileInfo.originalName?"Обновить":"Загрузить",margin:"0"},null,8,["id","text"])])],4)],4)],64)}}}),Is=x(Bf,[["__scopeId","data-v-51318b14"]]),Rf={class:"container"},$f={key:0,class:"result"},Nf={class:"list"},Af=["onClick"],_i=x(i.defineComponent({inheritAttrs:!1,__name:"PAutocomplete",props:{modelValue:{type:String,default:""},searchFunc:{type:Function,default:()=>{}},suggestions:{type:Array,default:[]}},emits:["select","input"],setup(t,{emit:e}){const n=e,r=t,o=i.ref(r.modelValue),s=i.ref([]);async function a(){n("input",o.value),await c()}async function c(){r.searchFunc&&(s.value=await r.searchFunc(o.value))}async function l(u){n("select",u)}return(u,h)=>{const f=Ci,m=ct;return i.openBlock(),i.createElementBlock("div",Rf,[i.createVNode(m,{modelValue:i.unref(o),"onUpdate:modelValue":h[0]||(h[0]=g=>i.isRef(o)?o.value=g:null),placeholder:"Найти",onInput:a},{right:i.withCtx(()=>[i.createVNode(f)]),_:1},8,["modelValue"]),i.unref(o)?(i.openBlock(),i.createElementBlock("div",$f,[i.createElementVNode("ul",Nf,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(i.unref(s),g=>(i.openBlock(),i.createElementBlock("li",{key:g.value,onClick:p=>l(g)},i.toDisplayString(g.label),9,Af))),128))])])):i.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-58b78c5c"]]),If={class:"footer"},Ps=x(i.defineComponent({__name:"PDialog",setup(t){const e=i.computed(()=>{switch(S.Dialog.GetType()){case"info":return"message primary";case"success":return"message success";case"warning":return"message warning";case"error":return"message danger";default:return"message neutral"}});return(n,r)=>{const o=Mn,s=Ce;return i.openBlock(),i.createBlock(i.Transition,{name:"fade"},{default:i.withCtx(()=>[("PF"in n?n.PF:i.unref(S)).Dialog.IsVisible()?(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(i.unref(e))},[i.createVNode(o,{title:("PF"in n?n.PF:i.unref(S)).Dialog.GetTitle(),text:("PF"in n?n.PF:i.unref(S)).Dialog.GetText()},null,8,["title","text"]),i.createElementVNode("div",If,[i.createVNode(s,{type:"primary",text:("PF"in n?n.PF:i.unref(S)).Dialog.GetConfirmButtonText(),margin:"10px 0 0 0",onClick:r[0]||(r[0]=a=>("PF"in n?n.PF:i.unref(S)).Dialog.Submit())},null,8,["text"]),i.createVNode(s,{type:"warning",text:("PF"in n?n.PF:i.unref(S)).Dialog.GetCancelButtonText(),margin:"10px 0 0 0",onClick:r[1]||(r[1]=a=>("PF"in n?n.PF:i.unref(S)).Dialog.Cancel())},null,8,["text"])])],2)):i.createCommentVNode("",!0)]),_:1})}}}),[["__scopeId","data-v-3af87587"]]),Ts=x(i.defineComponent({__name:"PhoneForm",props:{modelValue:{},modelModifiers:{}},emits:["update:modelValue"],setup(t){const e=i.useModel(t,"modelValue"),n=async()=>{await S.S.Phones.Update(e.value)};return(r,o)=>{const s=ct;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createVNode(s,{modelValue:e.value.number,"onUpdate:modelValue":o[0]||(o[0]=a=>e.value.number=a),onBlur:n},null,8,["modelValue"]),i.createVNode(s,{modelValue:e.value.description,"onUpdate:modelValue":o[1]||(o[1]=a=>e.value.description=a),onBlur:n},null,8,["modelValue"])],64)}}}),[["__scopeId","data-v-6de09525"]]),Pf={};function Tf(t,e){return i.openBlock(),i.createElementBlock(i.Fragment,null,[e[0]||(e[0]=i.createElementVNode("div",{class:"blur"},null,-1)),e[1]||(e[1]=i.createElementVNode("div",{class:"loader-container"},[i.createElementVNode("div",{class:"loader",style:{"--b":"20px",width:"200px","--n":"10"}})],-1))],64)}const zs=x(Pf,[["render",Tf],["__scopeId","data-v-879cfd55"]]),Vs=x(i.defineComponent({__name:"PNotification",setup(t){const e=i.computed(()=>{switch(S.Notification.GetType()){case"info":return"message info";case"success":return"message success";case"warning":return"message warning";case"error":return"message error";default:return"message neutral"}});return(n,r)=>{const o=Mn;return i.openBlock(),i.createBlock(i.Transition,{name:"fade"},{default:i.withCtx(()=>[("PF"in n?n.PF:i.unref(S)).Notification.IsVisible()?(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(i.unref(e))},[i.createVNode(o,{title:("PF"in n?n.PF:i.unref(S)).Notification.GetTitle(),text:("PF"in n?n.PF:i.unref(S)).Notification.GetText()},null,8,["title","text"])],2)):i.createCommentVNode("",!0)]),_:1})}}}),[["__scopeId","data-v-ec6a4660"]]),zf={style:{display:"flex","justify-content":"center",width:"100%"}},Vf={class:"pag-number"},Ff={class:"pag-ul"},Of={key:2},Fs=x(i.defineComponent({__name:"PPagination",props:{showConfirm:{type:Boolean,default:!1},justifyContent:{type:String,default:"center"},store:{type:Object,required:!0}},emits:["cancel","save"],setup(t,{emit:e}){const n=t,r=g=>g?"active":"neutral",o=g=>g?"not-active":"neutral",s=S.Paginator,a=i.ref(!1),c=i.ref(!1),l=e;s.count=n.store.Count().value;const u=async g=>{if(g!==s.curPage){if(g<1&&(g=1),g>s.pagesCount()&&(g=s.pagesCount()),!n.showConfirm)return await h(g);S.Dialog.Save().then(async()=>{l("save"),await h(g)}).catch(async()=>{S.Notification.Warning("Изменения не были сохранены"),l("cancel"),await h(g)})}},h=async(g,p)=>{s.setCurPage(g),S.H.FTSP.Get().p.offset=(g-1)*s.limit,await n.store.FTSP(),m()},f=i.computed(()=>{const g=s.pagesCount();return g<8?S.H.Arrays.GenerateNumsRange(2,g-1).filter(p=>p<g&&p>1):S.H.Arrays.GenerateNumsRange(s.curPage-2,s.curPage+3).filter(p=>p<g&&p>1)}),m=()=>{const g=document.querySelector(".el-table__body-wrapper"),p=document.querySelector("#list");g?g.scrollTo({top:0}):p&&p.scrollTo({top:0})};return i.onBeforeUnmount(()=>{S.H.FTSP.Get().p.drop()}),(g,p)=>{const k=pn,w=Ce,B=Si,D=Ei,L=ki,F=gn;return i.openBlock(),i.createElementBlock("div",zf,[i.createElementVNode("div",{class:"pag-container",style:i.normalizeStyle({justifyContent:t.justifyContent})},[i.createElementVNode("div",Vf,[i.createVNode(w,{skin:"pag",type:o(i.unref(s).curPage===1),onClick:p[0]||(p[0]=z=>u(i.unref(s).curPage-1))},{default:i.withCtx(()=>[i.createVNode(k)]),_:1},8,["type"]),i.createElementVNode("ul",Ff,[i.createElementVNode("li",null,[i.createVNode(w,{skin:"pag",type:r(i.unref(s).curPage===1),text:"1",onClick:p[1]||(p[1]=z=>u(1))},null,8,["type"])]),i.unref(s).pagesCount()>8&&i.unref(s).curPage>4?(i.openBlock(),i.createElementBlock("li",{key:0,onMouseenter:p[3]||(p[3]=z=>a.value=!0),onMouseleave:p[4]||(p[4]=z=>a.value=!1)},[i.createVNode(w,{skin:"pag",type:"neutral",onClick:p[2]||(p[2]=z=>u(i.unref(s).curPage-5))},{default:i.withCtx(()=>[i.unref(a)?(i.openBlock(),i.createBlock(B,{key:0})):(i.openBlock(),i.createBlock(D,{key:1}))]),_:1})],32)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(i.unref(f),z=>(i.openBlock(),i.createElementBlock("li",{key:z},[i.createVNode(w,{skin:"pag",type:r(z===i.unref(s).curPage),text:z,onClick:we=>u(z)},null,8,["type","text","onClick"])]))),128)),i.unref(s).pagesCount()>=8&&i.unref(s).curPage<i.unref(s).pagesCount()-3?(i.openBlock(),i.createElementBlock("li",{key:1,onMouseenter:p[6]||(p[6]=z=>c.value=!0),onMouseleave:p[7]||(p[7]=z=>c.value=!1)},[i.createVNode(w,{skin:"pag",type:"neutral",onClick:p[5]||(p[5]=z=>u(i.unref(s).curPage+5))},{default:i.withCtx(()=>[i.unref(c)?(i.openBlock(),i.createBlock(L,{key:0})):(i.openBlock(),i.createBlock(D,{key:1}))]),_:1})],32)):i.createCommentVNode("",!0),i.unref(s).pagesCount()>1?(i.openBlock(),i.createElementBlock("li",Of,[i.createVNode(w,{skin:"pag",type:r(i.unref(s).pagesCount()===i.unref(s).curPage),text:i.unref(s).pagesCount(),onClick:p[8]||(p[8]=z=>u(i.unref(s).pagesCount()))},null,8,["type","text"])])):i.createCommentVNode("",!0)]),i.createVNode(w,{skin:"pag",type:o(i.unref(s).curPage===i.unref(s).pagesCount()),onClick:p[9]||(p[9]=z=>u(i.unref(s).curPage+1))},{default:i.withCtx(()=>[i.createVNode(F)]),_:1},8,["type"])])],4)])}}}),[["__scopeId","data-v-5aea8b91"]]),Os=x(i.defineComponent({__name:"RemoteSearch",props:{keyValue:{type:String,default:""},modelValue:{type:String,default:""},storeModule:{type:String,default:""},placeholder:{type:String,default:"Начните вводить запрос"},showSuggestions:{type:Boolean,default:!0},maxWidth:{type:[Number,String],default:350},focus:{type:Boolean,default:!1}},emits:["select","load","input"],setup(t,{emit:e}){const n=t,r=e,o=i.ref(n.modelValue),s=i.ref(),a=S.S.Search.SearchModel();i.watch(()=>n.focus,()=>{n.focus&&setTimeout(()=>{s.value.focus(),o.value=""},500)});const c=async h=>{if(h.length<2)return;s.value.activated=!0,a.searchObjects=[],a.query=h,a.key=n.keyValue;const f=a.searchGroups.find(m=>m.key===n.keyValue);return f&&(a.searchGroup=f),await S.S.Search.Search(a),a.searchObjects},l=async h=>{r("select",h),o.value=""},u=h=>{r("input",h),h.length===0&&r("input","")};return(h,f)=>{const m=_i;return i.openBlock(),i.createBlock(m,{ref_key:"searchForm",ref:s,modelValue:i.unref(o),"onUpdate:modelValue":f[0]||(f[0]=g=>i.isRef(o)?o.value=g:null),"value-key":"label",style:{width:"100%","margin-right":"10px"},placeholder:t.placeholder,"search-func":c,"trigger-on-focus":t.showSuggestions,suggestions:i.unref(a).searchObjects,onSelect:l,onInput:u},{suffix:i.withCtx(()=>f[1]||(f[1]=[i.createElementVNode("i",{class:"el-icon-search"},null,-1)])),_:1},8,["modelValue","placeholder","trigger-on-focus","suggestions"])}}}),[["__scopeId","data-v-f236facf"]]),Df={class:"mainblock-body"},Lf={class:"mainblock-footer"},Ds=x(i.defineComponent({__name:"ResearcheContainer",props:{background:{type:String,required:!1,default:"inherit"},padding:{type:String,required:!1,default:"0px 10px"}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",{class:"mainblock",style:i.normalizeStyle({background:t.background,padding:t.padding})},[i.createElementVNode("div",{class:"mainblock-header",style:i.normalizeStyle({background:t.background})},[i.renderSlot(e.$slots,"header",{},void 0,!0)],4),i.createElementVNode("div",Df,[i.renderSlot(e.$slots,"body",{},void 0,!0)]),i.createElementVNode("div",Lf,[i.renderSlot(e.$slots,"footer",{},void 0,!0)])],4))}}),[["__scopeId","data-v-a670fb4a"]]),Hf={class:"right-slider-content"},_f={class:"right-slider-content-header"},qf={class:"right-slider-content-box"},Uf={class:"right-slider-button"},Ls=x(i.defineComponent({__name:"RightSliderContainer",props:{sliderOffWidth:{type:String,required:!1,default:"30px"},sliderOnWidth:{type:String,required:!1,default:"260px"},background:{type:String,required:!1,default:"inherit"},toggle:{type:Boolean,default:!1},titleOpen:{type:String,required:!1,default:"Скрыть список исследований"},titleClose:{type:String,required:!1,default:"Показать список исследований"}},emits:["toggle"],setup(t,{emit:e}){const n=t,r=e,o=i.ref(!1);i.watch(()=>n.toggle,()=>{o.value=!o.value});const s=a=>{o.value=!o.value,r("toggle",a)};return(a,c)=>{const l=fe;return i.openBlock(),i.createElementBlock("div",{class:"right-slider",style:i.normalizeStyle({marginRight:i.unref(o)?`calc(${t.sliderOffWidth} - ${t.sliderOnWidth})`:"0",width:t.sliderOnWidth})},[i.createElementVNode("div",{class:"click-line",onClick:c[0]||(c[0]=u=>s(!i.unref(o)))},[i.unref(o)?(i.openBlock(),i.createBlock(l,{key:0,string:t.titleClose,"font-size":"16px",padding:"0",color:"#343E5C"},null,8,["string"])):i.createCommentVNode("",!0),i.unref(o)?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(l,{key:1,string:t.titleOpen,"font-size":"16px",padding:"0",color:"#343E5C"},null,8,["string"]))]),i.createElementVNode("div",Hf,[i.createElementVNode("div",_f,[i.renderSlot(a.$slots,"header",{},void 0,!0)]),i.createElementVNode("div",qf,[i.renderSlot(a.$slots,"default",{},void 0,!0)])]),i.createElementVNode("div",Uf,[i.renderSlot(a.$slots,"button",{},void 0,!0)])],4)}}}),[["__scopeId","data-v-495a90f9"]]),Wf={class:"mainblock"},jf={class:"body-block"},Gf={class:"tab-block"},Hs=x(i.defineComponent({__name:"RightTabsContainer",props:{sliderOffWidth:{type:String,required:!1,default:"101px"},sliderOnWidth:{type:String,required:!1,default:"332px"},background:{type:String,required:!1,default:"inherit"},isToggle:{type:Boolean,required:!1,default:!1},mobileWidth:{type:String,required:!1,default:"768px"}},emits:["toggle"],setup(t,{emit:e}){const n=t,r=e,o=i.ref(!1),s=i.ref(window.matchMedia("(max-width: 768px)").matches),a=l=>{r("toggle",l)},c=i.ref(!1);return i.onBeforeMount(async()=>{window.addEventListener("resize",()=>{switch(n.mobileWidth){case"1330px":return s.value=window.matchMedia("(max-width: 1330px)").matches;case"1215px":return s.value=window.matchMedia("(max-width: 1215px)").matches;case"1024px":return s.value=window.matchMedia("(max-width: 1024px)").matches;case"768px":return s.value=window.matchMedia("(max-width: 768px)").matches}return s.value=window.matchMedia("(max-width: 1330px)").matches}),o.value=!0}),(l,u)=>(i.openBlock(),i.createElementBlock("div",Wf,[i.createElementVNode("div",{class:"slider-block",style:i.normalizeStyle({marginRight:i.unref(s)?t.isToggle?"49px":`calc(49px - ${t.sliderOnWidth})`:t.isToggle?t.sliderOffWidth:`calc(${t.sliderOffWidth} - ${t.sliderOnWidth})`,width:t.sliderOnWidth,minHeight:t.sliderOffWidth,height:t.isToggle?"auto":"100px"})},[i.createElementVNode("div",{class:"slider-icon",style:i.normalizeStyle({border:t.isToggle?"1px solid #379FFF":"1px solid #00B5A4",background:t.isToggle?"#ffffff":"#C7ECEA"}),onClick:u[0]||(u[0]=h=>a(!t.isToggle)),onMouseenter:u[1]||(u[1]=h=>c.value=!0),onMouseleave:u[2]||(u[2]=h=>c.value=!1)},[i.createElementVNode("div",{class:"icon-block",style:i.normalizeStyle({transform:i.unref(c)?t.isToggle?"rotate(-225deg) scale(1.2, 1.2)":"rotate(0deg) scale(1.2, 1.2)":t.isToggle?"rotate(-225deg)":"rotate(0deg)",fill:t.isToggle?"#379FFF":"#00B5A4"})},[i.renderSlot(l.$slots,"icon",{},void 0,!0)],4)],36),i.createElementVNode("div",{class:"slider-info",style:i.normalizeStyle({width:`calc(${t.sliderOnWidth} - ${t.sliderOffWidth})`})},[i.renderSlot(l.$slots,"slider-body",{},void 0,!0)],4)],4),i.createElementVNode("div",jf,[i.renderSlot(l.$slots,"body",{},void 0,!0)]),i.createElementVNode("div",Gf,[i.renderSlot(l.$slots,"tabs",{},void 0,!0)])]))}}),[["__scopeId","data-v-eaeca0cc"]]),Zf=["label","value"],_s=x(i.defineComponent({__name:"SelectValueType",props:{selectedType:{type:String,required:!0}},emits:["select"],setup(t,{emit:e}){const n={[de.String]:"Текстовый ответ",[de.Text]:"Развёрнутый текстовый ответ",[de.Number]:"Числовой ответ",[de.Date]:"Ответ в виде даты",[de.Radio]:"Выбор одного из вариантов",[de.Set]:"Выбор нескольких вариантов",[de.File]:"Ответ в виде файла",[de.MatrixRadio]:"Матрица с одним выбором",[de.MatrixSet]:"Матрица с несколькими выборами"},r=e,o=s=>{r("select",s)};return(s,a)=>{const c=fe,l=tt;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createVNode(c,{string:"Выберите вид ответа:","font-size":"14px",padding:"0","justify-content":"left",margin:"10px 0"}),i.createVNode(l,{"model-value":t.selectedType,placeholder:"Вид ответа",onChange:o},{default:i.withCtx(()=>[(i.openBlock(),i.createElementBlock(i.Fragment,null,i.renderList(n,(u,h)=>i.createElementVNode("option",{key:u,label:u,value:h},null,8,Zf)),64))]),_:1},8,["model-value"])],64)}}}),[["__scopeId","data-v-6be05cd5"]]),Jf={class:"field"},qs=x(i.defineComponent({__name:"SingleNameToggleForm",props:{withName:{type:Object,required:!0}},emits:["submit"],setup(t,{emit:e}){const n=t,r=e,o=i.ref(!1),s=i.ref(),a=i.ref(n.withName.name),c=i.ref(!1),l=()=>{c.value=!1},u=async()=>{a.value.trim(),n.withName.setName&&n.withName.setName(a.value),o.value=!o.value,r("submit")};return(h,f)=>{const m=fe,g=i.resolveComponent("el-input"),p=i.resolveComponent("el-form-item"),k=i.resolveComponent("el-form"),w=Ce;return i.openBlock(),i.createBlock(k,{ref_key:"form",ref:s,style:{width:"100%"}},{default:i.withCtx(()=>[i.createVNode(nt,{title:"Название","show-save-dialog":c.value,icon:"edit-title","with-hover":!0,close:o.value,width:"100%",onKeyupEnter:u,onAfterClose:l},{"open-inside-content":i.withCtx(()=>[i.createVNode(nt,{title:"",icon:"edit-title","with-open-window":!1,"with-hover":!1,"border-color":"#ffffff","base-box-margin":"0 0 15px 0",padding:"0",width:"100%","custom-class":"test","open-width":"100%"},{default:i.withCtx(()=>[i.createElementVNode("div",Jf,[i.createVNode(k,null,{default:i.withCtx(()=>[i.createVNode(p,{style:{width:"100%"},prop:"surname"},{default:i.withCtx(()=>[i.createVNode(g,{modelValue:a.value,"onUpdate:modelValue":f[0]||(f[0]=B=>a.value=B),style:{width:"100%"},autosize:!0,type:"textarea"},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1}),i.createVNode(w,{type:"admin",color:"blue",text:"Сохранить",onClick:u})]),default:i.withCtx(()=>[a.value.length?(i.openBlock(),i.createBlock(m,{key:0,string:a.value.length>60?a.value.slice(0,60)+"...":a.value},null,8,["string"])):(i.openBlock(),i.createBlock(m,{key:1,string:"Введите данные",color:"#B0A4C0"}))]),_:1},8,["show-save-dialog","close"])]),_:1},512)}}}),[["__scopeId","data-v-890163ac"]]),Xf=["label","value"],Us=x(i.defineComponent({__name:"SortList",props:{maxWidth:{type:[Number,String],default:250}},emits:["load"],setup(t,{emit:e}){const n=i.ref(!1),r=e,o=i.ref();i.onBeforeMount(()=>{n.value=!0,o.value=Ne.GetDefault(),S.H.FTSP.Get().setSortModel(o.value)});const s=async c=>{o.value=c??Ne.GetDefault(),S.H.FTSP.Get().setSortModel(o.value),S.H.FTSP.Get().p.drop(),r("load")},a=async c=>{S.H.FTSP.Get().p.drop(),await s(c)};return(c,l)=>{var h;const u=tt;return i.unref(n)?(i.openBlock(),i.createBlock(u,{key:0,modelValue:i.unref(o),"onUpdate:modelValue":l[0]||(l[0]=f=>i.isRef(o)?o.value=f:null),"popper-append-to-body":!1,clearable:!((h=i.unref(o))!=null&&h.default),"value-key":"label",onChange:a,onClear:l[1]||(l[1]=f=>a())},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(i.unref(Ne).Get(),(f,m)=>(i.openBlock(),i.createElementBlock("option",{key:m,label:f.label,value:f},null,8,Xf))),128))]),_:1},8,["modelValue","clearable"])):i.createCommentVNode("",!0)}}}),[["__scopeId","data-v-ef96d2ea"]]),Yf=["label","value"],Ws=x(i.defineComponent({__name:"SortSelect",props:{maxWidth:{type:[Number,String],default:250}},emits:["load"],setup(t,{emit:e}){const n=e,r=i.ref();i.onBeforeMount(()=>{r.value=Ne.GetDefault()});const o=async a=>{a||(r.value=Ne.GetDefault()),S.H.FTSP.Get().setSortModel(r.value),S.H.FTSP.Get().p.drop(),n("load")},s=async a=>{await o(a)};return(a,c)=>{var u;const l=tt;return i.openBlock(),i.createBlock(l,{modelValue:i.unref(r),"onUpdate:modelValue":c[0]||(c[0]=h=>i.isRef(r)?r.value=h:null),"popper-append-to-body":!1,clearable:!((u=i.unref(r))!=null&&u.default),"value-key":"label",onChange:s},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(i.unref(Ne).Get(),(h,f)=>(i.openBlock(),i.createElementBlock("option",{key:f,label:h.label,value:h},null,8,Yf))),128))]),_:1},8,["modelValue","clearable"])}}}),[["__scopeId","data-v-8f7ad510"]]),Qf={class:"switch-container"},Kf={class:"line"},em={class:"line"},js=x(i.defineComponent({__name:"Switch3Pos",props:{firstModel:{type:Object,required:!0},secondModel:{type:Object,required:!0},defaultLabel:{type:String,default:"Все"}},emits:["load"],setup(t,{emit:e}){const n=t,r={background:"inherit",border:"1px solid #c4c4c4"},o=()=>n.firstModel.valueEq(u.value)?void 0:r,s=()=>u.value?r:void 0,a=()=>n.secondModel.valueEq(u.value)?void 0:r,c=f=>{var g;return{color:(g=u.value)!=null&&g.valueEq(f)?"#006bb4":"#B0A4C0"}},l=e,u=i.ref(void 0),h=async f=>{var m;(m=u.value)!=null&&m.valueEq(f)||(S.H.FTSP.Get().replaceF(f,u.value),u.value=f,l("load"))};return(f,m)=>{const g=fe;return i.openBlock(),i.createElementBlock("div",Qf,[i.createElementVNode("div",Kf,[i.createVNode(g,{string:t.firstModel.label,"font-size":"12px",padding:"0",style:i.normalizeStyle(c(t.firstModel)),onClick:m[0]||(m[0]=p=>h(t.firstModel))},null,8,["string","style"]),i.createVNode(g,{string:"Все","font-size":"12px",padding:"0",style:i.normalizeStyle(c()),onClick:m[1]||(m[1]=p=>h())},null,8,["style"]),i.createVNode(g,{string:t.secondModel.label,"font-size":"12px",padding:"0",style:i.normalizeStyle(c(t.secondModel)),onClick:m[2]||(m[2]=p=>h(t.secondModel))},null,8,["string","style"])]),i.createElementVNode("div",em,[i.createElementVNode("div",{class:i.normalizeClass(["switch-knob1",{active:t.firstModel.valueEq(i.unref(u))}]),style:i.normalizeStyle(o()),onClick:m[3]||(m[3]=p=>h(t.firstModel))},null,6),i.createElementVNode("div",{class:i.normalizeClass(["switch-knob2",{active:!i.unref(u)}]),style:i.normalizeStyle(s()),onClick:m[4]||(m[4]=p=>h())},null,6),i.createElementVNode("div",{class:i.normalizeClass(["switch-knob3",{active:t.secondModel.valueEq(i.unref(u))}]),style:i.normalizeStyle(a()),onClick:m[5]||(m[5]=p=>h(t.secondModel))},null,6),m[6]||(m[6]=i.createElementVNode("div",{class:"switch-axis"},null,-1)),m[7]||(m[7]=i.createElementVNode("div",{class:"switch-axis-dash1"},null,-1)),m[8]||(m[8]=i.createElementVNode("div",{class:"switch-axis-dash2"},null,-1)),m[9]||(m[9]=i.createElementVNode("div",{class:"switch-axis-dash3"},null,-1))])])}}}),[["__scopeId","data-v-5dcc4d3d"]]),tm={},nm={class:"flex"};function im(t,e){return i.openBlock(),i.createElementBlock("div",nm,[i.renderSlot(t.$slots,"default",{},void 0,!0)])}const Gs=x(tm,[["render",im],["__scopeId","data-v-4d1abb74"]]),Zs=x(i.defineComponent({__name:"ToggleInfoItem",props:{title:{type:String,required:!0},content:{type:String,required:!0}},emits:["submit"],setup(t,{emit:e}){const n=i.ref(!1),r=e,o=async()=>{r("submit"),n.value=!n.value};return(s,a)=>{const c=fe,l=Ce,u=zt,h=nt;return i.openBlock(),i.createBlock(h,{title:t.title,icon:"edit-title","with-hover":!0,close:i.unref(n),width:"100%",onKeyupEnter:o},{"open-inside-content":i.withCtx(()=>[i.createVNode(u,{"custom-class":"grid"},{default:i.withCtx(()=>[i.renderSlot(s.$slots,"default",{},void 0,!0),i.createVNode(l,{type:"admin",color:"blue",text:"Сохранить",onClick:o})]),_:3})]),default:i.withCtx(()=>[t.content.length>0?(i.openBlock(),i.createBlock(c,{key:0,string:t.content},null,8,["string"])):(i.openBlock(),i.createBlock(c,{key:1,string:"Введите данные",color:"#B0A4C0"}))]),_:3},8,["title","close"])}}}),[["__scopeId","data-v-994f6522"]]),rm={class:"top-slider-content"},om={class:"center"},Js=x(i.defineComponent({__name:"TopSliderContainer",props:{sliderOffHeight:{type:String,required:!1,default:"53px"},sliderOnHeight:{type:String,required:!1,default:"220px"},background:{type:String,required:!1,default:"inherit"},toggle:{type:Boolean,default:!1}},emits:["toggle"],setup(t,{emit:e}){const n=t,r=e,o=i.ref(!0);i.watch(()=>n.toggle,()=>{o.value=!o.value});const s=a=>{o.value=!o.value,r("toggle",a)};return(a,c)=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[i.unref(o)?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",{key:0,class:"blur",onClick:[c[0]||(c[0]=i.withModifiers(l=>o.value=!0,["prevent"])),c[1]||(c[1]=i.withModifiers(()=>{},["stop"]))]})),i.createElementVNode("div",{class:"top-slider",style:i.normalizeStyle({marginTop:i.unref(o)?`calc(${t.sliderOffHeight} - ${t.sliderOnHeight})`:"0",height:t.sliderOnHeight}),onClick:c[3]||(c[3]=i.withModifiers(()=>{},["stop"]))},[i.createElementVNode("div",rm,[i.createElementVNode("div",om,[i.renderSlot(a.$slots,"default",{},void 0,!0)])]),i.createElementVNode("div",{class:"click-line",style:i.normalizeStyle({height:t.sliderOffHeight}),onClick:c[2]||(c[2]=l=>s(!i.unref(o)))},[i.renderSlot(a.$slots,"title",{},void 0,!0)],4)],4)],64))}}),[["__scopeId","data-v-fec4dfde"]]),sm={id:"drop-area",class:"img-container"},am={key:0},lm=["src"],cm={class:"tools-button"},dm={class:"ins"},um={key:1},hm=["id"],Xs=x(i.defineComponent({__name:"UploaderImage",props:{withCrop:{type:Boolean,default:!0},fileInfo:{type:_e,required:!0},height:{type:Number,default:150},width:{type:Number,default:150},cropRatio:{type:Boolean,default:!0},emitCrop:{type:Boolean,default:!1},defaultRatio:{type:Number,required:!1,default:1}},emits:["crop","removeFile"],setup(t,{emit:e}){const n=t,r=e,o=i.ref(void 0),s=S.H.Strings.CreateGuid(),a=i.ref(!1),c=i.ref(),l=w=>{const B=n.cropRatio?n.defaultRatio:0;S.S.Cropper.Open(dn.CreateCropper(w.url,B,n.fileInfo.id)),a.value=!0},u=()=>{S.Dialog.Show({text:"Вы хотите удалить изображение",confirmButtonText:"Удалить",cancelButtonText:"Не удалять"}).then(()=>{o.value=void 0,c.value.clearFiles(),r("removeFile")})},h=w=>{n.fileInfo.setFile(w),n.fileInfo.fileSystemPath&&(o.value=n.fileInfo),a.value=!1,r("crop")};i.onBeforeMount(()=>{n.fileInfo.fileSystemPath&&(o.value=n.fileInfo,o.value.url=n.fileInfo.getFileUrl())});let f=null;i.onMounted(()=>{const w=document.getElementById("drop-area");w&&(w.addEventListener("dragover",B=>{m(B),w.classList.add("drag-over")}),w.addEventListener("dragleave",B=>{m(B),w.classList.remove("drag-over")}),w.addEventListener("dragenter",m),w.addEventListener("dragleave",m),w.addEventListener("drop",p),f=document.getElementById(s))});function m(w){w.preventDefault(),w.stopPropagation()}const g=()=>{f&&f.click()};function p(w){if(w.preventDefault(),!w.dataTransfer)return;const B=w.dataTransfer.files;B.length&&f&&(f.files=B,k())}const k=()=>{if(!f||!f.files||!f.files.length)return;const w=f.files[0];w.url=URL.createObjectURL(w),o.value=w,n.fileInfo.uploadNewFile(w),l(o.value)};return(w,B)=>{const D=Ce,L=Li;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",sm,[i.unref(o)?(i.openBlock(),i.createElementBlock("div",am,[i.createElementVNode("div",{class:"img-block",style:i.normalizeStyle({width:t.height*t.defaultRatio-2+"px",height:t.height+"px"})},[i.createElementVNode("img",{class:"el-upload-list__item-thumbnail",src:i.unref(o).url,alt:"upload-image"},null,8,lm)],4),i.createElementVNode("div",cm,[i.createElementVNode("div",dm,[i.createVNode(D,{skin:"text",text:"Изменить","font-size":"20px",width:"300px",margin:"100px 0 0 0",onClick:B[0]||(B[0]=F=>l(i.unref(o)))}),i.createVNode(D,{skin:"text",text:"Удалить","font-size":"20px",width:"300px",margin:"50px 0 0 0",onClick:B[1]||(B[1]=F=>u())})])])])):(i.openBlock(),i.createElementBlock("div",um,[i.createElementVNode("div",{class:"add-button",style:i.normalizeStyle({width:t.height*t.defaultRatio-2+"px",height:t.height+"px"})},[i.createVNode(D,{skin:"text",text:"Добавить","font-size":"20px",onClick:g})],4)]))]),i.createElementVNode("input",{id:i.unref(s),type:"file",hidden:"",onChange:k},null,40,hm),t.withCrop?(i.openBlock(),i.createBlock(L,{key:0,open:i.unref(a),"default-ratio":t.defaultRatio,onCrop:h,onClose:B[2]||(B[2]=F=>a.value=!1)},null,8,["open","default-ratio"])):i.createCommentVNode("",!0)],64)}}}),[["__scopeId","data-v-4b143fdb"]]),fm=["Orders"],mm={install:function(t){t.component("PButton",Ce),t.component("PCheckBox",gi),t.component("PDatePicker",Eo),t.component("PFlex",yi),t.component("PInput",ct),t.component("PInputDate",wi),t.component("PInputNumber",vo),t.component("PLeftSlider",xo),t.component("PList",Mo),t.component("PListItem",Bo),t.component("PRadio",Ro),t.component("PRightSlider",$o),t.component("PSelect",tt),t.component("PSticky",mn),t.component("PString",fe),t.component("PTextarea",No),t.component("PTopSlider",Ao),t.component("IconDownload",qo),t.component("IconFilter",Uo),t.component("ArrowLeft",pn),t.component("ArrowRight",gn),t.component("DoubleArrowLeft",Si),t.component("DoubleArrowRight",ki),t.component("EllipsisSvg",Ei),t.component("IconArrowLeft",Wo),t.component("IconCheckDefault",pi),t.component("IconClose",Pt),t.component("IconEdit",jo),t.component("IconEmail",Go),t.component("IconMove",Zo),t.component("IconPhone",Jo),t.component("IconSearch",Ci),t.component("IconSelectArrow",bi),t.component("CollapseContainer",xs),t.component("CollapseItem",Ms),t.component("VerticalCollapseContainer",Bs),t.component("PAdd",Rs),t.component("PContainer",Hi),t.component("PContainerStickyHead",$s),t.component("PDel",Ns),t.component("PTabs",As),t.component("UploaderFile",Is),t.component("AuthForm",ln),t.component("PModal",Tt),t.component("AuthPage",oi),t.component("PageNotFound",si),t.component("AdaptiveContainer",Zi),t.component("AdaptiveContainerHorizontal",Ji),t.component("AdminGallery",ko),t.component("AuthModal",Io),t.component("CarouselImages",Po),t.component("ContextWindow",To),t.component("DateInputRangeV2",Vo),t.component("DateInputRange",zo),t.component("DropList",Fo),t.component("FilterCheckbox",Oo),t.component("FiltersButtonsSelect",Do),t.component("FilterSelect",Lo),t.component("FTSPPanel",Ho),t.component("GeneralItem",_o),t.component("GridContainer",zt),t.component("ImageCropper",Li),t.component("InfoItem",nt),t.component("InfoItemSelectButtons",Es),t.component("LeftRightContainer",vs),t.component("MessageBody",Mn),t.component("PAutocomplete",_i),t.component("PDialog",Ps),t.component("PhoneForm",Ts),t.component("PLoader",zs),t.component("PNotification",Vs),t.component("PPagination",Fs),t.component("RemoteSearch",Os),t.component("ResearcheContainer",Ds),t.component("RightSliderContainer",Ls),t.component("RightTabsContainer",Hs),t.component("SelectValueType",_s),t.component("SingleNameToggleForm",qs),t.component("SortList",Us),t.component("SortSelect",Ws),t.component("Switch3Pos",js),t.component("ThemeWrapper",Gs),t.component("ToggleInfoItem",Zs),t.component("TopSliderContainer",Js),t.component("UploaderImage",Xs)}},pm=["PF","PFM"];v.AdaptiveContainer=Zi,v.AdaptiveContainerHorizontal=Ji,v.AdminGallery=ko,v.ArrowLeft=pn,v.ArrowRight=gn,v.AuthForm=ln,v.AuthModal=Io,v.AuthPage=oi,v.CarouselImages=Po,v.CollapseContainer=xs,v.CollapseItem=Ms,v.ContextWindow=To,v.DateInputRange=zo,v.DateInputRange_v2=Vo,v.DoubleArrowLeft=Si,v.DoubleArrowRight=ki,v.DropList=Fo,v.EllipsisSvg=Ei,v.FTSPPanel=Ho,v.FilterCheckbox=Oo,v.FilterSelect=Lo,v.FiltersButtonsSelect=Do,v.GeneralItem=_o,v.GridContainer=zt,v.IconArrowLeft=Wo,v.IconCheckDefault=pi,v.IconClose=Pt,v.IconDownload=qo,v.IconEdit=jo,v.IconEmail=Go,v.IconFilter=Uo,v.IconMove=Zo,v.IconPhone=Jo,v.IconSearch=Ci,v.IconSelectArrow=bi,v.ImageCropper=Li,v.InfoItem=nt,v.InfoItemSelectButtons=Es,v.LeftRightContainer=vs,v.MessageBody=Mn,v.Orders=$e,v.PAdd=Rs,v.PAutocomplete=_i,v.PButton=Ce,v.PCheckBox=gi,v.PContainer=Hi,v.PContainerStickyHead=$s,v.PDatePicker=Eo,v.PDel=Ns,v.PDialog=Ps,v.PFM=Nu,v.PFlex=yi,v.PInput=ct,v.PInputDate=wi,v.PInputNumber=vo,v.PLeftSlider=xo,v.PList=Mo,v.PListItem=Bo,v.PLoader=zs,v.PModal=Tt,v.PNotification=Vs,v.PPagination=Fs,v.PRadio=Ro,v.PRightSlider=$o,v.PSelect=tt,v.PSticky=mn,v.PString=fe,v.PTabs=As,v.PTextarea=No,v.PTopSlider=Ao,v.PageNotFound=si,v.PhoneForm=Ts,v.RemoteSearch=Os,v.ResearcheContainer=Ds,v.RightSliderContainer=Ls,v.RightTabsContainer=Hs,v.SelectValueType=_s,v.SingleNameToggleForm=qs,v.SortList=Us,v.SortSelect=Ws,v.Switch3Pos=js,v.ThemeWrapper=Gs,v.ToggleInfoItem=Zs,v.TopSliderContainer=Js,v.UploaderFile=Is,v.UploaderImage=Xs,v.VerticalCollapseContainer=Bs,v.pfName=pm,v.servicesComponents=mm,v.typesNames=fm,Object.defineProperty(v,Symbol.toStringTag,{value:"Module"})});
42
+ `.concat(-this.coordinates.left/t-a.rotate.left-a.scale.left,"px,").concat(-this.coordinates.top/t-a.rotate.top-a.scale.top,"px) ")+gs(e),this.transitions&&this.transitions.enabled&&(s.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction)),s}return{}},size:function(){return{width:this.width||this.calculatedSize.width,height:this.height||this.calculatedSize.height}},imageSize:function(){return{width:this.image.width||this.calculatedImageSize.width,height:this.image.height||this.calculatedImageSize.height}}},watch:{image:function(t){(t.width||t.height)&&this.onChangeImage()}},mounted:function(){var t=this;this.onChangeImage(),this.$refs.image.addEventListener("load",function(){t.refreshImage()}),window.addEventListener("resize",this.refresh),window.addEventListener("orientationchange",this.refresh)},unmounted:function(){window.removeEventListener("resize",this.refresh),window.removeEventListener("orientationchange",this.refresh)},methods:{refreshImage:function(){var t=this.$refs.image;this.calculatedImageSize.height=t.naturalHeight,this.calculatedImageSize.width=t.naturalWidth},refresh:function(){var t=this.$refs.root;this.width||(this.calculatedSize.width=t.clientWidth),this.height||(this.calculatedSize.height=t.clientHeight)},onChangeImage:function(){var t=this.$refs.image;t&&t.complete&&this.refreshImage(),this.refresh()}}};bs.render=function(t,e,n,r,o,s){return i.openBlock(),i.createBlock("div",{ref:"root",class:s.classes.root,style:s.style},[i.createVNode("div",{ref:"wrapper",class:s.classes.wrapper,style:s.wrapperStyle},[i.withDirectives(i.createVNode("img",{ref:"image",src:n.image&&n.image.src,class:s.classes.image,style:s.imageStyle},null,14,["src"]),[[i.vShow,n.image&&n.image.src]])],6)],6)};var Cs={components:{Preview:bs},inheritAttrs:!1};Cs.render=function(t,e,n,r,o,s){var a=i.resolveComponent("preview");return i.openBlock(),i.createBlock(a,i.mergeProps(t.$attrs,{fill:!0}),null,16)};var Di=Be("vue-rectangle-stencil"),Ss={name:"RectangleStencil",components:{StencilPreview:Cs,BoundingBox:ms,DraggableArea:ps},props:{image:{type:Object},coordinates:{type:Object},stencilCoordinates:{type:Object},handlers:{type:Object},handlersComponent:{type:[Object,String],default:function(){return Ti}},lines:{type:Object},linesComponent:{type:[Object,String],default:function(){return zi}},aspectRatio:{type:[Number,String]},minAspectRatio:{type:[Number,String]},maxAspectRatio:{type:[Number,String]},movable:{type:Boolean,default:!0},resizable:{type:Boolean,default:!0},transitions:{type:Object},movingClass:{type:String},resizingClass:{type:String},previewClass:{type:String},boundingBoxClass:{type:String},linesClasses:{type:Object,default:function(){return{}}},linesWrappersClasses:{type:Object,default:function(){return{}}},handlersClasses:{type:Object,default:function(){return{}}},handlersWrappersClasses:{type:Object,default:function(){return{}}}},data:function(){return{moving:!1,resizing:!1}},computed:{classes:function(){return{stencil:Y(Di({movable:this.movable,moving:this.moving,resizing:this.resizing}),this.moving&&this.movingClass,this.resizing&&this.resizingClass),preview:Y(Di("preview"),this.previewClass),boundingBox:Y(Di("bounding-box"),this.boundingBoxClass)}},style:function(){var t=this.stencilCoordinates,e=t.height,n=t.width,r=t.left,o=t.top,s={width:"".concat(n,"px"),height:"".concat(e,"px"),transform:"translate(".concat(r,"px, ").concat(o,"px)")};return this.transitions&&this.transitions.enabled&&(s.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction)),s}},methods:{onMove:function(t){this.$emit("move",t),this.moving=!0},onMoveEnd:function(){this.$emit("move-end"),this.moving=!1},onResize:function(t){this.$emit("resize",t),this.resizing=!0},onResizeEnd:function(){this.$emit("resize-end"),this.resizing=!1},aspectRatios:function(){return{minimum:this.aspectRatio||this.minAspectRatio,maximum:this.aspectRatio||this.maxAspectRatio}}},emits:["resize","resize-end","move","move-end"]};Ss.render=function(t,e,n,r,o,s){var a=i.resolveComponent("stencil-preview"),c=i.resolveComponent("draggable-area"),l=i.resolveComponent("bounding-box");return i.openBlock(),i.createBlock("div",{class:s.classes.stencil,style:s.style},[i.createVNode(l,{width:n.stencilCoordinates.width,height:n.stencilCoordinates.height,transitions:n.transitions,class:s.classes.boundingBox,handlers:n.handlers,"handlers-component":n.handlersComponent,"handlers-classes":n.handlersClasses,"handlers-wrappers-classes":n.handlersWrappersClasses,lines:n.lines,"lines-component":n.linesComponent,"lines-classes":n.linesClasses,"lines-wrappers-classes":n.linesWrappersClasses,resizable:n.resizable,onResize:s.onResize,onResizeEnd:s.onResizeEnd},{default:i.withCtx(function(){return[i.createVNode(c,{movable:n.movable,onMove:s.onMove,onMoveEnd:s.onMoveEnd},{default:i.withCtx(function(){return[i.createVNode(a,{image:n.image,coordinates:n.coordinates,width:n.stencilCoordinates.width,height:n.stencilCoordinates.height,class:s.classes.preview,transitions:n.transitions},null,8,["image","coordinates","width","height","class","transitions"])]}),_:1},8,["movable","onMove","onMoveEnd"])]}),_:1},8,["width","height","transitions","class","handlers","handlers-component","handlers-classes","handlers-wrappers-classes","lines","lines-component","lines-classes","lines-wrappers-classes","resizable","onResize","onResizeEnd"])],6)};var Xh=["transitions"],Le=Be("vue-advanced-cropper"),ks={name:"Cropper",components:{BackgroundWrapper:Oi},props:{src:{type:String,default:null},stencilComponent:{type:[Object,String],default:function(){return Ss}},backgroundWrapperComponent:{type:[Object,String],default:function(){return Oi}},stencilProps:{type:Object,default:function(){return{}}},autoZoom:{type:Boolean,default:!1},imageClass:{type:String},boundariesClass:{type:String},backgroundClass:{type:String},foregroundClass:{type:String},minWidth:{type:[Number,String]},minHeight:{type:[Number,String]},maxWidth:{type:[Number,String]},maxHeight:{type:[Number,String]},debounce:{type:[Boolean,Number],default:500},transitions:{type:Boolean,default:!0},checkOrientation:{type:Boolean,default:!0},canvas:{type:[Object,Boolean],default:!0},crossOrigin:{type:[Boolean,String],default:void 0},transitionTime:{type:Number,default:300},imageRestriction:{type:String,default:"fit-area",validator:function(t){return Rh.indexOf(t)!==-1}},roundResult:{type:Boolean,default:!0},defaultSize:{type:[Function,Object]},defaultPosition:{type:[Function,Object]},defaultVisibleArea:{type:[Function,Object]},defaultTransforms:{type:[Function,Object]},defaultBoundaries:{type:[Function,String],validator:function(t){return!(typeof t=="string"&&t!=="fill"&&t!=="fit")}},priority:{type:String,default:"coordinates"},stencilSize:{type:[Object,Function]},resizeImage:{type:[Boolean,Object],default:!0},moveImage:{type:[Boolean,Object],default:!0},autoZoomAlgorithm:{type:Function},resizeAlgorithm:{type:Function,default:function(t){var e=t.event,n=t.coordinates,r=t.aspectRatio,o=t.positionRestrictions,s=t.sizeRestrictions,a=I(I({},n),{right:n.left+n.width,bottom:n.top+n.height}),c=e.params||{},l=I({},e.directions),u=c.allowedDirections||{left:!0,right:!0,bottom:!0,top:!0};s.widthFrozen&&(l.left=0,l.right=0),s.heightFrozen&&(l.top=0,l.bottom=0),Ae.forEach(function(F){u[F]||(l[F]=0)});var h=Pe(a,l=fs({coordinates:a,directions:l,sizeRestrictions:s,positionRestrictions:o})).width,f=Pe(a,l).height,m=c.preserveRatio?W(a):Ai(h/f,r);if(m){var g=c.respectDirection;if(g||(g=a.width>=a.height||m===1?"width":"height"),g==="width"){var p=h/m-a.height;if(u.top&&u.bottom){var k=l.top,w=l.bottom;l.bottom=vn(p,w,k),l.top=vn(p,k,w)}else u.bottom?l.bottom=p:u.top?l.top=p:u.right?l.right=0:u.left&&(l.left=0)}else if(g==="height"){var B=a.width-f*m;if(u.left&&u.right){var D=l.left,L=l.right;l.left=-vn(B,D,L),l.right=-vn(B,L,D)}else u.left?l.left=-B:u.right?l.right=-B:u.top?l.top=0:u.bottom&&(l.bottom=0)}l=fs({directions:l,coordinates:a,sizeRestrictions:s,positionRestrictions:o,preserveRatio:!0,compensate:c.compensate})}return h=Pe(a,l).width,f=Pe(a,l).height,(m=c.preserveRatio?W(a):Ai(h/f,r))&&Math.abs(m-h/f)>.001&&Ae.forEach(function(F){u[F]||(l[F]=0)}),Pi({event:new Ri({left:-l.left,top:-l.top}),coordinates:{width:n.width+l.right+l.left,height:n.height+l.top+l.bottom,left:n.left,top:n.top},positionRestrictions:o})}},moveAlgorithm:{type:Function,default:Pi},initStretcher:{type:Function,default:function(t){var e=t.stretcher,n=t.imageSize,r=W(n);e.style.width=n.width+"px",e.style.height=e.clientWidth/r+"px",e.style.width=e.clientWidth+"px"}},fitCoordinates:{type:Function,default:function(t){var e=t.visibleArea,n=t.coordinates,r=t.aspectRatio,o=t.sizeRestrictions,s=t.positionRestrictions,a=I(I({},n),De({width:n.width,height:n.height,aspectRatio:r,sizeRestrictions:{maxWidth:e.width,maxHeight:e.height,minHeight:Math.min(e.height,o.minHeight),minWidth:Math.min(e.width,o.minWidth)}}));return a=ae(a=me(a,pt(se(n),se(a))),kn(Ie(e),s))}},fitVisibleArea:{type:Function,default:function(t){var e=t.visibleArea,n=t.boundaries,r=t.getAreaRestrictions,o=t.coordinates,s=I({},e);s.height=s.width/W(n),s.top+=(e.height-s.height)/2,(o.height-s.height>0||o.width-s.width>0)&&(s=ke(s,Math.max(o.height/s.height,o.width/s.width)));var a=Cn(yt(o,Ie(s=ke(s,Sn(s,r({visibleArea:s,type:"resize"}))))));return s.width<o.width&&(a.left=0),s.height<o.height&&(a.top=0),s=ae(s=me(s,a),r({visibleArea:s,type:"move"}))}},areaRestrictionsAlgorithm:{type:Function,default:function(t){var e=t.visibleArea,n=t.boundaries,r=t.imageSize,o=t.imageRestriction,s=t.type,a={};return o==="fill-area"?a={left:0,top:0,right:r.width,bottom:r.height}:o==="fit-area"&&(W(n)>W(r)?(a={top:0,bottom:r.height},e&&s==="move"&&(e.width>r.width?(a.left=-(e.width-r.width)/2,a.right=r.width-a.left):(a.left=0,a.right=r.width))):(a={left:0,right:r.width},e&&s==="move"&&(e.height>r.height?(a.top=-(e.height-r.height)/2,a.bottom=r.height-a.top):(a.top=0,a.bottom=r.height)))),a}},sizeRestrictionsAlgorithm:{type:Function,default:function(t){return{minWidth:t.minWidth,minHeight:t.minHeight,maxWidth:t.maxWidth,maxHeight:t.maxHeight}}},positionRestrictionsAlgorithm:{type:Function,default:function(t){var e=t.imageSize,n={};return t.imageRestriction!=="none"&&(n={left:0,top:0,right:e.width,bottom:e.height}),n}}},data:function(){return{transitionsActive:!1,imageLoaded:!1,imageAttributes:{width:null,height:null,crossOrigin:null,src:null},defaultImageTransforms:{rotate:0,flip:{horizontal:!1,vertical:!1}},appliedImageTransforms:{rotate:0,flip:{horizontal:!1,vertical:!1}},boundaries:{width:0,height:0},visibleArea:null,coordinates:U({},ss)}},computed:{image:function(){return{src:this.imageAttributes.src,width:this.imageAttributes.width,height:this.imageAttributes.height,transforms:this.imageTransforms}},imageTransforms:function(){return{rotate:this.appliedImageTransforms.rotate,flip:{horizontal:this.appliedImageTransforms.flip.horizontal,vertical:this.appliedImageTransforms.flip.vertical},translateX:this.visibleArea?this.visibleArea.left/this.coefficient:0,translateY:this.visibleArea?this.visibleArea.top/this.coefficient:0,scaleX:1/this.coefficient,scaleY:1/this.coefficient}},imageSize:function(){var t=function(e){return e*Math.PI/180}(this.imageTransforms.rotate);return{width:Math.abs(this.imageAttributes.width*Math.cos(t))+Math.abs(this.imageAttributes.height*Math.sin(t)),height:Math.abs(this.imageAttributes.width*Math.sin(t))+Math.abs(this.imageAttributes.height*Math.cos(t))}},initialized:function(){return!!(this.visibleArea&&this.imageLoaded)},settings:function(){var t=Bi(this.resizeImage,{touch:!0,wheel:{ratio:.1},adjustStencil:!0},{touch:!1,wheel:!1,adjustStencil:!1});return{moveImage:Bi(this.moveImage,{touch:!0,mouse:!0},{touch:!1,mouse:!1}),resizeImage:t}},coefficient:function(){return this.visibleArea?this.visibleArea.width/this.boundaries.width:0},areaRestrictions:function(){return this.imageLoaded?this.areaRestrictionsAlgorithm({imageSize:this.imageSize,imageRestriction:this.imageRestriction,boundaries:this.boundaries}):{}},transitionsOptions:function(){return{enabled:this.transitionsActive,timingFunction:"ease-in-out",time:350}},sizeRestrictions:function(){if(this.boundaries.width&&this.boundaries.height&&this.imageSize.width&&this.imageSize.height){var t=this.sizeRestrictionsAlgorithm({imageSize:this.imageSize,minWidth:ne(this.minWidth)?0:bn(this.minWidth),minHeight:ne(this.minHeight)?0:bn(this.minHeight),maxWidth:ne(this.maxWidth)?1/0:bn(this.maxWidth),maxHeight:ne(this.maxHeight)?1/0:bn(this.maxHeight)});if(t=function(r){var o=r.areaRestrictions,s=r.sizeRestrictions,a=r.boundaries,c=r.positionRestrictions,l=I(I({},s),{minWidth:s.minWidth!==void 0?s.minWidth:0,minHeight:s.minHeight!==void 0?s.minHeight:0,maxWidth:s.maxWidth!==void 0?s.maxWidth:1/0,maxHeight:s.maxHeight!==void 0?s.maxHeight:1/0});c.left!==void 0&&c.right!==void 0&&(l.maxWidth=Math.min(l.maxWidth,c.right-c.left)),c.bottom!==void 0&&c.top!==void 0&&(l.maxHeight=Math.min(l.maxHeight,c.bottom-c.top));var u=Ii(o),h=ls(a,u);return u.width<1/0&&(!l.maxWidth||l.maxWidth>h.width)&&(l.maxWidth=Math.min(l.maxWidth,h.width)),u.height<1/0&&(!l.maxHeight||l.maxHeight>h.height)&&(l.maxHeight=Math.min(l.maxHeight,h.height)),l.minWidth>l.maxWidth&&(l.minWidth=l.maxWidth,l.widthFrozen=!0),l.minHeight>l.maxHeight&&(l.minHeight=l.maxHeight,l.heightFrozen=!0),l}({sizeRestrictions:t,areaRestrictions:this.getAreaRestrictions({visibleArea:this.visibleArea,type:"resize"}),imageSize:this.imageSize,boundaries:this.boundaries,positionRestrictions:this.positionRestrictions,imageRestriction:this.imageRestriction,visibleArea:this.visibleArea,stencilSize:this.getStencilSize()}),this.visibleArea&&this.stencilSize){var e=this.getStencilSize(),n=Ii(this.getAreaRestrictions({visibleArea:this.visibleArea,type:"resize"}));t.maxWidth=Math.min(t.maxWidth,n.width*e.width/this.boundaries.width),t.maxHeight=Math.min(t.maxHeight,n.height*e.height/this.boundaries.height),t.maxWidth<t.minWidth&&(t.minWidth=t.maxWidth),t.maxHeight<t.minHeight&&(t.minHeight=t.maxHeight)}return t}return{minWidth:0,minHeight:0,maxWidth:0,maxHeight:0}},positionRestrictions:function(){return this.positionRestrictionsAlgorithm({imageSize:this.imageSize,imageRestriction:this.imageRestriction})},classes:function(){return{cropper:Le(),image:Y(Le("image"),this.imageClass),stencil:Le("stencil"),boundaries:Y(Le("boundaries"),this.boundariesClass),stretcher:Y(Le("stretcher")),background:Y(Le("background"),this.backgroundClass),foreground:Y(Le("foreground"),this.foregroundClass),imageWrapper:Y(Le("image-wrapper")),cropperWrapper:Y(Le("cropper-wrapper"))}},stencilCoordinates:function(){if(this.initialized){var t=this.coordinates,e=t.width,n=t.height,r=t.left,o=t.top;return{width:e/this.coefficient,height:n/this.coefficient,left:(r-this.visibleArea.left)/this.coefficient,top:(o-this.visibleArea.top)/this.coefficient}}return this.defaultCoordinates()},boundariesStyle:function(){var t={width:this.boundaries.width?"".concat(Math.round(this.boundaries.width),"px"):"auto",height:this.boundaries.height?"".concat(Math.round(this.boundaries.height),"px"):"auto",transition:"opacity ".concat(this.transitionTime,"ms"),pointerEvents:this.imageLoaded?"all":"none"};return this.imageLoaded||(t.opacity="0"),t},imageStyle:function(){var t=this.imageAttributes.width>this.imageAttributes.height?{width:Math.min(1024,this.imageAttributes.width),height:Math.min(1024,this.imageAttributes.width)/(this.imageAttributes.width/this.imageAttributes.height)}:{height:Math.min(1024,this.imageAttributes.height),width:Math.min(1024,this.imageAttributes.height)*(this.imageAttributes.width/this.imageAttributes.height)},e={left:(t.width-this.imageSize.width)/(2*this.coefficient),top:(t.height-this.imageSize.height)/(2*this.coefficient)},n={left:(1-1/this.coefficient)*t.width/2,top:(1-1/this.coefficient)*t.height/2},r=U(U({},this.imageTransforms),{},{scaleX:this.imageTransforms.scaleX*(this.imageAttributes.width/t.width),scaleY:this.imageTransforms.scaleY*(this.imageAttributes.height/t.height)}),o={width:"".concat(t.width,"px"),height:"".concat(t.height,"px"),left:"0px",top:"0px",transform:"translate(".concat(-e.left-n.left-this.imageTransforms.translateX,"px, ").concat(-e.top-n.top-this.imageTransforms.translateY,"px)")+gs(r)};return this.transitionsOptions.enabled&&(o.transition="".concat(this.transitionsOptions.time,"ms ").concat(this.transitionsOptions.timingFunction)),o}},watch:{src:function(){this.onChangeImage()},stencilComponent:function(){var t=this;this.$nextTick(function(){t.resetCoordinates(),t.runAutoZoom("setCoordinates"),t.onChange()})},minWidth:function(){this.onPropsChange()},maxWidth:function(){this.onPropsChange()},minHeight:function(){this.onPropsChange()},maxHeight:function(){this.onPropsChange()},imageRestriction:function(){this.reset()},stencilProps:function(t,e){["aspectRatio","minAspectRatio","maxAspectRatio"].find(function(n){return t[n]!==e[n]})&&this.$nextTick(this.onPropsChange)}},created:function(){this.debouncedUpdate=Mi(this.update,this.debounce),this.debouncedDisableTransitions=Mi(this.disableTransitions,this.transitionsOptions.time),this.awaiting=!1},mounted:function(){this.$refs.image.addEventListener("load",this.onSuccessLoadImage),this.$refs.image.addEventListener("error",this.onFailLoadImage),this.onChangeImage(),window.addEventListener("resize",this.refresh),window.addEventListener("orientationchange",this.refresh)},unmounted:function(){window.removeEventListener("resize",this.refresh),window.removeEventListener("orientationchange",this.refresh),this.imageAttributes.revoke&&this.imageAttributes.src&&URL.revokeObjectURL(this.imageAttributes.src),this.debouncedUpdate.clear(),this.debouncedDisableTransitions.clear()},methods:{getResult:function(){var t=this.initialized?this.prepareResult(U({},this.coordinates)):this.defaultCoordinates(),e={rotate:this.imageTransforms.rotate%360,flip:U({},this.imageTransforms.flip)};if(this.src&&this.imageLoaded){var n=this;return{image:this.image,coordinates:t,visibleArea:this.visibleArea?U({},this.visibleArea):null,imageTransforms:e,get canvas(){return n.canvas?n.getCanvas():void 0}}}return{image:this.image,coordinates:t,visibleArea:this.visibleArea?U({},this.visibleArea):null,canvas:void 0,imageTransforms:e}},zoom:function(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.transitions,o=r===void 0||r;this.onManipulateImage(new Vt({},{factor:1/t,center:e}),{normalize:!1,transitions:o})},move:function(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.transitions,o=r===void 0||r;this.onManipulateImage(new Vt({left:t||0,top:e||0}),{normalize:!1,transitions:o})},setCoordinates:function(t){var e=this,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.autoZoom,o=r===void 0||r,s=n.transitions,a=s===void 0||s;this.$nextTick(function(){e.imageLoaded?(e.transitionsActive||(a&&e.enableTransitions(),e.coordinates=e.applyTransform(t),o&&e.runAutoZoom("setCoordinates"),a&&e.debouncedDisableTransitions()),e.onChange()):e.delayedTransforms=t})},refresh:function(){var t=this,e=this.$refs.image;if(this.src&&e)return this.initialized?this.updateVisibleArea().then(function(){t.onChange()}):this.resetVisibleArea().then(function(){t.onChange()})},reset:function(){var t=this;return this.resetVisibleArea().then(function(){t.onChange(!1)})},awaitRender:function(t){var e=this;this.awaiting||(this.awaiting=!0,this.$nextTick(function(){t(),e.awaiting=!1}))},prepareResult:function(t){return this.roundResult?function(e){var n=e.coordinates,r=e.sizeRestrictions,o=e.positionRestrictions,s={width:Math.round(n.width),height:Math.round(n.height),left:Math.round(n.left),top:Math.round(n.top)};return s.width>r.maxWidth?s.width=Math.floor(n.width):s.width<r.minWidth&&(s.width=Math.ceil(n.width)),s.height>r.maxHeight?s.height=Math.floor(n.height):s.height<r.minHeight&&(s.height=Math.ceil(n.height)),ae(s,o)}(U(U({},this.getPublicProperties()),{},{positionRestrictions:En(this.positionRestrictions,this.visibleArea),coordinates:t})):t},processAutoZoom:function(t,e,n,r){var o=this.autoZoomAlgorithm;o||(o=this.stencilSize?Ah:this.autoZoom?Ih:Ph);var s=o({event:{type:t,params:r},visibleArea:e,coordinates:n,boundaries:this.boundaries,aspectRatio:this.getAspectRatio(),positionRestrictions:this.positionRestrictions,getAreaRestrictions:this.getAreaRestrictions,sizeRestrictions:this.sizeRestrictions,stencilSize:this.getStencilSize()});return U(U({},s),{},{changed:!as(s.visibleArea,e)||!as(s.coordinates,n)})},runAutoZoom:function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=e.transitions,r=n!==void 0&&n,o=Ch(e,Xh),s=this.processAutoZoom(t,this.visibleArea,this.coordinates,o),a=s.visibleArea,c=s.coordinates,l=s.changed;r&&l&&this.enableTransitions(),this.visibleArea=a,this.coordinates=c,r&&l&&this.debouncedDisableTransitions()},normalizeEvent:function(t){return function(e){var n=e.event,r=e.visibleArea,o=e.coefficient;if(n.type==="manipulateImage")return I(I({},n),{move:{left:n.move&&n.move.left?o*n.move.left:0,top:n.move&&n.move.top?o*n.move.top:0},scale:{factor:n.scale&&n.scale.factor?n.scale.factor:1,center:n.scale&&n.scale.center?{left:n.scale.center.left*o+r.left,top:n.scale.center.top*o+r.top}:null}});if(n.type==="resize"){var s=I(I({},n),{directions:I({},n.directions)});return Ae.forEach(function(c){s.directions[c]*=o}),s}if(n.type==="move"){var a=I(I({},n),{directions:I({},n.directions)});return Bh.forEach(function(c){a.directions[c]*=o}),a}return n}(U(U({},this.getPublicProperties()),{},{event:t}))},getCanvas:function(){if(this.$refs.canvas){var t=this.$refs.canvas,e=this.$refs.image,n=this.imageTransforms.rotate!==0||this.imageTransforms.flip.horizontal||this.imageTransforms.flip.vertical?function(c,l,u){var h=u.rotate,f=u.flip,m={width:l.naturalWidth,height:l.naturalHeight},g=cs(m,h),p=c.getContext("2d");c.height=g.height,c.width=g.width,p.save();var k=We(se(I({left:0,top:0},m)),h);return p.translate(-(k.left-g.width/2),-(k.top-g.height/2)),p.rotate(h*Math.PI/180),p.translate(f.horizontal?m.width:0,f.vertical?m.height:0),p.scale(f.horizontal?-1:1,f.vertical?-1:1),p.drawImage(l,0,0,m.width,m.height),p.restore(),c}(this.$refs.sourceCanvas,e,this.imageTransforms):e,r=U({minWidth:0,minHeight:0,maxWidth:1/0,maxHeight:1/0,maxArea:this.maxCanvasSize,imageSmoothingEnabled:!0,imageSmoothingQuality:"high",fillColor:"transparent"},this.canvas),o=function(c){return c.find(function(l){return u=l,!Number.isNaN(parseFloat(u))&&isFinite(u);var u})},s=De({sizeRestrictions:{minWidth:o([r.width,r.minWidth])||0,minHeight:o([r.height,r.minHeight])||0,maxWidth:o([r.width,r.maxWidth])||1/0,maxHeight:o([r.height,r.maxHeight])||1/0},width:this.coordinates.width,height:this.coordinates.height,aspectRatio:{minimum:this.coordinates.width/this.coordinates.height,maximum:this.coordinates.width/this.coordinates.height}});if(r.maxArea&&s.width*s.height>r.maxArea){var a=Math.sqrt(r.maxArea/(s.width*s.height));s={width:Math.round(a*s.width),height:Math.round(a*s.height)}}return function(c,l,u,h,f){c.width=h?h.width:u.width,c.height=h?h.height:u.height;var m=c.getContext("2d");m.clearRect(0,0,c.width,c.height),f&&(f.imageSmoothingEnabled&&(m.imageSmoothingEnabled=f.imageSmoothingEnabled),f.imageSmoothingQuality&&(m.imageSmoothingQuality=f.imageSmoothingQuality),f.fillColor&&(m.fillStyle=f.fillColor,m.fillRect(0,0,c.width,c.height),m.save()));var g=u.left<0?-u.left:0,p=u.top<0?-u.top:0;m.drawImage(l,u.left+g,u.top+p,u.width,u.height,g*(c.width/u.width),p*(c.height/u.height),c.width,c.height)}(t,n,this.coordinates,s,r),t}},update:function(){this.$emit("change",this.getResult())},applyTransform:function(t){var e=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n=this.visibleArea&&e?$h(this.sizeRestrictions,this.visibleArea):this.sizeRestrictions,r=this.visibleArea&&e?En(this.positionRestrictions,this.visibleArea):this.positionRestrictions;return Nh({transform:t,coordinates:this.coordinates,imageSize:this.imageSize,sizeRestrictions:n,positionRestrictions:r,aspectRatio:this.getAspectRatio(),visibleArea:this.visibleArea})},resetCoordinates:function(){var t=this;if(this.$refs.image){this.$refs.cropper,this.$refs.image;var e=this.defaultSize;e||(e=this.stencilSize?Vh:zh);var n=this.sizeRestrictions;n.minWidth,n.minHeight,n.maxWidth,n.maxHeight;var r=mt(e)?e({boundaries:this.boundaries,imageSize:this.imageSize,aspectRatio:this.getAspectRatio(),sizeRestrictions:this.sizeRestrictions,stencilSize:this.getStencilSize(),visibleArea:this.visibleArea}):e,o=this.defaultPosition||Th,s=[r,function(a){var c=a.coordinates;return U({},mt(o)?o({coordinates:c,imageSize:t.imageSize,visibleArea:t.visibleArea}):t.defaultPosition)}];this.delayedTransforms&&s.push.apply(s,it(Array.isArray(this.delayedTransforms)?this.delayedTransforms:[this.delayedTransforms])),this.coordinates=this.applyTransform(s,!0),this.delayedTransforms=null}},clearImage:function(){var t=this;this.imageLoaded=!1,setTimeout(function(){var e=t.$refs.stretcher;e&&(e.style.height="auto",e.style.width="auto"),t.coordinates=t.defaultCoordinates(),t.boundaries={width:0,height:0}},this.transitionTime)},enableTransitions:function(){this.transitions&&(this.transitionsActive=!0)},disableTransitions:function(){this.transitionsActive=!1},updateBoundaries:function(){var t=this,e=this.$refs.stretcher,n=this.$refs.cropper;return this.initStretcher({cropper:n,stretcher:e,imageSize:this.imageSize}),this.$nextTick().then(function(){var r={cropper:n,imageSize:t.imageSize};if(mt(t.defaultBoundaries)?t.boundaries=t.defaultBoundaries(r):t.defaultBoundaries==="fit"?t.boundaries=function(o){var s=o.cropper,a=o.imageSize,c=s.clientHeight,l=s.clientWidth,u=c,h=a.width*c/a.height;return h>l&&(h=l,u=a.height*l/a.width),{width:h,height:u}}(r):t.boundaries=function(o){var s=o.cropper;return{width:s.clientWidth,height:s.clientHeight}}(r),!t.boundaries.width||!t.boundaries.height)throw new Error("It's impossible to fit the cropper in the current container")})},resetVisibleArea:function(){var t=this;return this.appliedImageTransforms=U(U({},this.defaultImageTransforms),{},{flip:U({},this.defaultImageTransforms.flip)}),this.updateBoundaries().then(function(){t.priority!=="visible-area"&&(t.visibleArea=null,t.resetCoordinates());var e,n,r,o,s,a,c=t.defaultVisibleArea||Fh;t.visibleArea=mt(c)?c({imageSize:t.imageSize,boundaries:t.boundaries,coordinates:t.priority!=="visible-area"?t.coordinates:null,getAreaRestrictions:t.getAreaRestrictions,stencilSize:t.getStencilSize()}):t.defaultVisibleArea,t.visibleArea=(e={visibleArea:t.visibleArea,boundaries:t.boundaries,getAreaRestrictions:t.getAreaRestrictions},n=e.visibleArea,r=e.boundaries,o=e.getAreaRestrictions,s=I({},n),a=W(r),s.width/s.height!==a&&(s.height=s.width/a),ae(s,o({visibleArea:s,type:"move"}))),t.priority==="visible-area"?t.resetCoordinates():t.coordinates=t.fitCoordinates({visibleArea:t.visibleArea,coordinates:t.coordinates,aspectRatio:t.getAspectRatio(),positionRestrictions:t.positionRestrictions,sizeRestrictions:t.sizeRestrictions}),t.runAutoZoom("resetVisibleArea")}).catch(function(){t.visibleArea=null})},updateVisibleArea:function(){var t=this;return this.updateBoundaries().then(function(){t.visibleArea=t.fitVisibleArea({imageSize:t.imageSize,boundaries:t.boundaries,visibleArea:t.visibleArea,coordinates:t.coordinates,getAreaRestrictions:t.getAreaRestrictions}),t.coordinates=t.fitCoordinates({visibleArea:t.visibleArea,coordinates:t.coordinates,aspectRatio:t.getAspectRatio(),positionRestrictions:t.positionRestrictions,sizeRestrictions:t.sizeRestrictions}),t.runAutoZoom("updateVisibleArea")}).catch(function(){t.visibleArea=null})},onChange:function(){var t=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];t&&this.debounce?this.debouncedUpdate():this.update()},onChangeImage:function(){var t,e=this;if(this.imageLoaded=!1,this.delayedTransforms=null,this.src){if(function(o){if(es(o))return!1;var s=window.location,a=/(\w+:)?(?:\/\/)([\w.-]+)?(?::(\d+))?\/?/.exec(o)||[],c={protocol:a[1]||"",host:a[2]||"",port:a[3]||""},l=function(u){return u.port||((u.protocol||s.protocol)==="http"?80:433)};return!(!c.protocol&&!c.host&&!c.port||c.protocol&&c.protocol==s.protocol&&c.host&&c.host==s.host&&c.host&&l(c)==l(s))}(this.src)){var n=ne(this.crossOrigin)?this.canvas:this.crossOrigin;n===!0&&(n="anonymous"),this.imageAttributes.crossOrigin=n||null}if(this.checkOrientation){var r=(t=this.src,new Promise(function(o){Zh(t).then(function(s){var a=Jh(s);o(s?{source:t,arrayBuffer:s,orientation:a}:{source:t,arrayBuffer:null,orientation:null})}).catch(function(s){console.warn(s),o({source:t,arrayBuffer:null,orientation:null})})}));setTimeout(function(){r.then(e.onParseImage)},this.transitionTime)}else setTimeout(function(){e.onParseImage({source:e.src})},this.transitionTime)}else this.clearImage()},onFailLoadImage:function(){this.imageAttributes.src&&(this.clearImage(),this.$emit("error"))},onSuccessLoadImage:function(){var t=this,e=this.$refs.image;e&&!this.imageLoaded&&(this.imageAttributes.height=e.naturalHeight,this.imageAttributes.width=e.naturalWidth,this.imageLoaded=!0,this.resetVisibleArea().then(function(){t.$emit("ready"),t.onChange(!1)}))},onParseImage:function(t){var e=this,n=t.source,r=t.arrayBuffer,o=t.orientation;this.imageAttributes.revoke&&this.imageAttributes.src&&URL.revokeObjectURL(this.imageAttributes.src),this.imageAttributes.revoke=!1,r&&o&&o>1?Ko(n)||!es(n)?(this.imageAttributes.src=URL.createObjectURL(new Blob([r])),this.imageAttributes.revoke=!0):this.imageAttributes.src=function(s){for(var a=[],c=new Uint8Array(s);c.length>0;){var l=c.subarray(0,8192);a.push(String.fromCharCode.apply(null,Array.from?Array.from(l):l.slice())),c=c.subarray(8192)}return"data:image/jpeg;base64,"+btoa(a.join(""))}(r):this.imageAttributes.src=n,mt(this.defaultTransforms)?this.appliedImageTransforms=Fi(this.defaultTransforms()):wn(this.defaultTransforms)?this.appliedImageTransforms=Fi(this.defaultTransforms):this.appliedImageTransforms=function(s){var a=Fi({});if(s)switch(s){case 2:a.flip.horizontal=!0;break;case 3:a.rotate=-180;break;case 4:a.flip.vertical=!0;break;case 5:a.rotate=90,a.flip.vertical=!0;break;case 6:a.rotate=90;break;case 7:a.rotate=90,a.flip.horizontal=!0;break;case 8:a.rotate=-90}return a}(o),this.defaultImageTransforms=U(U({},this.appliedImageTransforms),{},{flip:U({},this.appliedImageTransforms.flip)}),this.$nextTick(function(){var s=e.$refs.image;s&&s.complete&&(function(a){return!!a.naturalWidth}(s)?e.onSuccessLoadImage():e.onFailLoadImage())})},onResizeEnd:function(){this.runAutoZoom("resize",{transitions:!0})},onMoveEnd:function(){this.runAutoZoom("move",{transitions:!0})},onMove:function(t){var e=this;this.transitionsOptions.enabled||this.awaitRender(function(){e.coordinates=e.moveAlgorithm(U(U({},e.getPublicProperties()),{},{positionRestrictions:En(e.positionRestrictions,e.visibleArea),coordinates:e.coordinates,event:e.normalizeEvent(t)})),e.onChange()})},onResize:function(t){var e=this;this.transitionsOptions.enabled||this.stencilSize&&!this.autoZoom||this.awaitRender(function(){var n=e.sizeRestrictions,r=Math.min(e.coordinates.width,e.coordinates.height,20*e.coefficient);e.coordinates=e.resizeAlgorithm(U(U({},e.getPublicProperties()),{},{positionRestrictions:En(e.positionRestrictions,e.visibleArea),sizeRestrictions:{maxWidth:Math.min(n.maxWidth,e.visibleArea.width),maxHeight:Math.min(n.maxHeight,e.visibleArea.height),minWidth:Math.max(n.minWidth,r),minHeight:Math.max(n.minHeight,r)},event:e.normalizeEvent(t)})),e.onChange(),e.ticking=!1})},onManipulateImage:function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.transitionsOptions.enabled){var n=e.transitions,r=n!==void 0&&n,o=e.normalize,s=o===void 0||o;r&&this.enableTransitions();var a=Oh(U(U({},this.getPublicProperties()),{},{event:s?this.normalizeEvent(t):t,getAreaRestrictions:this.getAreaRestrictions,imageRestriction:this.imageRestriction,adjustStencil:!this.stencilSize&&this.settings.resizeImage.adjustStencil})),c=a.visibleArea,l=a.coordinates;this.visibleArea=c,this.coordinates=l,this.runAutoZoom("manipulateImage"),this.onChange(),r&&this.debouncedDisableTransitions()}},onPropsChange:function(){this.coordinates=this.applyTransform(this.coordinates,!0),this.onChange(!1)},getAreaRestrictions:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=t.visibleArea,n=t.type,r=n===void 0?"move":n;return this.areaRestrictionsAlgorithm({boundaries:this.boundaries,imageSize:this.imageSize,imageRestriction:this.imageRestriction,visibleArea:e,type:r})},getAspectRatio:function(t){var e,n,r=this.stencilProps,o=r.aspectRatio,s=r.minAspectRatio,a=r.maxAspectRatio;if(this.$refs.stencil&&this.$refs.stencil.aspectRatios){var c=this.$refs.stencil.aspectRatios();e=c.minimum,n=c.maximum}if(ne(e)&&(e=ne(o)?s:o),ne(n)&&(n=ne(o)?a:o),!t&&(ne(e)||ne(n))){var l=this.getStencilSize(),u=l?W(l):null;ne(e)&&(e=ts(u)?u:void 0),ne(n)&&(n=ts(u)?u:void 0)}return{minimum:e,maximum:n}},getStencilSize:function(){if(this.stencilSize)return t={currentStencilSize:{width:this.stencilCoordinates.width,height:this.stencilCoordinates.height},stencilSize:this.stencilSize,boundaries:this.boundaries,coefficient:this.coefficient,coordinates:this.coordinates,aspectRatio:this.getAspectRatio(!0)},e=t.boundaries,n=t.stencilSize,r=t.aspectRatio,Ai(W(o=mt(n)?n({boundaries:e,aspectRatio:r}):n),r)&&(o=De({sizeRestrictions:{maxWidth:e.width,maxHeight:e.height,minWidth:0,minHeight:0},width:o.width,height:o.height,aspectRatio:{minimum:r.minimum,maximum:r.maximum}})),(o.width>e.width||o.height>e.height)&&(o=De({sizeRestrictions:{maxWidth:e.width,maxHeight:e.height,minWidth:0,minHeight:0},width:o.width,height:o.height,aspectRatio:{minimum:W(o),maximum:W(o)}})),o;var t,e,n,r,o},getPublicProperties:function(){return{coefficient:this.coefficient,visibleArea:this.visibleArea,coordinates:this.coordinates,boundaries:this.boundaries,sizeRestrictions:this.sizeRestrictions,positionRestrictions:this.positionRestrictions,aspectRatio:this.getAspectRatio(),imageRestriction:this.imageRestriction}},defaultCoordinates:function(){return U({},ss)},flip:function(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.transitions,o=r===void 0||r;if(!this.transitionsActive){o&&this.enableTransitions();var s=U({},this.imageTransforms.flip),a=Lh({flip:{horizontal:t?!s.horizontal:s.horizontal,vertical:e?!s.vertical:s.vertical},previousFlip:s,rotate:this.imageTransforms.rotate,visibleArea:this.visibleArea,coordinates:this.coordinates,imageSize:this.imageSize,positionRestrictions:this.positionRestrictions,sizeRestrictions:this.sizeRestrictions,getAreaRestrictions:this.getAreaRestrictions,aspectRatio:this.getAspectRatio()}),c=a.visibleArea,l=a.coordinates;t&&(this.appliedImageTransforms.flip.horizontal=!this.appliedImageTransforms.flip.horizontal),e&&(this.appliedImageTransforms.flip.vertical=!this.appliedImageTransforms.flip.vertical),this.visibleArea=c,this.coordinates=l,this.onChange(),o&&this.debouncedDisableTransitions()}},rotate:function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=e.transitions,r=n===void 0||n;if(!this.transitionsActive){r&&this.enableTransitions();var o=U({},this.imageSize);this.appliedImageTransforms.rotate+=t;var s=Dh({visibleArea:this.visibleArea,coordinates:this.coordinates,previousImageSize:o,imageSize:this.imageSize,angle:t,positionRestrictions:this.positionRestrictions,sizeRestrictions:this.sizeRestrictions,getAreaRestrictions:this.getAreaRestrictions,aspectRatio:this.getAspectRatio()}),a=s.visibleArea,c=s.coordinates,l=this.processAutoZoom("rotateImage",a,c);a=l.visibleArea,c=l.coordinates,this.visibleArea=a,this.coordinates=c,this.onChange(),r&&this.debouncedDisableTransitions()}}},emits:["change","error","ready"]},Yh={key:0,ref:"canvas",style:{display:"none"}},Qh={key:1,ref:"sourceCanvas",style:{display:"none"}};ks.render=function(t,e,n,r,o,s){return i.openBlock(),i.createBlock("div",{ref:"cropper",class:s.classes.cropper},[i.createVNode("div",{ref:"stretcher",class:s.classes.stretcher},null,2),i.createVNode("div",{class:s.classes.boundaries,style:s.boundariesStyle},[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(n.backgroundWrapperComponent),{class:s.classes.cropperWrapper,"wheel-resize":s.settings.resizeImage.wheel,"touch-resize":s.settings.resizeImage.touch,"touch-move":s.settings.moveImage.touch,"mouse-move":s.settings.moveImage.mouse,onMove:s.onManipulateImage,onResize:s.onManipulateImage},{default:i.withCtx(function(){return[i.createVNode("div",{class:s.classes.background,style:s.boundariesStyle},null,6),i.createVNode("div",{class:s.classes.imageWrapper},[i.createVNode("img",{ref:"image",crossorigin:o.imageAttributes.crossOrigin,src:o.imageAttributes.src,class:s.classes.image,style:s.imageStyle,onMousedown:e[1]||(e[1]=i.withModifiers(function(){},["prevent"]))},null,46,["crossorigin","src"])],2),i.createVNode("div",{class:s.classes.foreground,style:s.boundariesStyle},null,6),i.withDirectives((i.openBlock(),i.createBlock(i.resolveDynamicComponent(n.stencilComponent),i.mergeProps({ref:"stencil",image:s.image,coordinates:o.coordinates,"stencil-coordinates":s.stencilCoordinates,transitions:s.transitionsOptions},n.stencilProps,{onResize:s.onResize,onResizeEnd:s.onResizeEnd,onMove:s.onMove,onMoveEnd:s.onMoveEnd}),null,16,["image","coordinates","stencil-coordinates","transitions","onResize","onResizeEnd","onMove","onMoveEnd"])),[[i.vShow,o.imageLoaded]]),n.canvas?(i.openBlock(),i.createBlock("canvas",Yh,null,512)):i.createCommentVNode("",!0),n.canvas?(i.openBlock(),i.createBlock("canvas",Qh,null,512)):i.createCommentVNode("",!0)]}),_:1},8,["class","wheel-resize","touch-resize","touch-move","mouse-move","onMove","onResize"]))],6)],2)};const Kh={class:"background-container"},ef={class:"tools-line"},tf={class:"line-block"},nf={class:"dialog-footer"},Li=x(i.defineComponent({__name:"ImageCropper",props:{open:{type:Boolean,required:!0},defaultRatio:{type:Number,required:!1,default:1}},emits:["crop","close"],setup(t,{emit:e}){const n=t,r=e,o=S.S.Cropper.Cropper(),s=i.ref(n.defaultRatio);o.ratio=s.value;const a=async()=>{s.value===0?o.ratio=0:o.ratio=s.value},c=i.ref({width:0,height:0,left:0,top:0}),l=i.ref(!1),u=i.ref(""),h=i.ref(),f=async()=>{l.value=!0;const g=h.value.getResult();o.ratio===0&&(s.value=c.value.width/c.value.height),g&&g.canvas.toBlob(p=>{var k;r("crop",{blob:p,src:(k=g.canvas)==null?void 0:k.toDataURL()})}),l.value=!1},m=g=>{var p;c.value=g.coordinates,u.value=(p=g.canvas)==null?void 0:p.toDataURL()};return(g,p)=>{const k=tt,w=i.resolveComponent("el-form-item"),B=i.resolveComponent("el-form"),D=i.resolveComponent("el-button"),L=Tt;return i.openBlock(),i.createBlock(L,{show:t.open,title:"Настройка изображения","close-on-click-modal":!1,"close-on-press-escape":!1,"show-close":!1},{default:i.withCtx(()=>[i.createElementVNode("div",Kh,[i.createElementVNode("div",ef,[i.createElementVNode("div",tf,[i.createVNode(B,null,{default:i.withCtx(()=>[i.createVNode(w,{label:"Задайте пропорции фото:"},{default:i.withCtx(()=>[i.createVNode(k,{modelValue:i.unref(s),"onUpdate:modelValue":p[0]||(p[0]=F=>i.isRef(s)?s.value=F:null),label:"Пропорции изображения",onChange:a},{default:i.withCtx(()=>p[1]||(p[1]=[i.createElementVNode("option",{label:"2:3 (формат A4)",value:2/3},null,-1),i.createElementVNode("option",{label:"4:3 (для карточек новостей)",value:4/3},null,-1),i.createElementVNode("option",{label:"1:1 (для фото сотрудников)",value:1},null,-1),i.createElementVNode("option",{label:"3:2",value:3/2},null,-1),i.createElementVNode("option",{label:"16:9",value:16/9},null,-1),i.createElementVNode("option",{label:"3:4 (вертикальное изображение)",value:3/4},null,-1),i.createElementVNode("option",{label:"Задать пропорции вручную",value:0},null,-1)])),_:1},8,["modelValue"])]),_:1})]),_:1})])]),i.createVNode(i.unref(ks),{ref_key:"cropperRef",ref:h,src:i.unref(o).src,"stencil-props":{aspectRatio:i.unref(o).ratio},style:{"max-height":"50vh","min-height":"50vh"},onChange:m},null,8,["src","stencil-props"]),i.createElementVNode("div",nf,[i.createVNode(D,{loading:i.unref(l),type:"success",onClick:f},{default:i.withCtx(()=>p[2]||(p[2]=[i.createTextVNode(" Сохранить ")])),_:1},8,["loading"])])])]),_:1},8,["show"])}}}),[["__scopeId","data-v-cab0e63b"]]),Es=x(i.defineComponent({__name:"InfoItemSelectButtons",props:{selected:{type:String,required:!0},title:{type:String,required:!0},list:{type:Array,required:!0}},emits:["select","reset"],setup(t,{emit:e}){const n=i.ref(!1),r=e,o=s=>{n.value=!n.value,r("select",s)};return(s,a)=>{const c=fe,l=Ce,u=nt;return i.openBlock(),i.createBlock(u,{close:i.unref(n),title:t.title,"close-window-overflow":"hidden","with-hover":!0,"with-open-window":!0},{"open-inside-content":i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.list,h=>(i.openBlock(),i.createBlock(l,{key:h,type:"admin",color:"blue",text:h,onClick:f=>o(h)},null,8,["text","onClick"]))),128)),i.createVNode(l,{type:"admin",color:"blue",text:"Сбросить",onClick:a[0]||(a[0]=h=>o(void 0))})]),default:i.withCtx(()=>[i.createVNode(c,{string:t.selected,"font-size":"14px",width:"100%"},null,8,["string"])]),_:1},8,["close","title"])}}}),[["__scopeId","data-v-89897936"]]),rf={class:"mainblock"},of={class:"mainline"},vs=x(i.defineComponent({__name:"LeftRightContainer",props:{leftWidth:{type:String,required:!1,default:"0px"},background:{type:String,required:!1,default:"inherit"}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",rf,[i.createElementVNode("div",of,[i.createElementVNode("div",{class:"mainblock-left",style:i.normalizeStyle({minWidth:t.leftWidth,maxWidth:t.leftWidth,background:t.background,display:t.leftWidth!=="0px"?"block":"none"})},[i.renderSlot(e.$slots,"left",{},void 0,!0)],4),i.createElementVNode("div",{class:"mainblock-right",style:i.normalizeStyle({background:t.background})},[i.renderSlot(e.$slots,"right",{},void 0,!0)],4)])]))}}),[["__scopeId","data-v-a4bc6b16"]]),sf={class:"message-title"},af={class:"message-text"},Mn=x(i.defineComponent({__name:"MessageBody",props:{title:{type:String,default:"",required:!1},text:{type:String,default:"",required:!1}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",null,[i.createElementVNode("div",sf,i.toDisplayString(t.title),1),i.createElementVNode("div",af,i.toDisplayString(t.text),1)]))}}),[["__scopeId","data-v-e3c1e672"]]),lf=i.defineComponent({name:"CollapseContainer",props:{initActiveIdx:{type:Number,default:0}},setup(t){const e=i.ref(t.initActiveIdx),n=r=>{e.value=r};return i.watch(()=>t.initActiveIdx,()=>{n(t.initActiveIdx)}),{changeActiveId:n,activeIdx:e}}});function cf(t,e,n,r,o,s){return i.openBlock(),i.createElementBlock("div",null,[i.renderSlot(t.$slots,"default",{activeIdx:t.activeIdx,changeActiveId:t.changeActiveId})])}const xs=x(lf,[["render",cf]]),df=i.defineComponent({name:"CollapseItem",props:{tabId:{type:String,required:!1,default:""},activeId:{type:String,default:""},isCollaps:{type:Boolean,default:!0},title:{type:String,default:""},showToolsOnHover:{type:Boolean,default:!0},background:{type:String,required:!1,default:"#ffffff"},backgroundAttention:{type:String,required:!1,default:"#ffffff"},changeColor:{type:Boolean,default:!1},margin:{type:String,default:"10px 8px 2px 2px"},padding:{type:String,default:"0 10px"},selectable:{type:Boolean,default:!1}},emits:["changeActiveId"],setup(t,{emit:e}){const n=i.ref(t.activeId==="0"),r=()=>{n.value=!n.value,e("changeActiveId",t.tabId)};return i.onUpdated(()=>{t.activeId&&t.activeId!==t.tabId&&(n.value=!0)}),i.onBeforeMount(()=>{t.activeId&&t.activeId!==t.tabId&&(n.value=!1)}),{collapsed:n,handleItemClick:r}}}),uf=["for"],hf={class:"inside-icon"};function ff(t,e,n,r,o,s){return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",{class:"tab",style:i.normalizeStyle({margin:t.margin,height:t.isCollaps&&t.collapsed?"60px":"","box-shadow":t.selectable&&t.activeId===t.tabId?"0px 0px 1px 2px #1979cf":""})},[t.isCollaps&&t.collapsed?(i.openBlock(),i.createElementBlock("svg",{key:0,class:"icon-arrow",onClick:e[0]||(e[0]=(...a)=>t.handleItemClick&&t.handleItemClick(...a))},e[3]||(e[3]=[i.createElementVNode("use",{"xlink:href":"#arrow-down"},null,-1)]))):t.isCollaps&&!t.collapsed?(i.openBlock(),i.createElementBlock("svg",{key:1,class:"icon-arrow",onClick:e[1]||(e[1]=(...a)=>t.handleItemClick&&t.handleItemClick(...a))},e[4]||(e[4]=[i.createElementVNode("use",{"xlink:href":"#arrow-up"},null,-1)]))):i.createCommentVNode("",!0),i.createElementVNode("label",{for:t.tabId,onClick:e[2]||(e[2]=(...a)=>t.handleItemClick&&t.handleItemClick(...a))},[i.createElementVNode("div",{style:i.normalizeStyle({cursor:t.isCollaps?"pointer":"default",background:t.changeColor?t.background:t.backgroundAttention,padding:t.padding,borderRadius:"5px"}),class:"tab-name"},[i.createElementVNode("div",hf,[i.renderSlot(t.$slots,"icon",{},void 0,!0)]),t.title?(i.openBlock(),i.createElementBlock("div",{key:0,class:"title-in",style:i.normalizeStyle({marginRight:t.isCollaps?"50px":"0",width:t.isCollaps?"calc(100% - 50px)":"100%"})},i.toDisplayString(t.title),5)):(i.openBlock(),i.createElementBlock("div",{key:1,class:"title-in",style:i.normalizeStyle({marginRight:t.isCollaps?"50px":"0",width:t.isCollaps?"calc(100% - 50px)":"100%"})},[i.renderSlot(t.$slots,"inside-title",{},void 0,!0)],4)),i.createElementVNode("div",{class:i.normalizeClass(["tools-bar",{"hidden-part":t.showToolsOnHover}])},[i.renderSlot(t.$slots,"tools",{},void 0,!0)],2)],4)],8,uf),i.createElementVNode("div",{style:i.normalizeStyle({maxHeight:t.isCollaps?"":"1000000vh",background:t.changeColor?t.background:t.backgroundAttention}),class:i.normalizeClass(t.collapsed?"tab-content-down":"tab-content-up")},[i.renderSlot(t.$slots,"inside-content",{},void 0,!0)],6)],4),e[5]||(e[5]=i.createStaticVNode('<svg width="0" height="0" class="hidden" data-v-50a7d390><symbol id="arrow-down" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" data-v-50a7d390><path d="M5 6L10 11L15 6L17 7L10 14L3 7L5 6Z" fill="currentColor" data-v-50a7d390></path></symbol><symbol id="arrow-up" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" data-v-50a7d390><path d="M15 14L10 9L5 14L3 13L10 6L17 13L15 14Z" fill="currentColor" data-v-50a7d390></path></symbol></svg>',1))],64)}const Ms=x(df,[["render",ff],["__scopeId","data-v-50a7d390"]]),mf={class:"tab"},pf={class:"rotate"},Bs=x(i.defineComponent({__name:"VerticalCollapseContainer",setup(t){const e=i.ref(!1),n=async()=>{e.value=!e.value};return(r,o)=>{const s=gn,a=pn;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",mf,[i.renderSlot(r.$slots,"main",{},void 0,!0),i.createElementVNode("div",{style:i.normalizeStyle({width:i.unref(e)?"50%":"20px",transition:"0.3s"}),class:"left"},[i.createElementVNode("div",{style:i.normalizeStyle({width:i.unref(e)?"100%":"0",transition:"0.3s"}),class:"left-content"},[i.renderSlot(r.$slots,"inside-content-left",{},void 0,!0)],4),i.createElementVNode("div",{class:"arrow-bar",onClick:n},[i.createElementVNode("div",pf,[i.renderSlot(r.$slots,"inside-title",{},void 0,!0)]),i.unref(e)?(i.openBlock(),i.createBlock(s,{key:0,"icon-class":"icon-arrow"})):(i.openBlock(),i.createBlock(a,{key:1,"icon-class":"icon-arrow"}))])],4),i.createElementVNode("div",{style:i.normalizeStyle({width:i.unref(e)?"50%":"100%",transition:"0.3s"}),class:"right"},[i.renderSlot(r.$slots,"inside-content-right",{},void 0,!0)],4)]),i.createVNode(a),i.createVNode(s)],64)}}}),[["__scopeId","data-v-d802b6b9"]]),gf={class:"add-block_body"},Rs=x(i.defineComponent({__name:"PAdd",props:{background:{type:String,required:!1,default:"inherit"},margin:{type:String,required:!1,default:"0"},padding:{type:String,required:!1,default:"0"},top:{type:String,required:!1,default:"0"},zIndex:{type:Number,required:!1,default:0}},setup(t){return(e,n)=>{const r=mn;return i.openBlock(),i.createElementBlock("div",{class:"add-block",style:i.normalizeStyle({margin:t.margin,background:t.background,padding:t.padding})},[i.createVNode(r,{top:t.top,"z-index":t.zIndex},{default:i.withCtx(()=>[i.renderSlot(e.$slots,"title",{},void 0,!0)]),_:3},8,["top","z-index"]),i.createElementVNode("div",gf,[i.renderSlot(e.$slots,"default",{},void 0,!0)])],4)}}}),[["__scopeId","data-v-b93bc8b1"]]),Hi=x(i.defineComponent({__name:"PContainer",props:{background:{type:String,required:!1,default:"inherit"},margin:{type:String,required:!1,default:"0"},padding:{type:String,required:!1,default:"0"}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",{class:"add-block",style:i.normalizeStyle({margin:t.margin,background:t.background,padding:t.padding})},[i.renderSlot(e.$slots,"default",{},void 0,!0)],4))}}),[["__scopeId","data-v-b89bdc7a"]]),yf={class:"add-block_body"},$s=x(i.defineComponent({__name:"PContainerStickyHead",props:{background:{type:String,required:!1,default:"inherit"},margin:{type:String,required:!1,default:"0"},padding:{type:String,required:!1,default:"0"},top:{type:String,required:!1,default:"0"},zIndex:{type:Number,required:!1,default:0}},setup(t){return(e,n)=>{const r=mn,o=Hi;return i.openBlock(),i.createBlock(o,{background:t.background,margin:t.margin,padding:t.padding},{default:i.withCtx(()=>[i.createVNode(r,{top:t.top,"z-index":t.zIndex},{default:i.withCtx(()=>[i.renderSlot(e.$slots,"title",{},void 0,!0)]),_:3},8,["top","z-index"]),i.createElementVNode("div",yf,[i.renderSlot(e.$slots,"default",{},void 0,!0)])]),_:3},8,["background","margin","padding"])}}}),[["__scopeId","data-v-e59e418e"]]),wf={class:"del-block_title"},bf={class:"del-block_body"},Ns=x(i.defineComponent({__name:"PDel",props:{background:{type:String,required:!1,default:"inherit"},margin:{type:String,required:!1,default:"10px 10px 10px 50px"},padding:{type:String,required:!1,default:"10px"}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",{class:"del-block",style:i.normalizeStyle({margin:t.margin,background:t.background,padding:t.padding})},[i.createElementVNode("div",wf,[i.renderSlot(e.$slots,"title",{},void 0,!0)]),i.createElementVNode("div",bf,[i.renderSlot(e.$slots,"default",{},void 0,!0)])],4))}}),[["__scopeId","data-v-362b7b0d"]]),Cf=["onClick"],As=x(i.defineComponent({__name:"PTabs",props:{tabs:{type:Object,required:!0},tabHeight:{type:String,required:!1,default:"40px"},height:{type:String,required:!1,default:""},minMenuItemWidth:{type:String,required:!1,default:"150px"},outTopMargin:{type:String,required:!1,default:"40px"},background:{type:String,required:!1,default:"#ffffff"}},emits:["select"],setup(t,{emit:e}){const n=t,r=e,o=i.ref(n.tabs[0]),s=i.ref(0),a=i.ref(window.innerWidth),c=i.ref(),l=i.ref(Number(n.tabHeight.replace(/[^+\d]/g,""))),u=()=>{a.value=window.innerWidth,l.value=c.value?c.value.clientHeight:Number(n.tabHeight.replace(/[^+\d]/g,""))};i.onMounted(()=>window.addEventListener("resize",u)),i.onUnmounted(()=>window.removeEventListener("resize",u));const h=i.computed(()=>`calc(100% - ${l.value}px + 1px)`),f=(m,g)=>{o.value=m,s.value=g,r("select",m)};return(m,g)=>(i.openBlock(),i.createElementBlock("div",{class:"mainblock",style:i.normalizeStyle({height:`calc(100% - ${t.outTopMargin} - ${t.tabHeight}`})},[i.createElementVNode("div",{ref_key:"menuRef",ref:c,class:"top-menu",style:i.normalizeStyle({gridTemplateColumns:`repeat(auto-fit, minmax(${t.minMenuItemWidth}, 1fr))`})},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.tabs,(p,k)=>(i.openBlock(),i.createElementBlock("div",{key:k},[i.createElementVNode("div",{class:i.normalizeClass({"selected-tab":k===i.unref(s),tab:k!==i.unref(s)}),style:i.normalizeStyle({minHeight:t.tabHeight,maxHeight:t.tabHeight}),onClick:w=>f(p,k)},i.toDisplayString(p.name),15,Cf)]))),128))],4),i.createElementVNode("div",{class:"body-container",style:i.normalizeStyle({background:t.background,height:i.unref(h)})},[i.renderSlot(m.$slots,"default",{},()=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(i.unref(o).component)))],!0)],4)],4))}}),[["__scopeId","data-v-3cb80968"]]),Sf=["id"],kf=["for"],Ef={class:"left-field"},vf=["href","download"],xf={key:1,class:"text-field__input"},Mf={class:"right-field"},Bf=i.defineComponent({__name:"UploaderFile",props:{fileInfo:{type:Object,required:!1,default:new _e},formats:{type:Array,default:()=>["pdf","jpeg","jpg"]},label:{type:String,default:"Label",required:!1},margin:{type:String,required:!1,default:"10px 0 0 0"},disabled:{type:Boolean,required:!1,default:!1},padding:{type:String,default:"",required:!1},mask:{type:String,required:!1,default:void 0},borderColor:{type:String,default:"var(--input-border-color)",required:!1},color:{type:String,default:"var(--input-font-color)",required:!1},placeholder:{type:String,required:!1,default:""}},emits:["upload","remove"],setup(t,{emit:e}){const n=t,r=e,o=S.H.Strings.CreateGuid(),s=S.H.Strings.CreateGuid(),a=()=>{const u=document.getElementById(o);if(!u.files)return;const h=u.files[0];if(h){if(!l(h.name)){S.Notification.Error("Загруженный файл должен быть в формате pdf, jpg или jpeg");return}n.fileInfo.uploadAndSetFile(h),r("upload",n.fileInfo)}},c=()=>{n.fileInfo.clearFile(),r("remove",n.fileInfo)};i.onMounted(()=>{const u=document.getElementById(s);u&&(u.onclick=()=>{var h;return(h=document.getElementById(o))==null?void 0:h.click()})});const l=u=>{let h=S.H.Extension.Get(u);return!!n.formats.includes(h.toLowerCase())};return(u,h)=>{const f=fe,m=yi,g=Ce;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("input",{id:i.unref(o),type:"file",hidden:"",onChange:a},null,40,Sf),i.createElementVNode("div",{class:"text-field",style:i.normalizeStyle({margin:t.margin,padding:t.padding})},[t.label?(i.openBlock(),i.createElementBlock("label",{key:0,class:"text-field__label",for:t.label},i.toDisplayString(t.label),9,kf)):i.createCommentVNode("",!0),i.createElementVNode("div",{class:"field",style:i.normalizeStyle({borderColor:t.borderColor})},[i.createElementVNode("div",Ef,[i.createVNode(m,null,{default:i.withCtx(()=>[i.renderSlot(u.$slots,"default",{},void 0,!0),i.createVNode(f,{string:t.placeholder,"font-size":"var(--font-size-default:)",color:"var(--input-label-color)",margin:"0 10px 0 0"},null,8,["string"])]),_:3})]),t.fileInfo&&t.fileInfo.originalName?(i.openBlock(),i.createElementBlock("div",{key:0,class:"text-field__input",style:i.normalizeStyle({color:t.color})},[i.createElementVNode("a",{href:t.fileInfo.getFileUrl(),target:"_blank",download:t.fileInfo.originalName},[i.createElementVNode("div",null,i.toDisplayString(t.fileInfo.originalName),1)],8,vf),i.createVNode(g,{skin:"text",type:"del",onClick:c},{default:i.withCtx(()=>[i.createVNode(Pt,{size:"20px",margin:"0 5px"})]),_:1})],4)):(i.openBlock(),i.createElementBlock("div",xf,[i.createVNode(f,{string:"Файл не загружен","font-size":"var(--inpur-font-size-default)",color:"var(--palette-warning)",margin:"0 10px 0 0"})])),i.createElementVNode("div",Mf,[i.createVNode(g,{id:i.unref(s),skin:"text",type:"success","data-test":"upload-btn",text:t.fileInfo&&t.fileInfo.originalName?"Обновить":"Загрузить",margin:"0"},null,8,["id","text"])])],4)],4)],64)}}}),Is=x(Bf,[["__scopeId","data-v-51318b14"]]),Rf={class:"container"},$f={key:0,class:"result"},Nf={class:"list"},Af=["onClick"],_i=x(i.defineComponent({inheritAttrs:!1,__name:"PAutocomplete",props:{modelValue:{type:String,default:""},searchFunc:{type:Function,default:()=>{}},suggestions:{type:Array,default:[]}},emits:["select","input"],setup(t,{emit:e}){const n=e,r=t,o=i.ref(r.modelValue),s=i.ref([]);async function a(){n("input",o.value),await c()}async function c(){r.searchFunc&&(s.value=await r.searchFunc(o.value))}async function l(u){n("select",u)}return(u,h)=>{const f=Ci,m=ct;return i.openBlock(),i.createElementBlock("div",Rf,[i.createVNode(m,{modelValue:i.unref(o),"onUpdate:modelValue":h[0]||(h[0]=g=>i.isRef(o)?o.value=g:null),placeholder:"Найти",onInput:a},{right:i.withCtx(()=>[i.createVNode(f)]),_:1},8,["modelValue"]),i.unref(o)?(i.openBlock(),i.createElementBlock("div",$f,[i.createElementVNode("ul",Nf,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(i.unref(s),g=>(i.openBlock(),i.createElementBlock("li",{key:g.value,onClick:p=>l(g)},i.toDisplayString(g.label),9,Af))),128))])])):i.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-58b78c5c"]]),If={class:"footer"},Ps=x(i.defineComponent({__name:"PDialog",setup(t){const e=i.computed(()=>{switch(S.Dialog.GetType()){case"info":return"message primary";case"success":return"message success";case"warning":return"message warning";case"error":return"message danger";default:return"message neutral"}});return(n,r)=>{const o=Mn,s=Ce;return i.openBlock(),i.createBlock(i.Transition,{name:"fade"},{default:i.withCtx(()=>[("PF"in n?n.PF:i.unref(S)).Dialog.IsVisible()?(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(i.unref(e))},[i.createVNode(o,{title:("PF"in n?n.PF:i.unref(S)).Dialog.GetTitle(),text:("PF"in n?n.PF:i.unref(S)).Dialog.GetText()},null,8,["title","text"]),i.createElementVNode("div",If,[i.createVNode(s,{type:"primary",text:("PF"in n?n.PF:i.unref(S)).Dialog.GetConfirmButtonText(),margin:"10px 0 0 0",onClick:r[0]||(r[0]=a=>("PF"in n?n.PF:i.unref(S)).Dialog.Submit())},null,8,["text"]),i.createVNode(s,{type:"warning",text:("PF"in n?n.PF:i.unref(S)).Dialog.GetCancelButtonText(),margin:"10px 0 0 0",onClick:r[1]||(r[1]=a=>("PF"in n?n.PF:i.unref(S)).Dialog.Cancel())},null,8,["text"])])],2)):i.createCommentVNode("",!0)]),_:1})}}}),[["__scopeId","data-v-3af87587"]]),Ts=x(i.defineComponent({__name:"PhoneForm",props:{modelValue:{},modelModifiers:{}},emits:["update:modelValue"],setup(t){const e=i.useModel(t,"modelValue"),n=async()=>{await S.S.Phones.Update(e.value)};return(r,o)=>{const s=ct;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createVNode(s,{modelValue:e.value.number,"onUpdate:modelValue":o[0]||(o[0]=a=>e.value.number=a),onBlur:n},null,8,["modelValue"]),i.createVNode(s,{modelValue:e.value.description,"onUpdate:modelValue":o[1]||(o[1]=a=>e.value.description=a),onBlur:n},null,8,["modelValue"])],64)}}}),[["__scopeId","data-v-6de09525"]]),Pf={};function Tf(t,e){return i.openBlock(),i.createElementBlock(i.Fragment,null,[e[0]||(e[0]=i.createElementVNode("div",{class:"blur"},null,-1)),e[1]||(e[1]=i.createElementVNode("div",{class:"loader-container"},[i.createElementVNode("div",{class:"loader",style:{"--b":"20px",width:"200px","--n":"10"}})],-1))],64)}const zs=x(Pf,[["render",Tf],["__scopeId","data-v-879cfd55"]]),Vs=x(i.defineComponent({__name:"PNotification",setup(t){const e=i.computed(()=>{switch(S.Notification.GetType()){case"info":return"message info";case"success":return"message success";case"warning":return"message warning";case"error":return"message error";default:return"message neutral"}});return(n,r)=>{const o=Mn;return i.openBlock(),i.createBlock(i.Transition,{name:"fade"},{default:i.withCtx(()=>[("PF"in n?n.PF:i.unref(S)).Notification.IsVisible()?(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(i.unref(e))},[i.createVNode(o,{title:("PF"in n?n.PF:i.unref(S)).Notification.GetTitle(),text:("PF"in n?n.PF:i.unref(S)).Notification.GetText()},null,8,["title","text"])],2)):i.createCommentVNode("",!0)]),_:1})}}}),[["__scopeId","data-v-ec6a4660"]]),zf={style:{display:"flex","justify-content":"center",width:"100%"}},Vf={class:"pag-number"},Ff={class:"pag-ul"},Of={key:2},Fs=x(i.defineComponent({__name:"PPagination",props:{showConfirm:{type:Boolean,default:!1},justifyContent:{type:String,default:"center"},store:{type:Object,required:!0}},emits:["cancel","save"],setup(t,{emit:e}){const n=t,r=g=>g?"active":"neutral",o=g=>g?"not-active":"neutral",s=S.Paginator,a=i.ref(!1),c=i.ref(!1),l=e;s.count=n.store.Count().value;const u=async g=>{if(g!==s.curPage){if(g<1&&(g=1),g>s.pagesCount()&&(g=s.pagesCount()),!n.showConfirm)return await h(g);S.Dialog.Save().then(async()=>{l("save"),await h(g)}).catch(async()=>{S.Notification.Warning("Изменения не были сохранены"),l("cancel"),await h(g)})}},h=async(g,p)=>{s.setCurPage(g),S.H.FTSP.Get().p.offset=(g-1)*s.limit,await n.store.FTSP(),m()},f=i.computed(()=>{const g=s.pagesCount();return g<8?S.H.Arrays.GenerateNumsRange(2,g-1).filter(p=>p<g&&p>1):S.H.Arrays.GenerateNumsRange(s.curPage-2,s.curPage+3).filter(p=>p<g&&p>1)}),m=()=>{const g=document.querySelector(".el-table__body-wrapper"),p=document.querySelector("#list");g?g.scrollTo({top:0}):p&&p.scrollTo({top:0})};return i.onBeforeUnmount(()=>{S.H.FTSP.Get().p.drop()}),(g,p)=>{const k=pn,w=Ce,B=Si,D=Ei,L=ki,F=gn;return i.openBlock(),i.createElementBlock("div",zf,[i.createElementVNode("div",{class:"pag-container",style:i.normalizeStyle({justifyContent:t.justifyContent})},[i.createElementVNode("div",Vf,[i.createVNode(w,{skin:"pag",type:o(i.unref(s).curPage===1),onClick:p[0]||(p[0]=z=>u(i.unref(s).curPage-1))},{default:i.withCtx(()=>[i.createVNode(k)]),_:1},8,["type"]),i.createElementVNode("ul",Ff,[i.createElementVNode("li",null,[i.createVNode(w,{skin:"pag",type:r(i.unref(s).curPage===1),text:"1",onClick:p[1]||(p[1]=z=>u(1))},null,8,["type"])]),i.unref(s).pagesCount()>8&&i.unref(s).curPage>4?(i.openBlock(),i.createElementBlock("li",{key:0,onMouseenter:p[3]||(p[3]=z=>a.value=!0),onMouseleave:p[4]||(p[4]=z=>a.value=!1)},[i.createVNode(w,{skin:"pag",type:"neutral",onClick:p[2]||(p[2]=z=>u(i.unref(s).curPage-5))},{default:i.withCtx(()=>[i.unref(a)?(i.openBlock(),i.createBlock(B,{key:0})):(i.openBlock(),i.createBlock(D,{key:1}))]),_:1})],32)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(i.unref(f),z=>(i.openBlock(),i.createElementBlock("li",{key:z},[i.createVNode(w,{skin:"pag",type:r(z===i.unref(s).curPage),text:z,onClick:we=>u(z)},null,8,["type","text","onClick"])]))),128)),i.unref(s).pagesCount()>=8&&i.unref(s).curPage<i.unref(s).pagesCount()-3?(i.openBlock(),i.createElementBlock("li",{key:1,onMouseenter:p[6]||(p[6]=z=>c.value=!0),onMouseleave:p[7]||(p[7]=z=>c.value=!1)},[i.createVNode(w,{skin:"pag",type:"neutral",onClick:p[5]||(p[5]=z=>u(i.unref(s).curPage+5))},{default:i.withCtx(()=>[i.unref(c)?(i.openBlock(),i.createBlock(L,{key:0})):(i.openBlock(),i.createBlock(D,{key:1}))]),_:1})],32)):i.createCommentVNode("",!0),i.unref(s).pagesCount()>1?(i.openBlock(),i.createElementBlock("li",Of,[i.createVNode(w,{skin:"pag",type:r(i.unref(s).pagesCount()===i.unref(s).curPage),text:i.unref(s).pagesCount(),onClick:p[8]||(p[8]=z=>u(i.unref(s).pagesCount()))},null,8,["type","text"])])):i.createCommentVNode("",!0)]),i.createVNode(w,{skin:"pag",type:o(i.unref(s).curPage===i.unref(s).pagesCount()),onClick:p[9]||(p[9]=z=>u(i.unref(s).curPage+1))},{default:i.withCtx(()=>[i.createVNode(F)]),_:1},8,["type"])])],4)])}}}),[["__scopeId","data-v-5aea8b91"]]),Os=x(i.defineComponent({__name:"RemoteSearch",props:{keyValue:{type:String,default:""},modelValue:{type:String,default:""},storeModule:{type:String,default:""},placeholder:{type:String,default:"Начните вводить запрос"},showSuggestions:{type:Boolean,default:!0},maxWidth:{type:[Number,String],default:350},focus:{type:Boolean,default:!1}},emits:["select","load","input"],setup(t,{emit:e}){const n=t,r=e,o=i.ref(n.modelValue),s=i.ref(),a=S.S.Search.SearchModel();i.watch(()=>n.focus,()=>{n.focus&&setTimeout(()=>{s.value.focus(),o.value=""},500)});const c=async h=>{if(h.length<2)return;s.value.activated=!0,a.searchObjects=[],a.query=h,a.key=n.keyValue;const f=a.searchGroups.find(m=>m.key===n.keyValue);return f&&(a.searchGroup=f),await S.S.Search.Search(a),a.searchObjects},l=async h=>{r("select",h),o.value=""},u=h=>{r("input",h),h.length===0&&r("input","")};return(h,f)=>{const m=_i;return i.openBlock(),i.createBlock(m,{ref_key:"searchForm",ref:s,modelValue:i.unref(o),"onUpdate:modelValue":f[0]||(f[0]=g=>i.isRef(o)?o.value=g:null),"value-key":"label",style:{width:"100%","margin-right":"10px"},placeholder:t.placeholder,"search-func":c,"trigger-on-focus":t.showSuggestions,suggestions:i.unref(a).searchObjects,onSelect:l,onInput:u},{suffix:i.withCtx(()=>f[1]||(f[1]=[i.createElementVNode("i",{class:"el-icon-search"},null,-1)])),_:1},8,["modelValue","placeholder","trigger-on-focus","suggestions"])}}}),[["__scopeId","data-v-f236facf"]]),Df={class:"mainblock-body"},Lf={class:"mainblock-footer"},Ds=x(i.defineComponent({__name:"ResearcheContainer",props:{background:{type:String,required:!1,default:"inherit"},padding:{type:String,required:!1,default:"0px 10px"}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",{class:"mainblock",style:i.normalizeStyle({background:t.background,padding:t.padding})},[i.createElementVNode("div",{class:"mainblock-header",style:i.normalizeStyle({background:t.background})},[i.renderSlot(e.$slots,"header",{},void 0,!0)],4),i.createElementVNode("div",Df,[i.renderSlot(e.$slots,"body",{},void 0,!0)]),i.createElementVNode("div",Lf,[i.renderSlot(e.$slots,"footer",{},void 0,!0)])],4))}}),[["__scopeId","data-v-a670fb4a"]]),Hf={class:"right-slider-content"},_f={class:"right-slider-content-header"},qf={class:"right-slider-content-box"},Uf={class:"right-slider-button"},Ls=x(i.defineComponent({__name:"RightSliderContainer",props:{sliderOffWidth:{type:String,required:!1,default:"30px"},sliderOnWidth:{type:String,required:!1,default:"260px"},background:{type:String,required:!1,default:"inherit"},toggle:{type:Boolean,default:!1},titleOpen:{type:String,required:!1,default:"Скрыть список исследований"},titleClose:{type:String,required:!1,default:"Показать список исследований"}},emits:["toggle"],setup(t,{emit:e}){const n=t,r=e,o=i.ref(!1);i.watch(()=>n.toggle,()=>{o.value=!o.value});const s=a=>{o.value=!o.value,r("toggle",a)};return(a,c)=>{const l=fe;return i.openBlock(),i.createElementBlock("div",{class:"right-slider",style:i.normalizeStyle({marginRight:i.unref(o)?`calc(${t.sliderOffWidth} - ${t.sliderOnWidth})`:"0",width:t.sliderOnWidth})},[i.createElementVNode("div",{class:"click-line",onClick:c[0]||(c[0]=u=>s(!i.unref(o)))},[i.unref(o)?(i.openBlock(),i.createBlock(l,{key:0,string:t.titleClose,"font-size":"16px",padding:"0",color:"#343E5C"},null,8,["string"])):i.createCommentVNode("",!0),i.unref(o)?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(l,{key:1,string:t.titleOpen,"font-size":"16px",padding:"0",color:"#343E5C"},null,8,["string"]))]),i.createElementVNode("div",Hf,[i.createElementVNode("div",_f,[i.renderSlot(a.$slots,"header",{},void 0,!0)]),i.createElementVNode("div",qf,[i.renderSlot(a.$slots,"default",{},void 0,!0)])]),i.createElementVNode("div",Uf,[i.renderSlot(a.$slots,"button",{},void 0,!0)])],4)}}}),[["__scopeId","data-v-495a90f9"]]),Wf={class:"mainblock"},jf={class:"body-block"},Gf={class:"tab-block"},Hs=x(i.defineComponent({__name:"RightTabsContainer",props:{sliderOffWidth:{type:String,required:!1,default:"101px"},sliderOnWidth:{type:String,required:!1,default:"332px"},background:{type:String,required:!1,default:"inherit"},isToggle:{type:Boolean,required:!1,default:!1},mobileWidth:{type:String,required:!1,default:"768px"}},emits:["toggle"],setup(t,{emit:e}){const n=t,r=e,o=i.ref(!1),s=i.ref(window.matchMedia("(max-width: 768px)").matches),a=l=>{r("toggle",l)},c=i.ref(!1);return i.onBeforeMount(async()=>{window.addEventListener("resize",()=>{switch(n.mobileWidth){case"1330px":return s.value=window.matchMedia("(max-width: 1330px)").matches;case"1215px":return s.value=window.matchMedia("(max-width: 1215px)").matches;case"1024px":return s.value=window.matchMedia("(max-width: 1024px)").matches;case"768px":return s.value=window.matchMedia("(max-width: 768px)").matches}return s.value=window.matchMedia("(max-width: 1330px)").matches}),o.value=!0}),(l,u)=>(i.openBlock(),i.createElementBlock("div",Wf,[i.createElementVNode("div",{class:"slider-block",style:i.normalizeStyle({marginRight:i.unref(s)?t.isToggle?"49px":`calc(49px - ${t.sliderOnWidth})`:t.isToggle?t.sliderOffWidth:`calc(${t.sliderOffWidth} - ${t.sliderOnWidth})`,width:t.sliderOnWidth,minHeight:t.sliderOffWidth,height:t.isToggle?"auto":"100px"})},[i.createElementVNode("div",{class:"slider-icon",style:i.normalizeStyle({border:t.isToggle?"1px solid #379FFF":"1px solid #00B5A4",background:t.isToggle?"#ffffff":"#C7ECEA"}),onClick:u[0]||(u[0]=h=>a(!t.isToggle)),onMouseenter:u[1]||(u[1]=h=>c.value=!0),onMouseleave:u[2]||(u[2]=h=>c.value=!1)},[i.createElementVNode("div",{class:"icon-block",style:i.normalizeStyle({transform:i.unref(c)?t.isToggle?"rotate(-225deg) scale(1.2, 1.2)":"rotate(0deg) scale(1.2, 1.2)":t.isToggle?"rotate(-225deg)":"rotate(0deg)",fill:t.isToggle?"#379FFF":"#00B5A4"})},[i.renderSlot(l.$slots,"icon",{},void 0,!0)],4)],36),i.createElementVNode("div",{class:"slider-info",style:i.normalizeStyle({width:`calc(${t.sliderOnWidth} - ${t.sliderOffWidth})`})},[i.renderSlot(l.$slots,"slider-body",{},void 0,!0)],4)],4),i.createElementVNode("div",jf,[i.renderSlot(l.$slots,"body",{},void 0,!0)]),i.createElementVNode("div",Gf,[i.renderSlot(l.$slots,"tabs",{},void 0,!0)])]))}}),[["__scopeId","data-v-eaeca0cc"]]),Zf=["label","value"],_s=x(i.defineComponent({__name:"SelectValueType",props:{selectedType:{type:String,required:!0}},emits:["select"],setup(t,{emit:e}){const n={[de.String]:"Текстовый ответ",[de.Text]:"Развёрнутый текстовый ответ",[de.Number]:"Числовой ответ",[de.Date]:"Ответ в виде даты",[de.Radio]:"Выбор одного из вариантов",[de.Set]:"Выбор нескольких вариантов",[de.File]:"Ответ в виде файла",[de.MatrixRadio]:"Матрица с одним выбором",[de.MatrixSet]:"Матрица с несколькими выборами"},r=e,o=s=>{r("select",s)};return(s,a)=>{const c=fe,l=tt;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createVNode(c,{string:"Выберите вид ответа:","font-size":"14px",padding:"0","justify-content":"left",margin:"10px 0"}),i.createVNode(l,{"model-value":t.selectedType,placeholder:"Вид ответа",onChange:o},{default:i.withCtx(()=>[(i.openBlock(),i.createElementBlock(i.Fragment,null,i.renderList(n,(u,h)=>i.createElementVNode("option",{key:u,label:u,value:h},null,8,Zf)),64))]),_:1},8,["model-value"])],64)}}}),[["__scopeId","data-v-6be05cd5"]]),Jf={class:"field"},qs=x(i.defineComponent({__name:"SingleNameToggleForm",props:{withName:{type:Object,required:!0}},emits:["submit"],setup(t,{emit:e}){const n=t,r=e,o=i.ref(!1),s=i.ref(),a=i.ref(n.withName.name),c=i.ref(!1),l=()=>{c.value=!1},u=async()=>{a.value.trim(),n.withName.setName&&n.withName.setName(a.value),o.value=!o.value,r("submit")};return(h,f)=>{const m=fe,g=i.resolveComponent("el-input"),p=i.resolveComponent("el-form-item"),k=i.resolveComponent("el-form"),w=Ce;return i.openBlock(),i.createBlock(k,{ref_key:"form",ref:s,style:{width:"100%"}},{default:i.withCtx(()=>[i.createVNode(nt,{title:"Название","show-save-dialog":c.value,icon:"edit-title","with-hover":!0,close:o.value,width:"100%",onKeyupEnter:u,onAfterClose:l},{"open-inside-content":i.withCtx(()=>[i.createVNode(nt,{title:"",icon:"edit-title","with-open-window":!1,"with-hover":!1,"border-color":"#ffffff","base-box-margin":"0 0 15px 0",padding:"0",width:"100%","custom-class":"test","open-width":"100%"},{default:i.withCtx(()=>[i.createElementVNode("div",Jf,[i.createVNode(k,null,{default:i.withCtx(()=>[i.createVNode(p,{style:{width:"100%"},prop:"surname"},{default:i.withCtx(()=>[i.createVNode(g,{modelValue:a.value,"onUpdate:modelValue":f[0]||(f[0]=B=>a.value=B),style:{width:"100%"},autosize:!0,type:"textarea"},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1}),i.createVNode(w,{type:"admin",color:"blue",text:"Сохранить",onClick:u})]),default:i.withCtx(()=>[a.value.length?(i.openBlock(),i.createBlock(m,{key:0,string:a.value.length>60?a.value.slice(0,60)+"...":a.value},null,8,["string"])):(i.openBlock(),i.createBlock(m,{key:1,string:"Введите данные",color:"#B0A4C0"}))]),_:1},8,["show-save-dialog","close"])]),_:1},512)}}}),[["__scopeId","data-v-890163ac"]]),Xf=["label","value"],Us=x(i.defineComponent({__name:"SortList",props:{maxWidth:{type:[Number,String],default:250}},emits:["load"],setup(t,{emit:e}){const n=i.ref(!1),r=e,o=i.ref();i.onBeforeMount(()=>{n.value=!0,o.value=Ne.GetDefault(),S.H.FTSP.Get().setSortModel(o.value)});const s=async c=>{o.value=c??Ne.GetDefault(),S.H.FTSP.Get().setSortModel(o.value),S.H.FTSP.Get().p.drop(),r("load")},a=async c=>{S.H.FTSP.Get().p.drop(),await s(c)};return(c,l)=>{var h;const u=tt;return i.unref(n)?(i.openBlock(),i.createBlock(u,{key:0,modelValue:i.unref(o),"onUpdate:modelValue":l[0]||(l[0]=f=>i.isRef(o)?o.value=f:null),"popper-append-to-body":!1,clearable:!((h=i.unref(o))!=null&&h.default),"value-key":"label",onChange:a,onClear:l[1]||(l[1]=f=>a())},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(i.unref(Ne).Get(),(f,m)=>(i.openBlock(),i.createElementBlock("option",{key:m,label:f.label,value:f},null,8,Xf))),128))]),_:1},8,["modelValue","clearable"])):i.createCommentVNode("",!0)}}}),[["__scopeId","data-v-ef96d2ea"]]),Yf=["label","value"],Ws=x(i.defineComponent({__name:"SortSelect",props:{maxWidth:{type:[Number,String],default:250}},emits:["load"],setup(t,{emit:e}){const n=e,r=i.ref();i.onBeforeMount(()=>{r.value=Ne.GetDefault()});const o=async a=>{a||(r.value=Ne.GetDefault()),S.H.FTSP.Get().setSortModel(r.value),S.H.FTSP.Get().p.drop(),n("load")},s=async a=>{await o(a)};return(a,c)=>{var u;const l=tt;return i.openBlock(),i.createBlock(l,{modelValue:i.unref(r),"onUpdate:modelValue":c[0]||(c[0]=h=>i.isRef(r)?r.value=h:null),"popper-append-to-body":!1,clearable:!((u=i.unref(r))!=null&&u.default),"value-key":"label",onChange:s},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(i.unref(Ne).Get(),(h,f)=>(i.openBlock(),i.createElementBlock("option",{key:f,label:h.label,value:h},null,8,Yf))),128))]),_:1},8,["modelValue","clearable"])}}}),[["__scopeId","data-v-8f7ad510"]]),Qf={class:"switch-container"},Kf={class:"line"},em={class:"line"},js=x(i.defineComponent({__name:"Switch3Pos",props:{firstModel:{type:Object,required:!0},secondModel:{type:Object,required:!0},defaultLabel:{type:String,default:"Все"}},emits:["load"],setup(t,{emit:e}){const n=t,r={background:"inherit",border:"1px solid #c4c4c4"},o=()=>n.firstModel.valueEq(u.value)?void 0:r,s=()=>u.value?r:void 0,a=()=>n.secondModel.valueEq(u.value)?void 0:r,c=f=>{var g;return{color:(g=u.value)!=null&&g.valueEq(f)?"#006bb4":"#B0A4C0"}},l=e,u=i.ref(void 0),h=async f=>{var m;(m=u.value)!=null&&m.valueEq(f)||(S.H.FTSP.Get().replaceF(f,u.value),u.value=f,l("load"))};return(f,m)=>{const g=fe;return i.openBlock(),i.createElementBlock("div",Qf,[i.createElementVNode("div",Kf,[i.createVNode(g,{string:t.firstModel.label,"font-size":"12px",padding:"0",style:i.normalizeStyle(c(t.firstModel)),onClick:m[0]||(m[0]=p=>h(t.firstModel))},null,8,["string","style"]),i.createVNode(g,{string:"Все","font-size":"12px",padding:"0",style:i.normalizeStyle(c()),onClick:m[1]||(m[1]=p=>h())},null,8,["style"]),i.createVNode(g,{string:t.secondModel.label,"font-size":"12px",padding:"0",style:i.normalizeStyle(c(t.secondModel)),onClick:m[2]||(m[2]=p=>h(t.secondModel))},null,8,["string","style"])]),i.createElementVNode("div",em,[i.createElementVNode("div",{class:i.normalizeClass(["switch-knob1",{active:t.firstModel.valueEq(i.unref(u))}]),style:i.normalizeStyle(o()),onClick:m[3]||(m[3]=p=>h(t.firstModel))},null,6),i.createElementVNode("div",{class:i.normalizeClass(["switch-knob2",{active:!i.unref(u)}]),style:i.normalizeStyle(s()),onClick:m[4]||(m[4]=p=>h())},null,6),i.createElementVNode("div",{class:i.normalizeClass(["switch-knob3",{active:t.secondModel.valueEq(i.unref(u))}]),style:i.normalizeStyle(a()),onClick:m[5]||(m[5]=p=>h(t.secondModel))},null,6),m[6]||(m[6]=i.createElementVNode("div",{class:"switch-axis"},null,-1)),m[7]||(m[7]=i.createElementVNode("div",{class:"switch-axis-dash1"},null,-1)),m[8]||(m[8]=i.createElementVNode("div",{class:"switch-axis-dash2"},null,-1)),m[9]||(m[9]=i.createElementVNode("div",{class:"switch-axis-dash3"},null,-1))])])}}}),[["__scopeId","data-v-5dcc4d3d"]]),tm={},nm={class:"flex"};function im(t,e){return i.openBlock(),i.createElementBlock("div",nm,[i.renderSlot(t.$slots,"default",{},void 0,!0)])}const Gs=x(tm,[["render",im],["__scopeId","data-v-4d1abb74"]]),Zs=x(i.defineComponent({__name:"ToggleInfoItem",props:{title:{type:String,required:!0},content:{type:String,required:!0}},emits:["submit"],setup(t,{emit:e}){const n=i.ref(!1),r=e,o=async()=>{r("submit"),n.value=!n.value};return(s,a)=>{const c=fe,l=Ce,u=zt,h=nt;return i.openBlock(),i.createBlock(h,{title:t.title,icon:"edit-title","with-hover":!0,close:i.unref(n),width:"100%",onKeyupEnter:o},{"open-inside-content":i.withCtx(()=>[i.createVNode(u,{"custom-class":"grid"},{default:i.withCtx(()=>[i.renderSlot(s.$slots,"default",{},void 0,!0),i.createVNode(l,{type:"admin",color:"blue",text:"Сохранить",onClick:o})]),_:3})]),default:i.withCtx(()=>[t.content.length>0?(i.openBlock(),i.createBlock(c,{key:0,string:t.content},null,8,["string"])):(i.openBlock(),i.createBlock(c,{key:1,string:"Введите данные",color:"#B0A4C0"}))]),_:3},8,["title","close"])}}}),[["__scopeId","data-v-994f6522"]]),rm={class:"top-slider-content"},om={class:"center"},Js=x(i.defineComponent({__name:"TopSliderContainer",props:{sliderOffHeight:{type:String,required:!1,default:"53px"},sliderOnHeight:{type:String,required:!1,default:"220px"},background:{type:String,required:!1,default:"inherit"},toggle:{type:Boolean,default:!1}},emits:["toggle"],setup(t,{emit:e}){const n=t,r=e,o=i.ref(!0);i.watch(()=>n.toggle,()=>{o.value=!o.value});const s=a=>{o.value=!o.value,r("toggle",a)};return(a,c)=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[i.unref(o)?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",{key:0,class:"blur",onClick:[c[0]||(c[0]=i.withModifiers(l=>o.value=!0,["prevent"])),c[1]||(c[1]=i.withModifiers(()=>{},["stop"]))]})),i.createElementVNode("div",{class:"top-slider",style:i.normalizeStyle({marginTop:i.unref(o)?`calc(${t.sliderOffHeight} - ${t.sliderOnHeight})`:"0",height:t.sliderOnHeight}),onClick:c[3]||(c[3]=i.withModifiers(()=>{},["stop"]))},[i.createElementVNode("div",rm,[i.createElementVNode("div",om,[i.renderSlot(a.$slots,"default",{},void 0,!0)])]),i.createElementVNode("div",{class:"click-line",style:i.normalizeStyle({height:t.sliderOffHeight}),onClick:c[2]||(c[2]=l=>s(!i.unref(o)))},[i.renderSlot(a.$slots,"title",{},void 0,!0)],4)],4)],64))}}),[["__scopeId","data-v-fec4dfde"]]),sm={id:"drop-area",class:"img-container"},am={key:0},lm=["src"],cm={class:"tools-button"},dm={class:"ins"},um={key:1},hm=["id"],Xs=x(i.defineComponent({__name:"UploaderImage",props:{withCrop:{type:Boolean,default:!0},fileInfo:{type:_e,required:!0},height:{type:Number,default:150},width:{type:Number,default:150},cropRatio:{type:Boolean,default:!0},emitCrop:{type:Boolean,default:!1},defaultRatio:{type:Number,required:!1,default:1}},emits:["crop","removeFile"],setup(t,{emit:e}){const n=t,r=e,o=i.ref(void 0),s=S.H.Strings.CreateGuid(),a=i.ref(!1),c=i.ref(),l=w=>{const B=n.cropRatio?n.defaultRatio:0;S.S.Cropper.Open(dn.CreateCropper(w.url,B,n.fileInfo.id)),a.value=!0},u=()=>{S.Dialog.Show({text:"Вы хотите удалить изображение",confirmButtonText:"Удалить",cancelButtonText:"Не удалять"}).then(()=>{o.value=void 0,c.value.clearFiles(),r("removeFile")})},h=w=>{n.fileInfo.setFile(w),n.fileInfo.fileSystemPath&&(o.value=n.fileInfo),a.value=!1,r("crop")};i.onBeforeMount(()=>{n.fileInfo.fileSystemPath&&(o.value=n.fileInfo,o.value.url=n.fileInfo.getFileUrl())});let f=null;i.onMounted(()=>{const w=document.getElementById("drop-area");w&&(w.addEventListener("dragover",B=>{m(B),w.classList.add("drag-over")}),w.addEventListener("dragleave",B=>{m(B),w.classList.remove("drag-over")}),w.addEventListener("dragenter",m),w.addEventListener("dragleave",m),w.addEventListener("drop",p),f=document.getElementById(s))});function m(w){w.preventDefault(),w.stopPropagation()}const g=()=>{f&&f.click()};function p(w){if(w.preventDefault(),!w.dataTransfer)return;const B=w.dataTransfer.files;B.length&&f&&(f.files=B,k())}const k=()=>{if(!f||!f.files||!f.files.length)return;const w=f.files[0];w.url=URL.createObjectURL(w),o.value=w,n.fileInfo.uploadNewFile(w),l(o.value)};return(w,B)=>{const D=Ce,L=Li;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",sm,[i.unref(o)?(i.openBlock(),i.createElementBlock("div",am,[i.createElementVNode("div",{class:"img-block",style:i.normalizeStyle({width:t.height*t.defaultRatio-2+"px",height:t.height+"px"})},[i.createElementVNode("img",{class:"el-upload-list__item-thumbnail",src:i.unref(o).url,alt:"upload-image"},null,8,lm)],4),i.createElementVNode("div",cm,[i.createElementVNode("div",dm,[i.createVNode(D,{skin:"text",text:"Изменить","font-size":"20px",width:"300px",margin:"100px 0 0 0",onClick:B[0]||(B[0]=F=>l(i.unref(o)))}),i.createVNode(D,{skin:"text",text:"Удалить","font-size":"20px",width:"300px",margin:"50px 0 0 0",onClick:B[1]||(B[1]=F=>u())})])])])):(i.openBlock(),i.createElementBlock("div",um,[i.createElementVNode("div",{class:"add-button",style:i.normalizeStyle({width:t.height*t.defaultRatio-2+"px",height:t.height+"px"})},[i.createVNode(D,{skin:"text",text:"Добавить","font-size":"20px",onClick:g})],4)]))]),i.createElementVNode("input",{id:i.unref(s),type:"file",hidden:"",onChange:k},null,40,hm),t.withCrop?(i.openBlock(),i.createBlock(L,{key:0,open:i.unref(a),"default-ratio":t.defaultRatio,onCrop:h,onClose:B[2]||(B[2]=F=>a.value=!1)},null,8,["open","default-ratio"])):i.createCommentVNode("",!0)],64)}}}),[["__scopeId","data-v-4b143fdb"]]),fm=["Orders"],mm={install:function(t){t.component("PButton",Ce),t.component("PCheckBox",gi),t.component("PDatePicker",Eo),t.component("PFlex",yi),t.component("PInput",ct),t.component("PInputDate",wi),t.component("PInputNumber",vo),t.component("PLeftSlider",xo),t.component("PList",Mo),t.component("PListItem",Bo),t.component("PRadio",Ro),t.component("PRightSlider",$o),t.component("PSelect",tt),t.component("PSticky",mn),t.component("PString",fe),t.component("PTextarea",No),t.component("PTopSlider",Ao),t.component("IconDownload",qo),t.component("IconFilter",Uo),t.component("ArrowLeft",pn),t.component("ArrowRight",gn),t.component("DoubleArrowLeft",Si),t.component("DoubleArrowRight",ki),t.component("EllipsisSvg",Ei),t.component("IconArrowLeft",Wo),t.component("IconCheckDefault",pi),t.component("IconClose",Pt),t.component("IconEdit",jo),t.component("IconEmail",Go),t.component("IconMove",Zo),t.component("IconPhone",Jo),t.component("IconSearch",Ci),t.component("IconSelectArrow",bi),t.component("CollapseContainer",xs),t.component("CollapseItem",Ms),t.component("VerticalCollapseContainer",Bs),t.component("PAdd",Rs),t.component("PContainer",Hi),t.component("PContainerStickyHead",$s),t.component("PDel",Ns),t.component("PTabs",As),t.component("UploaderFile",Is),t.component("AuthForm",ln),t.component("PModal",Tt),t.component("AuthPage",oi),t.component("PageNotFound",si),t.component("AdaptiveContainer",Zi),t.component("AdaptiveContainerHorizontal",Ji),t.component("AdminGallery",ko),t.component("AuthModal",Io),t.component("CarouselImages",Po),t.component("ContextWindow",To),t.component("DateInputRangeV2",Vo),t.component("DateInputRange",zo),t.component("DropList",Fo),t.component("FilterCheckbox",Oo),t.component("FiltersButtonsSelect",Do),t.component("FilterSelect",Lo),t.component("FTSPPanel",Ho),t.component("GeneralItem",_o),t.component("GridContainer",zt),t.component("ImageCropper",Li),t.component("InfoItem",nt),t.component("InfoItemSelectButtons",Es),t.component("LeftRightContainer",vs),t.component("MessageBody",Mn),t.component("PAutocomplete",_i),t.component("PDialog",Ps),t.component("PhoneForm",Ts),t.component("PLoader",zs),t.component("PNotification",Vs),t.component("PPagination",Fs),t.component("RemoteSearch",Os),t.component("ResearcheContainer",Ds),t.component("RightSliderContainer",Ls),t.component("RightTabsContainer",Hs),t.component("SelectValueType",_s),t.component("SingleNameToggleForm",qs),t.component("SortList",Us),t.component("SortSelect",Ws),t.component("Switch3Pos",js),t.component("ThemeWrapper",Gs),t.component("ToggleInfoItem",Zs),t.component("TopSliderContainer",Js),t.component("UploaderImage",Xs)}},pm=["PF","PFM"];v.AdaptiveContainer=Zi,v.AdaptiveContainerHorizontal=Ji,v.AdminGallery=ko,v.ArrowLeft=pn,v.ArrowRight=gn,v.AuthForm=ln,v.AuthModal=Io,v.AuthPage=oi,v.CarouselImages=Po,v.CollapseContainer=xs,v.CollapseItem=Ms,v.ContextWindow=To,v.DateInputRange=zo,v.DateInputRange_v2=Vo,v.DoubleArrowLeft=Si,v.DoubleArrowRight=ki,v.DropList=Fo,v.EllipsisSvg=Ei,v.FTSPPanel=Ho,v.FilterCheckbox=Oo,v.FilterSelect=Lo,v.FiltersButtonsSelect=Do,v.GeneralItem=_o,v.GridContainer=zt,v.IconArrowLeft=Wo,v.IconCheckDefault=pi,v.IconClose=Pt,v.IconDownload=qo,v.IconEdit=jo,v.IconEmail=Go,v.IconFilter=Uo,v.IconMove=Zo,v.IconPhone=Jo,v.IconSearch=Ci,v.IconSelectArrow=bi,v.ImageCropper=Li,v.InfoItem=nt,v.InfoItemSelectButtons=Es,v.LeftRightContainer=vs,v.MessageBody=Mn,v.Orders=$e,v.PAdd=Rs,v.PAutocomplete=_i,v.PButton=Ce,v.PCheckBox=gi,v.PContainer=Hi,v.PContainerStickyHead=$s,v.PDatePicker=Eo,v.PDel=Ns,v.PDialog=Ps,v.PF=S,v.PFM=Nu,v.PFlex=yi,v.PInput=ct,v.PInputDate=wi,v.PInputNumber=vo,v.PLeftSlider=xo,v.PList=Mo,v.PListItem=Bo,v.PLoader=zs,v.PModal=Tt,v.PNotification=Vs,v.PPagination=Fs,v.PRadio=Ro,v.PRightSlider=$o,v.PSelect=tt,v.PSticky=mn,v.PString=fe,v.PTabs=As,v.PTextarea=No,v.PTopSlider=Ao,v.PageNotFound=si,v.PhoneForm=Ts,v.RemoteSearch=Os,v.ResearcheContainer=Ds,v.RightSliderContainer=Ls,v.RightTabsContainer=Hs,v.SelectValueType=_s,v.SingleNameToggleForm=qs,v.SortList=Us,v.SortSelect=Ws,v.Switch3Pos=js,v.ThemeWrapper=Gs,v.ToggleInfoItem=Zs,v.TopSliderContainer=Js,v.UploaderFile=Is,v.UploaderImage=Xs,v.VerticalCollapseContainer=Bs,v.pfName=pm,v.servicesComponents=mm,v.typesNames=fm,Object.defineProperty(v,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "sprof",
3
3
  "description": "components for the designer and uikit",
4
4
  "author": "Stanislav Lushnikov, Daniil Gaivoronskiy",
5
- "version": "0.0.53",
5
+ "version": "0.0.55",
6
6
  "private": false,
7
7
  "type": "module",
8
8
  "main": "./dist/sprof.umd.cjs",