import r from"@babel/runtime/helpers/toConsumableArray";import e from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/regenerator";import{useCallback as a}from"react";import{dataFormatter as o}from"../utils.js";import{useGet as n}from"./sharedHooks.js";import{publishAppSettingsTemplate as s}from"../../../../clients/jsonApi/index.js";var i=function(){var i=n("get"),m=n("set");return a(function(){var a=e(t.mark((function e(a,n,p){var u,c,l,f;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u=p.rigIds,c=p.programIds,l=n.trim(),e.t0=o,e.next=5,s(i().appKey,a,{name:l,metadata:{rigIds:u,programIds:c}});case 5:e.t1=e.sent,f=e.t0.deserialize.call(e.t0,e.t1),m((function(e){var t=e.loadedTemplates;return{loadedTemplates:[].concat(r(t),[f])}}));case 8:case"end":return e.stop()}}),e)})));return function(r,e,t){return a.apply(this,arguments)}}(),[i,m])};export{i as usePublishTemplate};
//# sourceMappingURL=usePublishTemplate.js.map
