var __awaiter=this&&this.__awaiter||function(e,t,n,i){function r(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,l){function a(e){try{u(i.next(e))}catch(e){l(e)}}function o(e){try{u(i["throw"](e))}catch(e){l(e)}}function u(e){e.done?n(e.value):r(e.value).then(a,o)}u((i=i.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(l[0]&1)throw l[1];return l[1]},trys:[],ops:[]},i,r,l,a;return a={next:o(0),throw:o(1),return:o(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function o(e){return function(t){return u([e,t])}}function u(a){if(i)throw new TypeError("Generator is already executing.");while(n)try{if(i=1,r&&(l=a[0]&2?r["return"]:a[0]?r["throw"]||((l=r["return"])&&l.call(r),0):r.next)&&!(l=l.call(r,a[1])).done)return l;if(r=0,l)a=[a[0]&2,l.value];switch(a[0]){case 0:case 1:l=a;break;case 4:n.label++;return{value:a[1],done:false};case 5:n.label++;r=a[1];a=[0];continue;case 7:a=n.ops.pop();n.trys.pop();continue;default:if(!(l=n.trys,l=l.length>0&&l[l.length-1])&&(a[0]===6||a[0]===2)){n=0;continue}if(a[0]===3&&(!l||a[1]>l[0]&&a[1]<l[3])){n.label=a[1];break}if(a[0]===6&&n.label<l[1]){n.label=l[1];l=a;break}if(l&&n.label<l[2]){n.label=l[2];n.ops.push(a);break}if(l[2])n.ops.pop();n.trys.pop();continue}a=t.call(e,n)}catch(e){a=[6,e];r=0}finally{i=l=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};System.register(["./p-5e377a26.system.js"],(function(e){"use strict";var t,n,i,r,l;return{setters:[function(e){t=e.r;n=e.c;i=e.h;r=e.H;l=e.g}],execute:function(){var a="dvn-field-input-cell-text{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;height:100%}";var o=e("dvn_field_input_cell_text",function(){function e(e){t(this,e);this.cellFormCancel=n(this,"cellFormCancel",7);this.cellFormSubmit=n(this,"cellFormSubmit",7)}e.prototype.focus=function(){return __awaiter(this,void 0,void 0,(function(){var e,t;return __generator(this,(function(n){(t=(e=this.el.querySelector("dvn-input"))===null||e===void 0?void 0:e.focus)===null||t===void 0?void 0:t.call(e);return[2]}))}))};e.prototype.handleKeyDown=function(e){if(e.key==="Escape"){this.cellFormCancel.emit();this.internalValue=this.value}else if(e.key==="Enter"){if(this.internalValue!==this.value){this.cellFormSubmit.emit({value:this.internalValue})}this.cellFormCancel.emit()}};e.prototype.componentWillLoad=function(){this.internalValue=this.value};e.prototype.render=function(){var e=this;var t=this,n=t.disabled,l=t.errors,a=t.field,o=t.value;var u=l&&l.length>0;return i(r,null,i("dvn-input",{id:a.id,type:a.inputType||"text",disabled:n||a.disabled,placeholder:a.placeholder,onChange:function(t){t.stopImmediatePropagation();e.internalValue=t.detail},onBlur:function(t){t.stopImmediatePropagation();if(e.internalValue!==e.value){e.cellFormSubmit.emit({value:e.internalValue})}e.cellFormCancel.emit()},value:o,feedback:u?"error":undefined,leaned:true,autoComplete:a.autoComplete,overrideStyle:{width:"100%","min-width":"0"},scale:"small"}))};Object.defineProperty(e.prototype,"el",{get:function(){return l(this)},enumerable:false,configurable:true});return e}());o.style=a}}}));