%PDF- %PDF-
Direktori : /var/www/tif-dev/wp-content/plugins/lazy-blocks/controls/select/ |
Current File : //var/www/tif-dev/wp-content/plugins/lazy-blocks/controls/select/component-choices.min.js |
!function(){var e={2456:function(e){"use strict";e.exports=function(e,t,n,r,o,i,a,l){if(!e){var s;if(void 0===t)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,o,i,a,l],u=0;(s=new Error(t.replace(/%s/g,(function(){return c[u++]})))).name="Invariant Violation"}throw s.framesToPop=1,s}}},9739:function(e,t,n){"use strict";var r=n(6669);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,a){if(a!==r){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},7329:function(e,t,n){e.exports=n(9739)()},6669:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){"use strict";function e(){return e=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},e.apply(this,arguments)}function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function r(e,n){if(e){if("string"==typeof e)return t(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,n):void 0}}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,l=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){l=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(l)throw o}}return i}}(e,t)||r(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&r.push.apply(r,Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach((function(t){i(e,t,n[t])}))}return e}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function c(e,t,n){return t&&s(e.prototype,t),n&&s(e,n),e}function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function d(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function f(e,t){if(t&&("object"===u(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return d(e)}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}function p(e,t){return p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},p(e,t)}function g(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&p(e,t)}var y=React,m=ReactDOM,v=n(2456),x=n.n(v);var w=n(7329),b=n.n(w),S=function(){function e(){l(this,e),i(this,"refs",{})}return c(e,[{key:"add",value:function(e,t){this.refs[e]||(this.refs[e]=[]),this.refs[e].push(t)}},{key:"remove",value:function(e,t){var n=this.getIndex(e,t);-1!==n&&this.refs[e].splice(n,1)}},{key:"isActive",value:function(){return this.active}},{key:"getActive",value:function(){var e=this;return this.refs[this.active.collection].find((function(t){return t.node.sortableInfo.index==e.active.index}))}},{key:"getIndex",value:function(e,t){return this.refs[e].indexOf(t)}},{key:"getOrderedRefs",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.active.collection;return this.refs[e].sort(C)}}]),e}();function C(e,t){return e.node.sortableInfo.index-t.node.sortableInfo.index}function O(e,t){return Object.keys(e).reduce((function(n,r){return-1===t.indexOf(r)&&(n[r]=e[r]),n}),{})}var T={end:["touchend","touchcancel","mouseup"],move:["touchmove","mousemove"],start:["touchstart","mousedown"]},E=function(){if("undefined"==typeof window||"undefined"==typeof document)return"";var e=window.getComputedStyle(document.documentElement,"")||["-moz-hidden-iframe"],t=(Array.prototype.slice.call(e).join("").match(/-(moz|webkit|ms)-/)||""===e.OLink&&["","o"])[1];return"ms"===t?"ms":t&&t.length?t[0].toUpperCase()+t.substr(1):""}();function I(e,t){Object.keys(t).forEach((function(n){e.style[n]=t[n]}))}function k(e,t){e.style["".concat(E,"Transform")]=null==t?"":"translate3d(".concat(t.x,"px,").concat(t.y,"px,0)")}function R(e,t){e.style["".concat(E,"TransitionDuration")]=null==t?"":"".concat(t,"ms")}function D(e,t){for(;e;){if(t(e))return e;e=e.parentNode}return null}function M(e,t,n){return Math.max(e,Math.min(n,t))}function N(e){return"px"===e.substr(-2)?parseFloat(e):0}function A(e){var t=window.getComputedStyle(e);return{bottom:N(t.marginBottom),left:N(t.marginLeft),right:N(t.marginRight),top:N(t.marginTop)}}function H(e,t){var n=t.displayName||t.name;return n?"".concat(e,"(").concat(n,")"):e}function P(e,t){var n=e.getBoundingClientRect();return{top:n.top+t.top,left:n.left+t.left}}function W(e){return e.touches&&e.touches.length?{x:e.touches[0].pageX,y:e.touches[0].pageY}:e.changedTouches&&e.changedTouches.length?{x:e.changedTouches[0].pageX,y:e.changedTouches[0].pageY}:{x:e.pageX,y:e.pageY}}function L(e){return e.touches&&e.touches.length||e.changedTouches&&e.changedTouches.length}function j(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{left:0,top:0};if(e){var r={left:n.left+e.offsetLeft,top:n.top+e.offsetTop};return e.parentNode===t?r:j(e.parentNode,t,r)}}function _(e,t,n){return e<n&&e>t?e-1:e>n&&e<t?e+1:e}function K(e){var t=e.lockOffset,n=e.width,r=e.height,o=t,i=t,a="px";if("string"==typeof t){var l=/^[+-]?\d*(?:\.\d*)?(px|%)$/.exec(t);x()(null!==l,'lockOffset value should be a number or a string of a number followed by "px" or "%". Given %s',t),o=parseFloat(t),i=parseFloat(t),a=l[1]}return x()(isFinite(o)&&isFinite(i),"lockOffset value should be a finite. Given %s",t),"%"===a&&(o=o*n/100,i=i*r/100),{x:o,y:i}}function V(e){var t=e.height,n=e.width,r=e.lockOffset,i=Array.isArray(r)?r:[r,r];x()(2===i.length,"lockOffset prop of SortableContainer should be a single value or an array of exactly two values. Given %s",r);var a=o(i,2),l=a[0],s=a[1];return[K({height:t,lockOffset:l,width:n}),K({height:t,lockOffset:s,width:n})]}function B(e){return e instanceof HTMLElement?function(e){var t=window.getComputedStyle(e),n=/(auto|scroll)/;return["overflow","overflowX","overflowY"].find((function(e){return n.test(t[e])}))}(e)?e:B(e.parentNode):null}function G(e){var t=window.getComputedStyle(e);return"grid"===t.display?{x:N(t.gridColumnGap),y:N(t.gridRowGap)}:{x:0,y:0}}var U="BUTTON",X="INPUT",Y="OPTION",F="TEXTAREA",z="SELECT";function Z(e){var n,o="input, textarea, select, canvas, [contenteditable]",i=e.querySelectorAll(o),a=e.cloneNode(!0);return(n=a.querySelectorAll(o),function(e){if(Array.isArray(e))return t(e)}(n)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(n)||r(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).forEach((function(e,t){"file"!==e.type&&(e.value=i[t].value),"radio"===e.type&&e.name&&(e.name="__sortableClone__".concat(e.name)),"CANVAS"===e.tagName&&i[t].width>0&&i[t].height>0&&e.getContext("2d").drawImage(i[t],0,0)})),a}function q(e){return null!=e.sortableHandle}var $=function(){function e(t,n){l(this,e),this.container=t,this.onScrollCallback=n}return c(e,[{key:"clear",value:function(){null!=this.interval&&(clearInterval(this.interval),this.interval=null)}},{key:"update",value:function(e){var t=this,n=e.translate,r=e.minTranslate,o=e.maxTranslate,i=e.width,a=e.height,l={x:0,y:0},s={x:1,y:1},c=this.container,u=c.scrollTop,d=c.scrollLeft,f=c.scrollHeight,h=c.scrollWidth,p=0===u,g=f-u-c.clientHeight==0,y=0===d,m=h-d-c.clientWidth==0;n.y>=o.y-a/2&&!g?(l.y=1,s.y=10*Math.abs((o.y-a/2-n.y)/a)):n.x>=o.x-i/2&&!m?(l.x=1,s.x=10*Math.abs((o.x-i/2-n.x)/i)):n.y<=r.y+a/2&&!p?(l.y=-1,s.y=10*Math.abs((n.y-a/2-r.y)/a)):n.x<=r.x+i/2&&!y&&(l.x=-1,s.x=10*Math.abs((n.x-i/2-r.x)/i)),this.interval&&(this.clear(),this.isAutoScrolling=!1),0===l.x&&0===l.y||(this.interval=setInterval((function(){t.isAutoScrolling=!0;var e={left:s.x*l.x,top:s.y*l.y};t.container.scrollTop+=e.top,t.container.scrollLeft+=e.left,t.onScrollCallback(e)}),5))}}]),e}(),J={axis:b().oneOf(["x","y","xy"]),contentWindow:b().any,disableAutoscroll:b().bool,distance:b().number,getContainer:b().func,getHelperDimensions:b().func,helperClass:b().string,helperContainer:b().oneOfType([b().func,"undefined"==typeof HTMLElement?b().any:b().instanceOf(HTMLElement)]),hideSortableGhost:b().bool,keyboardSortingTransitionDuration:b().number,lockAxis:b().string,lockOffset:b().oneOfType([b().number,b().string,b().arrayOf(b().oneOfType([b().number,b().string]))]),lockToContainerEdges:b().bool,onSortEnd:b().func,onSortMove:b().func,onSortOver:b().func,onSortStart:b().func,pressDelay:b().number,pressThreshold:b().number,keyCodes:b().shape({lift:b().arrayOf(b().number),drop:b().arrayOf(b().number),cancel:b().arrayOf(b().number),up:b().arrayOf(b().number),down:b().arrayOf(b().number)}),shouldCancelStart:b().func,transitionDuration:b().number,updateBeforeSortStart:b().func,useDragHandle:b().bool,useWindowAsScrollContainer:b().bool},Q={lift:[32],drop:[32],cancel:[27],up:[38,37],down:[40,39]},ee={axis:"y",disableAutoscroll:!1,distance:0,getHelperDimensions:function(e){var t=e.node;return{height:t.offsetHeight,width:t.offsetWidth}},hideSortableGhost:!0,lockOffset:"50%",lockToContainerEdges:!1,pressDelay:0,pressThreshold:5,keyCodes:Q,shouldCancelStart:function(e){return-1!==[X,F,z,Y,U].indexOf(e.target.tagName)||!!D(e.target,(function(e){return"true"===e.contentEditable}))},transitionDuration:300,useWindowAsScrollContainer:!1},te=Object.keys(J);function ne(e){x()(!(e.distance&&e.pressDelay),"Attempted to set both `pressDelay` and `distance` on SortableContainer, you may only use one or the other, not both at the same time.")}function re(e,t){try{var n=e()}catch(e){return t(!0,e)}return n&&n.then?n.then(t.bind(null,!1),t.bind(null,!0)):t(!1,value)}var oe=(0,y.createContext)({manager:{}}),ie={index:b().number.isRequired,collection:b().oneOfType([b().number,b().string]),disabled:b().bool},ae=Object.keys(ie);function le(){return le=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},le.apply(this,arguments)}var se=wp.i18n.__,ce=(wp.element.Component,wp.components),ue=(ce.BaseControl,ce.TextControl),de=(ce.Button,function(t){var n,r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{withRef:!1};return r=n=function(n){function r(){var e,t;l(this,r);for(var n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];return i(d(d(t=f(this,(e=h(r)).call.apply(e,[this].concat(o))))),"wrappedInstance",(0,y.createRef)()),t}return g(r,n),c(r,[{key:"componentDidMount",value:function(){(0,m.findDOMNode)(this).sortableHandle=!0}},{key:"getWrappedInstance",value:function(){return x()(o.withRef,"To access the wrapped instance, you need to pass in {withRef: true} as the second argument of the SortableHandle() call"),this.wrappedInstance.current}},{key:"render",value:function(){var n=o.withRef?this.wrappedInstance:null;return(0,y.createElement)(t,e({ref:n},this.props))}}]),r}(y.Component),i(n,"displayName",H("sortableHandle",t)),r}((function(){return wp.element.createElement("div",{className:"lzb-constructor-controls-item-settings-choices-item-handler"},wp.element.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},wp.element.createElement("path",{d:"M10 4.99976H8V6.99976H10V4.99976Z",fill:"currentColor"}),wp.element.createElement("path",{d:"M10 10.9998H8V12.9998H10V10.9998Z",fill:"currentColor"}),wp.element.createElement("path",{d:"M10 16.9998H8V18.9998H10V16.9998Z",fill:"currentColor"}),wp.element.createElement("path",{d:"M16 4.99976H14V6.99976H16V4.99976Z",fill:"currentColor"}),wp.element.createElement("path",{d:"M16 10.9998H14V12.9998H16V10.9998Z",fill:"currentColor"}),wp.element.createElement("path",{d:"M16 16.9998H14V18.9998H16V16.9998Z",fill:"currentColor"})))}))),fe=function(t){var n,r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{withRef:!1};return r=n=function(n){function r(){var e,t;l(this,r);for(var n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];return i(d(d(t=f(this,(e=h(r)).call.apply(e,[this].concat(o))))),"wrappedInstance",(0,y.createRef)()),t}return g(r,n),c(r,[{key:"componentDidMount",value:function(){this.register()}},{key:"componentDidUpdate",value:function(e){this.node&&(e.index!==this.props.index&&(this.node.sortableInfo.index=this.props.index),e.disabled!==this.props.disabled&&(this.node.sortableInfo.disabled=this.props.disabled)),e.collection!==this.props.collection&&(this.unregister(e.collection),this.register())}},{key:"componentWillUnmount",value:function(){this.unregister()}},{key:"register",value:function(){var e=this.props,t=e.collection,n=e.disabled,r=e.index,o=(0,m.findDOMNode)(this);o.sortableInfo={collection:t,disabled:n,index:r,manager:this.context.manager},this.node=o,this.ref={node:o},this.context.manager.add(t,this.ref)}},{key:"unregister",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props.collection;this.context.manager.remove(e,this.ref)}},{key:"getWrappedInstance",value:function(){return x()(o.withRef,"To access the wrapped instance, you need to pass in {withRef: true} as the second argument of the SortableElement() call"),this.wrappedInstance.current}},{key:"render",value:function(){var n=o.withRef?this.wrappedInstance:null;return(0,y.createElement)(t,e({ref:n},O(this.props,ae)))}}]),r}(y.Component),i(n,"displayName",H("sortableElement",t)),i(n,"contextType",oe),i(n,"propTypes",ie),i(n,"defaultProps",{collection:0}),r}((function(e){return wp.element.createElement("div",{className:"lzb-constructor-controls-item-settings-choices-item"},wp.element.createElement(ue,{placeholder:se("Label","lazy-blocks"),value:e.label,onChange:function(t){return e.updateChoice({label:t})}}),wp.element.createElement(ue,{placeholder:se("Value","lazy-blocks"),value:e.value,onChange:function(t){return e.updateChoice({value:t})}}),wp.element.createElement(de,null),wp.element.createElement("button",{className:"lzb-constructor-controls-item-settings-choices-item-remove",onClick:function(){return e.removeChoice()}},wp.element.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},wp.element.createElement("path",{d:"M6.33734 7.1706C6.23299 6.4793 6.76826 5.85717 7.4674 5.85717H16.5326C17.2317 5.85717 17.767 6.4793 17.6627 7.17061L15.9807 18.3134C15.8963 18.8724 15.416 19.2857 14.8507 19.2857H9.14934C8.58403 19.2857 8.10365 18.8724 8.01928 18.3134L6.33734 7.1706Z",stroke:"currentColor",strokeWidth:"1.71429"}),wp.element.createElement("rect",{x:"4",y:"5",width:"16",height:"2",fill:"currentColor"}),wp.element.createElement("path",{d:"M14.2857 5C14.2857 5 13.2624 5 12 5C10.7376 5 9.71428 5 9.71428 5C9.71428 3.73763 10.7376 2.71429 12 2.71429C13.2624 2.71429 14.2857 3.73763 14.2857 5Z",fill:"currentColor"}))))}));!function(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{withRef:!1};n=function(n){function s(e){var t;l(this,s),i(d(d(t=f(this,h(s).call(this,e)))),"state",{}),i(d(d(t)),"handleStart",(function(e){var n=t.props,r=n.distance,o=n.shouldCancelStart;if(2!==e.button&&!o(e)){t.touched=!0,t.position=W(e);var i=D(e.target,(function(e){return null!=e.sortableInfo}));if(i&&i.sortableInfo&&t.nodeIsChild(i)&&!t.state.sorting){var a=t.props.useDragHandle,l=i.sortableInfo,s=l.index,c=l.collection;if(l.disabled)return;if(a&&!D(e.target,q))return;t.manager.active={collection:c,index:s},L(e)||"A"!==e.target.tagName||e.preventDefault(),r||(0===t.props.pressDelay?t.handlePress(e):t.pressTimer=setTimeout((function(){return t.handlePress(e)}),t.props.pressDelay))}}})),i(d(d(t)),"nodeIsChild",(function(e){return e.sortableInfo.manager===t.manager})),i(d(d(t)),"handleMove",(function(e){var n=t.props,r=n.distance,o=n.pressThreshold;if(!t.state.sorting&&t.touched&&!t._awaitingUpdateBeforeSortStart){var i=W(e),a={x:t.position.x-i.x,y:t.position.y-i.y},l=Math.abs(a.x)+Math.abs(a.y);t.delta=a,r||o&&!(l>=o)?r&&l>=r&&t.manager.isActive()&&t.handlePress(e):(clearTimeout(t.cancelTimer),t.cancelTimer=setTimeout(t.cancel,0))}})),i(d(d(t)),"handleEnd",(function(){t.touched=!1,t.cancel()})),i(d(d(t)),"cancel",(function(){var e=t.props.distance;t.state.sorting||(e||clearTimeout(t.pressTimer),t.manager.active=null)})),i(d(d(t)),"handlePress",(function(e){try{var n=t.manager.getActive(),r=function(){if(n){var r=function(){var n=h.sortableInfo.index,r=A(h),o=G(t.container),u=t.scrollContainer.getBoundingClientRect(),y=l({index:n,node:h,collection:p});if(t.node=h,t.margin=r,t.gridGap=o,t.width=y.width,t.height=y.height,t.marginOffset={x:t.margin.left+t.margin.right+t.gridGap.x,y:Math.max(t.margin.top,t.margin.bottom,t.gridGap.y)},t.boundingClientRect=h.getBoundingClientRect(),t.containerBoundingRect=u,t.index=n,t.newIndex=n,t.axis={x:i.indexOf("x")>=0,y:i.indexOf("y")>=0},t.offsetEdge=j(h,t.container),t.initialOffset=W(g?a({},e,{pageX:t.boundingClientRect.left,pageY:t.boundingClientRect.top}):e),t.initialScroll={left:t.scrollContainer.scrollLeft,top:t.scrollContainer.scrollTop},t.initialWindowScroll={left:window.pageXOffset,top:window.pageYOffset},t.helper=t.helperContainer.appendChild(Z(h)),I(t.helper,{boxSizing:"border-box",height:"".concat(t.height,"px"),left:"".concat(t.boundingClientRect.left-r.left,"px"),pointerEvents:"none",position:"fixed",top:"".concat(t.boundingClientRect.top-r.top,"px"),width:"".concat(t.width,"px")}),g&&t.helper.focus(),c&&(t.sortableGhost=h,I(h,{opacity:0,visibility:"hidden"})),t.minTranslate={},t.maxTranslate={},g){var m=f?{top:0,left:0,width:t.contentWindow.innerWidth,height:t.contentWindow.innerHeight}:t.containerBoundingRect,v=m.top,x=m.left,w=m.width,b=v+m.height,S=x+w;t.axis.x&&(t.minTranslate.x=x-t.boundingClientRect.left,t.maxTranslate.x=S-(t.boundingClientRect.left+t.width)),t.axis.y&&(t.minTranslate.y=v-t.boundingClientRect.top,t.maxTranslate.y=b-(t.boundingClientRect.top+t.height))}else t.axis.x&&(t.minTranslate.x=(f?0:u.left)-t.boundingClientRect.left-t.width/2,t.maxTranslate.x=(f?t.contentWindow.innerWidth:u.left+u.width)-t.boundingClientRect.left-t.width/2),t.axis.y&&(t.minTranslate.y=(f?0:u.top)-t.boundingClientRect.top-t.height/2,t.maxTranslate.y=(f?t.contentWindow.innerHeight:u.top+u.height)-t.boundingClientRect.top-t.height/2);s&&s.split(" ").forEach((function(e){return t.helper.classList.add(e)})),t.listenerNode=e.touches?e.target:t.contentWindow,g?(t.listenerNode.addEventListener("wheel",t.handleKeyEnd,!0),t.listenerNode.addEventListener("mousedown",t.handleKeyEnd,!0),t.listenerNode.addEventListener("keydown",t.handleKeyDown)):(T.move.forEach((function(e){return t.listenerNode.addEventListener(e,t.handleSortMove,!1)})),T.end.forEach((function(e){return t.listenerNode.addEventListener(e,t.handleSortEnd,!1)}))),t.setState({sorting:!0,sortingIndex:n}),d&&d({node:h,index:n,collection:p,isKeySorting:g,nodes:t.manager.getOrderedRefs(),helper:t.helper},e),g&&t.keyMove(0)},o=t.props,i=o.axis,l=o.getHelperDimensions,s=o.helperClass,c=o.hideSortableGhost,u=o.updateBeforeSortStart,d=o.onSortStart,f=o.useWindowAsScrollContainer,h=n.node,p=n.collection,g=t.manager.isKeySorting,y=function(){if("function"==typeof u){t._awaitingUpdateBeforeSortStart=!0;var n=re((function(){var t=h.sortableInfo.index;return Promise.resolve(u({collection:p,index:t,node:h,isKeySorting:g},e)).then((function(){}))}),(function(e,n){if(t._awaitingUpdateBeforeSortStart=!1,e)throw n;return n}));if(n&&n.then)return n.then((function(){}))}}();return y&&y.then?y.then(r):r()}}();return Promise.resolve(r&&r.then?r.then((function(){})):void 0)}catch(e){return Promise.reject(e)}})),i(d(d(t)),"handleSortMove",(function(e){var n=t.props.onSortMove;"function"==typeof e.preventDefault&&e.cancelable&&e.preventDefault(),t.updateHelperPosition(e),t.animateNodes(),t.autoscroll(),n&&n(e)})),i(d(d(t)),"handleSortEnd",(function(e){var n=t.props,r=n.hideSortableGhost,o=n.onSortEnd,i=t.manager,a=i.active.collection,l=i.isKeySorting,s=t.manager.getOrderedRefs();t.listenerNode&&(l?(t.listenerNode.removeEventListener("wheel",t.handleKeyEnd,!0),t.listenerNode.removeEventListener("mousedown",t.handleKeyEnd,!0),t.listenerNode.removeEventListener("keydown",t.handleKeyDown)):(T.move.forEach((function(e){return t.listenerNode.removeEventListener(e,t.handleSortMove)})),T.end.forEach((function(e){return t.listenerNode.removeEventListener(e,t.handleSortEnd)})))),t.helper.parentNode.removeChild(t.helper),r&&t.sortableGhost&&I(t.sortableGhost,{opacity:"",visibility:""});for(var c=0,u=s.length;c<u;c++){var d=s[c],f=d.node;d.edgeOffset=null,d.boundingClientRect=null,k(f,null),R(f,null),d.translate=null}t.autoScroller.clear(),t.manager.active=null,t.manager.isKeySorting=!1,t.setState({sorting:!1,sortingIndex:null}),"function"==typeof o&&o({collection:a,newIndex:t.newIndex,oldIndex:t.index,isKeySorting:l,nodes:s},e),t.touched=!1})),i(d(d(t)),"autoscroll",(function(){var e=t.props.disableAutoscroll,n=t.manager.isKeySorting;if(e)t.autoScroller.clear();else{if(n){var r=a({},t.translate),o=0,i=0;return t.axis.x&&(r.x=Math.min(t.maxTranslate.x,Math.max(t.minTranslate.x,t.translate.x)),o=t.translate.x-r.x),t.axis.y&&(r.y=Math.min(t.maxTranslate.y,Math.max(t.minTranslate.y,t.translate.y)),i=t.translate.y-r.y),t.translate=r,k(t.helper,t.translate),t.scrollContainer.scrollLeft+=o,void(t.scrollContainer.scrollTop+=i)}t.autoScroller.update({height:t.height,maxTranslate:t.maxTranslate,minTranslate:t.minTranslate,translate:t.translate,width:t.width})}})),i(d(d(t)),"onAutoScroll",(function(e){t.translate.x+=e.left,t.translate.y+=e.top,t.animateNodes()})),i(d(d(t)),"handleKeyDown",(function(e){var n=e.keyCode,r=t.props,o=r.shouldCancelStart,i=r.keyCodes,l=a({},Q,void 0===i?{}:i);t.manager.active&&!t.manager.isKeySorting||!(t.manager.active||l.lift.includes(n)&&!o(e)&&t.isValidSortingTarget(e))||(e.stopPropagation(),e.preventDefault(),l.lift.includes(n)&&!t.manager.active?t.keyLift(e):l.drop.includes(n)&&t.manager.active?t.keyDrop(e):l.cancel.includes(n)?(t.newIndex=t.manager.active.index,t.keyDrop(e)):l.up.includes(n)?t.keyMove(-1):l.down.includes(n)&&t.keyMove(1))})),i(d(d(t)),"keyLift",(function(e){var n=e.target,r=D(n,(function(e){return null!=e.sortableInfo})).sortableInfo,o=r.index,i=r.collection;t.initialFocusedNode=n,t.manager.isKeySorting=!0,t.manager.active={index:o,collection:i},t.handlePress(e)})),i(d(d(t)),"keyMove",(function(e){var n=t.manager.getOrderedRefs(),r=n[n.length-1].node.sortableInfo.index,o=t.newIndex+e,i=t.newIndex;if(!(o<0||o>r)){t.prevIndex=i,t.newIndex=o;var a=_(t.newIndex,t.prevIndex,t.index),l=n.find((function(e){return e.node.sortableInfo.index===a})),s=l.node,c=t.containerScrollDelta,u=l.boundingClientRect||P(s,c),d=l.translate||{x:0,y:0},f=u.top+d.y-c.top,h=u.left+d.x-c.left,p=i<o,g=p&&t.axis.x?s.offsetWidth-t.width:0,y=p&&t.axis.y?s.offsetHeight-t.height:0;t.handleSortMove({pageX:h+g,pageY:f+y,ignoreTransition:0===e})}})),i(d(d(t)),"keyDrop",(function(e){t.handleSortEnd(e),t.initialFocusedNode&&t.initialFocusedNode.focus()})),i(d(d(t)),"handleKeyEnd",(function(e){t.manager.active&&t.keyDrop(e)})),i(d(d(t)),"isValidSortingTarget",(function(e){var n=t.props.useDragHandle,r=e.target,o=D(r,(function(e){return null!=e.sortableInfo}));return o&&o.sortableInfo&&!o.sortableInfo.disabled&&(n?q(r):r.sortableInfo)}));var n=new S;return ne(e),t.manager=n,t.wrappedInstance=(0,y.createRef)(),t.sortableContextValue={manager:n},t.events={end:t.handleEnd,move:t.handleMove,start:t.handleStart},t}return g(s,n),c(s,[{key:"componentDidMount",value:function(){var e=this,t=this.props.useWindowAsScrollContainer,n=this.getContainer();Promise.resolve(n).then((function(n){e.container=n,e.document=e.container.ownerDocument||document;var r=e.props.contentWindow||e.document.defaultView||window;e.contentWindow="function"==typeof r?r():r,e.scrollContainer=t?e.document.scrollingElement||e.document.documentElement:B(e.container)||e.container,e.autoScroller=new $(e.scrollContainer,e.onAutoScroll),Object.keys(e.events).forEach((function(t){return T[t].forEach((function(n){return e.container.addEventListener(n,e.events[t],!1)}))})),e.container.addEventListener("keydown",e.handleKeyDown)}))}},{key:"componentWillUnmount",value:function(){var e=this;this.helper&&this.helper.parentNode&&this.helper.parentNode.removeChild(this.helper),this.container&&(Object.keys(this.events).forEach((function(t){return T[t].forEach((function(n){return e.container.removeEventListener(n,e.events[t])}))})),this.container.removeEventListener("keydown",this.handleKeyDown))}},{key:"updateHelperPosition",value:function(e){var t=this.props,n=t.lockAxis,r=t.lockOffset,i=t.lockToContainerEdges,a=t.transitionDuration,l=t.keyboardSortingTransitionDuration,s=void 0===l?a:l,c=this.manager.isKeySorting,u=e.ignoreTransition,d=W(e),f={x:d.x-this.initialOffset.x,y:d.y-this.initialOffset.y};if(f.y-=window.pageYOffset-this.initialWindowScroll.top,f.x-=window.pageXOffset-this.initialWindowScroll.left,this.translate=f,i){var h=o(V({height:this.height,lockOffset:r,width:this.width}),2),p=h[0],g=h[1],y={x:this.width/2-p.x,y:this.height/2-p.y},m={x:this.width/2-g.x,y:this.height/2-g.y};f.x=M(this.minTranslate.x+y.x,this.maxTranslate.x-m.x,f.x),f.y=M(this.minTranslate.y+y.y,this.maxTranslate.y-m.y,f.y)}"x"===n?f.y=0:"y"===n&&(f.x=0),c&&s&&!u&&R(this.helper,s),k(this.helper,f)}},{key:"animateNodes",value:function(){var e=this.props,t=e.transitionDuration,n=e.hideSortableGhost,r=e.onSortOver,o=this.containerScrollDelta,i=this.windowScrollDelta,a=this.manager.getOrderedRefs(),l=this.offsetEdge.left+this.translate.x+o.left,s=this.offsetEdge.top+this.translate.y+o.top,c=this.manager.isKeySorting,u=this.newIndex;this.newIndex=null;for(var d=0,f=a.length;d<f;d++){var h=a[d].node,p=h.sortableInfo.index,g=h.offsetWidth,y=h.offsetHeight,m={height:this.height>y?y/2:this.height/2,width:this.width>g?g/2:this.width/2},v=c&&p>this.index&&p<=u,x=c&&p<this.index&&p>=u,w={x:0,y:0},b=a[d].edgeOffset;b||(b=j(h,this.container),a[d].edgeOffset=b,c&&(a[d].boundingClientRect=P(h,o)));var S=d<a.length-1&&a[d+1],C=d>0&&a[d-1];S&&!S.edgeOffset&&(S.edgeOffset=j(S.node,this.container),c&&(S.boundingClientRect=P(S.node,o))),p!==this.index?(t&&R(h,t),this.axis.x?this.axis.y?x||p<this.index&&(l+i.left-m.width<=b.left&&s+i.top<=b.top+m.height||s+i.top+m.height<=b.top)?(w.x=this.width+this.marginOffset.x,b.left+w.x>this.containerBoundingRect.width-m.width&&S&&(w.x=S.edgeOffset.left-b.left,w.y=S.edgeOffset.top-b.top),null===this.newIndex&&(this.newIndex=p)):(v||p>this.index&&(l+i.left+m.width>=b.left&&s+i.top+m.height>=b.top||s+i.top+m.height>=b.top+y))&&(w.x=-(this.width+this.marginOffset.x),b.left+w.x<this.containerBoundingRect.left+m.width&&C&&(w.x=C.edgeOffset.left-b.left,w.y=C.edgeOffset.top-b.top),this.newIndex=p):v||p>this.index&&l+i.left+m.width>=b.left?(w.x=-(this.width+this.marginOffset.x),this.newIndex=p):(x||p<this.index&&l+i.left<=b.left+m.width)&&(w.x=this.width+this.marginOffset.x,null==this.newIndex&&(this.newIndex=p)):this.axis.y&&(v||p>this.index&&s+i.top+m.height>=b.top?(w.y=-(this.height+this.marginOffset.y),this.newIndex=p):(x||p<this.index&&s+i.top<=b.top+m.height)&&(w.y=this.height+this.marginOffset.y,null==this.newIndex&&(this.newIndex=p))),k(h,w),a[d].translate=w):n&&(this.sortableGhost=h,I(h,{opacity:0,visibility:"hidden"}))}null==this.newIndex&&(this.newIndex=this.index),c&&(this.newIndex=u);var O=c?this.prevIndex:u;r&&this.newIndex!==O&&r({collection:this.manager.active.collection,index:this.index,newIndex:this.newIndex,oldIndex:O,isKeySorting:c,nodes:a,helper:this.helper})}},{key:"getWrappedInstance",value:function(){return x()(r.withRef,"To access the wrapped instance, you need to pass in {withRef: true} as the second argument of the SortableContainer() call"),this.wrappedInstance.current}},{key:"getContainer",value:function(){var e=this.props.getContainer;return"function"!=typeof e?(0,m.findDOMNode)(this):e(r.withRef?this.getWrappedInstance():void 0)}},{key:"render",value:function(){var n=r.withRef?this.wrappedInstance:null;return(0,y.createElement)(oe.Provider,{value:this.sortableContextValue},(0,y.createElement)(t,e({ref:n},O(this.props,te))))}},{key:"helperContainer",get:function(){var e=this.props.helperContainer;return"function"==typeof e?e():this.props.helperContainer||this.document.body}},{key:"containerScrollDelta",get:function(){return this.props.useWindowAsScrollContainer?{left:0,top:0}:{left:this.scrollContainer.scrollLeft-this.initialScroll.left,top:this.scrollContainer.scrollTop-this.initialScroll.top}}},{key:"windowScrollDelta",get:function(){return{left:this.contentWindow.pageXOffset-this.initialWindowScroll.left,top:this.contentWindow.pageYOffset-this.initialWindowScroll.top}}}]),s}(y.Component),i(n,"displayName",H("sortableList",t)),i(n,"defaultProps",ee),i(n,"propTypes",J)}((function(e){var t=e.items;return wp.element.createElement("div",{className:"lzb-constructor-controls-item-settings-choices-items"},t.map((function(e,t){return wp.element.createElement(fe,le({key:"lzb-constructor-controls-item-settings-choices-item-".concat(t),index:t},e))})))}))}()}();