define(["require","exports","tslib","../../Validation","../../Errors"],function(t,e,r,a,c){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=(i.prototype.execute=function(o){return r.__awaiter(this,void 0,void 0,function(){var e,n,i;return r.__generator(this,function(t){if(e=a.validation.exists("content",o.content),n=a.validation.string("name",o.name,a.validation.never),i=a.validation.string("contentType",o.contentType),!(e instanceof ArrayBuffer||e instanceof Blob||"string"==typeof e))throw new c.ActivityInputError("content","Unsupported content. Content must be an ArrayBuffer, Blob or string.");return i=this.determineContentType(i,e),[2,{result:this.getValidContent(e,n,i)}]})})},i.prototype.determineContentType=function(t,e){return t||("string"==typeof e?"text/plain":"application/octet-stream")},i.prototype.getValidContent=function(e,n,i){try{return new File([e],n,{type:i})}catch(t){if(document.documentMode){i=new Blob([e],{type:i});return i.lastModifiedDate=new Date,i.name=n,i}throw t}},i.action="gcx:wf:core::CreateFile",i.suite="gcx:wf:builtin",i);function i(){}e.CreateFile=n});