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