PageSourceSearch

https://oma.mustankorkea.fi/e-services/mustankorkea/assets/geomasync-CVsnlNEf.js

js mustankorkea.fi collected 2026-09-24 23:52:06 UTC 16,624 bytes, 2 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./unitConversion-PMk7djti.js","./index-CYBe2UDx.js","./index-M7HaBUb6.css"])))=>i.map(i=>d[i]);
2import{ah as X,ag as z,fG as m,cz as y,fH as v,bN as R,bh as _,_ as Y,bP as b,bi as x,bO as T,ae as B}from"./index-CYBe2UDx.js";import{F as d,ah as S,Z as V,u as h,a1 as H,a0 as G,y as q,g as J,A as E,B as L,ai as Z,aj as M,ak as $,al as k,b as P,am as nn,J as j,an as en,ao as tn,ap as rn,V as K,C as D,K as C}from"./arcade-C6IGAC5T.js";import{a as o,r as s}from"./unitConversion-PMk7djti.js";import{o as O}from"./TimeOnly-vv6zEOEI.js";import{l as W}from"./portalUtils-CJJ2IuLj.js";import{a as f}from"./operatorsWorkerConnection-ThOuy9ke.js";import"./ImmutableArray-BPVd6ESQ.js";import"./shared-CMkHQevH.js";import"./number-DEptek2u.js";import"./featureConversionUtils-Cquilb6a.js";import"./OptimizedFeature-CzNwUVQB.js";import"./memoryEstimations-BOmgFOek.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./FieldsIndex-BnZy10GO.js";import"./WhereClause-DWKGMMUN.js";async function Q(a,e,t){var r,i;if(!((r=X)==null?void 0:r.findCredential(a.restUrl)))return null;if(a.loadStatus==="loaded"&&e===""&&((i=a.user)!=null&&i.sourceJSON)&&t===!1)return a.user.sourceJSON;const u={responseType:"json",query:{f:"json"}};if(t&&(u.query.returnUserLicenseTypeExtensions=!0),e===""){const c=await z(a.restUrl+"/community/self",u);if(c.data){const w=c.data;if(w!=null&&w.username)return w}return null}const n=await z(a.restUrl+"/community/users/"+e,u);if(n.data){const c=n.data;return c.error?null:c}return null}
2function p(a){if(a==null)return a;switch(typeof a){case"string":case"number":return a;default:throw new o(null,s.InvalidParameter,null)}}function Sn(a){a.mode==="async"&&(a.functions.disjoint=function(e,t){return a.standardFunctionAsync(e,t,(l,u,n)=>(n=d(n),S(n,e,t),n[0]===null||n[1]===null||f("disjoint",[n[0].toJSON(),n[1].toJSON()])))},a.functions.intersects=function(e,t){return a.standardFunctionAsync(e,t,(l,u,n)=>(n=d(n),S(n,e,t),n[0]!==null&&n[1]!==null&&f("intersects",[n[0].toJSON(),n[1].toJSON()])))},a.functions.touches=function(e,t){return a.standardFunctionAsync(e,t,(l,u,n)=>(n=d(n),S(n,e,t),n[0]!==null&&n[1]!==null&&f("touches",[n[0].toJSON(),n[1].toJSON()])))},a.functions.crosses=function(e,t){return a.standardFunctionAsync(e,t,(l,u,n)=>(n=d(n),S(n,e,t),n[0]!==null&&n[1]!==null&&f("crosses",[n[0].toJSON(),n[1].toJSON()])))},a.functions.within=function(e,t){return a.standardFunctionAsync(e,t,(l,u,n)=>(n=d(n),S(n,e,t),n[0]!==null&&n[1]!==null&&f("within",[n[0].toJSON(),n[1].toJSON()])))},a.functions.contains=function(e,t){return a.standardFunctionAsync(e,t,(l,u,n)=>(n=d(n),S(n,e,t),n[0]!==null&&n[1]!==null&&f("contains",[n[0].toJSON(),n[1].toJSON()])))},a.functions.overlaps=function(e,t){return a.standardFunctionAsync(e,t,(l,u,n)=>(n=d(n),S(n,e,t),n[0]!==null&&n[1]!==null&&f("overlaps",[n[0].toJSON(),n[1].toJSON()])))},a.functions.equals=function(e,t){return a.standardFunctionAsync(e,t,(l,u,n)=>(h(n,2,2,e,t),n[0]===n[1]||(n[0]instanceof m&&n[1]instanceof m?f("equals",[n[0].toJSON(),n[1].toJSON()]):(V(n[0])&&V(n[1])||!!(H(n[0])&&H(n[1])||G(n[0])&&G(n[1])))&&n[0].equals(n[1]))))},a.functions.relate=function(e,t){return a.standardFunctionAsync(e,t,(l,u,n)=>{if(n=d(n),h(n,3,3,e,t),n[0]instanceof m&&n[1]instanceof m)return f("relate",[n[0].toJSON(),n[1].toJSON(),q(n[2])]);if(n[0]instanceof m&&n[1]===null||n[1]instanceof m&&n[0]===null||n[0]===null&&n[1]===null)return!1;throw new o(e,s.InvalidParameter,t)})},a.functions.intersection=function(e,t){return a.standardFunctionAsync(e,t,async(l,u,n)=>(n=d(n),S(n,e,t),n[0]===null||n[1]===null?null:y(await f("intersection",[n[0].toJSON(),n[1].toJSON()]))))},a.functions.union=function(e,t){return a.standardFunctionAsync(e,t,async(l,u,n)=>{if((n=d(n)).length===0)throw new o(e,s.WrongNumberOfParameters,t);const r=[];if(n.length===1)if(v(n[0])){for(const i of d(n[0]))if(i!==null){if(!(i instanceof m))throw new o(e,s.InvalidParameter,t);r.push(i.toJSON())}}else{if(!J(n[0])){if(n[0]instanceof m)return E(O(n[0]),e.spatialReference);if(n[0]===null)return null;throw new o(e,s.InvalidParameter,t)}for(const i of d(n[0].toArray()))if(i!==null){if(!(i instanceof m))throw new o(e,s.InvalidParameter,t);r.push(i.toJSON())}}else for(const i of n)if(i!==null){if(!(i instanceof m))throw new o(e,s.InvalidParameter,t);r.push(i.toJSON())}return r.length===0?null:y(await f("union",[r]))})},a.functions.difference=function(e,t){return a.standardFunctionAsync(e,t,async(l,u,n)=>(n=d(n),S(n,e,t),n[0]===null?null:n[1]===null?O(n[0]):y(await f("difference",[n[0].toJSON(),n[1].toJSON()]))))},a.functions.symmetricdifference=function(e,t){return a.standardFunctionAsync(e,t,async(l,u,n)=>(n=d(n),S(n,e,t),n[0]===null&&n[1]===null?null:n[0]===null?O(n[1]):n[1]===null?O(n[0]):y(await f("symmetricDifference",[n[0].toJSON(),n[1].toJSON()]))))},a.functions.clip=function(e,t){return a.standardFunctionAsync(e,t,async(l,u,n)=>{if(n=d(n),h(n,2,2,e,t),!(n[1]instanceof R)&&n[1]!==null)throw new o(e,s.InvalidParameter,t);if(n[0]===null)return null;if(!(n[0]instanceof m))throw new o(e,s.InvalidParameter,t);return n[1]===null?null:y(await f("clip",[n[0].toJSON(),n[1].toJSON()]))})},a.functions.cut=function(e,t){return a.standardFunctionAsync(e,t,async(l,u,n)=>{if(n=d(n),h(n,2,2,e,t),!(n[1]instanceof _)&&n[1]!==null)throw new o(e,s.InvalidParameter,t);if(n[0]===null)return[];if(!(n[0]instanceof m))throw new o(e,s.InvalidParameter,t);return n[1]===null?[O(n[0])]:(await f("cut",[n[0].toJSON(),n[1].toJSON()])).map(r=>y(r))})},a.functions.area=function(e,t){return a.standardFunctionAsync(e,t,async(l,u,n)=>{if(h(n,1,2,e,t),n=d(n),L(n[0])){const i=await n[0].sumArea(p(n[1]),!1,e.abortSignal);if(e.abortSignal.aborted)throw new o(e,s.Cancelled,t);return i}let r=n[0];if((v(r)||J(r))&&(r=Z(n[0],e.spatialReference)),r===null)return 0;if(!(r instanceof m))throw new o(e,s.InvalidParameter,t);return f("area",[r.toJSON(),p(n[1])])})},a.functions.areageodetic=function(e,t){return a.standardFunctionAsync(e,t,async(l,u,n)=>{if(h(n,1,2,e,t),n=d(n),L(n[0])){const i=await n[0].sumArea(p(n[1]),!0,e.abortSignal);if(e.abortSignal.aborted)throw new o(e,s.Cancelled,t);return i}let r=n[0];if((v(n[0])||J(n[0]))&&(r=Z(n[0],e.spatialReference)),r===null)return 0;if(!(r instanceof m))throw new o(e,s.InvalidParameter,t);return f("geodeticArea",[r.toJSON(),p(n[1])])})},a.functions.length=function(e,t){return a.standardFunctionAsync(e,t,async(l,u,n)=>{if(h(n,1,2,e,t),n=d(n),L(n[0])){const i=await n[0].sumLength(p(n[1]),!1,e.abortSignal);if(e.abortSignal.aborted)throw new o(e,s.Cancelled,t);return i}let r=n[0];if((v(n[0])||J(n[0]))&&(r=M(n[0],e.spatialReference)),r===null)return 0;if(!(r instanceof m))throw new o(e,s.InvalidParameter,t);return f("length",[r.toJSON(),p(n[1])])})},a.functions.length3d=function(e,t){return a.standardFunctionAsync(e,t,async(l,u,n)=>{if(h(n,1,2,e,t),(n=d(n))[0]===null)return 0;let r=n[0];if((v(n[0])||J(n[0]))&&(r=M(n[0],e.spatialReference)),r===null)return 0;if(!(r instanceof m))throw new o(e,s.InvalidParameter,t);if(r.hasZ===!0){const{convertFromSpatialReferenceUnit:i,toLengthUnit:c}=await Y(()=>import("./unitConversion-PMk7djti.js").then(N=>N.e),__vite__mapDeps([0,1,2]),import.meta.url),w=$(r);return i(r.spatialReference,c(n[1]),w)}return f("length",[r.toJSON(),p(n[1])])})},a.functions.lengthgeodetic=function(e,t){return a.standardFunctionAsync(e,t,async(l,u,n)=>{if(h(n,1,2,e,t),n=d(n),L(n[0])){const i=await n[0].sumLength(p(n[1]),!0,e.abortSignal);if(e.abortSignal.aborted)throw new o(e,s.Cancelled,t);return i}let r=n[0];if((v(n[0])||J(n[0]))&&(r=M(n[0],e.spatialReference)),r===null)return 0;if(!(r instanceof m))throw new o(e,s.InvalidParameter,t);return f("geodeticLength",[r.toJSON(),p(n[1])])})},a.functions.distance=function(e,t){return a.standardFunctionAsync(e,t,async(l,u,n)=>{n=d(n),h(n,2,3,e,t);let r=n[0];if((v(n[0])||J(n[0]))&&(r=k(n[0],e.spatialReference)),!(r instanceof m))throw new o(e,s.InvalidParameter,t);let i=n[1];if((v(n[1])||J(n[1]))&&(i=k(n[1],e.spatialReference)),!(i instanceof m))throw new o(e,s.InvalidParameter,t);return f("distance",[r.toJSON(),i.toJSON(),p(n[2])])})},a.functions.distancegeodetic=function(e,t){return a.standardFunctionAsync(e,t,async(l,u,n)=>{n=d(n),h(n,2,3,e,t);const r=n[0];if(!(r instanceof b))throw new o(e,s.InvalidParameter,t);const i=n[1];if(!(i instanceof b))throw new o(e,s.InvalidParameter,t);const c=new _({paths:[],spatialReference:r.spatialReference});return c.addPath([r,i]),f("geodeticLength",[c.toJSON(),p(n[2])])})},a.functions.densify=function(e,t){return a.standardFunctionAsync(e,t,async(l,u,n)=>{if(n=d(n),h(n,2,3,e,t),n[0]===null)return null;if(!(n[0]instanceof m))throw new o(e,s.InvalidParameter,t);const r=P(n[1]);if(isNaN(r))throw new o(e,s.InvalidParameter,t);if(r<=0)throw new o(e,s.InvalidParameter,t);switch(n[0].type){case"polygon":case"polyline":case"extent":return y(await f("densify",[n[0].toJSON(),r,p(n[2])]));default:return n[0]}})},a.functions.densifygeodetic=function(e,t){return a.standardFunctionAsync(e,t,async(l,u,n)=>{if(n=d(n),h(n,2,3,e,t),n[0]===null)return null;if(!(n[0]instanceof m))throw new o(e,s.InvalidParameter,t);const r=P(n[1]);if(isNaN(r))throw new o(e,s.InvalidParameter,t);if(r<=0)throw new o(e,s.InvalidParameter,t);switch(n[0].type){case"polygon":case"polyline":case"extent":return y(await f("geodeticDensify",[n[0].toJSON(),r,p(n[2])]));default:return n[0]}})},a.functions.generalize=function(e,t){return a.standardFunctionAsync(e,t,async(l,u,n)=>{if(n=d(n),h(n,2,4,e,t),n[0]===null)return null;if(!(n[0]instanceof m))throw new o(e,s.InvalidParameter,t);const r=P(n[1]);if(isNaN(r))throw new o(e,s.InvalidParameter,t);const i=nn(j(n[2],!0));return y(await f("generalize",[n[0].toJSON(),r,p(n[3]),{removeDegenerateParts:i}]))})},a.functions.buffer=function(e,t){return a.standardFunctionAsync(e,t,async(l,u,n)=>{if(n=d(n),h(n,2,3,e,t),n[0]===null)return null;if(!(n[0]instanceof m))throw new o(e,s.InvalidParameter,t);const r=P(n[1]);if(isNaN(r))throw new o(e,s.InvalidParameter,t);return r===0?O(n[0]):y(await f("buffer",[n[0].toJSON(),r,p(n[2])]))})},a.functions.buffergeodetic=function(e,t){return a.standardFunctionAsync(e,t,async(l,u,n)=>{if(n=d(n),h(n,2,3,e,t),n[0]===null)return null;if(!(n[0]instanceof m))throw new o(e,s.InvalidParameter,t);const r=P(n[1]);if(isNaN(r))throw new o(e,s.InvalidParameter,t);return r===0?O(n[0]):y(await f("geodesicBuffer",[n[0].toJSON(),r,p(n[2])]))})},a.functions.offset=function(e,t){return a.standardFunctionAsync(e,t,async(l,u,n)=>{if(n=d(n),h(n,2,6,e,t),n[0]===null)return null;if(!(n[0]instanceof x||n[0]instanceof _))throw new o(e,s.InvalidParameter,t);const r=P(n[1]);if(isNaN(r))throw new o(e,s.InvalidParameter,t);const i=q(n[3]??"round").toLowerCase();let c;switch(i){case"round":case"bevel":case"miter":case"square":c=i;break;default:c="round"}const w=P(j(n[4],10));if(isNaN(w))throw new o(e,s.InvalidParameter,t);const N=P(j(n[5],0));if(isNaN(N))throw new o(e,s.InvalidParameter,t);return y(await f("offset",[n[0].toJSON(),r,p(n[2]),{joins:c,miterLimit:w,flattenError:N}
2]))})},a.functions.rotate=function(e,t){return a.standardFunctionAsync(e,t,async(l,u,n)=>{var w;if(n=d(n),h(n,2,3,e,t),n[0]===null)return null;if(!(n[0]instanceof m))throw new o(e,s.InvalidParameter,t);const r=n[0]instanceof R?x.fromExtent(n[0]):n[0],i=P(n[1]);if(isNaN(i))throw new o(e,s.InvalidParameter,t);const c=j(n[2],null);if(c===null){const N=r.type==="point"?r:(w=r.extent)==null?void 0:w.center;return y(await f("rotate",[r.toJSON(),i,N==null?void 0:N.x,N==null?void 0:N.y]))}if(c instanceof b)return y(await f("rotate",[r.toJSON(),i,c.x,c.y]));throw new o(e,s.InvalidParameter,t)})},a.functions.centroid=function(e,t){return a.standardFunctionAsync(e,t,async(l,u,n)=>{if(n=d(n),h(n,1,2,e,t),n[0]===null)return null;const r=q(n[1]??"geometric").toLowerCase();if(r!=="geometric"&&r!=="labelpoint")throw new o(e,s.InvalidParameter,t);let i=n[0];if((v(n[0])||J(n[0]))&&(i=r==="geometric"?k(n[0],e.spatialReference):Z(n[0],e.spatialReference),i===null))return null;if(!(i instanceof m))throw new o(e,s.InvalidParameter,t);return y(r==="geometric"?await f("centroid",[i.toJSON()]):await f("labelPoint",[i.toJSON()]))})},a.functions.measuretocoordinate=function(e,t){return a.standardFunctionAsync(e,t,en)},a.functions.pointtocoordinate=function(e,t){return a.standardFunctionAsync(e,t,tn)},a.functions.distancetocoordinate=function(e,t){return a.standardFunctionAsync(e,t,rn)},a.functions.multiparttosinglepart=function(e,t){return a.standardFunctionAsync(e,t,async(l,u,n)=>{if(n=d(n),h(n,1,1,e,t),n[0]===null)return null;if(!(n[0]instanceof m))throw new o(e,s.InvalidParameter,t);if(n[0]instanceof b)return[E(O(n[0]),e.spatialReference)];if(n[0]instanceof R)return[E(O(n[0]),e.spatialReference)];const r=y(await f("simplify",[n[0].toJSON()]));if(r instanceof x){const i=[],c=[];for(let w=0;w<r.rings.length;w++)if(r.isClockwise(r.rings[w])){const N=y({rings:[r.rings[w]],hasZ:r.hasZ===!0,hasM:r.hasM===!0,spatialReference:r.spatialReference.toJSON()});i.push(N)}else c.push({ring:r.rings[w],pt:r.getPoint(w,0)});for(let w=0;w<c.length;w++)for(let N=0;N<i.length;N++)if(i[N].contains(c[w].pt)){i[N].addRing(c[w].ring);break}return i}if(r instanceof _){const i=[];for(let c=0;c<r.paths.length;c++){const w=y({paths:[r.paths[c]],hasZ:r.hasZ===!0,hasM:r.hasM===!0,spatialReference:r.spatialReference.toJSON()});i.push(w)}return i}if(n[0]instanceof T){const i=[],c=E(O(n[0]),e.spatialReference);for(let w=0;w<c.points.length;w++)i.push(c.getPoint(w));return i}return null})},a.functions.issimple=function(e,t){return a.standardFunctionAsync(e,t,(l,u,n)=>{if(n=d(n),h(n,1,1,e,t),n[0]===null)return!0;if(!(n[0]instanceof m))throw new o(e,s.InvalidParameter,t);return f("isSimple",[n[0].toJSON()])})},a.functions.simplify=function(e,t){return a.standardFunctionAsync(e,t,async(l,u,n)=>{if(n=d(n),h(n,1,1,e,t),n[0]===null)return null;if(!(n[0]instanceof m))throw new o(e,s.InvalidParameter,t);return y(await f("simplify",[n[0].toJSON()]))})},a.functions.convexhull=function(e,t){return a.standardFunctionAsync(e,t,async(l,u,n)=>{if(n=d(n),h(n,1,1,e,t),n[0]===null)return null;if(!(n[0]instanceof m))throw new o(e,s.InvalidParameter,t);return y(await f("convexHull",[n[0].toJSON()]))})},a.functions.getuser=function(e,t){return a.standardFunctionAsync(e,t,async(l,u,n)=>{var w,N;h(n,0,2,e,t);let r=j(n[1],""),i=r===!0;if(r=r===!0||r===!1?"":q(r),n.length===0||n[0]instanceof K){let I;I=(w=e.services)!=null&&w.portal?e.services.portal:B.getDefault(),n.length>0&&(I=W(n[0],I));const F=await Q(I,r,i);if(F){const A=JSON.parse(JSON.stringify(F));for(const g of["lastLogin","created","modified"])A[g]!==void 0&&A[g]!==null&&(A[g]=new Date(A[g]));return D.convertObjectToArcadeDictionary(A,C(e))}return null}let c=null;if(L(n[0])&&(c=n[0]),c){if(i=!1,r)return null;await c.load();const I=await c.getOwningSystemUrl();if(!I){if(!r){const g=await c.getIdentityUser();return g?D.convertObjectToArcadeDictionary({username:g},C(e)):null}return null}let F;F=(N=e.services)!=null&&N.portal?e.services.portal:B.getDefault(),F=W(new K(I),F);const A=await Q(F,r,i);if(A){const g=JSON.parse(JSON.stringify(A));for(const U of["lastLogin","created","modified"])g[U]!==void 0&&g[U]!==null&&(g[U]=new Date(g[U]));return D.convertObjectToArcadeDictionary(g,C(e))}return null}throw new o(e,s.InvalidParameter,t)})},a.functions.nearestcoordinate=function(e,t){return a.standardFunctionAsync(e,t,async(l,u,n)=>{if(n=d(n),h(n,2,2,e,t),!(n[0]instanceof m||n[0]===null))throw new o(e,s.InvalidParameter,t);if(!(n[1]instanceof b||n[1]===null))throw new o(e,s.InvalidParameter,t);if(n[0]===null||n[1]===null)return null;const r=n[0]instanceof R?x.fromExtent(n[0]):n[0],i=await f("getNearestCoordinate",[r.toJSON(),n[1].toJSON(),{calculateLeftRightSide:!0}]);return i===null?null:D.convertObjectToArcadeDictionary({coordinate:y(i.coordinate),distance:i.distance,sideOfLine:i.distance===0?"straddle":i.rightSide?"right":"left"}
2,C(e),!1,!0)})},a.functions.nearestvertex=function(e,t){return a.standardFunctionAsync(e,t,async(l,u,n)=>{if(n=d(n),h(n,2,2,e,t),!(n[0]instanceof m||n[0]===null))throw new o(e,s.InvalidParameter,t);if(!(n[1]instanceof b||n[1]===null))throw new o(e,s.InvalidParameter,t);if(n[0]===null||n[1]===null)return null;const r=n[0]instanceof R?x.fromExtent(n[0]):n[0],i=await f("getNearestVertex",[r.toJSON(),n[1].toJSON()]);return i===null?null:D.convertObjectToArcadeDictionary({coordinate:y(i.coordinate),distance:i.distance,sideOfLine:i.distance===0?"straddle":i.rightSide?"right":"left"},C(e),!1,!0)})})}export{Sn as registerFunctions};

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.