(self.webpackChunkpyquirk=self.webpackChunkpyquirk||[]).push([[261,568],{568:(e,t,i)=>{e.exports=i(729),e.exports.version=i(306).version},261:(e,t,i)=>{var s=i(568),a=i(337);e.exports={id:"pyquirk:plugin",requires:[a.IJupyterWidgetRegistry],activate:function(e,t){t.registerWidget({name:"pyquirk",version:s.version,exports:s})},autoStart:!0}},729:(e,t,i)=>{var s=i(337),a=i(431),h=i(217),r=s.DOMWidgetModel.extend({defaults:a.extend(s.DOMWidgetModel.prototype.defaults(),{_model_name:"QuirkModel",_view_name:"QuirkView",_model_module:"pyquirk",_view_module:"pyquirk",_model_module_version:"0.1.6",_view_module_version:"0.1.6",width:1e3,height:450,scale:.5})}),d=s.DOMWidgetView.extend({render:function(){model=this.model,width=model.get("width"),height=model.get("height"),scale=model.get("scale"),this.container=document.createElement("div"),this.container.id="pyquirk",this.container.style.width=`${width}px`,this.container.style.height=`${height}px`,this.frame=document.createElement("iframe"),this.frame.id="iframe",this.frame.style.transformOrigin="0 0",this.frame.style.transform=`scale(${scale})`,this.frame.style.width=1/scale*100+"%",this.frame.style.height=1/scale*100+"%",this.frame.src=h.default,this.container.appendChild(this.frame),this.frame.onload=function(){console.log("IFRAME loaded: "+this.src),this.contentWindow.onclick=function(){qasm=this.document.getElementById("export-qasm-pre").innerText,model.set("circuit_qasm",qasm),model.save_changes()}},this.el.appendChild(this.container),this.model.on("change:value",this.circuit_updated,this),this.model.on("change:width",this.update_width,this),this.model.on("change:height",this.update_height,this),this.model.on("change:scale",this.update_scale,this)},update_width:function(e){this.container.style.width=`${this.model.get("width")}px`},update_height:function(e){this.container.style.height=`${this.model.get("height")}px`},update_scale:function(e){scale=this.model.get("scale"),this.frame.style.transform=`scale(${scale})`,this.frame.style.width=1/scale*100+"%",this.frame.style.height=1/scale*100+"%"},circuit_updated:function(){this.frame.src=h.default+`#circuit={"cols":${this.model.get("value").replaceAll("'",'"')}}`}});e.exports={QuirkModel:r,QuirkView:d}},217:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>s});const s=i.p+"a344cd889e9a479207a9caf74eed7f79.html"},306:e=>{"use strict";e.exports={version:"0.1.6"}}}]);