import{u as d,_ as m,o as f,c as p,d as u,s as l,a as i,q as _,f as S,b8 as b}from"./BDipKYNj.js";import{_ as g}from"./Modal-ProhnaeJ.mjs";async function w(e,t,r,o){const{$gql:n,$ss:a}=d(),c={source:a.general.siteName,section:e,eventType:t,resourceLink:r,searchTerm:""};["partNumber","searchTerm","manufacturerId","distributorId"].map(s=>{typeof o[s]<"u"&&(c[s]=o[s])}),n.query("trackSourceesbEvent",{...c})}const y={props:{dataSheetUrl:{type:String,require:!0},partNumber:{type:String,require:!0},searchPartNumber:{type:String,require:!0},manufacturer:{type:Number,required:!0},searchManufacturer:{type:String,required:!0},distributor:{type:Number,required:!0},mode:{type:String,default:"hollow"},page:{type:Object},searchTerm:{type:String,default:""},source:{type:String,default:""},action:{type:String,default:"modal"}},data(){return{showDataSheet:!1,isLoadingFrame:!1}},computed:{iframeSrc(){const e=`part_number=${this.partNumber}`,t=`manufacturer=${this.searchManufacturer}`,r=`data_sheet_url=${encodeURI(this.dataSheetUrl)}`;return`/data-sheet?${e}&${t}&${r}&includeShell=false&fullHeight=false&fullWidth=true`}},methods:{toggleDataSheet(){if(!this.showDataSheet||this.action==="tab"){const e={partNumber:this.partNumber,manufacturerId:this.manufacturer,distributorId:this.distributor};this.searchTerm&&(e.searchTerm=this.searchTerm),w(this.source,"Data Sheet",encodeURI(this.dataSheetUrl),e,this.page)}this.action==="modal"?this.showDataSheet=!this.showDataSheet:window.open(this.dataSheetUrl)}}},N={class:"contents"},x={class:"data-sheet"},$=["src"];function D(e,t,r,o,n,a){const c=S,h=b,s=g;return f(),p("div",null,[u(h,{class:"ebm-source-esb-data-sheet-button sesb-button",mode:r.mode,onOnClick:a.toggleDataSheet},{default:l(()=>[i("div",N,[u(c,{icon:"mdi:file-pdf-box","icon-color":r.mode==="hollow"?e.$ss.baseStyles.primaryColor:"white",width:20},null,8,["icon-color"]),t[0]||(t[0]=_(" Data Sheet "))])]),_:1},8,["mode","onOnClick"]),u(s,{show:n.showDataSheet,"max-width":"90%",height:"80vh","allow-close":!0,"on-close":a.toggleDataSheet,"overflow-y":"auto"},{default:l(()=>[i("div",x,[i("iframe",{ref:"frame",src:a.iframeSrc},null,8,$)])]),_:1},8,["show","on-close"])])}const k=m(y,[["render",D],["__scopeId","data-v-50edc6e6"]]);export{k as _,w as u};