System.register(["./p-41c1c3a3.system.js","./p-f2675089.system.js","./p-92a952e2.system.js","./p-37a67f53.system.js","./p-ef8124fa.system.js"],(function(t){"use strict";var e,r,o,n;return{setters:[function(t){e=t.r},function(t){r=t.a},function(t){o=t.s},function(t){n=t.w},function(){}],execute:function(){var i;(function(t){t["OPEN"]="open";t["CANCELED"]="canceled";t["IN_PROCESS"]="in_process";t["PARTIALLY_COMPLETED"]="partially_completed";t["COMPLETED"]="completed"})(i||(i={}));function l(t){switch(t){case i.OPEN:return"grey";case i.CANCELED:return"red";case i.IN_PROCESS:return"dark-blue";case i.PARTIALLY_COMPLETED:return"orange";case i.COMPLETED:return"green";default:return"grey"}}var s=function(t){var e=t.type,r=t.text;var o=l(e);return''+r+""};var a=function(t){var e=t.returnNumber,r=t.status,o=t.createdAt,n=t.createdBy,i=t.positions,l=t.detailLink;var a=s(r);return"\n
\n "+e+" | \n "+a+" | \n "+o+" | \n "+n+" | \n "+i+' | \n | \n
\n '};var u='.order-return-overview__filter-container::before,.order-return-overview__filter-container::after{content:" ";display:table}.order-return-overview__filter-container::after{clear:both}.order-return-overview__filter-container .ux-tag{background-color:#285172}.order-return-overview__filter-container .datepicker-range{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-ms-flex-align:center;align-items:center;-ms-flex-pack:start;justify-content:flex-start}.order-return-overview__filter-container .datepicker-range__divider{-ms-flex:0 0 20px;flex:0 0 20px}.order-return-overview__filter-container .datepicker{-ms-flex:1 1 auto;flex:1 1 auto}.order-return-overview__filter-dropdown{min-width:250px;max-width:300px;position:relative;display:inline-block;margin-right:18px;margin-bottom:20px}.order-return-overview__result-set.result-set{margin-top:0;position:relative;text-align:center}.order-return-overview__table-container .ux-text-status{display:-ms-flexbox;display:flex;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-align:center;align-items:center;-ms-flex-pack:start;justify-content:flex-start}.order-return-overview__table-container .ux-text-status::before{content:"";display:inline-block;background-color:currentColor;width:0.8em;height:0.8em;border-radius:100%;margin-right:0.8em}.order-return-overview .ux-collapsible-button__container{padding:15px;text-align:center}';var c=t("ux_iws_data_controller_order_return",function(){function t(t){e(this,t);this.url="";this.filterSelector="";this.dateFormSelector="";this.sortFormSelector="";this.tableSelector="";this.totalNumberSelector="";this.filteredNumberSelector="";this.scrollSensorSelector="";this.filter=null;this.filterForm=null;this.dateForm=null;this.sortForm=null;this.table=null;this.tableBody=null;this.filteredNumberElements=null;this.totalNumberElements=null;this.nextPage="";this.scrollSensor=null}t.prototype.componentDidLoad=function(){this.setDateForm();this.setSortForm();this.setFilter();this.setTable();this.setScrollSensor();this.setTotalNumberElements();this.setFilteredNumberElements();this.requestData(this.url)};t.prototype.setDateForm=function(){if(this.dateFormSelector==="")return;this.dateForm=document.querySelector(this.dateFormSelector);if(this.dateForm===null)return;this.dateForm.addEventListener("submit",(function(t){return t.preventDefault()}))};t.prototype.setFilter=function(){var t=this;if(this.filterSelector==="")return;this.filter=document.querySelector(this.filterSelector);n(this.filter,(function(){return t.setFilterForm()}));this.filter.addEventListener("uxFilterChange",(function(){return t.requestData(t.url)}))};t.prototype.setSortForm=function(){if(this.sortFormSelector==="")return;this.sortForm=document.querySelector(this.sortFormSelector);if(this.sortForm===null)return;this.sortForm.addEventListener("submit",d)};t.prototype.setTotalNumberElements=function(){if(this.totalNumberSelector==="")return;this.totalNumberElements=document.querySelectorAll(this.totalNumberSelector)};t.prototype.setFilteredNumberElements=function(){if(this.filteredNumberSelector==="")return;this.filteredNumberElements=document.querySelectorAll(this.filteredNumberSelector)};t.prototype.setFilterForm=function(){this.filterForm=this.filter.querySelector("form");if(this.filterForm===null)return;this.filterForm.addEventListener("submit",d)};t.prototype.syncSortStateToTable=function(){if(this.table===null||this.sortForm===null)return;var t=this.sortForm.querySelector("input").value;var e=this.table.querySelector('ux-table-sort[sorted-direction="desc"], ux-table-sort[sorted-direction="asc"]');if(e!==null){e.sortedDirection=""}var r=this.table.querySelector('ux-table-sort[asc-name="'+t+'"]');var o=this.table.querySelector('ux-table-sort[desc-name="'+t+'"]');if(r!==null){r.sortedDirection="asc"}if(o!==null){o.sortedDirection="desc"}};t.prototype.updateNumbers=function(t,e){m(this.filteredNumberElements,t.toString());m(this.totalNumberElements,e.toString())};t.prototype.setTable=function(){var t=this;var e;if(this.tableSelector==="")return;this.table=document.querySelector(this.tableSelector);this.tableBody=(e=this.table)===null||e===void 0?void 0:e.querySelector("tbody");if(this.table!==null&&this.sortForm!==null){this.table.addEventListener("uxTableSort",(function(e){var r=e.detail;if(r==="")return;t.sortForm.querySelector("input").value=r;t.requestData(t.url)}));this.syncSortStateToTable()}};t.prototype.setScrollSensor=function(){var t=this;if(this.scrollSensorSelector==="")return;this.scrollSensor=document.querySelector(this.scrollSensorSelector);if(this.scrollSensor!==null){this.scrollSensor.addEventListener("uxInfiniteScrollSensorScrolledIntoView",(function(){t.requestData(t.nextPage)}))}};t.prototype.initialRequest=function(){this.requestData(this.url)};t.prototype.getSerializedFormData=function(){return[o(this.dateForm),o(this.filterForm),o(this.sortForm)].filter((function(t){return t!==""})).join("&")};t.prototype.requestData=function(t){var e=this;if(t==="")return;var o=f(t)?{}:{method:"POST",body:this.getSerializedFormData(),headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"}};r(t,o).then((function(r){if(e.url===t){e.clearExistingData();e.replaceFilter(r.filterHTML)}e.appendItemsToTable(r.items);e.updateNumbers(r.filteredCount,r.totalCount);e.nextPage=r.nextPage||"";if(e.nextPage!==""&&e.scrollSensor!==null){e.scrollSensor.hasFired=false}}))};t.prototype.replaceFilter=function(t){if(typeof t==="string"&&t.length>0&&this.filter!==null){var e=this.filter.parentElement;if(e!==null){e.style.height=e.offsetHeight+"px"}this.filter.outerHTML=t;this.setFilter();setTimeout((function(){e.style.height="auto"}),200)}};t.prototype.clearExistingData=function(){if(this.tableBody!==null)this.tableBody.textContent=""};t.prototype.appendItemsToTable=function(t){if(this.tableBody===null)return;this.tableBody.insertAdjacentHTML("beforeend",t.map(a).join(""))};t.prototype.render=function(){return null};Object.defineProperty(t,"watchers",{get:function(){return{dateFormSelector:["setDateForm"],filterSelector:["setFilter"],sortFormSelector:["setSortForm"],totalNumberSelector:["setTotalNumberElements"],filteredNumberSelector:["setFilteredNumberElements"],tableSelector:["setTable"],scrollSensorSelector:["setScrollSensor"],url:["initialRequest"]}},enumerable:false,configurable:true});return t}());function f(t){return t.indexOf("mock-data/")>-1}function d(t){t.preventDefault()}function m(t,e){if(t===null)return;[].forEach.call(t,(function(t){return t.textContent=e}))}c.style=u}}}));