export default function({preset:o={},chapters:e,branding:i,src:l,analytics:t,automations:n,autoplay:d,blockAttributes:s={},provider:a="",provider_video_id:r="",youtube:u,type:p,isAdmin:v,i18n:c,storage:y={enabled:!v,key:`presto-player-${o.id}`}}){var _,b,g,w;const m=["settings"],h=[...["youtube","vimeo"].includes(a)?["pip"]:[]],k=["play-large","rewind","play","fast-forward","progress","current-time","mute","volume","captions","settings","pip","fullscreen"].filter((e=>((null==o?void 0:o[e])||m.includes(e))&&!h.includes(e)));(null===(_=null==s?void 0:s.mutedPreview)||void 0===_?void 0:_.enabled)&&(y={enabled:!1});let f=Object.assign(Object.assign(Object.assign(Object.assign({id:null==s?void 0:s.id,title:(null==s?void 0:s.title)||"",blockAttributes:Object.assign(Object.assign({},s),{type:p}),src:l,ajaxProgress:!0,analytics:t,preset:o,automations:n,mutedPreview:{enabled:null===(b=null==s?void 0:s.mutedPreview)||void 0===b?void 0:b.enabled},loop:{active:"loop"===(null==o?void 0:o.on_video_end)},chapters:e,controls:k,settings:["captions","quality","loop",...(null==o?void 0:o.speed)?["speed"]:[]],hideControls:null==o?void 0:o.auto_hide,captions:{active:null==o?void 0:o.captions_enabled,language:"auto",update:!1},logo:null==i?void 0:i.logo,logo_width:null==i?void 0:i.logo_width,hide_logo:null==o?void 0:o.hide_logo,lazy_load_youtube:null==o?void 0:o.lazy_load_youtube,save_player_position:!!(null==o?void 0:o.save_player_position),sticky_scroll:null==o?void 0:o.sticky_scroll,play_video_viewport:null==o?void 0:o.play_video_viewport,autoplay:!(!d||(null===(g=window.wp)||void 0===g?void 0:g.blocks))},a?{provider:a}:{}),r?{provider_video_id:r}:{}),(null==s?void 0:s.poster)?{poster:s.poster}:{}),{invertTime:!o.hasOwnProperty("invert_time")||(null==o?void 0:o.invert_time),storage:y,keyboard:{focused:!1,global:!1},resetOnEnd:!!(null==o?void 0:o.reset_on_end),vimeo:{byline:!1,portrait:!1,title:!1,speed:!0,transparent:!1,customControls:!0,premium:!1,playsinline:!!(null==s?void 0:s.playsInline)},youtube:{rel:0,showinfo:0,iv_load_policy:3,modestbranding:1,customControls:!0,noCookie:!!(null==u?void 0:u.noCookie),playsinline:!!(null==s?void 0:s.playsInline)},tooltips:{controls:!0,seek:!0},i18n:c});return(null===(w=null===window||void 0===window?void 0:window.wp)||void 0===w?void 0:w.hooks)&&(f=window.wp.hooks.applyFilters("presto.playerSettings",f)),f}