var __awaiter=this&&this.__awaiter||function(t,i,e,n){function o(t){return t instanceof e?t:new e((function(i){i(t)}))}return new(e||(e=Promise))((function(e,r){function s(t){try{l(n.next(t))}catch(t){r(t)}}function a(t){try{l(n["throw"](t))}catch(t){r(t)}}function l(t){t.done?e(t.value):o(t.value).then(s,a)}l((n=n.apply(t,i||[])).next())}))};var __generator=this&&this.__generator||function(t,i){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,o,r,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(t){return function(i){return l([t,i])}}function l(a){if(n)throw new TypeError("Generator is already executing.");while(s&&(s=0,a[0]&&(e=0)),e)try{if(n=1,o&&(r=a[0]&2?o["return"]:a[0]?o["throw"]||((r=o["return"])&&r.call(o),0):o.next)&&!(r=r.call(o,a[1])).done)return r;if(o=0,r)a=[a[0]&2,r.value];switch(a[0]){case 0:case 1:r=a;break;case 4:e.label++;return{value:a[1],done:false};case 5:e.label++;o=a[1];a=[0];continue;case 7:a=e.ops.pop();e.trys.pop();continue;default:if(!(r=e.trys,r=r.length>0&&r[r.length-1])&&(a[0]===6||a[0]===2)){e=0;continue}if(a[0]===3&&(!r||a[1]>r[0]&&a[1]0;if(o&&n===this.leftOptions){return[2]}if(r&&n===this.rightOptions){return[2]}this.closeOpened();this.state=4;requestAnimationFrame((function(){s.calculateOptsWidth();var i=t==="end"?s.optsWidthRightSide:-s.optsWidthLeftSide;O=s.el;s.setOpenAmount(i,false);s.state=t==="end"?8:16}));return[2]}))}))};t.prototype.close=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.setOpenAmount(0,true);return[2]}))}))};t.prototype.closeOpened=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(O!==undefined){O.close();O=undefined;return[2,true]}return[2,false]}))}))};t.prototype.getOptions=function(t){if(t===undefined){return this.leftOptions||this.rightOptions}else if(t==="start"){return this.leftOptions}else{return this.rightOptions}};t.prototype.updateOptions=function(){return __awaiter(this,void 0,void 0,(function(){var t,i,e,n,o,r,s;return __generator(this,(function(a){switch(a.label){case 0:t=this.el.querySelectorAll("ion-item-options");i=0;this.leftOptions=this.rightOptions=undefined;e=0;a.label=1;case 1:if(!(ethis.optsWidthRightSide){e=this.optsWidthRightSide;i=e+(i-e)*M}else if(i<-this.optsWidthLeftSide){e=-this.optsWidthLeftSide;i=e+(i-e)*M}this.setOpenAmount(i,false)};t.prototype.onEnd=function(t){var i=this,e=i.contentEl,n=i.initialContentScrollY;if(e){m(e,n)}var o=t.velocityX;var r=this.openAmount>0?this.optsWidthRightSide:-this.optsWidthLeftSide;var s=this.openAmount>0===!(o<0);var a=Math.abs(o)>.3;var l=Math.abs(this.openAmount)0){this.state=t>=this.optsWidthRightSide+S?8|32:8}else if(t<0){this.state=t<=-this.optsWidthLeftSide-S?16|64:16}else{n.classList.add("item-sliding-closing");if(this.gesture){this.gesture.enable(false)}this.tmr=setTimeout((function(){e.state=2;e.tmr=undefined;if(e.gesture){e.gesture.enable(!e.disabled)}n.classList.remove("item-sliding-closing")}),600);O=undefined;o.transform="";return}o.transform="translate3d(".concat(-t,"px,0,0)");this.ionDrag.emit({amount:t,ratio:this.getSlidingRatioSync()})};t.prototype.getSlidingRatioSync=function(){if(this.openAmount>0){return this.openAmount/this.optsWidthRightSide}else if(this.openAmount<0){return this.openAmount/this.optsWidthLeftSide}else{return 0}};t.prototype.render=function(){var t;var i=l(this);return n(o,{key:"83e1673fc5af892612deb9b49d5e792b8b0b6473",class:(t={},t[i]=true,t["item-sliding-active-slide"]=this.state!==2,t["item-sliding-active-options-end"]=(this.state&8)!==0,t["item-sliding-active-options-start"]=(this.state&16)!==0,t["item-sliding-active-swipe-end"]=(this.state&32)!==0,t["item-sliding-active-swipe-start"]=(this.state&64)!==0,t)})};Object.defineProperty(t.prototype,"el",{get:function(){return r(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{disabled:["disabledChanged"]}},enumerable:false,configurable:true});return t}());var T=function(t,i,e){return!i&&e||t&&i};P.style=z}}}));