PageSourceSearch

https://senorge.no/assets/MediaLayerView2D-CqfOJS1h.js

js senorge.no collected 2026-09-24 18:39:45 UTC 13,085 bytes, 2 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./MediaLayerInteraction-Cr8IN8Ff.js","./index-Cf8Ahf00.js","./index-Bue4NFPB.css"])))=>i.map(i=>d[i]);
2import{b0 as D,jx as Q,fh as c,fi as E,cM as L,eX as W,jy as V,ac as b,s as k,f4 as B,f5 as O,lC as j,aB as N,eb as F,a1 as l,a2 as m,a3 as T,a7 as X,fk as q,_ as J,el as P,eQ as K,eR as Y,eS as Z,mL as ee,eT as te,c5 as ie,eD as se,bI as re,mM as ne}from"./index-Cf8Ahf00.js";import{o as oe,p as ae,i as G}from"./mediaLayerUtils-K8YTbQFJ.js";import"./rasterizingUtils-H33-EGWE.js";import"./CIMSymbolHelper-DWUBsrt8.js";import"./OverrideHelper-CpzJ4VLv.js";import{e as le}from"./Container-CKBikg2o.js";import"./WGLContainer-BUNBOltM.js";import"./ProgramTemplate-BSdlZST5.js";import"./BufferObject-CyOGF4wO.js";import"./Utils-CGQh9c_X.js";import"./GridShader-BKfADITZ.js";import"./FramebufferObject-DahWN1Cd.js";import"./FeatureCommandQueue-BdGWBUCi.js";import"./UpdateTracking2D-dZpugBeS.js";import"./TexturedLineMeshWriter-CHqDRfAw.js";import"./renderState-CKc66y4x.js";import"./glsl-B5bJgrnA.js";import"./testSVGPremultipliedAlpha-DFTCIjP-.js";import"./GraphicsView2D-CigMTQur.js";import"./vec3f32-WCVSSNPR.js";import{h as he,m as de}from"./utils-CC89o0W_.js";import{f as me}from"./OverlayContainer-CHih6AoC.js";import{b as pe}from"./LayerView2D-BV4QfDhG.js";import{d as ce}from"./LayerView-BF2v872l.js";import"./normalizeUtilsSync-DMu-9GNy.js";import"./BidiEngine-BvER9tXK.js";import"./labelPoint-BS1YNIAJ.js";import"./Rect-CUzevAry.js";import"./BoundingBox-CJ3RUgb_.js";import"./callExpressionWithFeature-CkiVz0BP.js";import"./quantizationUtils-BA7_uCM1.js";import"./VertexArrayObject-fx0lovJ8.js";import"./VertexBuffer-DnUBH7ul.js";import"./config-BOD8--da.js";import"./GraphShaderModule-knwbLQ0g.js";import"./ShaderBuilder-gvAbqBEg.js";import"./utils-C2g5VRKh.js";import"./constants-BBnGEY1d.js";import"./CircularArray-CujHzHWW.js";import"./SymbolFader-dgUQmxkZ.js";import"./streamLayerUtils-DFlbJ4P1.js";import"./QueueProcessor-1m-9qy9m.js";import"./TurboLine-rAmnWSkw.js";import"./AttributeStore-D1v7yPop.js";import"./FeatureStoreQueryAdapter-Df1XTZXL.js";import"./queryUtils-CUAxDfQ4.js";import"./timeSupport-BS8OD7gj.js";import"./FeatureMetadata-xP-zciMi.js";import"./dehydratedFeatures-D9TMKMLi.js";import"./grouping-C-3NicGN.js";import"./utils-DDjZAYSk.js";import"./layerViewUtils-CFYMjo3s.js";const H=[1,1],y=N(),ue={none:"None",loop:"Loop",oscillate:"Oscillate"};function ye(t){return t?{type:"CIMAnimatedSymbolProperties",...t,playAnimation:t.playing,repeatType:t.repeatType?ue[t.repeatType]:void 0}:{type:"CIMAnimatedSymbolProperties"}}class fe extends le{constructor(e){super(),this.elementView=e,this.isWrapAround=!1,this.wrapAroundShift=0,this.perspectiveTransform=D(),this._handles=new Q,this._vertices=new Float32Array(8),this._indices=new Uint16Array([0,0,0,1,1,0,1,1,1,1,0,0,0,0,0,1,1,0,1,1]),this._handles.add([c(()=>this.elementView.element.opacity,i=>this.opacity=i,E),c(()=>[this.elementView.coords],()=>{this.requestRender()},E),c(()=>["animationOptions"in this.elementView.element&&this.elementView.element.animationOptions],()=>{this.texture=L(this.texture),this.requestRender()},E),W(()=>this.elementView.element.loaded,()=>{const i=this.elementView.element;this.ready(),oe(i)&&i.content!=null&&(this._handles.add([V(i.content,"play",()=>this.requestRender()),V(i.content,"loadeddata",()=>this.requestRender()),V(i.content,"loaded",()=>this.requestRender())]),"requestVideoFrameCallback"in i.content?i.content.requestVideoFrameCallback(()=>this.requestRender()):this._handles.add([V(i.content,"seeked",()=>this.requestRender())]),this.requestRender())},E)]),e.element.load().catch(i=>{b.getLogger("esri.views.2d.layers.MediaLayerView2D").error(new k("element-load-error","Element cannot be displayed",{element:e,error:i}))})}getMesh(e){throw new Error("Method not implemented.")}destroy(){super.destroy(),this._handles.destroy(),this.texture=L(this.texture)}get textureSize(){return H}get dvsMat3(){return this.parent.dvsMat3}beforeRender(e){const{context:i}=e,s=this.elementView.element.content;if(s!=null){const r=s instanceof HTMLImageElement,a=s instanceof HTMLVideoElement,h=r?s.naturalWi
2dth:a?s.videoWidth:s.width,o=r?s.naturalHeight:a?s.videoHeight:s.height;if(this._updatePerspectiveTransform(h,o),this.texture)if(a)if(s.readyState>=s.HAVE_CURRENT_DATA)e.animationsEnabled&&this._updateTextureAndRequestRender(s);else{const n=()=>{this._updateTextureAndRequestRender(s),s.removeEventListener("canplay",n),s.removeEventListener("seeked",n)};s.addEventListener("canplay",n),s.addEventListener("seeked",n)}else"getFrame"in s&&e.animationsEnabled&&this.requestRender();else{const n=new B(h,o);if(n.wrapMode=33071,n.preMultiplyAlpha=!0,"getFrame"in s){const w=u=>{this.texture?this.texture.setData(u):this.texture=new O(i,n,u)};"animationOptions"in this.elementView.element&&(this._player=he(s,ye(this.elementView.element.animationOptions),null,w))}else this.texture=new O(i,n,s);this.texture.generateMipmap(),a&&this._requestVideoFrame(s)}}super.beforeRender(e)}_updateTextureAndRequestRender(e){this.texture.setData(e),this.texture.generateMipmap(),this._requestVideoFrame(e)}_requestVideoFrame(e){"requestVideoFrameCallback"in e?e.requestVideoFrameCallback(()=>this.requestRender()):e.paused||this.requestRender()}_createTransforms(){return null}draw(e,i){this.isReady&&this.texture!=null?(de(e,this._player),i.render(e,{transform:{dvs:this.dvsMat3},config:{perspective:this.perspectiveTransform,texSize:H,wrapAroundShift:this.wrapAroundShift,isWrapAround:this.isWrapAround,opacity:this.opacity,texture:{texture:this.texture,unit:0}},position:this._vertices,tex:this._indices})):this.requestRender()}updateDrawCoords(e,i,s,r){const{coords:a,bounds:h}=this.elementView;if(a==null||h==null)return;const[o,n,w,u]=a.rings[0],I=this._vertices,{x:g,y:x}=e;I.set([n[0]-g,n[1]-x,o[0]-g,o[1]-x,w[0]-g,w[1]-x,u[0]-g,u[1]-x]);let R=i;if(r){const[S,,C]=h,{worldWidth:A,xBounds:z}=r,[M,$]=z;S<M&&C>M?R=A:C>$&&S<$&&(R=-A)}this.wrapAroundShift=R,this.isWrapAround=R!==0}_updatePerspectiveTransform(e,i){const s=this._vertices;ae(y,[0,0,e,0,0,i,e,i],[s[0],s[1],s[4],s[5],s[2],s[3],s[6],s[7]]),j(this.perspectiveTransform,y[6]/y[8]*e,y[7]/y[8]*i)}}let v=class extends F{constructor(t){super(t),this.editSourcePoints=!1}};l([m()],v.prototype,"editSourcePoints",void 0),v=l([T("esri.views.3d.layers.support.MediaLayerInteractionOptions.ReshapeOptions")],v);let p=class extends F{constructor(e){super(e),this.tool="transform",this.reshapeOptions=new v}};l([m()],p.prototype,"tool",void 0),l([m({type:v})],p.prototype,"reshapeOptions",void 0),p=l([T("esri.views.3d.layers.support.MediaLayerInteractionOptions")],p);const _e=t=>{const e=t;let i=class extends e{constructor(...s){super(...s),this.layer=null,this.interactive=!1,this.interactionOptions=new p,this.selectedElement=null}highlight(s,r){throw new Error("missing implementation")}};return l([m()],i.prototype,"layer",void 0),l([m()],i.prototype,"interactive",void 0),l([m({type:p})],i.prototype,"interactionOptions",void 0),l([m()],i.prototype,"selectedElement",void 0),i=l([T("esri.views.layers.MediaLayerView")],i),i};let _=class extends pe(_e(ce)){constructor(){super(...arguments),this._overlayContainer=null,this._fetchQueue=null,this._tileStrategy=null,this._elementReferences=new Map,this._debugGraphicsView=null,this._interaction=null,this.layer=null,this.elements=new X}initialize(){this.addHandles([c(()=>[this.interactive,this.suspended],async()=>{if(this.interactive&&!this._interaction){const{MediaLayerInteraction:t}=await J(()=>import("./MediaLayerInteraction-Cr8IN8Ff.js"),__vite__mapDeps([0,1,2]),import.meta.url);this._interaction=new t({view:this.view,layer:this.layer}),this.selectedElement!==this._interaction.selectedElement&&(this._interaction.selectedElement=this.selectedElement),this.interactionOptions!==this._interaction.options&&(this._interaction.options=this.interactionOptions)}this._interaction&&(this._interaction.enabled=!this.suspended&&this.interactive)},q),c(()=>this.interactionOptions,t=>{this._interaction&&(this._interaction.options=t)},q),c(()=>this.selectedElement,t=>{this._interaction&&(this._interaction.selectedElement=t)},q)])}attach(){this.addAttachHandles([P(()=>this.layer.effectiveSource,"refresh",()=>{this._tileStrategy.refresh(t=>this._updateTile(t)),this.requestUpdate()}),P(()=>this.layer.effectiveSource,"change",({element:t})=>this._elementUpdateHandler(t))]),this._overlayContainer=new me,this.container.addChild(this._overlayContainer),this._fetchQueue=new K({tileInfoView:this.view.featuresTilingScheme,concurrency:10,process:(t,e)=>this._queryElements(t,e),scheduler:this.scheduler,priority:Y.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new Z({cachePolicy:"purge",resampling:!0,acquireTile:t=>this._acquireTile(t),releaseTile:t=>this._releaseTile(t),tileInfoView:this.view.featuresTilingScheme}),this.requestUpdate()}detach(){var t;this.elements.removeAll(),this._tileStrategy.destroy(),this._fetchQueue.destroy(),this._overlayContainer.removeAllChildren(),this.container.removeAllChildren(),this._elementReferences.clear(),(t=this._debugGraphicsView)==null||t.destroy()}supportsSpatialReference(t){return!0}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}update(t){var e;this._tileStrategy.update(t),(e=this._debugGraphicsView)==null||e.update(t)}async hitTest(t,e){const i=[],s=t.normalize(),r=[s.x,s.y];for(const{elementView:{normalizedCoords:a,element:h}}of this._elementReferences.values())a!=null&&ee(a.rings,r)&&i.push({type:"media",element:h,layer:this.layer,mapPoint:t,sourcePoint:h.toSource(t)});return i.reverse()}canResume(){return this.layer.source!=null&&super.canResume()}async doRefresh(){this._fetchQueue.reset(),this._tileStrategy.refresh(t=>this._updateTile(t))}_acquireTile(t){const e=new ve(t.clone());return this._updateTile(e),e}_updateTile(t){this._updatingHandles.addPromise(this._fetchQueue.push(t.key).then(e=>{const[i,s]=t.setElements(e);this._referenceElements(t,i),this._dereferenceElements(t,s),this.requestUpdate()},e=>{te(e)||b.getLogger(this).error(e)}))}_releaseTile(t){this._fetchQueue.abort(t.key.id),t.elements&&this._dereferenceElements(t,t.elements),this.requestUpdate()}async _queryElements(t,e){const i=this.layer.effectiveSource;if(i==null)return[];this.view.featuresTilingScheme.getTileBounds(d,t,!0);const s=new ie({xmin:d[0],ymin:d[1],xmax:d[2],ymax:d[3],spatialReference:this.view.spatialReference});return i.queryElements(s,e)}_referenceElements(t,e){if(this.layer.source!=null)for(const i of e)this._referenceElement(t,i)}_referenceElement(t,e){se(this._elementReferences,e.uid,()=>{const i=new G({element:e,spatialReference:this.view.spatialReference}),s=new fe(i);return this._overlayContainer.addChild(s),this.elements.add(e),this._updatingHandles.addPromise(e.load().catch(r=>{b.getLogger("esri.views.2d.layers.MediaLayerView2D").error(new k("element-load-error","Element cannot be displayed",{element:e,error:r}))})),{debugGraphic:null,elementView:i,overlay:s,tiles:new Set}}).tiles.add(t)}_dereferenceElements(t,e){for(const i of e)this._dereferenceElement(t,i)}_dereferenceElement(t,e){var s;const i=this._elementReferences.get(e.uid);i.tiles.delete(t),i.tiles.size||(this._overlayContainer.removeChild(i.overlay),i.overlay.destroy(),i.elementView.destroy(),this._elementReferences.delete(e.uid),this.elements.remove(e),(s=this._debugGraphicsView)==null||s.graphics.remove(i.debugGraphic))}_elementUpdateHandler(t){var s;let e=this._elementReferences.get(t.uid);if(e){const r=e.elementView.normalizedCoords;if(r==null)return this._overlayContainer.removeChild(e.overlay),e.overlay.destroy(),e.elementView.destroy(),this._elementReferences.delete(t.uid),this.elements.remove(t),void((s=this._debugGraphicsView)==null?void 0:s.graphics.remove(e.debugGraphic));const a=[],h=[];for(const o of this._tileStrategy.tiles){const n=U(this.view.featuresTilingScheme,o,r);e.tiles.has(o)?n||h.push(o):n&&a.push(o)}for(const o of a)this._referenceElement(o,t);for(const o of h)this._dereferenceElement(o,t);return e=this._elementReferences.get(t.uid),void((e==null?void 0:e.debugGraphic)&&(e.debugGraphic.geometry=e.elementView.normalizedCoords,this._debugGraphicsView.graphicUpdateHandler({graphic:e.debugGraphic,property:"geometry"})))}const i=new G({element:t,spatialReference:this.view.spatialReference}).normalizedCoords;if(i!=null)for(const r of this._tileStrategy.tiles)U(this.view.featuresTilingScheme,r,i)&&this._referenceElement(r,t)}};l([m()],_.prototype,"layer",void 0),l([m({readOnly:!0})],_.prototype,"elements",void 0),_=l([T("esri.views.2d.layers.MediaLayerView2D")],_);const d=re(),f={xmin:0,ymin:0,xmax:0,ymax:0};function U(t,e,i){return t.getTileBounds(d,e.key,!0),f.xmin=d[0],f.ymin=d[1],f.xmax=d[2],f.ymax=d[3],ne(f,i)}class ve{constructor(e){this.key=e,this.elements=null,this.isReady=!1,this.visible=!0}setElements(e){const i=[],s=new Set(this.elements);this.elements=e;for(const r of e)s.has(r)?s.delete(r):i.push(r);return this.isReady=!0,[i,Array.from(s)]}destroy(){}}const vt=_;export{vt as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.